Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: thumbnails support #1211

Closed

Conversation

justchokingaround
Copy link
Collaborator

@justchokingaround justchokingaround commented Aug 29, 2023

Pull Request Template

Type of change

  • Bug fix
  • Feature
  • Documentation update

Description

requires fzf version 0.44.0: https://github.com/junegunn/fzf/releases/tag/0.44.0

didn't document in help, man or readme bc lazy

Checklist

  • any anime playing
  • bumped version

  • next, prev and replay work
  • -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
  • --dub and regular (sub) mode both work
  • all providers return links (not necessarily on a single anime, use debug mode to confirm)

  • -h help info is up to date
  • Readme is up to date
  • Man page is up to date

Additional Testcases

  • The safe bet: One Piece
  • Episode 0: Saenai Heroine no Sodatekata ♭
  • Unicode: Saenai Heroine no Sodatekata ♭
  • Non-whole episodes: Tensei shitara slime datta ken (ep. 24.5, ep. 24.9)

@justchokingaround
Copy link
Collaborator Author

i also refactored the args to be in alphabetical order

@justchokingaround
Copy link
Collaborator Author

justchokingaround commented Aug 29, 2023

TODO:

  • : fix shellscheck duh
  • : update the help menu, man page and readme
  • : have chafa as fallback option and as default for windows
  • : implement rofi preview using the printf \x method
  • : implement image caching, i would like to leave this to @Derisis13 if u don't mind

@Derisis13
Copy link
Collaborator

This is a lot of code (50+ lines, which is a 10% increase) already for a feature that's optional. @port19x what do you think?

@justchokingaround
Copy link
Collaborator Author

there will be more if we go for rofi implementation too

@port19x
Copy link
Collaborator

port19x commented Sep 2, 2023

This is a lot of code (50+ lines, which is a 10% increase) already for a feature that's optional. @port19x what do you think?

I'm conflicted. 50 loc is a lot indeed, but perhaps warranted for a large feature like thumbnails.
The question would then be if we accept a considerable bloating of our codebase for this feature.

Considering this doesn't include the rofi implementation I'd say it's not worth it.
iirc jerry has thumbnail support, and that script is >1k loc (likely for other reasons too).

Copy link
Collaborator

@port19x port19x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a good opportunity for a poll

@port19x

This comment was marked as outdated.

ani-cli Show resolved Hide resolved
ani-cli Outdated Show resolved Hide resolved
ani-cli Outdated Show resolved Hide resolved
ani-cli Outdated Show resolved Hide resolved
ani-cli Show resolved Hide resolved
ani-cli Show resolved Hide resolved
ani-cli Show resolved Hide resolved
ani-cli Outdated Show resolved Hide resolved
ani-cli Outdated Show resolved Hide resolved
ani-cli Outdated Show resolved Hide resolved
@justchokingaround
Copy link
Collaborator Author

this is what the implementation looks like. no external dependencies are required, except a minimum version of 0.44.0 for fzf

image
image

Copy link
Collaborator

@port19x port19x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also some shellcheck thingy to look into.
I'm glad to have work continue on this feature

ani-cli Show resolved Hide resolved
ani-cli Show resolved Hide resolved
Comment on lines +464 to +477
if [ "$thumbnails" = "1" ]; then
search_anime "$query"
image_preview
title=$(printf "%s" "$choice" | sed -nE "s/(.*) \([0-9]* episodes\) .*/\1 /p")
id=$(printf "%s" "$choice" | sed -nE "s/.* \([0-9]* episodes\) (.*)\.jpg/\1/p")
else
anime_list=$(search_anime "$query")
[ -z "$anime_list" ] && die "No results found!"
[ "$index" -eq "$index" ] 2>/dev/null && result=$(printf "%s" "$anime_list" | sed -n "${index}p")
[ -z "$index" ] && result=$(printf "%s" "$anime_list" | nl -w 2 | sed 's/^[[:space:]]//' | nth "Select anime: ")
[ -z "$result" ] && exit 1
title=$(printf "%s" "$result" | cut -f2)
id=$(printf "%s" "$result" | cut -f1)
fi
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to placement of the code addition, I'm semi-confident that thumbnails will not work with history search

@port19x
Copy link
Collaborator

port19x commented Jan 12, 2024

Please elaborate on the case for image caching

@port19x
Copy link
Collaborator

port19x commented Jan 16, 2024

I think I get it.
Say I want to watch all the differently named seasons of an anime, or all the one from franchise.
Or maybe I want to watch the movies of a large anime.
Then I'll search the same common term over and over again, thus there is benefit to caching.

@port19x
Copy link
Collaborator

port19x commented May 14, 2024

Let's be real, this will never get done and that's not even much of an issue.
I'm closing this ancient PR

@port19x port19x closed this May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants