Skip to content

How can i change the code so that the episode saved in history is the current instead of next? #1482

Answered by NONSTOPPE9
NONSTOPPE9 asked this question in Q&A
Discussion options

You must be logged in to vote

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 and p; prints that line. So what i did was remove n; from the line.
n; is what is responsible for "incrementi…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@NONSTOPPE9
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by NONSTOPPE9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants