Taxel / PlexTraktSync

A python script that syncs the movies, shows and ratings between trakt and Plex (without needing a PlexPass or Trakt VIP subscription)
MIT License
1.62k stars 106 forks source link

Error during ratings sync: 'NoneType' object has no attribute 'plex' #1785

Closed JonzaUK closed 8 months ago

JonzaUK commented 9 months ago

Confirmation

The problem

Container stops running.

Steps to reproduce the behavior

  1. Run the container
  2. Wait for it to start processing series.

Error trace / logs

https://gist.github.com/JonzaUK/98c06f229a82ffb35ffe22d6477d122d

Expected behavior

App to finish syncing of libraries

Inspect of problematic items

No response

Workarounds

No response

Install method

Unraid installation (not supported)

Config file contents

```yaml cache: path: $PTS_CACHE_DIR/trakt_cache excluded-libraries: - Private - Family Holidays config: dotenv_override: true plex: timeout: 30 logging: append: true # Whether to show timestamps in console messages console_time: false debug: false filename: plextraktsync.log # Additional logger names to apply filtering filter_loggers: # - plexapi # - requests_cache.backends # - requests_cache.backends.base # - requests_cache.backends.sqlite # - requests_cache.policy.actions # - requests_cache.session # - trakt.core # - urllib3.connectionpool filter: # # Filter out all messages with level WARNING # - level: WARNING # # Filter out message with level WARNING and containing a text # - level: WARNING # message: "not found on Trakt" # - message: "because provider local has no external Id" # - message: "because provider none has no external Id" # - message: "Retry using search for specific Plex Episode" # # Filter out messages by requests_cache # - name: requests_cache.backends # - name: requests_cache.backends.base # - name: requests_cache.backends.sqlite # - name: requests_cache.policy.actions # - name: requests_cache.session # settings for 'sync' command (default) sync: plex_to_trakt: collection: true # Clear collected state of items not present in Plex clear_collected: false ratings: true watched_status: true # If plex_to_trakt watchlist=false and trakt_to_plex watchlist=true # the Plex watchlist will be overwritten by Trakt watchlist watchlist: true trakt_to_plex: liked_lists: false ratings: false watched_status: false # If trakt_to_plex watchlist=false and plex_to_trakt watchlist=true # the Trakt watchlist will be overwritten by Plex watchlist watchlist: false # If you prefer to fetch trakt watchlist as a playlist instead of # plex watchlist, toggle this to true (is read only if watchlist=true) watchlist_as_playlist: false # Setting for whether ratings from one platform should have priority. # Valid values are trakt, plex or none. (default: plex) # none - No rating priority. Existing ratings are not overwritten. # trakt - Trakt ratings have priority. Existing Plex ratings are overwritten. # plex - Plex ratings have priority. Existing Trakt ratings are overwritten. rating_priority: plex # settings for 'watch' command watch: add_collection: false remove_collection: false # what video watched percentage (0 to 100) triggers the watched status scrobble_threshold: 80 # true to scrobble only what's watched by you, false for all your PMS users username_filter: true # Show the progress bar of played media in terminal media_progressbar: true xbmc-providers: movies: imdb shows: tvdb ##### Advanced settings below this line, don't edit unless you know what you're doing ##### #http_cache: # https://requests-cache.readthedocs.io/en/main/user_guide/expiration.html#url-patterns # https://requests-cache.readthedocs.io/en/main/user_guide/expiration.html#expiration-values # # The value is seconds to cache. # Or one of the following special values: # - DO_NOT_CACHE: Skip both reading from and writing to the cache # - EXPIRE_IMMEDIATELY: Consider the response already expired, but potentially usable # - NEVER_EXPIRE: Store responses indefinitely # # The value can be also suffixed with a time unit: # - 5m, 1h, 3d # See full documentation at: # - https://github.com/wroberts/pytimeparse#pytimeparse-time-expression-parser # # NOTE: If there is more than one match, the first match will be used in the order they are defined # policy: # "*.trakt.tv/users/me": 1d # "*.trakt.tv/users/likes/lists": DO_NOT_CACHE # vim:ts=2:sw=2:et ```

Version

0.28.15

Python Version

3.12.1

Plex Server Version

1.40.0.7775

Operating System and Version

unRAID

glensc commented 9 months ago

duplicate.

provide the same info asked from the previous reporter:

but they disappeared, so issue is closed

JonzaUK commented 9 months ago

Will try and run this tonight and come, of course disabling rating sync issue goes away.

glensc commented 9 months ago

of course disabling rating sync issue goes away.

not sure of the of course part. didn't see the trace. the gist is unreadable gibberish.

you can post relevant part from plextraktsync.log file content (rename as .txt) to be able to attach to issue.

JonzaUK commented 9 months ago

plextraktsync.txt

Log File attached, this is without the amendments you mention in the previous issue topic as I am not at home at the moment to make those changes just yet.

RyanTheTechMan commented 9 months ago

Here is my log file. Same issue, disabling Rating Sync in BOTH directions fixes the issue. plextraktsync.log

glensc commented 9 months ago

I didn't really ask for log, just said the log in issue body is unreadable gibberish. and how you should share the logs.

what i did ask, is what asked from previous reporter, need to see inspect of the failing id:

I've created PR, which when used will maybe show error better what id is affected:

so use that pr and run the inspect as asked.

glensc commented 9 months ago

another user (or even two), who report a problem and then disappear?

will close this soon then: https://github.com/Taxel/PlexTraktSync/commit/c1311ca6e4cd26f9c0727e2a7bb7fc0b19d1bfa6

JonzaUK commented 9 months ago

I'll try and look into this tonight, apologies just been busy.

RyanTheTechMan commented 9 months ago

Hello, I didn't receive a notification for the message, sorry about that! If you need more information please let me know.

Sync log: PlexTraktSync Logs.txt

Inspect log: plextraktsync1-ryanthetechman_logs.txt

glensc commented 9 months ago
2024-02-13T14:24:39.198655284Z Guids:
2024-02-13T14:24:39.198810758Z   Guid: <PlexGuid:tvdb://140391>, Id: 140391, Provider: 'tvdb'
2024-02-13T14:24:39.204998090Z WARNING  Skipping <PlexGuid:tvdb://140391> not found on Trakt 
2024-02-13T14:24:39.205076104Z Trakt: No match found

so, the problem is with episodes of tv shows that have no trakt match?

this particular one you can fix if you submit the show to tmdb and let trakt import the tvdb id.

and why did you show inspect of id=112175? your error is with 112177. please show inspect of problematic item.

RyanTheTechMan commented 9 months ago

I see, my mistake. Here is the inspect for 112177: PlexTraktSync1 logs.txt


Doesn't the arr family use TVDB by default? So if it is there, shouldn't it be found on TVDB? For example, for Guid: <PlexGuid:tvdb://140391>, Id: 140391, Provider: 'tvdb' matches with this entry on TVDB. So I'm confused why that would fail?

glensc commented 9 months ago

looked your second inspect, the episode has trakt match:

so far so good. but doesn't explain why show attribute is still missing. can you do the same inspect of same id's with old plextraktsync version that it used to work for syncing? i suspect the inspect will fail there too.


that tvdb has entry, has nothing to do if trakt doesn't have it. if trakt doesn't have tvdb entry this program won't be able to make a match with trakt.

however trakt has match for that tvdb episode:

redirects to:


why your plex has only tvdb, beats me. you can try to do fix match for your show in plex and then see with inspect again if the show has more guids present.

simonc56 commented 9 months ago

why your plex has only tvdb, beats me.

I agree it's strange. Same probleme here : https://github.com/Taxel/PlexTraktSync/discussions/1746, Plex only populates tvdb id as external id.

~~Hypothese : I think it's because this new 1.40 Plex version updates database. And maybe forces use of 'Plex Series' as default agent instead of older TVDB agent (see here). Not sure about this but maybe a full metadata refresh could fix this guid problem.~~

EDIT: it's a Plex issue : Episode ordering “TheTVDB (Aired)” not fetching latest metadata

Doesn't explain the crash though.

glensc commented 8 months ago

@simonc56 do you understand how to reproduce this?

RyanTheTechMan commented 8 months ago

why your plex has only tvdb, beats me. you can try to do fix match for your show in plex and then see with inspect again if the show has more guids present.

I fixed match and it showed two instances of the show within plex, I selected the other one. Here are both inspects. It looks like this may have solved the crash as well. before change: inspect-1.txt after change: inspect-2.txt

Also, it appears that everywhere "Skipping <PlexGuid:imdb://#####> not found on Trakt" occurs, I can run a rematch and find 1-2 OTHER matches for the same movie or show, and in changing it, traktsync can find it on Trakt. So, I'm not too sure how the crash was occurring, but it does appear to allow it to work. (I have around 10-15 movies and 10-20 anime with the issue so not a huge issue for me but obv shouldn't crash)

simonc56 commented 8 months ago

@simonc56 do you understand how to reproduce this?

No.

glensc commented 8 months ago

Also, if anyone understands how to reproduce the situation, it would greatly improve the chances of fixing the problem. maybe the fix is just to ignore such situation, i.e in the earlier version that didn't crash, was the problematic id processed or skipped?

I suspect it has something to do with broken data from plex side. that in earlier versions resulted skipping the item

nemchik commented 8 months ago

Coming from #1804 (all my original issue template information is filled out there)

Adding 4 inspect outputs (explained below)


plextraktsync inspect https://app.plex.tv/desktop/#!/server/8f4be8150aed112bf36daee7fab458482c75f8cd/details?key=%2Flibrary%2Fmetadata%2F228729 This is for S01E01 of Gundam SEED (NOT the problem show/episode). Seems to work.

PlexTraktSync [0.28.18]
INFO     Connecting with url: http://192.168.1.20:32400, timeout 30 seconds                                             

Inspecting <PlexId:8f4be8150aed112bf36daee7fab458482c75f8cd:228729>: 
<tmdb:580305:Episode:228729:Mobile-Suit-Gundam-S-s01e01>
--- Plex
Library: TV Shows
Plex Web URL: 
https://app.plex.tv/desktop/#!/server/8f4be8150aed112bf36daee7fab458482c75f8cd/details?key=/library/metadata/228729
Discover URL: 
https://app.plex.tv/desktop/#!/provider/tv.plex.provider.discover/details?key=/library/metadata/5d9c10793c3f87001f3a8608
Title: False Peace
Media.Duration: 00:23:53
Media.Type: 'episode'
Media.Guid: 'plex://episode/5d9c10793c3f87001f3a8608'
Media.Guids: [<Guid:tmdb://580305>, <Guid:tvdb://4235321>]
Audio: 'stereo', 'Japanese (OPUS Stereo)'
Video: 'hevc'
Subtitles:
  Subtitle 1: (English) Full (codec: ass, selected: False, transient: None)
  Subtitle 2: (English) Signs/Songs (codec: ass, selected: True, transient: None)
Parts:
  Part 1: /storage/medialibrary/tv/Mobile Suit Gundam SEED (2002) {imdb-tt0374407}/Season 01/Mobile Suit Gundam SEED 
(2002) - S01E01 - False Peace [Bluray-1080p][Opus 2.0][x265]-XerBlade.mkv 283400840 bytes
Markers:
  credits: 00:22:17.808 - 00:23:13.808
Guids:
  Guid: <PlexGuid:tmdb://580305>, Id: 580305, Provider: 'tmdb'
  Guid: <PlexGuid:tvdb://4235321>, Id: 4235321, Provider: 'tvdb'
Metadata: {'collected_at': '2024-02-17T15:02:27.000Z', 'media_type': 'digital', 'resolution': 'hd_1080p', 
'audio_channels': '2.0'}
Played on Plex: True
Plex play history:
- 2023-08-14 21:47:45 <EpisodeHistory:228729:Mobile-Suit-Gundam-S-s01e01>: by nemchik on Master Bedroom with Roku
--- Trakt
Trakt: https://trakt.tv/episodes/588748
Plex Rating: None
Trakt Rating: None
Watched on Trakt: True
Collected on Trakt: True

plextraktsync inspect https://app.plex.tv/desktop/#!/provider/tv.plex.provider.discover/details?key=/library/metadata/5d9c10793c3f87001f3a8608 This is for S01E01 of Gundam SEED (NOT the problem show/episode). Seems to work.

PlexTraktSync [0.28.18]
INFO     Connecting with url: http://192.168.1.20:32400, timeout 30 seconds                                             

Inspecting <PlexId:metadata.provider.plex.tv:5d9c10793c3f87001f3a8608>: 
<tmdb:580305:Episode:5d9c10793c3f87001f3a8608:Mobile-Suit-Gundam-S-s01e01>
--- Plex
Plex Web URL: 
https://app.plex.tv/desktop/#!/provider/tv.plex.provider.discover/details?key=/library/metadata/5d9c10793c3f87001f3a8608
Title: False Peace
Media.Duration: 00:24:00
Media.Type: 'episode'
Media.Guid: 'plex://episode/5d9c10793c3f87001f3a8608'
Media.Guids: [<Guid:tmdb://580305>, <Guid:tvdb://4235321>]
Guids:
  Guid: <PlexGuid:tmdb://580305>, Id: 580305, Provider: 'tmdb'
  Guid: <PlexGuid:tvdb://4235321>, Id: 4235321, Provider: 'tvdb'
Metadata: {'collected_at': '2002-10-05T00:00:00.000Z', 'media_type': 'digital'}
Played on Plex: False
Plex play history:
--- Trakt
Trakt: https://trakt.tv/episodes/588748
Plex Rating: None
Trakt Rating: None
Watched on Trakt: True
Collected on Trakt: True

plextraktsync inspect https://app.plex.tv/desktop/#!/server/8f4be8150aed112bf36daee7fab458482c75f8cd/details?key=%2Flibrary%2Fmetadata%2F228726 This is for S01E01 of Gundam SEED Destiny (the problem show/episode). Trakt believes this is S02E01 of Gundam SEED and that Gundam SEED Destiny does not exist at all. Seems to NOT work.

PlexTraktSync [0.28.18]
INFO     Connecting with url: http://192.168.1.20:32400, timeout 30 seconds                                             

Inspecting <PlexId:8f4be8150aed112bf36daee7fab458482c75f8cd:228726>: 
<tvdb:157141:Episode:228726:Mobile-Suit-Gundam-S-s01e01>
--- Plex
Library: TV Shows
Plex Web URL: 
https://app.plex.tv/desktop/#!/server/8f4be8150aed112bf36daee7fab458482c75f8cd/details?key=/library/metadata/228726
Discover URL: 
https://app.plex.tv/desktop/#!/provider/tv.plex.provider.discover/details?key=/library/metadata/6145a6ebead0605f55dcbe44
Title: Angry Eyes
Media.Duration: 00:23:53
Media.Type: 'episode'
Media.Guid: 'plex://episode/6145a6ebead0605f55dcbe44'
Media.Guids: [<Guid:tvdb://157141>]
Audio: 'stereo', 'Japanese (OPUS Stereo)'
Video: 'hevc'
Subtitles:
  Subtitle 1: (English) Full (codec: ass, selected: False, transient: None)
  Subtitle 2: (English) Signs/Songs (codec: ass, selected: True, transient: None)
Parts:
  Part 1: /storage/medialibrary/tv/Mobile Suit Gundam SEED Destiny (2004) {imdb-tt0434694}/Season 01/Mobile Suit Gundam 
SEED Destiny (2004) - S01E01 - Angry Eyes [Bluray-1080p][Opus 2.0][x265]-XerBlade.mkv 328828464 bytes
Markers:
  credits: 00:22:31.808 - 00:23:21.808
Guids:
  Guid: <PlexGuid:tvdb://157141>, Id: 157141, Provider: 'tvdb'
Metadata: {'collected_at': '2024-02-17T14:37:50.000Z', 'media_type': 'digital', 'resolution': 'hd_1080p', 
'audio_channels': '2.0'}
Played on Plex: True
Plex play history:
- 2023-10-08 00:12:06 <EpisodeHistory:228726:Mobile-Suit-Gundam-S-s01e01>: by nemchik on Master Bedroom with Roku
--- Trakt
Trakt: https://trakt.tv/episodes/588798
WARNING  Mobile Suit Gundam Seed Destiny (2004): Skipping <PlexGuid:tvdb://74890> not found on Trakt                    
WARNING  Mobile Suit Gundam Seed Destiny (2004): Skipping <PlexGuid:imdb://tt0434694> not found on Trakt                
ERROR    Need show attribute, but it is missing for <tvdb:157141:Episode:228726:Mobile-Suit-Gundam-S-s01e01>            
         ╭───────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────╮
         │ /app/plextraktsync/cli.py:26 in wrap                                                                        │
         │                                                                                                             │
         │    23 │   │   │   cmd = getattr(module, name)                                                               │
         │    24 │   │   │                                                                                             │
         │    25 │   │   │   try:                                                                                      │
         │ ❱  26 │   │   │   │   cmd(*args, **kwargs)                                                                  │
         │    27 │   │   │   except EOFError as e:                                                                     │
         │    28 │   │   │   │   raise ClickException(f"Program requested terminal, No terminal is                     │
         │       connected: {e}")                                                                                      │
         │    29 │   │   │   except ClickException as e:                                                               │
         │                                                                                                             │
         │ /app/plextraktsync/commands/inspect.py:108 in inspect                                                       │
         │                                                                                                             │
         │   105 │   print(f"PlexTraktSync [{factory.version.full_version}]")                                          │
         │   106 │                                                                                                     │
         │   107 │   for plex_id in expand_plexid(inputs):                                                             │
         │ ❱ 108 │   │   inspect_media(plex_id)                                                                        │
         │   109                                                                                                       │
         │                                                                                                             │
         │ /app/plextraktsync/commands/inspect.py:96 in inspect_media                                                  │
         │                                                                                                             │
         │    93 │   │   return                                                                                        │
         │    94 │                                                                                                     │
         │    95 │   print(f"Trakt: {m.trakt_url}")                                                                    │
         │ ❱  96 │   print(f"Plex Rating: {m.plex_rating}")                                                            │
         │    97 │   print(f"Trakt Rating: {m.trakt_rating}")                                                          │
         │    98 │   if pm.has_media:                                                                                  │
         │    99 │   │   print(f"Watched on Trakt: {m.watched_on_trakt}")                                              │
         │                                                                                                             │
         │ /usr/local/lib/python3.12/functools.py:995 in __get__                                                       │
         │                                                                                                             │
         │    992 │   │   │   raise TypeError(msg) from None                                                           │
         │    993 │   │   val = cache.get(self.attrname, _NOT_FOUND)                                                   │
         │    994 │   │   if val is _NOT_FOUND:                                                                        │
         │ ❱  995 │   │   │   val = self.func(instance)                                                                │
         │    996 │   │   │   try:                                                                                     │
         │    997 │   │   │   │   cache[self.attrname] = val                                                           │
         │    998 │   │   │   except TypeError:                                                                        │
         │                                                                                                             │
         │ /app/plextraktsync/media/Media.py:220 in plex_rating                                                        │
         │                                                                                                             │
         │   217 │   def plex_rating(self):                                                                            │
         │   218 │   │   if self.media_type == "episodes" and not self.plex.is_discover:                               │
         │   219 │   │   │   if not self.show:                                                                         │
         │ ❱ 220 │   │   │   │   raise RuntimeError(f"Need show attribute, but it is missing for {self}")              │
         │   221 │   │   │   show_id = self.show.plex.item.ratingKey                                                   │
         │   222 │   │   else:                                                                                         │
         │   223 │   │   │   show_id = None                                                                            │
         ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
         RuntimeError: Need show attribute, but it is missing for                                                       
         <tvdb:157141:Episode:228726:Mobile-Suit-Gundam-S-s01e01>                                                       

plextraktsync inspect https://app.plex.tv/desktop/#!/provider/tv.plex.provider.discover/details?key=/library/metadata/6145a6ebead0605f55dcbe44 This is for S01E01 of Gundam SEED Destiny (the problem show/episode). Trakt believes this is S02E01 of Gundam SEED and that Gundam SEED Destiny does not exist at all. Seems to work.

PlexTraktSync [0.28.18]
INFO     Connecting with url: http://192.168.1.20:32400, timeout 30 seconds                                             

Inspecting <PlexId:metadata.provider.plex.tv:6145a6ebead0605f55dcbe44>: 
<tvdb:157141:Episode:6145a6ebead0605f55dcbe44:Mobile-Suit-Gundam-S-s01e01>
--- Plex
Plex Web URL: 
https://app.plex.tv/desktop/#!/provider/tv.plex.provider.discover/details?key=/library/metadata/6145a6ebead0605f55dcbe44
Title: Angry Eyes
Media.Duration: 00:25:00
Media.Type: 'episode'
Media.Guid: 'plex://episode/6145a6ebead0605f55dcbe44'
Media.Guids: [<Guid:tvdb://157141>]
Guids:
  Guid: <PlexGuid:tvdb://157141>, Id: 157141, Provider: 'tvdb'
Metadata: {'collected_at': '2004-10-09T00:00:00.000Z', 'media_type': 'digital'}
Played on Plex: False
Plex play history:
--- Trakt
Trakt: https://trakt.tv/episodes/588798
Plex Rating: None
Trakt Rating: None
Watched on Trakt: True
Collected on Trakt: True
glensc commented 8 months ago

and how does syncing only the problematic id behave?

plextraktsync sync --id=PLEX_NUMERIC_ID
nemchik commented 8 months ago

and how does syncing only the problematic id behave?

plextraktsync sync --id=PLEX_NUMERIC_ID
/app # plextraktsync sync --id=228726
INFO     PlexTraktSync [0.28.18]
INFO     Connecting with url: http://192.168.1.20:32400, timeout 30 seconds
INFO     Sync Episodes: ['Angry Eyes']
WARNING  Partial walk, disabling liked lists updating. Liked lists won't update because it needs full library sync.
ERROR    <PlexGuid:plex://show/5d9c0847e98e47001eb0b925>: Skipping <PlexGuid:plex://show/5d9c0847e98e47001eb0b925>
         because is not a valid provider
Processing episodes 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/1  [ 0:00:00 < 0:00:00 , ? it/s ]
INFO     Preload shows data
INFO     Preloaded shows data (0 shows)
WARNING  Running partial library sync. Liked lists won't update because it needs full library sync.
INFO     Completed full sync in 1.5 seconds
nemchik commented 8 months ago

To reproduce from the ground btw:


I added Gundam SEED to Sonarr (monitoring off, no immediate search) I searched for S01E01, it grabbed and imported Plex picked it up I fixed match (it was already correct) and refreshed metadata I grabbed the IDs (web ID and discovery ID) from the XML info I ran plextraktsync inspect ... with both to produce the logs above


I added Gundam SEED Destiny to Sonarr (monitoring off, no immediate search) I searched for S01E01, it grabbed and imported Plex picked it up I fixed match (it was already correct) and refreshed metadata I grabbed the IDs (web ID and discovery ID) from the XML info I ran plextraktsync inspect ... with both to produce the logs above


Since Trakt seems to use TMDB which sees Gundam SEED Destiny as Season 2 of Gundam SEED but Sonarr/Plex see Gundam SEED Destiny as a separate show entirely there is a mismatch.

Trakt/TMDB see it as this: https://www.themoviedb.org/tv/20111-seed/season/2/episode/1 https://trakt.tv/shows/mobile-suit-gundam-seed/seasons/2/episodes/1

Sonarr/Plex see it as this: https://thetvdb.com/series/mobile-suit-gundam-seed-destiny/episodes/157141

Edit: I forgot to mention - for my "from the ground" test: I removed both shows via Sonarr, and also removed all files/folders. Plex detected the file changes and both shows were removed from my library I emptied trash in Plex I ran plextraktsync without issue while both shows were not present Then I proceeded with the above steps for each show to add them back and grab only the first episode of each to test

I'm done with both shows anyway, so I don't need them, but if another media item in the future has a similar issue I hope this information helps to narrow down how to fix it.

simonc56 commented 8 months ago

Inspecting :

--- Plex Plex Web URL: https://app.plex.tv/desktop/#!/provider/tv.plex.provider.discover/details?key=/library/metadata/6145a6ebead0605f55dcbe44 Title: Angry Eyes Media.Duration: 00:25:00 Media.Type: 'episode' Media.Guid: 'plex://episode/6145a6ebead0605f55dcbe44' Media.Guids: []

As explained previously, there is something wrong in your Plex metadata. IMDB and TMDB guids are missing. If I request Plex metadata for Angry eyes episode with https://metadata.provider.plex.tv/library/metadata/5d9c1079ffd9ef001e9e9455 I get the following 3 guids items as expected :

"Guid": [
    {"id": "imdb://tt0434694"},
    {"id": "tmdb://580252"},
    {"id": "tvdb://157141"}
]

Plextraktsync is perfectly able to manage seasons not being ordered identically in tmdb & tvdb, thanks to those episodes ids. That's why it's important that you get proper Plex metadata. Only then you can sync to trakt.

I can reproduce this guid problem with PMS 1.40.0.7998 :

Seems a Plex Server issue, see here : Episode ordering “TheTVDB (Aired)” not fetching latest metadata

Note: I can't reproduce the crash 'NoneType' object has no attribute 'plex' thing from first post.

nemchik commented 8 months ago

I switched from TVDB to TMDB for the shows agent and it seems to sync without error now. This causes a new issue however where plex doesn't seem to be reading metadata for the episode. The show still matches seemingly the same as it did before, but the episode is just listed as Episode 1 and no other metadata is available. Switching back to TVDB resolves the missing metadata, but then plextraktsync can't do its thing.

Edit: should note that other metadata seems fine, but because TMDB thinks this show is actually season 2 of another show it lacks matching episode metadata.

simonc56 commented 8 months ago

I switched from TVDB to TMDB for the shows agent

Switching back to TVDB

No, you're doing wrong. Agent must be Plex Series. Then you change episode order to be TMDB or TVDB as you wish, but you shouldn't change the agent.

nemchik commented 8 months ago

Sorry, I should have been clear. This is the specific setting I was changing (episode ordering, from the advanced tab of editing the library) image My agent has always been set to Plex Series. Changing the episode ordering setting made the difference with whether or not plextraktsync worked, and also whether or not the other metadata for the episode was available at all. All of the behavior I described above happened with the agent set to Plex Series (and never changed) and only changing the episode ordering.

simonc56 commented 8 months ago

Fix in PR #1806

nemchik commented 8 months ago

awesome. thanks. it does suck that there's no way to get a match to work for the sync (seems to be more of a plex issue though), but skipping is definitely preferable to crashing 😄