Skip to content

thumbnailer_shared: use full filename path for remote URLs#45

Merged
NicolaSmaniotto merged 1 commit intomarzzzello:masterfrom
olifre:use-path-for-remotes
Sep 21, 2023
Merged

thumbnailer_shared: use full filename path for remote URLs#45
NicolaSmaniotto merged 1 commit intomarzzzello:masterfrom
olifre:use-path-for-remotes

Conversation

@olifre
Copy link
Copy Markdown

@olifre olifre commented 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 #44

@NicolaSmaniotto
Copy link
Copy Markdown
Collaborator

It makes sense to consider use the whole path, but I don't like the use of the path itself as a filename (it usually contains special characters like /). Using the hash of the path seems more robust, there already is an implementation of SHA-1 in the repo.

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
@olifre olifre force-pushed the use-path-for-remotes branch from 0083857 to f4d5d40 Compare September 20, 2023 17:02
@olifre
Copy link
Copy Markdown
Author

olifre commented Sep 20, 2023

Good point! I've updated the PR accordingly, i.e. now the full path is still used for URLs, but any remote paths are always hashed not matter the length.

@NicolaSmaniotto
Copy link
Copy Markdown
Collaborator

Looks good, thanks

@NicolaSmaniotto NicolaSmaniotto merged commit 32fdc2d into marzzzello:master Sep 21, 2023
@olifre olifre deleted the use-path-for-remotes branch September 21, 2023 18:55
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.

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

2 participants