mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-10 15:32:38 -07:00
Fallback to show poster if season poster is unavailable.
This commit is contained in:
parent
1ec1edefdd
commit
c98505038a
1 changed files with 11 additions and 9 deletions
|
@ -449,21 +449,21 @@ class DataFactory(object):
|
||||||
try:
|
try:
|
||||||
if user_id:
|
if user_id:
|
||||||
query = 'SELECT session_history.id, session_history.media_type, session_history.rating_key, title, ' \
|
query = 'SELECT session_history.id, session_history.media_type, session_history.rating_key, title, ' \
|
||||||
'grandparent_title, thumb, parent_thumb, media_index, parent_media_index, year, started, user ' \
|
'grandparent_title, thumb, parent_thumb, grandparent_thumb, media_index, parent_media_index, year, started, user ' \
|
||||||
'FROM session_history_metadata ' \
|
'FROM session_history_metadata ' \
|
||||||
'JOIN session_history ON session_history_metadata.id = session_history.id ' \
|
'JOIN session_history ON session_history_metadata.id = session_history.id ' \
|
||||||
'WHERE user_id = ? AND session_history.media_type != "track" ORDER BY started DESC LIMIT ?'
|
'WHERE user_id = ? AND session_history.media_type != "track" ORDER BY started DESC LIMIT ?'
|
||||||
result = monitor_db.select(query, args=[user_id, limit])
|
result = monitor_db.select(query, args=[user_id, limit])
|
||||||
elif user:
|
elif user:
|
||||||
query = 'SELECT session_history.id, session_history.media_type, session_history.rating_key, title, ' \
|
query = 'SELECT session_history.id, session_history.media_type, session_history.rating_key, title, ' \
|
||||||
'grandparent_title, thumb, parent_thumb, media_index, parent_media_index, year, started, user ' \
|
'grandparent_title, thumb, parent_thumb, grandparent_thumb, media_index, parent_media_index, year, started, user ' \
|
||||||
'FROM session_history_metadata ' \
|
'FROM session_history_metadata ' \
|
||||||
'JOIN session_history ON session_history_metadata.id = session_history.id ' \
|
'JOIN session_history ON session_history_metadata.id = session_history.id ' \
|
||||||
'WHERE user = ? AND session_history.media_type != "track" ORDER BY started DESC LIMIT ?'
|
'WHERE user = ? AND session_history.media_type != "track" ORDER BY started DESC LIMIT ?'
|
||||||
result = monitor_db.select(query, args=[user, limit])
|
result = monitor_db.select(query, args=[user, limit])
|
||||||
else:
|
else:
|
||||||
query = 'SELECT session_history.id, session_history.media_type, session_history.rating_key, title, ' \
|
query = 'SELECT session_history.id, session_history.media_type, session_history.rating_key, title, ' \
|
||||||
'grandparent_title, thumb, parent_thumb, media_index, parent_media_index, year, started, user ' \
|
'grandparent_title, thumb, parent_thumb, grandparent_thumb, media_index, parent_media_index, year, started, user ' \
|
||||||
'FROM session_history_metadata WHERE session_history.media_type != "track"' \
|
'FROM session_history_metadata WHERE session_history.media_type != "track"' \
|
||||||
'JOIN session_history ON session_history_metadata.id = session_history.id ' \
|
'JOIN session_history ON session_history_metadata.id = session_history.id ' \
|
||||||
'ORDER BY started DESC LIMIT ?'
|
'ORDER BY started DESC LIMIT ?'
|
||||||
|
@ -473,8 +473,10 @@ class DataFactory(object):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
for row in result:
|
for row in result:
|
||||||
if row[1] == 'episode':
|
if row[1] == 'episode' and row[6]:
|
||||||
thumb = row[6]
|
thumb = row[6]
|
||||||
|
elif row[1] == 'episode':
|
||||||
|
thumb = row[7]
|
||||||
else:
|
else:
|
||||||
thumb = row[5]
|
thumb = row[5]
|
||||||
|
|
||||||
|
@ -484,11 +486,11 @@ class DataFactory(object):
|
||||||
'title': row[3],
|
'title': row[3],
|
||||||
'parent_title': row[4],
|
'parent_title': row[4],
|
||||||
'thumb': thumb,
|
'thumb': thumb,
|
||||||
'index': row[7],
|
'index': row[8],
|
||||||
'parent_index': row[8],
|
'parent_index': row[9],
|
||||||
'year': row[9],
|
'year': row[10],
|
||||||
'time': row[10],
|
'time': row[11],
|
||||||
'user': row[11]
|
'user': row[12]
|
||||||
}
|
}
|
||||||
recently_watched.append(recent_output)
|
recently_watched.append(recent_output)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue