mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 12:59:42 -07:00
Always match child (episode or track) by index
This commit is contained in:
parent
5aa7192e90
commit
45a385f36e
2 changed files with 8 additions and 8 deletions
|
@ -849,10 +849,10 @@ class DataFactory(object):
|
||||||
key_list = {0: {'rating_key': int(rating_key)}}
|
key_list = {0: {'rating_key': int(rating_key)}}
|
||||||
return key_list
|
return key_list
|
||||||
|
|
||||||
if media_type == 'show' or media_type == 'season' or media_type == 'episode':
|
if media_type == 'artist' or media_type == 'album' or media_type == 'track':
|
||||||
match_type = 'index'
|
|
||||||
elif media_type == 'artist' or media_type == 'album' or media_type == 'track':
|
|
||||||
match_type = 'title'
|
match_type = 'title'
|
||||||
|
else:
|
||||||
|
match_type = 'index'
|
||||||
|
|
||||||
# Get the grandparent rating key
|
# Get the grandparent rating key
|
||||||
try:
|
try:
|
||||||
|
@ -891,7 +891,7 @@ class DataFactory(object):
|
||||||
result = monitor_db.select(query=query.format('parent_rating_key', 'rating_key'),
|
result = monitor_db.select(query=query.format('parent_rating_key', 'rating_key'),
|
||||||
args=[item['parent_rating_key']])
|
args=[item['parent_rating_key']])
|
||||||
for item in result:
|
for item in result:
|
||||||
key = item['media_index'] if match_type == 'index' else item['title']
|
key = item['media_index']
|
||||||
children.update({key: {'rating_key': item['rating_key']}})
|
children.update({key: {'rating_key': item['rating_key']}})
|
||||||
|
|
||||||
key = item['parent_media_index'] if match_type == 'index' else item['parent_title']
|
key = item['parent_media_index'] if match_type == 'index' else item['parent_title']
|
||||||
|
|
|
@ -1479,10 +1479,10 @@ class PmsConnect(object):
|
||||||
key_list = {0: {'rating_key': int(rating_key)}}
|
key_list = {0: {'rating_key': int(rating_key)}}
|
||||||
return key_list
|
return key_list
|
||||||
|
|
||||||
if media_type == 'show' or media_type == 'season' or media_type == 'episode':
|
if media_type == 'artist' or media_type == 'album' or media_type == 'track':
|
||||||
match_type = 'index'
|
|
||||||
elif media_type == 'artist' or media_type == 'album' or media_type == 'track':
|
|
||||||
match_type = 'title'
|
match_type = 'title'
|
||||||
|
else:
|
||||||
|
match_type = 'index'
|
||||||
|
|
||||||
# get grandparent rating key
|
# get grandparent rating key
|
||||||
if media_type == 'season' or media_type == 'album':
|
if media_type == 'season' or media_type == 'album':
|
||||||
|
@ -1557,7 +1557,7 @@ class PmsConnect(object):
|
||||||
child_title = helpers.get_xml_attr(item, 'title')
|
child_title = helpers.get_xml_attr(item, 'title')
|
||||||
|
|
||||||
if child_rating_key:
|
if child_rating_key:
|
||||||
key = int(child_index) if match_type == 'index' else child_title
|
key = int(child_index)
|
||||||
children.update({key: {'rating_key': int(child_rating_key)}})
|
children.update({key: {'rating_key': int(child_rating_key)}})
|
||||||
|
|
||||||
key = int(parent_index) if match_type == 'index' else parent_title
|
key = int(parent_index) if match_type == 'index' else parent_title
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue