Skip to content

Commit

Permalink
Fix seasonal
Browse files Browse the repository at this point in the history
  • Loading branch information
Arial-Z committed Jun 10, 2024
1 parent abd0b5b commit bde9055
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ function write-metadata () {
then
all_anilist_ids=$(jq --arg tvdb_id "$tvdb_id" '.[] | select( .tvdb_id == $tvdb_id ) | .anilist_id' -r "$SCRIPT_FOLDER/config/tmp/list-animes-id.json" | paste -s -d, - | sed 's/,/\\|/g')
else
all_anilist_ids="$anilist_id"
all_anilist_ids=$anilist_id
fi
if grep -q -w "$all_anilist_ids" "$SCRIPT_FOLDER/config/data/anilist-$ANILIST_USERNAME-$userlist_type.tsv"
then
Expand All @@ -1242,7 +1242,7 @@ function write-metadata () {
then
userlist_type_add=$(printf "%s,%s" "$userlist_type_add" "$userlist_type")
else
userlist_type_add="$userlist_type"
userlist_type_add=$userlist_type
fi
userlist_type_remove=$(printf "%s" "$userlist_type_remove" | sed s/"$userlist_type"// | sed 's/^,//' | sed 's/,,/,/g')
fi
Expand Down
6 changes: 3 additions & 3 deletions seasonal-animes-download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ fi
printf "%s - Starting script\n\n" "$(date +%H:%M:%S)" | tee -a "$LOG"
download-anime-id-mapping
printf "%s - checking current season\n" "$(date +%H:%M:%S)" | tee -a "$LOG"
curl -s -L -A "Mozilla/5.0 (X11; Linux x86_64)" "https://livechart.me/" -o "$SCRIPT_FOLDER/config/tmp/this-season.html"
season=$(awk -v IGNORECASE=1 -v RS='</title' 'RT{gsub(/.*<title[^>]*>/,"");print;exit}' "$SCRIPT_FOLDER/config/tmp/this-season.html" | awk '{print $1}'| tr '[:lower:]' '[:upper:]')
year=$(awk -v IGNORECASE=1 -v RS='</title' 'RT{gsub(/.*<title[^>]*>/,"");print;exit}' "$SCRIPT_FOLDER/config/tmp/this-season.html" | awk '{print $2}')
curl -s -L -A "Mozilla/5.0 (X11; Linux x86_64)" "https://anidb.net/anime/season/" -o "$SCRIPT_FOLDER/config/tmp/this-season.html"
season=$(awk -v IGNORECASE=1 -v RS='</title' 'RT{gsub(/.*<title[^>]*>/,"");print;exit}' "$SCRIPT_FOLDER/config/tmp/this-season.html" | awk '{print $4}'| tr '[:lower:]' '[:upper:]')
year=$(awk -v IGNORECASE=1 -v RS='</title' 'RT{gsub(/.*<title[^>]*>/,"");print;exit}' "$SCRIPT_FOLDER/config/tmp/this-season.html" | awk '{print $5}')
printf "%s - Current season : %s %s\n\n" "$(date +%H:%M:%S)" "$season" "$year" | tee -a "$LOG"
printf "%s - Creating seasonal list\n" "$(date +%H:%M:%S)" | tee -a "$LOG"
printf "%s\t - Downloading anilist season list\n" "$(date +%H:%M:%S)" | tee -a "$LOG"
Expand Down

0 comments on commit bde9055

Please sign in to comment.