PlexTraktSync: Unable to scrobble episodes scanned with the new TV agent
The problem
I cannot seem to scrobble S04E01 of Dynasty. As you can see in the logs, it doesn’t seem to be able to match the episode in Trakt.
State: playing
Found <imdb:tt11568606:<Episode:62362:Dynasty-s04e01>>
State: paused
Found <imdb:tt11568606:<Episode:62362:Dynasty-s04e01>>
State: stopped
Found <imdb:tt11568606:<Episode:62362:Dynasty-s04e01>>
If I play another episode…
State: playing
Found <imdb:tt6926268:<Episode:30770:Dynasty-(2017)-s01e01>>
<Episode:30770:Dynasty-(2017)-s01e01>: 0.194093% Watched: True, LastViewed: 2019-11-10 11:10:04
State: stopped
Found <imdb:tt6926268:<Episode:30770:Dynasty-(2017)-s01e01>>
<Episode:30770:Dynasty-(2017)-s01e01>: 0.194093% Watched: True, LastViewed: 2019-11-10 11:10:04
Note the discrepancies in the names. Dynasty-(2017) seems to be the correct one, whereas just Dynasty doesn’t seem to match.
Problematic XML:
<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="2" librarySectionTitle="TV Shows" librarySectionUUID="xxxxx" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1618841291">
<Video ratingKey="62362" key="/library/metadata/62362" parentRatingKey="62361" grandparentRatingKey="28869" guid="plex://episode/60859a8c188611002d692098" parentGuid="plex://season/60859a8a188611002d692087" grandparentGuid="plex://show/5d9f410dca3253001ef364c7" type="episode" title="That Unfortunate Dinner" grandparentKey="/library/metadata/28869" parentKey="/library/metadata/62361" librarySectionTitle="TV Shows" librarySectionID="2" librarySectionKey="/library/sections/2" grandparentTitle="Dynasty (2017)" parentTitle="Season 4" contentRating="TV-14" summary="Fallon and Liam plan their wedding, with some unsolicited input from Alexis. Dominique runs into hiccups with her new fashion line and turns to unexpected sources for help. Blake is determined to work on his relationship with Cristal." index="1" parentIndex="4" viewOffset="624040" lastViewedAt="1620574213" parentYear="2021" thumb="/library/metadata/62362/thumb/1620542113" art="/library/metadata/28869/art/1620542043" parentThumb="/library/metadata/62361/thumb/1620548757" grandparentThumb="/library/metadata/28869/thumb/1620542043" grandparentArt="/library/metadata/28869/art/1620542043" duration="2549248" originallyAvailableAt="2021-05-07" addedAt="1620473297" updatedAt="1620542113">'
[REDACTED]
<Guid id="imdb://tt11568606" />
<Guid id="tmdb://2898461" />
<Guid id="tvdb://8311010" />
<Extras size="0" />
<Related />
</Video>
</MediaContainer>
XML from another episode:
<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="2" librarySectionTitle="TV Shows" librarySectionUUID="xxxxx" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1618841291">
<Video ratingKey="28871" key="/library/metadata/28871" parentRatingKey="28870" grandparentRatingKey="28869" guid="plex://episode/5e833825d9e2b6004236d566" parentGuid="plex://season/602e774167f4c8002ce56f48" grandparentGuid="plex://show/5d9f410dca3253001ef364c7" type="episode" title="Guilt Trip To Alaska" grandparentKey="/library/metadata/28869" parentKey="/library/metadata/28870" librarySectionTitle="TV Shows" librarySectionID="2" librarySectionKey="/library/sections/2" grandparentTitle="Dynasty (2017)" parentTitle="Season 3" contentRating="TV-14" summary="On the eve of the Carrington Foundation fundraiser, bodies are pulled from the lake on the Carrington Estate. Fallon finds herself haunted by Trixie's death in unexpected ways. Kirby visits Culhane." index="1" parentIndex="3" audienceRating="4.5" viewCount="1" lastViewedAt="1573364408" parentYear="2019" thumb="/library/metadata/28871/thumb/1618312430" art="/library/metadata/28869/art/1620542043" parentThumb="/library/metadata/28870/thumb/1620542111" grandparentThumb="/library/metadata/28869/thumb/1620542043" grandparentArt="/library/metadata/28869/art/1620542043" duration="2547808" originallyAvailableAt="2019-10-11" addedAt="1588414369" updatedAt="1618312430" audienceRatingImage="themoviedb://image.rating">
[REDACTED]
<Guid id="imdb://tt9702234" />
<Guid id="tmdb://1935866" />
<Guid id="tvdb://7241394" />
<Role id="185154" filter="actor=185154" tag="Ben Levin" role="Doug" thumb="https://metadata-static.plex.tv/people/5d776849f59e58002189b0d6.jpg" />
<Extras size="0" />
<Related />
</Video>
</MediaContainer>
Expected behavior
Item watched would scrobble.
Steps to reproduce the behavior
Unsure. Maybe touch a file with this TV show/episode and have Plex scan it?
Workarounds
Not that I’m aware of.
Environment
- Version:
master - Python version:
3.8.5 - Platform: Ubuntu 20.04
aarch64
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (7 by maintainers)
It looks like tvdb is problematic too : #318 Iterate over guids until match seems to be the correct robust solution.
according to Justin reply, should have a pre-defined list of order:
easiest fix is to change the guids[0], not to take the first item, but from the order of preference first existing guid (no search).
more complete solution would be to iterate over guids and do the search as well, until match is made.
I don’t think we need the complex solution, as it would assume trakt tmdb/tvdb also have no matches, as I can read out from the reply that only imdb is problematic.
yeah, ideally the logic should try any of the guid matches, or have preference in which order to try. but I can’t code right now 😃