Skip to content

KefinTweaks Watchlist, and Card Indicator Fixes#7

Merged
MakD merged 3 commits into
masterfrom
KefinTweaks-Watchlist
Dec 17, 2025
Merged

KefinTweaks Watchlist, and Card Indicator Fixes#7
MakD merged 3 commits into
masterfrom
KefinTweaks-Watchlist

Conversation

@MakD
Copy link
Copy Markdown
Owner

@MakD MakD commented Dec 17, 2025

No description provided.

MakD added 3 commits December 17, 2025 11:37
… - Supports KefinTweaks Watchlist

This commit refactors the app's "Watchlist" feature, replacing the local, device-specific implementation with the server's built-in "Like" functionality. This change ensures that a user's watchlist is synchronized across all their devices and sessions.

The local `watchlist` database table and its corresponding `WatchlistDao` and `WatchlistItemEntity` have been completely removed. The app now leverages the `isLiked` filter and user data from the Jellyfin server API to manage and display liked items.

### Key Changes:

*   **Data Models (`AfinityItem`, `AfinityMovie`, etc.):**
    *   A new `liked` boolean property has been added to the base `AfinityItem` interface and all implementing media models (`AfinityMovie`, `AfinityShow`, `AfinityEpisode`, etc.).
    *   This property is now populated from the `userData.likes` field returned by the Jellyfin API.

*   **Repository Layer:**
    *   `WatchlistRepository` has been rewritten to use `UserDataRepository` and `MediaRepository` instead of a local DAO.
    *   `addToWatchlist` and `removeFromWatchlist` now call `userDataRepository.setLike()`.
    *   `getWatchlistMovies`, `getWatchlistShows`, etc., now fetch items from the `MediaRepository` using the new `isLiked=true` filter.
    *   `JellyfinMediaRepository` and `MediaRepository` now accept an `isLiked` parameter and apply the `ItemFilter.LIKES` when querying the API.

*   **Database:**
    *   `WatchlistDao`, `WatchlistItemEntity`, and all related providers in Dagger have been deleted.
    *   A new database migration (`MIGRATION_14_15`) has been added to drop the now-obsolete `watchlist` table, bumping the database version to 15.

*   **ViewModel & UI (`ItemDetailViewModel`, `ItemDetailScreen`):**
    *   The local `isInWatchlist` state has been removed.
    *   The `toggleWatchlist()` function has been renamed to `toggleLike()` and updated to optimistically update the UI's `liked` state while making an API call to the server.
    *   The UI now determines whether to show a filled or an empty "favorite" (like) icon based on the `item.liked` property.
This commit improves the user experience by adding clear visual indicators for watched media and hiding already-watched items from "Latest" sections on the Home screen. It also adds support for animated GIF images.

Media items that have been fully watched will now display a prominent checkmark icon overlay on their posters in carousels and grids.

For shows, the episode count badge now intelligently displays the number of *unplayed* episodes. If all episodes are watched, no badge is shown, and the watched checkmark appears instead.

To keep content fresh, the "Latest Movies" and "Latest TV Shows" carousels, along with individual library sections on the Home screen, will now filter out items that have already been watched.

### Key Changes:

*   **Watched Content Filtering (`AppDataRepository.kt`):**
    *   Items that are marked as `played` are now filtered out from the "Latest" movies and TV show sections on the Home screen. This also applies to individual library carousels.
    *   "Highest Rated" sections will continue to include watched items to provide a comprehensive list.

*   **UI Enhancements (`MediaItemCard.kt`, `HomeScreen.kt`):**
    *   A checkmark icon in a circular primary-colored background is now overlaid on posters for any media item (`AfinityMovie`, `AfinityShow`, etc.) that is fully watched.
    *   For shows, the episode count badge now displays the `unplayedItemCount`. The badge is hidden if the unplayed count is zero.

*   **GIF Support (`ImageLoadingModule.kt`, `app/build.gradle.kts`, `libs.versions.toml`):**
    *   Added the `coil-gif` dependency to enable support for rendering animated GIFs in image loaders throughout the app.

*   **Minor UI Cleanup (`SettingsScreen.kt`):**
    *   Removed an unnecessary `HorizontalDivider` from the Settings screen for a cleaner layout.
This commit updates the application's version information. The version name is incremented to `0.1.1-beta`, and the version code is raised to 10.
@MakD MakD self-assigned this Dec 17, 2025
@MakD MakD merged commit 4592464 into master Dec 17, 2025
@MakD MakD deleted the KefinTweaks-Watchlist branch December 17, 2025 09:15
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.

1 participant