minor tweaks

This commit is contained in:
JimboKearn 2021-06-18 12:23:06 +05:30
parent 8c36d69ca6
commit 6d65ba099d

View File

@ -209,6 +209,10 @@ fi
fi fi
} }
# add anime to history file
grep -q -w "${selection_id}" $logfile ||
printf "%s\t%d\n" "$selection_id" $((episode+1)) >> $logfile
open_episode () { open_episode () {
anime_id=$1 anime_id=$1
episode=$2 episode=$2
@ -236,13 +240,9 @@ open_episode () {
if [ $is_download -eq 0 ]; then if [ $is_download -eq 0 ]; then
# write anime and episode number # write anime and episode number
if $(grep -w "${selection_id}" $logfile >/dev/null); then
sed -E " sed -E "
s/^${selection_id}\t[0-9]+/${selection_id}\t$((episode+1))/ s/^${selection_id}\t[0-9]+/${selection_id}\t$((episode+1))/
" $logfile > "${logfile}.new" && mv "${logfile}.new" $logfile " $logfile > "${logfile}.new" && mv "${logfile}.new" $logfile
else
printf "%s\t%d\n" "$selection_id" $((episode+1)) >> $logfile
fi
setsid -f $player_fn "$video_url" >/dev/null 2>&1 setsid -f $player_fn "$video_url" >/dev/null 2>&1
else else