Catch both old uppercase 5-char hash and newer lowercase 5-char hash when migrating to new hash#1552
Merged
Tyrrrz merged 4 commits intoJun 20, 2026
Conversation
SnowySailor
force-pushed
the
check-for-capital-hash-with-media-reuse
branch
2 times, most recently
from
June 15, 2026 04:10
121f257 to
0599234
Compare
Tyrrrz
reviewed
Jun 15, 2026
…when migrating to new hash
SnowySailor
force-pushed
the
check-for-capital-hash-with-media-reuse
branch
from
June 16, 2026 07:59
0599234 to
3574d03
Compare
Tyrrrz
approved these changes
Jun 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a bug with the media export
Originally, file hashes were generated using a 5-character all uppercase hex hash. In a more recent version of this tool (2.46.1, this commit), it was changed to a 5-character all lowercase hex hash. In the most recent version, the 5-character hex hash has been updated to a 16-character hash, with support for renaming files that were generated using the previous hash method.
However, this renaming process does not include a check for the original 5-character uppercase hash file. So files that were generated with the uppercase hash are ignored, and only files with the lowercase hash are detected and renamed. If a piece of media was deleted at the source (e.g. deleted from twitter) and can no longer be re-fetched, that media is treated as inaccessible even if the media was already exported using the 5-char uppercase file hash. The file exists on disk already from a previous export, but the code does not detect it since it's only looking for files with a lowercase hash.
This PR adds support for detecting files that were generated with the original uppercase hash as well as the newer lowercase hash.
Closes #1551