Skip to content

Feature/sync bookmark status - #3301

Open
liubquanti wants to merge 3 commits into
recloudstream:masterfrom
liubquanti-frk:feature/sync-bookmark-status
Open

liubquanti wants to merge 3 commits into
recloudstream:masterfrom
liubquanti-frk:feature/sync-bookmark-status

Conversation

@liubquanti

Copy link
Copy Markdown

Sync bookmark status to logged in sync accounts

Depends on #3300: without it, AniList rejects updates
that have no score, so this change would appear to do nothing for AniList.

Problem

The TV result page has no sync (AniList / MAL) controls at all; it only has the local
bookmark button. On TV the only interaction with a tracker is the player bumping the
episode count, and that only works for titles that are already on the user's list.
For a title that isn't, the status is NONE, so updateStatus takes the delete path
and nothing happens. As a result there is no way to add a title to AniList / MAL from
a TV.

Change

When the bookmark status of a title changes (ResultViewModel2.updateWatchStatus), the
same status is now set on every logged in sync account that has an id for the title
in syncData:

  • WatchType is mapped to SyncWatchType (same ids for 0–4, NONE mapped explicitly,
    since the two enums use different ids for it).
  • The current remote status is fetched first, so an existing score and episode
    progress are kept; only the status changes.
  • Removing the bookmark (NONE) removes the entry from the tracker list as well.
  • Once an update succeeds the library is reloaded again. The reload fired by the
    bookmark change usually fetches the remote list before the update has landed and
    then clears requireLibraryRefresh, leaving the library stale.

Accounts the user isn't logged into, and titles without a tracker id, are untouched.

Open question

This changes behaviour for everyone who is logged into a tracker: bookmarks were
purely local before. If you prefer, I can put it behind a setting
(e.g. "Sync bookmarks to tracker accounts"), off or on by default.

Testing

Tested on a Chromecast with Google TV (Android 14) with an AniList account:

  • Setting Plan to watch on a title that wasn't on the list adds it to AniList
    as Planning (syncWatchStatus AniList 154587 => PLANTOWATCH: Success(true)).
  • The title then shows up in the AniList library tab without restarting the app.

liubquanti and others added 2 commits November 1, 2026 12:45
- Make nullable the AniList fields that can be null (dates, episodes,
  seasonYear, updatedAt). Since the move to kotlinx serialization these
  are no longer coerced to 0, which made the library list fail to parse
  for practically every account.
- SaveMediaListEntry: only declare and pass scoreRaw / progress when they
  have a value. AniList rejected the whole mutation otherwise
  ("Variable $scoreRaw is not defined"), while it was reported as success.
- Treat GraphQL errors in the mutation response as a failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Changing a title's bookmark status now sets the same status on every
logged in sync account (AniList, MAL, ...) that has an id for the title,
then reloads the library once the update has landed. The TV layout has
no sync controls, so this was the only way to manage those lists there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fire-light42 fire-light42 added Review needed The pull request contains no obvious blockers. It just needs a review before merging. AI Assisted This pull request was AI assisted (or generated). labels Nov 1, 2026
@fire-light42

Copy link
Copy Markdown
Collaborator

Yes, such a fundamental change needs a toggle. We cannot change the expected behavior in the app too much, since many users have gotten used to the existing behavior.

@liubquanti

Copy link
Copy Markdown
Author

I’ve added a toggle to the account settings to enable synchronisation, which is disabled by default. I tested it on the same Chromecast using my AniList account.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Assisted This pull request was AI assisted (or generated). Review needed The pull request contains no obvious blockers. It just needs a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants