Closed llComodino closed 6 months ago
This could be a useful feature, I'll make a more thorough review later
The commit messages :joy: :ok_hand:
Sadly it's true, I've got a funny commit history for my CS class ...
In the current state, running ani-cli -c -N
prints countdowns for next episodes.
I'm currently figuring out how to conditionally print, only for animes with a next ep - Next episode in: %s
For instance, at the moment an history list would look like this: 1 anime_still_in_progress - episode %s - Next episode in: %s 2 anime_finished - episode %s - Next episode in:
I tried to chain [ "$countdown" = "1" ] && [ -z "$(time_until_next_ep "$title")"
which seemed most logical, since a finished anime should return nothing
Maybe I'm missing something 😕
Unless you want to keep entertaining the world with your comment messages, I recommend you to only push after testing (or at least running) your code. As long as your changes are local, you can safely use git commit --amend
to fix your typos without creating new commits.
Also in case you're unaware, you can turn on an explicite trace by running your program with sh -x ani-cli
, this might help you iron out the details.
Sorry for that, pushing hastily is a bad habit of mine 😅 I think I missed some errors because I was running shellcheck with different flags
On it
Actually, since the -N
just needs to return the countdown and terminate, I should just write a proper scraper for animeschedule
I haven't done it before because it would have slowed down the execution before prompting for the episodes, but but given that it doesn't need to anymore...
Do I close this PR and make another one when it's done?
I hope you'll find this version ok.
Now running with the -N
gets results for everything you search for
If you insert a query that does not return 1 result you will see every result containing your query (english and japanese titles) and it's status (either finished or the countdown)
I intend to test this later this evening, thanks for the effort
I like how it behaves now, thanks for adapting it
Looks ready, but I'll sleep on it
As you please, thanks for letting me contribute to this
Bonus points for implementing this with external menu compatibility as well as no fzf required. Good work
Btw
Check out #1309 for an awk-free edition
Pull Request Template
Type of change
Description
Implementation of a function to get the countdown to the next episode Also changed
#!/bin/sh
to#!/usr/bin/env sh
to make it more portable (sorry if I wasn't supposed to)I had originally opened a PR, but then noticed unwanted behavior for some japanese titles
Now it works with the vast majority of the titles, though some have really different names across websites, therefore the countdown is not found (an example is One Piece, 1P on allanime, one-piece on animeschedule Pretty sure this can be corrected with some thinkering but I haven't been able to
It uses https://animeschedule.net/ to find titles and their release date
Checklist
[x] bumped version
-c
history and continue work-d
downloads work-s
syncplay works-q
quality works-v
vlc works-e
select episode works-S
select index works-r
range selection works--skip
ani-skip works--skip-title
ani-skip title argument works--no-detach
no detach works--dub
and regular (sub) mode both work[x] all providers return links (not necessarily on a single anime, use debug mode to confirm)
-h
help info is up to dateAdditional Testcases