Jellyfin Forum
Mark watched not working for "some" movies - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions)
+--- Thread: Mark watched not working for "some" movies (/t-mark-watched-not-working-for-some-movies)



Mark watched not working for "some" movies - poweredbyporkers - 2025-12-12

Version: 10.11.4

Moving over from Plex, slowly, but I have an odd issue where some movies were primarily picked up in the scan as matching Japanese movies. Fair enough, I went through them and identified them correctly and all is good.

But

I've written a c# app to move status for all my users from Plex to Jellyfin and it works a treat except for a few movies, if I call the cUrl comand it returns a 200 OK but doesn't mark them as watched. Again I figured I'd stuffed up the code somewhere so I went to the UI and tried marking as watched, and the same thing, they just never stick at being watched. 

Monitoring the network tab in chrome dev tools shows the same issue a 200 response but with {"PlaybackPositionTicks": 0, "PlayCount": 0, "IsFavorite": false, "Played": false, "Key": "503901", "ItemId": "978b227d683dbf824d134ba62f60db32"}, others work fine?

Is there a trick to this?

A couple of calls being made, I've removed most of the headers for security and to make it smaller
Code:
curl -X POST "http://./Users/bfe5728ddb394279934fc5376fd5958b/Items/978b227d683dbf824d134ba62f60db32/UserData" -d '{"Played":true,"LastPlayedDate":"2023-11-16T05:44:49Z"}' - OK
curl -X POST "http://./Users/bfe5728ddb394279934fc5376fd5958b/Items/2d25176d48c4e90ec64e4069af69aa6b/UserData" -d '{"Played":true,"LastPlayedDate":"2025-07-31T21:59:26Z"}' - OK



RE: Mark watched not working for "some" movies - poweredbyporkers - 2025-12-13

I'm assuming when you rematch it should clear out the old match data not leave it hanging around but it seems to be still active.

The Bodyguard (1992) (tt0103855) for some reason matched to a Russian movie called Telokhranite (1991) (tt0197013) which has an aka of The Bodyguard so when you update the watched status it returns 5 records and sets 3 of them to watched, BUT, the first two records, the old data, is untouched and so Played = false and it returns the first record in the dataset and so it seems it's unwatched when it's actually watched

Should likely update UserDataManager to remove the now unassociated userdata items in SaveUserData. 

Quote:private static void RemoveUserDataNotAssociatedViaKey(JellyfinDbContext dbContext, User user, BaseItem item, List<string> keys)
{
    var notAssociated = dbContext.UserData
        .Where(f => f.ItemId == item.Id && f.UserId == user.Id && !keys.Contains(f.CustomDataKey));
    if (notAssociated.Any())
    {
        dbContext.UserData.RemoveRange(notAssociated);
    }
}