Skip to content

Catch both old uppercase 5-char hash and newer lowercase 5-char hash when migrating to new hash#1552

Merged
Tyrrrz merged 4 commits into
Tyrrrz:primefrom
SnowySailor:check-for-capital-hash-with-media-reuse
Jun 20, 2026
Merged

Catch both old uppercase 5-char hash and newer lowercase 5-char hash when migrating to new hash#1552
Tyrrrz merged 4 commits into
Tyrrrz:primefrom
SnowySailor:check-for-capital-hash-with-media-reuse

Conversation

@SnowySailor

@SnowySailor SnowySailor commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

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

@SnowySailor
SnowySailor force-pushed the check-for-capital-hash-with-media-reuse branch 2 times, most recently from 121f257 to 0599234 Compare June 15, 2026 04:10
@Tyrrrz Tyrrrz added the bug label Jun 15, 2026
Comment thread DiscordChatExporter.Core/Exporting/ExportAssetDownloader.cs
@SnowySailor
SnowySailor force-pushed the check-for-capital-hash-with-media-reuse branch from 0599234 to 3574d03 Compare June 16, 2026 07:59
@Tyrrrz
Tyrrrz merged commit 8bc9fe7 into Tyrrrz:prime Jun 20, 2026
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.

New file hash generator uses lowercase while old file hash generator used uppercase, causing files to get missed during conversion

2 participants