GitAuto: Hide hidden categories from history #767
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.
Resolves #762
Why is this feature needed?
Currently, while users can hide entire categories in the library, entries from these hidden categories still appear in the history tab. This creates a discrepancy between what users see in their library versus the history view, potentially exposing content that the user has intentionally hidden.
What and how are we changing? Why this approach?
We're modifying the SQL query that generates the history view. The change adds a WHERE clause that checks whether the manga associated with a history entry is linked to any hidden category. If it is, that entry is excluded from the results. This approach leverages existing category configuration (the "hidden" flag) to ensure consistency across different parts of the app.
What actions are required from users?
No explicit actions are needed from users. Once the update is applied, the history tab will automatically filter out entries from hidden categories. Users should verify that their hidden categories are properly configured in the library settings.
How does it work? (Technical details)
The SQL query is updated in the file:
Specifically, after joining the necessary tables for chapters and history, a WHERE NOT EXISTS clause was added. This clause queries the mangas_categories and categories tables to check if the related manga is assigned to any category marked as hidden (c.hidden = 1). If such an entry exists, the manga will be filtered from the history results.
Is it backwards compatible?
Yes, the change is backwards compatible. It only affects the display of history entries by excluding those that belong to hidden categories. If a manga is not part of any hidden category, its history will display as before. Users who do not use the hidden category feature will see no changes.
Any other considerations?