# Making the Indexing Feature optional #50
Merged
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.
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 #45While 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
.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.