How can i change the code so that the episode saved in history is the current instead of next? #1482
-
I want to make it so that the episode that is shown in history (ani-cli -c) is the episode where i left off, instead of the next episode.
Im guessing ${ep_no} is the next episode number, how to change it to make it save the episode where i left off. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
after more digging, i found that hist file stores the current episode. now i need help finding where the code changes the episode to the next episode when using |
Beta Was this translation helpful? Give feedback.
-
just increment the |
Beta Was this translation helpful? Give feedback.
-
I have figured out how to do it. I used an AI to understand the code and i found what is responsible for modifying the value of ep_no.
in line 5, sed is being used to process the episode numbers from some file. in the piece |
Beta Was this translation helpful? Give feedback.
I have figured out how to do it. I used an AI to understand the code and i found what is responsible for modifying the value of ep_no.
process_hist_entry() { ep_list=$(episodes_list "$id") latest_ep=$(printf "%s\n" "$ep_list" | tail -n1) title=$(printf "%s\n" "$title" | sed "s|[0-9]\+ episodes|${latest_ep} episodes|") ep_no=$(printf "%s" "$ep_list" | sed -n "/^${ep_no}$/{n;p;}") 2>/dev/null [ -n "$ep_no" ] && printf "%s\t%s - episode %s\n" "$id" "$title" "$ep_no"
in line 5, sed is being used to process the episode numbers from some file. in the piece
{n;p;}
,n;
reads the next line andp;
prints that line. So what i did was removen;
from the line.n;
is what is responsible for "incrementi…