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

Set the Cover Based on User's Original Custom Image Name #434

Open
tobylibo opened this issue Sep 17, 2024 · 3 comments
Open

Set the Cover Based on User's Original Custom Image Name #434

tobylibo opened this issue Sep 17, 2024 · 3 comments

Comments

@tobylibo
Copy link

Plugin: setSceneCoverFromFile.
Ver: 0.4-ca4a670
Stashapp Ver: v0.26.2-129-ge4ef14e8

I've found that it will only set an image named poster or cover as the cover. Please add any custom image names in the future.

Reason: There are two types of cover images: horizontal and vertical. Stashapp is not friendly enough to support vertical cover. However, most of the movie covers are vertical. In my video folder, in addition to the video files, there are also two kinds of cover images: poster (vertical) and fanart (horizontal ). But now this plugin doesn't support setting an image named fanart as a cover, only an image named poster as a cover.

I hope that in future updates, the plugin will be able to set the cover based on the user's original custom image name, rather than just the poster or cover.

Thanks.

@DogmaDragon
Copy link
Contributor

You can configure the pattern with regex in https://github.com/stashapp/CommunityScripts/blob/main/plugins/setSceneCoverFromFile/set_cover.py#L17, by updating your local file.

@tobylibo
Copy link
Author

You can configure the pattern with regex in https://github.com/stashapp/CommunityScripts/blob/main/plugins/setSceneCoverFromFile/set_cover.py#L17, by updating your local file.

Thank you soooooooooooooooo much!

I changed the code from:

cover_pattern = r"(?:thumb|poster|cover)\.(?:jpg|png)"

to:

cover_pattern = r"(?:thumb|fanart)\.(?:jpg|png)"

It works.

Thank you for your reply!

@tobylibo
Copy link
Author

@DogmaDragon

Plugin: setSceneCoverFromFile.

I may have found a bug. I used the method above and most of the covers that can be set are correct. But there are some videos that do have the same cover set up.

Especially when the file name is similar, it will be set to the same cover page.

Like what:

studios-my.video.fimename.1.mp4
...
studios-my.video.fimename.11.mp4
studios-my.video.fimename.12.mp4

or

studios-my.video.fimename.2.mp4
...
studios-my.video.fimename.21.mp4
studios-my.video.fimename.22.mp4
studios-my.video.fimename.23.mp4

However, sometimes, even though the file name is similar, it is possible to set a different cover correctly.

Very strange.

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

No branches or pull requests

2 participants