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

# Making the Indexing Feature optional #50

Merged
merged 11 commits into from
Feb 23, 2025

Conversation

HuskyZa
Copy link
Contributor

@HuskyZa HuskyZa commented Feb 21, 2025

Making the Indexing Feature optional.

Problem overview

In version 2.2.6, we've introduced an indexing feature that appends an index to the filename for multiple media files within the same post or story, resulting in filenames formatted as <postId>_<index>.jpg or <storyId>_<index>.jpg. This feature was requested in Issue #45

While this approach ensures unique filenames for posts with index at the end of filename, it presents challenges for stories. Since stories are ephemeral and their order can change dynamically, the appended index may lead to filename clashes, causing different stories to generate identical filenames. Additionally, if media within a post are re-ordered by the owner, re-downloading them could result in filename changes.

Solution

To address these issues and cater to users' preferences for unique filenames regardless of download instances, this PR introduces an option to disable the indexing feature. When disabled, filenames will revert to the original functionality, providing unique filenames as we had before the introduction of the indexing feature in version 2.2.6.

image

Remark

When the shorter ID filename option is enabled, the indexing feature is automatically disabled. This is because the shorter ID option hashes the original filename, including any appended index, rendering the index meaningless after hashing. To prevent confusion—where users might enable both the shorter ID and indexing features but not see the expected index—this PR designed the logic to disable indexing when the shorter ID feature is active. This ensures clarity and prevents users from mistakenly perceiving the absence of the index as a bug.

@HuskyZa HuskyZa marked this pull request as ready for review February 21, 2025 22:48
@HuskyZa HuskyZa changed the title Indexing option Enhance Filename Consistency by making the Indexing Feature optional Feb 21, 2025
@HuskyZa HuskyZa changed the title Enhance Filename Consistency by making the Indexing Feature optional # Making the Indexing Feature optional Feb 21, 2025
@TheKonka
Copy link
Owner

Thank you very much for the contribution.

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.

2 participants