Coder Social home page Coder Social logo

Comments (11)

SenorSmartyPants avatar SenorSmartyPants commented on August 27, 2024

i think I've found the relevant code.

if (matchedShow != null)
{
var matchedSeason =
matchedShow.seasons.FirstOrDefault(
tSeason =>
tSeason.number
== (episode.ParentIndexNumber == 0
? 0
: ((episode.ParentIndexNumber ?? 1))));
// if it's not a match then it means trakt doesn't know about the season, leave the watched state alone and move on
if (matchedSeason != null)
{
// episode is in users libary. Now we need to determine if it's watched
var userData = _userDataManager.GetUserData(user.Id, episode);
bool changed = false;
var matchedEpisode =
matchedSeason.episodes.FirstOrDefault(x => x.number == (episode.IndexNumber ?? -1));

Before matching on season and then episode, it should check for external IDs and match on those. This will be more accurate and support dvd order and absolute ordering. If no match is found then existing code should be used to match on season and episode IndexNumbers

from jellyfin-plugin-trakt.

SenorSmartyPants avatar SenorSmartyPants commented on August 27, 2024

The Get Watched call this plugin uses gets the full watched history for a trakt user. From what I can tell this call only returns season and episode index numbers (aired order), no ids (tvdb, imdb, etc). This is why history is matched the way it currently is.

Get History does return ids for episodes. It does not return all history by default, there are start and end parameters.

I'm not sure why this was implemented in this fashion (history vs. watched).

Smallest impact on JF code base would be to get Trakt to returns ids with Get Watched. But IDK if they would do that.

Sync could be re-written (for episodes) to pull from Get History instead.

Thoughts?

from jellyfin-plugin-trakt.

Shadowghost avatar Shadowghost commented on August 27, 2024

I tried to find a way to properly handle this but up until now I haven't found a sane way to do this.

Another problem with the Get History approach would be that we'd need to check each episode separatly (this will hammer the API) and we'd need to already have the Trakt ids available locally for properly lookup too...

from jellyfin-plugin-trakt.

HStep20 avatar HStep20 commented on August 27, 2024

I think this could also be related to a problem with specials being marked as unplayed because theyre listed on TVDB, but not listed as specials on Trakt. It mostly seems to happen with things like Movies that get categorized as Movies on trakt, but specials on TVDB.

South Park is a good example of it with their "Post Covid" specials that are listed as specials, whereas on Trakt they are listed as Movies and not included in the 'TV Series' listing at all.

from jellyfin-plugin-trakt.

Shadowghost avatar Shadowghost commented on August 27, 2024

That's nothing we can properly handle tbh.
Trakt switched to tmdb as main metadata provider.

from jellyfin-plugin-trakt.

HStep20 avatar HStep20 commented on August 27, 2024

Could it be possible to just ignore syncing items that don't exist on trakt, within a series?

from jellyfin-plugin-trakt.

Shadowghost avatar Shadowghost commented on August 27, 2024

I'm really tempted to drop the fallback to syncing by season and episode number (this would achieve what you request) because it's so damn unreliable.

from jellyfin-plugin-trakt.

SenorSmartyPants avatar SenorSmartyPants commented on August 27, 2024

Make that an option if you do, don't drop it entirely. I worked on the fallback code and I don't want it deleted.

from jellyfin-plugin-trakt.

SenorSmartyPants avatar SenorSmartyPants commented on August 27, 2024

Which thing is unreliable?

I have a PR in progress that addresses the specials/movie problem but it's not quite ready.

from jellyfin-plugin-trakt.

Shadowghost avatar Shadowghost commented on August 27, 2024

Your PR should be fine since we match on IDs (and I do like that). Matching on season and episode number is unreliable because they can be so extremly different between metadata services and if you don't adher to tmdb by default you get messed up playback tracking on trakt. Especially special naming and sorting is totally unreliable by number.

from jellyfin-plugin-trakt.

SenorSmartyPants avatar SenorSmartyPants commented on August 27, 2024

Scrobbling in my PR isn't the problem. It's manually marking as watched/unwatched. Trakt returns exactly what was provided when sending back what it didn't find. JF assumes this is always a episode object, but when it's a series/season/episode structure that is needed when doing SxE and deserializes it incorrectly. (I think that is the case, I know it is a problem with deserialization. Haven't worked on this in a bit)

from jellyfin-plugin-trakt.

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.