trakt / script.trakt

Trakt.tv movie and TV show scrobbler for Kodi
GNU General Public License v2.0
318 stars 149 forks source link

Trakt addon doesn't sync episode progress even though I get the scrobble notification #518

Closed unkn0wn234 closed 3 years ago

unkn0wn234 commented 3 years ago

I watch part way of an episode I back out, the resume point gets saved, but upon doing a Trakt Sync it resets it to the beginning. I can't go to another Kodi build and resume bc this doesn't work. I swear it used to before I fresh installed not sure whats going on. Let me know if you need a log.

EDIT: Issue was caused by Runtime for episodes being 0 in Kodi DB, you can fix it by editing the DB manually or generating NFOs for your episodes.

razzeee commented 3 years ago

What are your settings?

unkn0wn234 commented 3 years ago

https://imgur.com/a/7pFWAcr

razzeee commented 3 years ago

no dice without a good log

unkn0wn234 commented 3 years ago

Ill get to posting it tonight, thank you.

unkn0wn234 commented 3 years ago

kodi.log kodi.old.log

https://imgur.com/a/t4VAWLZ

unkn0wn234 commented 3 years ago

https://imgur.com/a/foe7icj

also this is a screencap of github progress manager, the seinfeld episode was there too but i removed it to set my eps back to normal, all the movies aside from justice have their progress and dont get reset. the other episodes dont update in my library at all

razzeee commented 3 years ago

You might want to update kodi, your some versions behind.

The logfiles are not very useable, chech https://github.com/trakt/script.trakt#creating-logfiles

unkn0wn234 commented 3 years ago

kodi.log kodi.old.log

for the time being id like to stay on my version as i heard people who updated broke alot of their home widget setups and stuff, if i need to to fix it then i will. Here are 2 debug logs, I notcied after the sync the progress was still there but it turned out it was just a visual bug with the skin I use bc I clicked into the show and the progress was lost again. Bit of false hope :L , anyways here are the debug logs.

razzeee commented 3 years ago

Both logs don't seem like you actually ran the sync, there is no log from the sync or something crashing.

unkn0wn234 commented 3 years ago

I have the option run sync upon library update or cleaning so I use that to force a sync I know it’s happening too because I have the notifications where it shows both movies and episode sync started, then completed like in those images in the imgur link I sent earlier. Or by sync are u referring to something else such as my episode progress being synced with trakt so it doesn’t get overridden upon a library update?? In which case I also have the scrobble notification enabled to make sure it’s updating and I see it being scribbled.

unkn0wn234 commented 3 years ago

It’s not crashing to me because the sync completes, and then my episode progress gets overridden being sent back to 0, if I mark the next few episodes as watched on trakt before the update it will update to that episode so I can tell it’s working on an episode basis just not with mid episode progress, even tho I get a scrobble notification

razzeee commented 3 years ago

When you start an episode and it says scrobbling, do you see that on trakt.tv on your profile too? As currently watching?

unkn0wn234 commented 3 years ago

I will go and check, if it does not what does that mean? Something on my end, a bug with trakt addon, etc. I will update in a few minutes

unkn0wn234 commented 3 years ago

Also again if y can check that GitHub image I sent it shows progress for episodes such as archer, kill la kill, and family guy which do not get updated.

unkn0wn234 commented 3 years ago

Yes it does, sorry for a late respone here is an image Capture

razzeee commented 3 years ago

Interesting, so your saying your not able to see that episode via the trakt progress viewer?

unkn0wn234 commented 3 years ago

Interesting, so your saying your not able to see that episode via the trakt progress viewer?

if you’re talking about the GitHub trakt viewer I do, I deleted the Seinfeld episode from it tho cause I wasn’t actually on that episode anyway I just did it to test and it showed 3x4 from me testing

Also I deleted it after the trakt sync so i didn’t make it not update

razzeee commented 3 years ago

So it showed the wrong episode or did you test with 3x4 this time?

unkn0wn234 commented 3 years ago

No just ignore that 3x4, bc i tested this numerous times, the time I went to 3x4, and the image above are separate occasions. When I had progress in 3x4 it would show 3x4 after the sync but the playback progress is removed, same with 3x1.

What always happens is, the correct episode is shown but any playback progress is wiped after a trakt sync

razzeee commented 3 years ago

Just tried with matrix on my android setup and demon slayers, the progress wasn't wiped for me.

We only ever set progress via scrobble, in fact we only have a get call for your progress data. So no idea, how they can go missing. Maybe it's server side, only the trakt guys might know @rectifyer

unkn0wn234 commented 3 years ago

Can you show me your trakt addon settings and version?

razzeee commented 3 years ago

Version is https://github.com/trakt/script.trakt/releases/tag/v3.3.2

Here's a settings diff:

unkn0wn234 commented 3 years ago

I checked Add new TV Episodes to Trakt collection as that would be the only thing I dont have on, no change. I just tested with Seinfeld 3x2, went about 10 min in, Trakt Github viewer showed I was watching it as well as the Trakt Site, I went and clicked Run on the Trakt addon went back to the episode, my episode progress vanished. I checked on Github viewer the 44% of 3x2 progress is still there.

I realized I made a mistake earlier I had enabled debug logging but not in the Trakt addon too let me delete 3x2 from the progress, and re-try. I also just re-installed the addon but my Trakt info was already logged in even tho i pressed delete all data.

unkn0wn234 commented 3 years ago

Oh by the way, the library folders i used is shared among another Kodi Build, do u think that could be the problem?

unkn0wn234 commented 3 years ago

Here is the debug log with debug in Trakt enabled. I will explain what I did a bit, I played Seinfeld S3E2, skipped halfway, checked on Trakt PLayback Progress Manager (github) progress was there. Though It didnt say I was playing it live this time, anyways I backed out checked progress it was still there, I played it again to confirm my library resume point was there and on the second play it went to the point I was it as you can see in the log. This time I checked again on Trakt Github Manager, and the Trakt site, both said I was currently watching this episode. I back out, run the Trakt addon to sync, go back and the progress is lost, just to be safe I play the episode, but as you can see it does not resume.

kodi.log

unkn0wn234 commented 3 years ago

Did a complete fresh install, and now my movies in progress wont even populate anymore, only completely watched episodes and movies are marked but none of the in progress are marked correctly in Kodi. :'/ (Also i just updated to Kodi 18.9 as well)

EDIT:I forgot to enable sync playback progress for both movies and episodes, doing so brought my in progress movies back, however not my in progress episodes.

I had progress in 21 Bridges, I marked it as unwatched, ran a Trakt sync and it came back, so i have no idea why this is not working with episodes at the moment. I will post another debug log.

unkn0wn234 commented 3 years ago

In this debug log I marked the 2 movies in my in-progress (21 bridges, and Da 5 Bloods) as unwatched, then watched partway into Seinfeld 3x3, I backed out to confirm it saved the resume point and also checked on the Trakt github viewer it showed both when i was watching it live, and the progress after I quit. I played 3x3 again to confirm it would resume and it did, then I ran the Trakt sync, Episode progress again is lost, but the 2 movies in progress returned again.

So this is a problem only with episodes in progress, movies and episodes watched status' sync fine, movies playback progress syncs up, however episode playback progress is the only thing that gets wiped everytime i run a trakt sync, and does not get synced to my library from trakt, bc as u can see on my trakt github the episodes have progress.

kodi.log

razzeee commented 3 years ago

would you be able to edit syncEpisodes.py and add more logging? then redo the test? especially in the later parts of __addEpisodeProgressToKodi

unkn0wn234 commented 3 years ago

would you be able to edit syncEpisodes.py and add more logging? then redo the test? especially in the later parts of __addEpisodeProgressToKodi

I am very nooby but if u tell me what to edit exactly I can follow instructions

unkn0wn234 commented 3 years ago

would you be able to edit syncEpisodes.py and add more logging? then redo the test? especially in the later parts of __addEpisodeProgressToKodi

Just following up

razzeee commented 3 years ago

try logger.debug("[Episodes Sync] Episode progress chunk: %s" % json.dumps(chunk)) right before kodiUtilities.kodiJsonRequest(chunk). You will also need to do import json at the top of the file.

Please keep it indented like the lines next to them.

unkn0wn234 commented 3 years ago

try logger.debug("[Episodes Sync] Episode progress chunk: %s" % json.dumps(chunk)) right before kodiUtilities.kodiJsonRequest(chunk). You will also need to do import json at the top of the file.

Please keep it indented like the lines next to them.

I can try but sorry to ask, if it’s not much hassle could u just send me the edited.py?

razzeee commented 3 years ago

I think this should work syncEpisodes.zip

unkn0wn234 commented 3 years ago

theres a .pyo as well but just replacing the .py is fine? do i also have to re enable Trakt debug, and Kodi debug?

unkn0wn234 commented 3 years ago

kodi.log

razzeee commented 3 years ago

Sorry, seems like I made a mistake while patching, can you try this?

syncEpisodes.zip

unkn0wn234 commented 3 years ago

Sorry, seems like I made a mistake while patching, can you try this?

syncEpisodes.zip

I didnt see this sorry testing now

unkn0wn234 commented 3 years ago

Untitled

Trakt website, and github progress manager both show in progress while watching. After exiting progress is shown/saved on the github progress manager as well. Running trakt sync wipes episode progress again however here is the log for it. Debug enabled on Kodi and in Trakt addon.

kodi.log

unkn0wn234 commented 3 years ago

Sorry, seems like I made a mistake while patching, can you try this?

syncEpisodes.zip

Following up, was this new log able to tell you anything?

razzeee commented 3 years ago

Seems like it reset these for you: 2020-12-21 20:34:43.863 T:9624 DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Episodes updated: The Promised Neverland [tvdb: 348002] - S01E05 2020-12-21 20:34:43.864 T:9624 DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Episodes updated: Family Guy [tvdb: 75978] - S19E01 2020-12-21 20:34:43.864 T:9624 DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Episodes updated: Demon Slayer: Kimetsu no Yaiba [tvdb: 348545] - S01E12

it seems to think the total length of the episode is 0 minutes, so that might be the cause for this.

unkn0wn234 commented 3 years ago

Seems like it reset these for you: 2020-12-21 20:34:43.863 T:9624 DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Episodes updated: The Promised Neverland [tvdb: 348002] - S01E05 2020-12-21 20:34:43.864 T:9624 DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Episodes updated: Family Guy [tvdb: 75978] - S19E01 2020-12-21 20:34:43.864 T:9624 DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Episodes updated: Demon Slayer: Kimetsu no Yaiba [tvdb: 348545] - S01E12

it seems to think the total length of the episode is 0 minutes, so that might be the cause for this.

Where does the trakt addon get the runtimes for episodes? My library uses .strms from the official TMDBHelper addon I would think this might be the reason as a strm Might default to 0 min, but my movies progress again work completely fine.

Is the 0 minutes something I can hope to see fixed or is there still more unknowns to try and figure out?

also thank you for taking the time to help. Me out these past however many day’s. I really appreciate it

razzeee commented 3 years ago

Do use nfo files? Which scraper are you using? Can you check if the episodes have a runtime in kodi/the database/the api? It's the "runtime" field on the episode.

unkn0wn234 commented 3 years ago

Do use nfo files? Which scraper are you using? Can you check if the episodes have a runtime in kodi/the database/the api? It's the "runtime" field on the episode.

I use the tmdb scraper for shows and sometimes tvdb I think tmdb makes nfos but only for the show as a whole not for episodes. Can you explain what u mean by in the database/api? I think I can just go check in my Kodi library I’ll go boot up my laptop

razzeee commented 3 years ago

Nfo files only get generated, if you want that (by kodi) but there are people who like to place them next to every file, to be able to control everything. Depending on where the database is, you can open it up and look at the tables and the data in there.

unkn0wn234 commented 3 years ago

Nfo files only get generated, if you want that (by kodi) but there are people who like to place them next to every file, to be able to control everything. Depending on where the database is, you can open it up and look at the tables and the data in there.

Uhh so what is the file named I can just search it up and open it? As of now my shows only have a .nfo in the root folder of the show for tmdb scraper shows not for all episodes I don’t think I want one for each file/episode unless u think I need to to fix this.

razzeee commented 3 years ago

filename should be the same as the episode name, but with .nfo an filetype. You can however check if the shows here have the top level nfo and if removing/moving, rescanning and retesting changes something.

unkn0wn234 commented 3 years ago

I think I found the database folder in Kodi but the files are all .db I don’t know how to open them, I think I checked an nfo and all it has is just the url to the tmdb but I could be wrong I just dtagvdropped it into chrome. Could u tell me how to make Kodi make nfos for each episode None of the information provider addons in Kodi I have have the option

unkn0wn234 commented 3 years ago

I think we may have got it, I’ll update in a few minutes to make sure it works with other shows too

unkn0wn234 commented 3 years ago

Nvm I didn’t even have sync episode playback on let me test now lol. I had it turned off CAuse it kept messin my stuff up

unkn0wn234 commented 3 years ago

Deleting an nfo from the show itself didn’t help to solve this unfortunately