Jump to content

I can't sync movies with Trakt and think EmbyCon might be the problem


oneandonly
Go to solution Solved by TeamB,

Recommended Posts

oneandonly

Hello all,

I'm using a RockPro64 (RK3399) running LibreELEC 19.3.0 Git:19.3-Matrix, TheMovieDB Helper v4.4.37, Trakt v3.5.0 and EmbyCon v1.10.18.

All the content I watch comes from a remote Emby server and I use TMDB Helper widgets to populate the skin Arctic Zephyr 2 Resurrection v0.7.1 menu entries from a couple of Trakt lists. In this scenario all the tv shows episodes I watch are correctly synced with Trakt. But not the movies...

At first I thought it could be any issue with the Trakt addon but yesterday I installed Seren and got a Real Debrid subscription for a month just to test things and noticed that when using Seren as a source of media instead of EmbyCon I was able to sync both movies and tv shows episodes (with no changes on anything else).

So I have no idea if the problem is with EmbyCon (maybe some id it should be passing to Trakt and that's correctly sent on tv episodes but not movies) or TMDB Helper (I imagined that maybe the EmbyCon player TMDB Helper uses is buggy, or something).

Btw, here's is what I see on kodi.log when I try to watch a movie from EmbyCon:

2021-11-27 13:35:34.929 T:6982  WARNING <general>: [script.trakt] trakt.interfaces.base: Request failed: "POST /scrobble/stop" - 404: "Method exists, but no record found" (Not Found)

I appreciate any help.

Link to comment
Share on other sites

  • Solution
TeamB

looks like there is a bug in the Trakt addon for kodi, it is expecting a (YYYY) in the movie title, i.e.

The Abyss (1989)

and if it does not find a (YYYY) in the movie title it drops it all together, the following line is the problem in the Trakt add-on.

https://github.com/trakt/script.trakt/blob/f81972a1d47d052eaf3f333ae6e4d26927da4be7/resources/lib/kodiUtilities.py#L421

I really dont want to have to add the year to the actual title as the year is already a separate field in the InfoLabel.

You can fix this in your local system by editing the following file in your kodi add-os dir

C:\Users\<user>\AppData\Roaming\Kodi\addons\script.trakt\resources\lib\kodiUtilities.py

change line :
data['title'] = utilities.regex_year(showtitle)[0]

to
data['title'] = showtitle

delete the kodiUtilities.pyo and restart Kodi.

The above location will change depending on your OS but when you find where your Kodi Add-ons are the \addons\script.trakt\resources\lib\kodiUtilities.py bit shojld be the same.

EDIT:
A better change would be to just fall back to the full title if the first step fails to extract one with the year

data['title'] = utilities.regex_year(showtitle)[0]
if not data['title']:
    data['title'] = showtitle

 

 

Edited by TeamB
Link to comment
Share on other sites

oneandonly
7 hours ago, TeamB said:

looks like there is a bug in the Trakt addon for kodi, it is expecting a (YYYY) in the movie title, i.e.

The Abyss (1989)

and if it does not find a (YYYY) in the movie title it drops it all together, the following line is the problem in the Trakt add-on.

https://github.com/trakt/script.trakt/blob/f81972a1d47d052eaf3f333ae6e4d26927da4be7/resources/lib/kodiUtilities.py#L421

I really dont want to have to add the year to the actual title as the year is already a separate field in the InfoLabel.

You can fix this in your local system by editing the following file in your kodi add-os dir

C:\Users\<user>\AppData\Roaming\Kodi\addons\script.trakt\resources\lib\kodiUtilities.py

change line :
data['title'] = utilities.regex_year(showtitle)[0]

to
data['title'] = showtitle

delete the kodiUtilities.pyo and restart Kodi.

The above location will change depending on your OS but when you find where your Kodi Add-ons are the \addons\script.trakt\resources\lib\kodiUtilities.py bit shojld be the same.

EDIT:
A better change would be to just fall back to the full title if the first step fails to extract one with the year

data['title'] = utilities.regex_year(showtitle)[0]
if not data['title']:
    data['title'] = showtitle

 

 

Hey @TeamB, it worked!

Thank you very much for taking the time to look into this issue. Who would tell that one single line would fix it? :)

I probably didn't understand it but am I supposed to delete the file I'd just edited? I mean... I tried to just edit it (no deletions) and it already worked.

As I had already opened a ticket on Trakt for Kodi's Github a month ago (no answers so far) may I link your solution there as a suggestion to the dev to fix his code?

 

Link to comment
Share on other sites

TeamB
1 hour ago, oneandonly said:

I probably didn't understand it but am I supposed to delete the file I'd just edited? I mean... I tried to just edit it (no deletions) and it already worked.

No not the file you just edited, notice the extension .pyo not .py

1 hour ago, oneandonly said:

as I had already opened a ticket on Trakt for Kodi's Github a month ago (no answers so far) may I link your solution there as a suggestion to the dev to fix his code?

Yeah that is fine

  • Like 1
Link to comment
Share on other sites

oneandonly
On 12/23/2021 at 9:19 AM, TeamB said:

No not the file you just edited, notice the extension .pyo not .py

Yeah that is fine

Hi, @TeamB

I have no .pyo files here... (tryed a `find . -type f -iname "*.pyo"` inside of the .kodi directory and got no results). But it's working even without this file (or without deleting it) which is what matters.

May I bother you a little more? Everything seems to be working nicely but I noticed that if I stop a movie and try to resume it later it won't appear in the "In-Progress Movies" widget of my skin, or if I directly access the "In Progress" list on TheMovieDB Helper (that gets these data from Trakt) the movie won't appear there either. If I reach the movie by any other means, as for example in any other list (lets say, "In theaters") or by searching for it and then trying to play it, it resumes all right. It just seems that it's not updating the "watching" status in Trakt and consequently it's not showing up in any of the correspondent widgets.

Now I know it's probably not related to any possible bug on EmbyCon, but do you believe this behaviour is somehow related to the bug you found in the Trakt for Kodi addon?

Link to comment
Share on other sites

TeamB

dont worry about the .pyo files

If you go to the EmbyCon addon and selected the in progress movies does the in progress movies show up.

Link to comment
Share on other sites

oneandonly
1 hour ago, TeamB said:

dont worry about the .pyo files

If you go to the EmbyCon addon and selected the in progress movies does the in progress movies show up.

Hi @TeamB. I can see all the stopped movies I was watching using EmbyCon on its "In Progress Movies" list, but I can't see them in TMDB (and its "In Progress" widgets). That's a problem because I use just trakt to converge all my watched and in-progress content to the different devices I use.

But don't worry. I'm already quite sure that there's nothing wrong with EmbyCon. I just asked because I imagine that it might have something to do with the bug you find before, so that I could maybe apply the same fix on whatever file is responsible to this specific scrobbling action.

Link to comment
Share on other sites

TeamB

there could be other scrobbling action that are failing, I did not check them all I just found the start stop one and looked at why that one was failing.

if you check your logs and find others not found errors then there could be other places this needs fixing.

Are you able to see in progress movies on the Trakt website? I have not really used Trakt like this before so dont know how or what it can do.

Link to comment
Share on other sites

  • 3 weeks later...
oneandonly
On 12/26/2021 at 4:29 AM, TeamB said:

there could be other scrobbling action that are failing, I did not check them all I just found the start stop one and looked at why that one was failing.

if you check your logs and find others not found errors then there could be other places this needs fixing.

Are you able to see in progress movies on the Trakt website? I have not really used Trakt like this before so dont know how or what it can do.

Hello @TeamB

Have a happy new year! :)

Well, sorry for the delay and just to let you know that I found the reason my "In-Progress" widget wasn't refreshing properly. It was a bug in TMDB Helper which was fixed as registered here. So I now know that I had two issues. First one was that Trakt for Kodi wasn't detecting EmbyCon movies (whose fix you so kindly suggested, although I have no idea if the developer intends to apply, as registered here) and the second one was that bug  in TMDB helper that prevented movies not finished to be correctly scrobbled to Trakt.

I really appreciated your invaluable help!

 

 

  • Like 1
Link to comment
Share on other sites

  • 1 year later...
anontv
        elif (year or video_ids) and season < 0 and not title:
            # we have a year or video_id and no season/showtitle info, enough for a movie
            type = 'movie'
            data['type'] = 'movie'
            if year.isdigit():
                data['year'] = int(year)
            data['title'] = utilities.regex_year(showtitle)[0]
            if not data['title']:
                data['title'] = showtitle
            logger.debug("getInfoLabelDetails - Playing a non-library 'movie' - %s (%s)." %
                         (data['title'], data.get('year', 'NaN')))
        elif (showtitle or title):
            title, season, episode = utilities.regex_tvshow(title)
            if season < 0 and episode < 0:
                title, season, episode = utilities.regex_tvshow(showtitle)
            data['type'] = 'episode'
            data['season'] = season
            data['episode'] = episode
            data['title'] = data['showtitle'] = (title or showtitle)
            logger.debug("getInfoLabelDetails - Title: %s, showtitle: %s, season: %d, episode: %d" %
                         (title, showtitle, season, episode))
        else:
            logger.debug(
                "getInfoLabelDetails - Non-library file, not enough data for scrobbling, skipping.")
            return {}, {}
    return type, data

this is what i got and it doesnt seem to work for me

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...