pystardust / ani-cli

A cli tool to browse and play anime
GNU General Public License v3.0
7.34k stars 530 forks source link

fix: allow using --select-nth with --continue #1366

Closed FireEgl closed 2 weeks ago

FireEgl commented 3 weeks ago

Allows using --select-nth with --continue to select the anime when there's multiple to choose from.

Pull Request Template

Type of change

Description

This adds a check for --select-nth when using --continue to select the anime, so it can be done non-interactively. Updated to work with the current code base. =)

Checklist

Additional Testcases

71zenith commented 3 weeks ago

as i said before, u cant even predict which index will have which anime, making this useless

FireEgl commented 3 weeks ago

as i said before, u cant even predict which index will have which anime, making this useless

Yes, it's unpredictable which anime it downloads/plays. But it also doesn't matter. I just want to periodically run the script to have all my animes downloaded (ani-cli -d -c -S 1). I get that it kind of mis-uses what --select-nth was meant for, but it works. The alternative is to rework a lot of the script to have a properly working non-interactive mode.. But since this might be the only use-case, I don't see the problem with a little bit of a hack.

port19x commented 3 weeks ago

Valid use case for a tiny change

FireEgl commented 3 weeks ago

I wonder how this code doesn't trigger SC2015

I tried checking the same code without the id= part and shellcheck gives a SC2015 (info) on it.. So, if somehow the interactive prompt fails, it's going to try to set it using --select-nth which will also fail, and the next line is a [ -z "$id" ] && exit 1 anyway, so it's fine. =)

71zenith commented 3 weeks ago

${index##*[!0-9]*} very cool way to type check and it seems this is posix as well. might want to incorporate more into the codebase rather than -eq which is far more ambiguous in what its trying to achieve

port19x commented 3 weeks ago

@71zenith you sure we wanna bump to 4.9?

port19x commented 3 weeks ago

We do have countdown to next episode as a feature I guess

71zenith commented 3 weeks ago

i believe we have enough fixes accumulated? did we aim at having some milestones for each release? just thought that .10 felt wrong. if u want we can wait a bit for the logger feature

port19x commented 3 weeks ago

Let's wait for the logger feature then. Almost all our downstreams being up-to-date is just very satisfying to look at on repology, so I'm hesitant. But you're right, we have a lot of small bumps and features

port19x commented 2 weeks ago

@71zenith you're gonna approve or no?

71zenith commented 2 weeks ago

approved, sorry i was at school