Git Product home page Git Product logo

Comments (15)

Andy2244 avatar Andy2244 commented on July 17, 2024 1

The main issue is you need to-be very carefully how/what you sync and also offer/study the settings options the trakt plugin has.

There can be catastrophic cases, where you wrongly sync the "unwatched" state from remote to local library or vice-versa and than quickly via a scheduled task, resync this new bad "unwatched" state back to the external list, basically wiping your watched states.

To prevent this case all trakt plugins by default disable remote->local "unwatched" sync via settings and also arrange the update jobs, so that the user has a chance to fix setting issues, before a full resync happens.

So by default you want the plugin to handle mainly "watched" states between local<->remote lists and via settings allow certain "unwatched" state combinations.

As example, the trakt plugin has specific settings to only set remote "watched/unwatched" if the user manually set the state. This is safer, since we detect a specific user toggled state change instead of doing some general assumptions on the whole library.

So if you don't use the trakt plugin already, i strongly recommend to check it out and check what settings combinations it offers, so you can avoid running into those catastrophic cases. We want safe defaults and carefully worded settings, similar to trakt so users quickly understand whats happening.

from jellyfin-ani-sync.

Nocifer avatar Nocifer commented on July 17, 2024 1

I know, I was replying to @vosmiic here:

So instead of doing an "outwards" sync (Jellyfin -> AniList/MAL/Kitsu), we sync the Jellyfin library to a provider (AniList/MAL/Kitsu -> Jellyfin)?
This has been requested before here #12.

"This" isn't what has been requested in #12 :)

from jellyfin-ani-sync.

vosmiic avatar vosmiic commented on July 17, 2024 1

"This" isn't what has been requested in #12 :)

Yeah sorry I got a bit confused.
I think I understand what would like to be achieved here, as it has been said before we would like both way sync between Jellyfin and the providers.
I also understand what @Andy2244 said with being careful how we handle it. Need to make sure it doesn't turn into a nasty loop of updating each others lists and end up with broken watch statuses on both sides. I can see that you explained how the trakt plugin handles it, and it seems to be the best method.
I'll take all of this into account when implementing these changes.

from jellyfin-ani-sync.

Andy2244 avatar Andy2244 commented on July 17, 2024 1

As most of the APIs don't contain the season number

Thats tobe expected as most Anime has no "official" seasons, so have no season numbers. Those are just made up by
TVDB/TMDB based on air dates.

Only problem being is that Jellyfin does not seem to store season provider IDs, at least not for me. It stores the series provider IDs, but not separate seasons.

Same for me, i think tvdb does not have separate season id's for a series?

So here is how this can work, lets use "Megalo Box 2nd" aka Second seasons as example:

  • get the AniList ID via api/watched/watching list https://anilist.co/anime/113359/MEGALOBOX-2-NOMAD/ so 113359
  • get the AniDB id via xrossref the AniList id 113359 from the offline list: we get 15271
  • find the AniDB entry in the anime-list.xml <anime anidbid="15271" tvdbid="341437" defaulttvdbseason="2">
  • check if there is a series for the user libs the plugin handles with a tvdbid="341437" main id
    • match the defaulttvdbseason season numbers and try find the season by number
    • sync watched states of episodes, accounting for possible episode offset's

we may need to also filter by ova/movies/special stuff.
The full Anime offline db file has those infos:

      "title": "Nomad: Megalo Box 2",
      "type": "TV",
      "episodes": 13,
      "status": "FINISHED",
      "animeSeason": {
        "season": "SPRING",
        "year": 2021 }

So i think the type, animeSeason can be used to ensure we actually match a series or movie, just check for examples.

from jellyfin-ani-sync.

vosmiic avatar vosmiic commented on July 17, 2024 1

This feature is now fully implemented on master.
Just doing some testing and then I should be able to release a new version with this functionality included.

from jellyfin-ani-sync.

vosmiic avatar vosmiic commented on July 17, 2024 1

Okay, the update with this has been released. Currently testing it locally and I am not hitting into any trouble.
That being said, I would be very careful using this - it could quite easily mess up your Jellyfin library or provider watch lists.

from jellyfin-ani-sync.

vosmiic avatar vosmiic commented on July 17, 2024

So instead of doing an "outwards" sync (Jellyfin -> AniList/MAL/Kitsu), we sync the Jellyfin library to a provider (AniList/MAL/Kitsu -> Jellyfin)?
This has been requested before here #12.
While it wasn't exactly the original idea of the plugin, I still feel like it falls into the same realm.
We could even make it an optional scheduled event, for those who update their AniList/MAL/Kitsu manually outside of Jellyfin.
I can't see how it would be that difficult to achieve, simply retrieve the users complete/in progress list and update the Jellyfin library.
I'll look into it and keep you updated.

from jellyfin-ani-sync.

Andy2244 avatar Andy2244 commented on July 17, 2024

@vosmiic btw i took the liberty to add the plugin to the official documentation: jellyfin/jellyfin-docs#675

from jellyfin-ani-sync.

vosmiic avatar vosmiic commented on July 17, 2024

btw i took the liberty to add the plugin to the official documentation

Ah great, thanks. I think we are now in a comfortable enough position to have it there.

from jellyfin-ani-sync.

Nocifer avatar Nocifer commented on July 17, 2024

Just as a FYI, #12 isn't really about what @Andy2244 is asking for here, which is importing watch status from a remote Trakt-like third-party provider (i.e. AniList/MAL/Kitsu -> Jellyfin) but rather an extended functionality of what Ani-Sync already does, which is exporting watch status to a third-party provider (i.e. Jellyfin -> AniList/MAL/Kitsu) but without the hard requirement that I must first initiate playback of an anime for AniSync to scan it and update its remote status.

My issue (and I'm pretty certain I'm far from the only one affected) is that many of my anime were already watched or in various states of in medias res before I ever installed AniSync, but I'd just never bothered to manually update my MAL profile. So what I'd love for AniSync to be able to do, and what I asked for in #12, would be that it be able to scan my local Jellyfin library, find which anime I have already watched and which shows I'm currently watching, and then update my MAL profile accordingly. And if it could also add my completely untouched anime to the "plan to watch" category, that would be even more awesome.

After this has been done, then adding what @Andy2244 is actually asking for, i.e. the ability to also import watch state from MAL et al to Jellyfin, would be the cherry on top.

from jellyfin-ani-sync.

Andy2244 avatar Andy2244 commented on July 17, 2024

I kinda included your scenario, its just a subpart of what a full 2-way sync does.

from jellyfin-ani-sync.

vosmiic avatar vosmiic commented on July 17, 2024

Hitting into some trouble syncing Jellyfin from the providers (AniList/MAL/Kitsu -> Jellyfin).
As most of the APIs don't contain the season number, we can't actually tell what season the user is on. Luckily each item in the providers database is a separate season.
The obvious way to accomplish this is to get the users watch list from the appropriate provider, get the IDs of the anime in said list and then run them through the anime offline database to get the AniDB ID and AniList ID of each season (if we are not using it as the selected provider to sync from) and then cross reference that to Jellyfin's database to see which seasons we have locally that match the IDs (we cannot use the local anime list XML file as that would only give us a TVDB ID which is bound to the series, not the season).
Only problem being is that Jellyfin does not seem to store season provider IDs, at least not for me. It stores the series provider IDs, but not separate seasons.
The only time that we will get a match with a provider ID from the Jellyfin database is if we are working with the first season of a show from the users watch list.
Could someone please confirm that it isn't only me not having any provider IDs (labelled "external IDs" in the Jellyfin interface) for seasons? I have tried running the metadata fetcher multiple times and I don't get any extra provider IDs for seasons. I get a TVDB ID, but when I cross reference it with the XML file I get no results. I'm not entirely sure what the ID represents as I even tried looking it up on TVDB but got no results.

from jellyfin-ani-sync.

vosmiic avatar vosmiic commented on July 17, 2024

find the AniDB entry in the anime-list.xml

Good idea, yeah this should work. Feels like its really inefficient but we have to work with what we have.

we may need to also filter by ova/movies/special stuff

Luckily AniList uses GraphQL so we can filter our results on the API side. Much more efficient. But we will have to manually filter by checking the anime offline db with MAL.

from jellyfin-ani-sync.

vosmiic avatar vosmiic commented on July 17, 2024

I have now got it updating shows from a users AniList watched list.
Just need to clean it up and get it working with other providers.

from jellyfin-ani-sync.

vosmiic avatar vosmiic commented on July 17, 2024

Forgot to update here recently but I believe I have got updating the Jellyfin library from providers anime list fully working.
I have added a warning to let users know that the feature is in "alpha" and that it may disrupt their Jellyfin libraries.
Next to do is to get the other direction working (Jellyfin to provider anime list).

from jellyfin-ani-sync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.