Improvements to processing history#1737
Open
RaitaroH wants to merge 2 commits into
Open
Conversation
fixes "Meitantei Conan" latest episode being incorrect
Author
|
This comment is not part of this PR, nor will it be. It is just a remark. We could reduce curls further if we skipped processing entries that are finished. Is just that, currently, we do not know if a show has been completed or we simply caught up to the latest known episode (say we watched ep 4 out of 4 known last week, but now there is a 5th episode, yet the script will skip without curl-ing, thus never updating to 5). process_hist_entry() {
# skip if anime is completed
last_known_ep_no=$(printf "%s" "$title" | grep -oP '\(\K[0-9.]+(?= episodes\))')
# use bc to avoid errors when ep_no is a float number
[ "$(echo "$ep_no >= $last_known_ep_no" | bc)" -eq 1 ] && exit 0
...
}I suppose we could have another column in the histfile to say if show is finished or not. For now deleting the histfile either with the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Template
Type of change
Description
Fixing sort -n
The anime "Detecitve Conan' has many episodes. The episodes_list() curl returns some strange numbers such as "348.349", which the current "sort -n" will put after latest ep "1201". This issue will also embed itself into the histfile.
To fix this, it is enough to use
sort -g.episodes_list is called many times
In the -c option we first call episodes_list() which processes all anime in histfile, then ep_list will call episodes_list again. We could instead have the episodes_list save the result in tmp so we don't curl again.
Checklist
-chistory and continue work-qquality works