Skip to content

Commit

Permalink
(feat) xseed.sh: add LOGID_FILE to track downloaded ids
Browse files Browse the repository at this point in the history
Move from log file to db
  • Loading branch information
bakerboy448 authored Aug 17, 2024
1 parent 326d731 commit f7298e9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xseed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# Load environment variables from .env file if it exists
# in the same directory as this bash script
VERSION='2.1.1'
VERSION='2.2.1'
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ENV_PATH="$SCRIPT_DIR/.env"

Expand Down Expand Up @@ -48,6 +48,7 @@ USENET_CLIENT_NAME=${USENET_CLIENT_NAME:-SABnzbd}
XSEED_HOST=${XSEED_HOST:-crossseed}
XSEED_PORT=${XSEED_PORT:-8080}
LOG_FILE=${LOG_FILE:-/config/xseed.log}
LOGID_FILE=${LOG_FILE:-/config/xseed-id.log}
XSEED_APIKEY=${XSEED_APIKEY:-}
log_message "DEBUG" "Using '.env' file for config?: $EVAR"
log_message "INFO" "Using Configuration:"
Expand All @@ -56,6 +57,7 @@ log_message "INFO" "USENET_CLIENT_NAME=$USENET_CLIENT_NAME"
log_message "INFO" "XSEED_HOST=$XSEED_HOST"
log_message "INFO" "XSEED_PORT=$XSEED_PORT"
log_message "INFO" "LOG_FILE=$LOG_FILE"
log_message "INFO" "LOGID_FILE=$LOGID_FILE"

# Function to send a request to Cross Seed API
cross_seed_request() {
Expand Down Expand Up @@ -199,7 +201,7 @@ handle_operations() {

log_message "INFO" "Cross-seed API response: $xseed_resp"
if [ "$xseed_resp" == "204" ]; then
echo "$unique_id" >>"$LOG_FILE"
echo "$unique_id" >>"$LOGID_FILE"
log_message "INFO" "Process completed successfully."
else
if [ "$xseed_resp" == "000" ]; then
Expand Down

0 comments on commit f7298e9

Please sign in to comment.