Fix Live TV air date on info page

This commit is contained in:
JonnyWong16 2020-02-16 20:36:53 -08:00
parent 4fc9b6fdb4
commit a7803dcad7
2 changed files with 9 additions and 4 deletions

View file

@ -285,10 +285,8 @@ DOCUMENTATION :: END
Year <strong> ${data['year']}</strong>
% elif data['media_type'] == 'show':
Aired <strong> ${data['year']}</strong>
% elif data['media_type'] == 'episode' and data['originally_available_at']:
% elif data['media_type'] == 'episode':
Aired <strong> <span id="airdate">${data['originally_available_at']}</span></strong>
% elif data['media_type'] == 'episode' and media_info['live']:
Aired <strong> <span id="airdate">${data['added_at']}</span></strong>
% elif data['media_type'] == 'album' or data['media_type'] == 'track':
Released <strong> ${data['year']}</strong>
% elif data['media_type'] == 'collection':

View file

@ -13,6 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import arrow
import json
from itertools import groupby
@ -1044,6 +1045,12 @@ class DataFactory(object):
else:
section_name = ''
if item['live']:
# Fake Live TV air date using added_at timestamp
originally_available_at = item['originally_available_at'] or arrow.get(item['added_at']).format('YYYY-MM-DD')
else:
originally_available_at = item['originally_available_at']
directors = item['directors'].split(';') if item['directors'] else []
writers = item['writers'].split(';') if item['writers'] else []
actors = item['actors'].split(';') if item['actors'] else []
@ -1084,7 +1091,7 @@ class DataFactory(object):
'parent_thumb': item['parent_thumb'],
'grandparent_thumb': item['grandparent_thumb'],
'art': item['art'],
'originally_available_at': item['originally_available_at'],
'originally_available_at': originally_available_at,
'added_at': item['added_at'],
'updated_at': item['updated_at'],
'last_viewed_at': item['last_viewed_at'],