Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve scrobbling issues with new Plex Scanner/Agent #616

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Cornishman
Copy link

This should resolve new issues with scrobbling with the new Plex Scanner/Agent metadata.

Scrobbling should now correctly send the Show external ids to Trakt to ensure scrobble matches are more accurate.
This should also resolve some scenarios where multi-part episodes were not scrobbling correctly.

Scrobbling data sent to Trakt should now look like more akin to this:

{
    "app_date": None,
    "progress": 14.24,
    "app_version": "1.3.3",
    "show": {
        "title": "Hawkeye (2021)",
        "ids": {
            "imdb": "tt10160804",
            "tmdb": 88329,
            "tvdb": 367146
        },
        "year": 2021
    },
    "episode": {
        "season": 1,
        "number": 1,
        "title": "Never Meet Your Heroes"
    }
}

Fixes #596
Fixes #598
Fixes #605

@disrupted
Copy link

disrupted commented Dec 16, 2021

@Cornishman thanks for looking into the issue!

I am still receiving the following error when playing a movie:

2021-12-16 15:52:56,911 - pyemitter                        (7f32c1028b38) :  WARNING (pyemitter:178) - [websocket.playing] Exception raised in: WebSocket.on_playing - 'list' object has no attribute 'valid'
Traceback (most recent call last):
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/pyemitter.py", line 175, in __call_sync
    callback(*args, **kwargs)
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/scrobbler/methods/s_websocket.py", line 65, in on_playing
    view_offset=payload.get('view_offset')
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/scrobbler/methods/core/base.py", line 54, in build_request
    result = cls.build_movie(metadata, guid, part)
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/scrobbler/methods/core/base.py", line 136, in build_movie
    ids = Identifier.get_ids(movie.guids, strict=False)
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/core/identifier.py", line 22, in get_ids
    if guid and guid.valid and guid.service in GUID_SERVICES:
AttributeError: 'list' object has no attribute 'valid'

@Cornishman
Copy link
Author

@disrupted Sorry about that, this was spotted by another user as well.
It should now be fixed with my latest version.

- I failed to commit a change 😞

@disrupted
Copy link

@Cornishman it's working now, great job!

@afonsojramos
Copy link

afonsojramos commented Dec 20, 2021

How can I test this change @disrupted @Cornishman?

Edit: Nevermind, figured it out, it is working, thank you so much!

@nehalvpatel
Copy link

Any indication on when we can expect these changes to land? 👀

@burkasaurusrex
Copy link

Just wanted to thank you @Cornishman for keeping this alive! Works like a charm

@afonsojramos
Copy link

@razzeee for visibility 👀

@Skaronator
Copy link

Tested on my machine, works perfectly - thanks!

Copy link

@carlosmg2 carlosmg2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested replacing the 7 modified files here over my https://github.com/trakt/Plex-Trakt-Scrobbler folder and fixed my issues. Thanks!

@KillrOfLife
Copy link

KillrOfLife commented Dec 30, 2022

@Cornishman thanks to your contribution the plugin shows up in the plugin list.
it seems that trakt's side works but plex doesn't anymore
Heres my log

2022-12-30 12:18:42,202 - plugin.modules.migrations.account (7fbf5fd00b38) :  INFO (plugin.modules.migrations.account:244) - Plex Token: environment
2022-12-30 12:18:42,214 - plugin.models.m_plex.account     (7fbf5fd00b38) :  INFO (plugin.models.m_plex.account:118) - Refreshing plex account: <PlexAccount username: None>
2022-12-30 12:18:42,405 - plugin.models.m_plex.account     (7fbf5fd00b38) :  WARNING (plugin.models.m_plex.account:126) - Unable to retrieve account details from plex.tv (status_code: 422)
2022-12-30 12:18:43,692 - plugin.managers.m_trakt.account  (7fbf5fd00b38) :  INFO (plugin.managers.m_trakt.account:161) - Updated account authorization for <TraktAccount username: u'KillrOfLife'>
2022-12-30 12:18:44,164 - root                             (7fbf5fd00b38) :  INFO (root:828) - 200 GET /video/trakt/:/prefs/set?pin=6429A63C (127.0.0.1) 1968.29ms

@burkasaurusrex
Copy link

burkasaurusrex commented Jan 2, 2023

@KillrOfLife you need this pull request as well as #615 to make the plugin work again. Make sure your config is up-to-date at https://trakt-for-plex.github.io/configuration if you're "using the API" in the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It just stop Scrobble Sync delay & no realtime scrobbling tv shows not scrobbling with new scanner/agent
9 participants