ryot icon indicating copy to clipboard operation
ryot copied to clipboard

[Feature Request] Bi directional sync to jellyfin

Open chrisb86 opened this issue 1 year ago • 7 comments

I love the Jellyfin integration. Everything was imported quite nice. Scrobbling from Jellyfin works fine too.

Something I miss is the sync from ryot TO Jellyfin. When I watch a movie in Cinema and track it in ryot it would be nice to have it marked as watched, when I add the movie to Jellyfin anytime later.

chrisb86 avatar Aug 14 '24 15:08 chrisb86

When I watch a movie in Cinema

Can you tell me what this is? Never heard of it.

IgnisDa avatar Aug 14 '24 22:08 IgnisDa

I mean a real world movie theater.

chrisb86 avatar Aug 15 '24 05:08 chrisb86

Oh lol.

Won't the Radarr integration be a better fit here? Once you have watched a movie, you add it to a collection in Ryot. Ryot forwards it to Radarr and the movie gets downloaded. Then you can watch it on Jellyfin anytime you want.

IgnisDa avatar Aug 15 '24 06:08 IgnisDa

Syncing watch history with Jellyfin in this scenario presents challenges, particularly when the movie isn't yet in Jellyfin's database. A preferable approach would be implementing a live burst sync mechanism. This would work as follows:

When you mark a movie as watched, it would connect to Jellyfin. It would send a message like "IMDB ID 1234 has been watched." If that ID doesn't exist in Jellyfin, the server would simply ignore it.

This method offers several advantages:

It prevents issues where marking something as unwatched for a rewatch interferes with Jellyfin's "Play Next" feature. It avoids Ryot repeatedly marking items as watched unnecessarily. It mitigates potential problems with Jellyfin incorrectly logging multiple views for a single watch (although Jellyfin may not have a watch counter).

Additionally, this approach addresses concerns for users with extensive watch histories. I have 15k entries which would need to sync. The proposed system might:

Take several minutes to mark everything as watched. Risk server timeouts. Generate unnecessary processing load if syncing occurs multiple times per hour.

By implementing a live burst sync, we can create a more efficient and user-friendly system that reduces server strain and improves overall functionality.

Jacob-Tate avatar Aug 16 '24 20:08 Jacob-Tate

Maybe we can implement a button on the media piece which performs a watch history sync? IE if the user has a sync to plex/emby/jellyfin theres a sync button under more actions to sync watch progress which will perform that live burst?

Jacob-Tate avatar Aug 16 '24 20:08 Jacob-Tate

To be honest, I don't understand the point of having this integration in the first place. IMO Jellyfin should be used to only watch movies, not track or download anything. So it does not make sense for Ryot to be sending data to Jellyfin.

I am waiting for @chrisb86 opinion of the Radarr sync (https://github.com/IgnisDa/ryot/issues/964#issuecomment-2290729247) method.

IgnisDa avatar Aug 17 '24 00:08 IgnisDa

The suggestion of @Jacob-Tate sounds quite good.

For me this has nothing to do with downloading media so the Radaar integration doesn't nail it. I want to achive the following: If a movie or episode that I watched anytime ago in my live happens to get to my jellyfin server will get correctly marked as watched. I would like ryot to replace trakt as my single source of truth of watched states. It is not about getting media but syncing the correct state.

If I watched a movie 15 years ago on DVD and think I would like to watch it again and somehow it appears on my server, I would like to see, that I watched it ago. When I'm at a friends house and watch an episode on netflix that I also have on my server on netflix I would track this by hand in ryot and have this state synced to Jellyfin.

Maybe following could work. When media gets tracked as watched in ryot, jellyfin gets notified (as suggested by @Jacob-Tate. When new media is added to jellyfin, the server could use the webhook to trigger the notification from ryot for this specific media.

chrisb86 avatar Aug 17 '24 11:08 chrisb86

@chrisb86 Does trakt already have this feature you are talking about?

IgnisDa avatar Oct 10 '24 02:10 IgnisDa

@IgnisDa The trakt plugins for Jellyfin and plex have jobs to regularly scan Trakt for the view states and keep them in sync. The Trakt server itself has no direct notification functionality.

As there are no respective plugins for ryot, webhooks would be the only way to implement this, I think.

chrisb86 avatar Oct 10 '24 04:10 chrisb86

Could you send me the plugin that you used to setup this scanning?

IgnisDa avatar Oct 10 '24 06:10 IgnisDa

I'm using this one from the plugin catalog https://github.com/jellyfin/jellyfin-plugin-trakt.

chrisb86 avatar Oct 13 '24 07:10 chrisb86

@chrisb86 I am mostly done with the development of this feature. Would it be possible for you to give me access to your jellyfin instance? I don't normally use mine so it does not have a lot of movie and so I am not able to account for edge cases.

IgnisDa avatar Oct 21 '24 02:10 IgnisDa

@IgnisDa That sounds great 👍🏻 Sure. I sent you an invitation to your Gmail address.

chrisb86 avatar Oct 21 '24 20:10 chrisb86

@chrisb86 I am able to login to your instance fine, but when I try to perform an import using Ryot, I get a bad version error. Is there any proxying going on which might be causing this?

IgnisDa avatar Oct 22 '24 00:10 IgnisDa