Skip to content

Embed Metadata Plugin for Stash#705

Open
findmenow404 wants to merge 2 commits intostashapp:mainfrom
findmenow404:EmbedMetadata
Open

Embed Metadata Plugin for Stash#705
findmenow404 wants to merge 2 commits intostashapp:mainfrom
findmenow404:EmbedMetadata

Conversation

@findmenow404
Copy link
Copy Markdown

This is a plugin for stash that will re-curse through your library and re-write the metadata in the MP4 and MKV files with the information from Stash. Additional options could be added to prevent re-write of files that have already been performed, or a selection.

@DogmaDragon DogmaDragon added the type:plugin Plugins label Apr 26, 2026
@DogmaDragon
Copy link
Copy Markdown
Contributor

Stash keeps track of files by path and oshash. You do replace in-place, but embedding metadata changes file oshash.

For me to merge this, I would want for it to handle updating database with the new file oshash. Otherwise if someone decided to move these newly created files, they would be left untracked.

@findmenow404
Copy link
Copy Markdown
Author

findmenow404 commented Apr 28, 2026

Do you know of another way to embed the data without it changing the oshash, since it's based on the first and last 64K of the file? I was hoping to keep it matching to stashdb databases for the oshash, but more as a secondary backup embeded directly in the file. I can add a auto re-scan and update documentation regarding the oshash change if needed.
Or possibly I'll update it to just export .nfo and .jpg files along side.

@DogmaDragon
Copy link
Copy Markdown
Contributor

Do you know of another way to embed the data without it changing the oshash, since it's based on the first and last 64K of the file?

No, as it also takes the file size. See https://github.com/opensubtitles/oshash#algorithm

hash = file_size + sum_uint64_le(first_64KB) + sum_uint64_le(last_64KB)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants