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

Thumbnails for wrong file may be used if files from different URLs are played #44

Closed
olifre opened this issue Sep 4, 2023 · 0 comments · Fixed by #45
Closed

Thumbnails for wrong file may be used if files from different URLs are played #44

olifre opened this issue Sep 4, 2023 · 0 comments · Fixed by #45
Labels
bug Something isn't working

Comments

@olifre
Copy link

olifre commented Sep 4, 2023

Description of the bug
Using for example ani-cli with mpv, URLs with patterns such as:

https://video.somewhere/video/somehash/1080p/mp4/file.mp4

will be played, differing by "hash" for different episodes. Playing two such URLs means the thumbnails from the first file are used for the second.

To Reproduce

  1. Play to different URLs with same "filename part".
  2. Observe thumbnails being reused for the second file.

Expected behavior
Thumnails to be recreated for the second file.

Debug log

Environment

  • OS: Gentoo Linux
  • mpv version: 0.35.1
  • mpv_thumbnail_script version: 0.5.2

Additional context
As expected, a subdirectory:

/tmp/mpv_thumbs_cache/file-0

is created and reused for all episodes.

Checking MPVs properties reveals:

$ echo '{ "command": ["get_property", "filename/no-ext"] }' | socat - ~/.mpv/ipc  
{"data":"file","request_id":0,"error":"success"}
$ echo '{ "command": ["get_property", "filename"] }' | socat - ~/.mpv/ipc  
{"data":"file.mp4","request_id":0,"error":"success"}
$ echo '{ "command": ["get_property", "path"] }' | socat - ~/.mpv/ipc  
{"data":"https://video.somewhere/video/somehash/1080p/mp4/file.mp4","request_id":0,"error":"success"}

So one way to fix this would be to use the property path in all cases where self.state.is_remote is true.

@olifre olifre added the bug Something isn't working label Sep 4, 2023
olifre added a commit to olifre/mpv_thumbnail_script that referenced this issue Sep 4, 2023
The actual filename part is often similar for different URLs,
so use the full path and let it be cleaned or hashed accordingly.

Closes marzzzello#44
olifre added a commit to olifre/mpv_thumbnail_script that referenced this issue Sep 20, 2023
The actual filename part is often similar for different URLs,
so use the full path. Ensure it is always hashed to prevent
bad characters from entering file names.

Closes marzzzello#44
NicolaSmaniotto pushed a commit that referenced this issue Sep 21, 2023
…#45)

The actual filename part is often similar for different URLs,
so use the full path. Ensure it is always hashed to prevent
bad characters from entering file names.

Closes #44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant