Skip to content

Added features to hide individual items from Home and toggle Special Episodes visibility#1193

Open
kuzhagan143 wants to merge 4 commits intoFuzzyGrim:devfrom
kuzhagan143:feature/hide-progress-and-specials
Open

Added features to hide individual items from Home and toggle Special Episodes visibility#1193
kuzhagan143 wants to merge 4 commits intoFuzzyGrim:devfrom
kuzhagan143:feature/hide-progress-and-specials

Conversation

@kuzhagan143
Copy link
Copy Markdown

This PR introduces two new filtering features for the Home page "In Progress" section.

Features:

  1. Hide Items from Home:
    Users can now hide specific media items from their "In Progress" list on the Home page.
    Added a "Hidden" filter option to the sort dropdown (visible only when hidden items exist).
    Hidden items can be viewed and individually restored via a new "Unhide" button (green eye icon).

  2. Special Episodes Toggle:
    Added a user preference to show/hide "Special Episodes" (Season 0) from the "In Progress" list.
    Controlled via Settings -> Preferences -> Show Special Episodes in In Progress.
    Default is enabled (current behavior).

Closes #732

…Episodes visibility

This PR introduces two new filtering features for the Home page "In Progress" section.

Features:

Hide Items from Home:
Users can now hide specific media items from their "In Progress" list on the Home page.
Added a "Hidden" filter option to the sort dropdown (visible only when hidden items exist).
Hidden items can be viewed and individually restored via a new "Unhide" button (green eye icon).
Special Episodes Toggle:
Added a user preference to show/hide "Special Episodes" (Season 0) from the "In Progress" list.
Controlled via Settings -> Preferences -> Show Special Episodes in In Progress.
Default is enabled (current behavior).
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @kuzhagan143, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the user experience on the Home page by providing more granular control over the displayed 'In Progress' media. Users can now personalize their view by hiding individual items and toggling the visibility of special episodes. These changes are supported by backend model updates and frontend UI adjustments, making the home feed more customizable and relevant to individual preferences.

Highlights

  • Home Page Item Visibility Control: Introduced the ability for users to hide specific media items from their 'In Progress' list on the Home page. A new 'Hidden' filter option is available in the sort dropdown, allowing users to view and unhide these items.
  • Special Episodes Toggle: Added a user preference to control the visibility of 'Special Episodes' (Season 0) within the 'In Progress' list on the Home page, configurable via Settings -> Preferences.
  • User Preference Refactoring: Refactored user preferences by replacing hide_completed_recommendations and hide_zero_rating with a new home_hidden_items ManyToMany field and a show_special_episodes boolean field, streamlining how item visibility is managed.
  • API Provider Enhancements: Updated several API providers (Comicvine, IGDB, TMDB) to refine data fetching and processing, including renaming Comicvine's comic recommendation function and limiting TMDB recommendations.
  • Frontend UI/UX Improvements: Enhanced the Home page UI to support the new filtering options, updated media card display logic for scores, and standardized SVG icon attributes.
Changelog
  • .gitignore
    • Added new entries for NodeJS, database, and Tailwind build artifacts to ignore list.
  • src/app/helpers.py
    • Removed unused 'Status' import.
    • Modified 'parse_qsl' to no longer keep blank values in query parameters.
    • Refactored 'enrich_items_with_user_data' by removing the 'section_name' parameter and related filtering logic.
  • src/app/models.py
    • Implemented logic to filter out special episodes (Season 0) from in-progress media lists based on user preference.
  • src/app/providers/comicvine.py
    • Renamed 'publisher_comics' to 'recommendations' and 'get_publisher_comics' to 'get_similar_comics'.
    • Adjusted the related dictionary key from 'recommendations' to 'from_the_same_publisher'.
    • Changed the default limit for similar comics from 15 to 10.
  • src/app/providers/igdb.py
    • Corrected the data parameter in the 'search' function call.
    • Removed 'dlcs' from the game details query and related items processing.
  • src/app/providers/tmdb.py
    • Limited the number of recommendations fetched for movies and TV shows to 15.
  • src/app/templatetags/app_tags.py
    • Removed the 'show_media_score' custom template filter.
  • src/app/tests/test_helpers.py
    • Updated calls to 'enrich_items_with_user_data' to remove the 'section_name' argument.
    • Removed tests related to the 'hide_completed_recommendations' preference.
  • src/app/tests/test_templatetags.py
    • Removed the 'test_show_media_score' test case.
  • src/app/urls.py
    • Added a new URL path '/home/hide/int:item_id' for toggling home item visibility.
  • src/app/views.py
    • Implemented logic in the 'home' view to filter and display items based on 'show_hidden' and 'show_special_episodes' preferences.
    • Added a new 'toggle_home_item' view to handle hiding and unhiding items from the home page.
    • Updated calls to 'enrich_items_with_user_data' to remove the 'section_name' argument.
  • src/config/settings.py
    • Removed the 'fakeredis' warning level from the logging configuration.
    • Removed an extraneous empty line.
  • src/integrations/imports/steam.py
    • Removed specific error handling for 'ProviderAPIError' when an IGDB game is not found.
    • Refactored '_match_with_igdb' to include a try-except block for robust error handling and to return None if no match is found.
  • src/static/css/main.css
    • Removed the 'break-words' utility class.
  • src/templates/app/components/home_grid.html
    • Added a 'home-card' class to media grid items.
    • Implemented dynamic hide/unhide buttons with HTMX for individual media items on the home page.
  • src/templates/app/components/media_card.html
    • Modified the condition for displaying media scores to check if 'media.score' is not None, replacing the 'show_media_score' filter.
  • src/templates/app/home.html
    • Dynamically updated the home page title and sort dropdown text based on whether hidden items are being shown.
    • Added a 'Hidden' filter option to the sort dropdown, displaying the count of hidden items.
    • Adjusted the visibility condition for the 'Load More' button.
    • Updated empty state messages and icons to reflect whether hidden items are being viewed.
  • src/templates/app/icons/alarm-clock.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/arrows-up-down.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/bars-increasing.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/bars-pyramid.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/bell-ringing.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/bell.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/book-open.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/bug.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/calendar.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/checkmark.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/chevron-down.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/chevron-left.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/chevron-right.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/chevron-up.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/circle-plus.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/circle-spinning-clockwise.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/circle-spinning-counter-clockwise.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/circle-x.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/clock-reversing.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/clock.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/copy.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/cube.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/database.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/download.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/edit-flat.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/edit.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/ellipsis.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/error.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/export.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/external-link.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/eye-closed.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/eye.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/flame.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/folder-plus.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/four-square.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/funnel.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/github.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/grid.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/hamburger.svg
    • Added 'width="24"' and 'height="24"' attributes.
  • src/templates/app/icons/history.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/horizontal-sliders.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/house.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/image.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/import.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/info.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/key.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/link.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/list-add.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/list.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/logout.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/magnifying-glass.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/minus.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/padlock.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/page-empty.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/page.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/person.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/persons.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/piechart.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/plus.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/pulse.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/repeat.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/ribbon.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/right-arrow.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/save.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/server.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/settings.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/shield-alert.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/shield.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/sidebar.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/star.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/states/completed.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/states/dropped.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/states/in-progress.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/states/paused.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/states/planning.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/table.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/trashcan.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/user-cog.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/vertical-sliders.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/warning.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/icons/x.svg
    • Added 'width="auto"' and 'height="100%"' attributes.
  • src/templates/app/media_details.html
    • Simplified the title rendering logic for related media sections.
  • src/templates/app/statistics.html
    • Modified the condition for displaying media scores to check if 'media.score' is not None, replacing the 'show_media_score' filter.
  • src/templates/base.html
    • Removed the 'id="global-search"' attribute from the search input field.
    • Removed the 'searchShortcut.js' script import.
  • src/templates/users/import_data.html
    • Removed 'overflow-x-auto' and 'break-words' classes from the traceback display div.
  • src/templates/users/preferences.html
    • Replaced the 'Hide completed media in recommendations' and 'Hide zero ratings' preference toggles with a 'Show Special Episodes in In Progress' toggle.
  • src/users/models.py
    • Replaced the 'hide_completed_recommendations' and 'hide_zero_rating' boolean fields with a 'home_hidden_items' ManyToMany field and a 'show_special_episodes' boolean field.
  • src/users/views.py
    • Updated the 'preferences' view to correctly handle the new 'show_special_episodes' preference and removed handling for the deprecated preferences.
Activity
  • No specific activity (comments, reviews, progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This PR introduces two useful filtering features on the home page: hiding individual items and toggling the visibility of special episodes. The implementation is quite extensive, touching many parts of the application from models and views to templates and helpers. The changes are mostly well-contained and logical.

I've identified a few areas for improvement, including a critical bug in the IGDB provider, a performance issue in the home page view, and a potential regression in the Steam import error handling. I've also left a couple of suggestions for improving UI and code cleanliness. Overall, a solid contribution with some important fixes needed.

"POST",
url,
data=multiquery,
data=data,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

There seems to be a copy-paste error here. The variable data is used, but it's not defined in this except block. The original query is stored in the multiquery variable. Using data here will raise a NameError when this retry logic is triggered. You should use multiquery instead.

Suggested change
data=data,
data=multiquery,

src/app/views.py Outdated
Comment on lines +42 to +80
if show_hidden:
# Show only hidden items: fetch all in-progress, keep only hidden ones
list_by_type = BasicMedia.objects.get_in_progress(
request.user,
sort_by,
None,
media_type_to_load,
)

for media_type in list(list_by_type.keys()):
items = list_by_type[media_type]["items"]
hidden_items = [m for m in items if m.item_id in hidden_item_ids]
if hidden_items:
list_by_type[media_type]["items"] = hidden_items
list_by_type[media_type]["total"] = len(hidden_items)
else:
del list_by_type[media_type]

else:
# Normal in-progress view
list_by_type = BasicMedia.objects.get_in_progress(
request.user,
sort_by,
items_limit,
media_type_to_load,
)

# Filter out hidden items
if hidden_item_ids:
for media_type in list(list_by_type.keys()):
original_items = list_by_type[media_type]["items"]
filtered_items = [
m for m in original_items if m.item_id not in hidden_item_ids
]
list_by_type[media_type]["items"] = filtered_items
# Remove empty sections
if not filtered_items and not media_type_to_load:
del list_by_type[media_type]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The current implementation for filtering hidden items has a couple of issues:

  1. Inefficiency: When show_hidden is true, it fetches all in-progress items from the database and then filters them in Python. This can be very inefficient if there are many in-progress items but few hidden ones. A better approach would be to filter in the database directly.
  2. Incorrect item count: When show_hidden is false, it fetches a limited number of items and then filters out hidden ones. This can result in fewer items being displayed than items_limit, which might not be the desired user experience.

I suggest refactoring this logic to perform filtering at the database level. This would improve performance and ensure the correct number of items is displayed. You could achieve this by modifying BasicMedia.objects.get_in_progress to accept a list of item IDs to include or exclude.

"title": game_details.get("title", game_name),
"image": game_details["image"],
}
except (ValueError, KeyError, TypeError) as e:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The try...except block in _match_with_igdb only catches (ValueError, KeyError, TypeError). However, the call to services.get_media_metadata within the try block can raise a services.ProviderAPIError, for example if the game is not found on IGDB. This exception is not caught here, which could cause the entire Steam import to fail if a single game lookup fails.

The previous implementation handled this by catching ProviderAPIError in _process_game. I recommend adding services.ProviderAPIError to this except block to make the import more resilient to failures with individual games.

Suggested change
except (ValueError, KeyError, TypeError) as e:
except (ValueError, KeyError, TypeError, services.ProviderAPIError) as e:


# Database
db/*.sqlite3
db/db.sqlite3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This entry is redundant because db/*.sqlite3 on the preceding line already covers all files ending with .sqlite3 in the db/ directory, including db.sqlite3. You can remove this line to keep the .gitignore file clean and avoid duplication.

{% endif %}

<div class="mt-2 space-y-1 text-sm bg-[#2a2f35] p-3 rounded overflow-x-auto break-words"
<div class="mt-2 space-y-1 text-sm bg-[#2a2f35] p-3 rounded"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The overflow-x-auto class was removed from this div, which is used to display import errors and tracebacks. Tracebacks can contain very long lines that don't wrap automatically. Without overflow-x-auto, these long lines could break the layout of the page.

I recommend adding overflow-x-auto back to ensure that long error messages are scrollable horizontally and don't disrupt the UI.

                  <div class="mt-2 space-y-1 text-sm bg-[#2a2f35] p-3 rounded overflow-x-auto"

kuzhagan143 and others added 3 commits February 14, 2026 21:05
Extend MediaManager to accept include_item_ids and exclude_item_ids (get_media_list and get_in_progress) and apply those as DB-level filters. Update home view to use these DB filters for showing/excluding hidden items (removing costly post-query Python filtering). Catch services.ProviderAPIError in the Steam importer to avoid unhandled provider errors. Add compiled Tailwind CSS asset, remove obsolete static/js and SVG, update import_data template, and add/replace user migration files for new display preferences.
@FuzzyGrim
Copy link
Copy Markdown
Owner

Thank you for the pull requests! However, it's very difficult to review this: https://github.com/FuzzyGrim/Yamtrack/pull/1193/changes

You've modified 111 files, most of which are unrelated to your features. Please try creating new pull requests with only the changes you want. I also suggest splitting the two features into separate pull requests.

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.

[Feature Request] Ignore Special / Season 0

2 participants