mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Return a sync_media_type for synced collections/playlists
This commit is contained in:
parent
ea199178b2
commit
947892c93f
2 changed files with 7 additions and 1 deletions
|
@ -558,16 +558,20 @@ class PlexTV(object):
|
|||
sync_item = synced.getElementsByTagName('SyncItem')
|
||||
for item in sync_item:
|
||||
|
||||
sync_media_type = None
|
||||
rating_key = None
|
||||
for location in item.getElementsByTagName('Location'):
|
||||
location_uri = unquote(helpers.get_xml_attr(location, 'uri'))
|
||||
|
||||
if location_uri.startswith('library://'):
|
||||
if 'collection' in location_uri:
|
||||
sync_media_type = 'collection'
|
||||
clean_uri = location_uri.split('/')
|
||||
rating_key = next((j for i, j in zip(clean_uri[:-1], clean_uri[1:])
|
||||
if i in ('metadata', 'collections')), None)
|
||||
|
||||
elif location_uri.startswith('playlist://'):
|
||||
sync_media_type = 'playlist'
|
||||
tokens = users.Users().get_tokens(user_id=device_user_id)
|
||||
if tokens['server_token']:
|
||||
plex = Plex(token=tokens['server_token'])
|
||||
|
@ -635,7 +639,8 @@ class PlexTV(object):
|
|||
"total_size": status_total_size,
|
||||
"failure": status_failure,
|
||||
"client_id": client_id,
|
||||
"sync_id": sync_id
|
||||
"sync_id": sync_id,
|
||||
"sync_media_type": sync_media_type
|
||||
}
|
||||
|
||||
synced_items.append(sync_details)
|
||||
|
|
|
@ -5977,6 +5977,7 @@ class WebInterface(object):
|
|||
"root_title": "Movies",
|
||||
"state": "complete",
|
||||
"sync_id": "11617019",
|
||||
"sync_media_type": null,
|
||||
"sync_title": "Deadpool",
|
||||
"total_size": "560718134",
|
||||
"user": "DrukenDwarfMan",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue