Improve EPG metadata (#13)

This commit is contained in:
Michaël Arnauts 2020-03-24 23:29:16 +01:00 committed by GitHub
parent fd59759892
commit 1006c6dae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 15 deletions

View File

@ -111,7 +111,6 @@ class Menu:
'duration': item.duration, 'duration': item.duration,
'season': item.season, 'season': item.season,
'episode': item.number, 'episode': item.number,
'aired': item.aired.strftime('%Y-%m-%d'),
}) })
stream_dict = STREAM_DICT.copy() stream_dict = STREAM_DICT.copy()

View File

@ -119,11 +119,6 @@ class TvGuide:
else: else:
context_menu = None context_menu = None
stream_dict = STREAM_DICT.copy()
stream_dict.update({
'duration': program.duration,
})
title = '{time} - {title}'.format( title = '{time} - {title}'.format(
time=program.start.strftime('%H:%M'), time=program.start.strftime('%H:%M'),
title=program.program_title title=program.program_title
@ -138,6 +133,22 @@ class TvGuide:
path = None path = None
title = '[COLOR gray]' + title + '[/COLOR]' title = '[COLOR gray]' + title + '[/COLOR]'
stream_dict = STREAM_DICT.copy()
stream_dict.update({
'duration': program.duration,
})
info_dict = {
'title': title,
'plot': program.description,
'studio': program.channel,
'duration': program.duration,
'tvshowtitle': program.program_title,
'season': program.season,
'episode': program.number,
'mediatype': 'episode',
}
listing.append( listing.append(
TitleItem(title=title, TitleItem(title=title,
path=path, path=path,
@ -145,12 +156,7 @@ class TvGuide:
'icon': program.cover, 'icon': program.cover,
'thumb': program.cover, 'thumb': program.cover,
}, },
info_dict={ info_dict=info_dict,
'title': title,
'plot': program.description,
'duration': program.duration,
'mediatype': 'video',
},
stream_dict=stream_dict, stream_dict=stream_dict,
context_menu=context_menu, context_menu=context_menu,
is_playable=True) is_playable=True)

View File

@ -16,13 +16,13 @@ _LOGGER = logging.getLogger('epg-api')
class EpgProgram: class EpgProgram:
""" Defines a Program in the EPG. """ """ Defines a Program in the EPG. """
def __init__(self, channel, program_title, episode_title, episode_title_original, nr, season, genre, start, won_id, won_program_id, program_description, def __init__(self, channel, program_title, episode_title, episode_title_original, number, season, genre, start, won_id, won_program_id, program_description,
description, duration, program_url, video_url, cover, airing): description, duration, program_url, video_url, cover, airing):
self.channel = channel self.channel = channel
self.program_title = program_title self.program_title = program_title
self.episode_title = episode_title self.episode_title = episode_title
self.episode_title_original = episode_title_original self.episode_title_original = episode_title_original
self.nr = nr self.number = number
self.season = season self.season = season
self.genre = genre self.genre = genre
self.start = start self.start = start
@ -109,7 +109,7 @@ class EpgApi:
program_title=data.get('program_title'), program_title=data.get('program_title'),
episode_title=data.get('episode_title'), episode_title=data.get('episode_title'),
episode_title_original=data.get('original_title'), episode_title_original=data.get('original_title'),
nr=int(data.get('episode_nr')) if data.get('episode_nr') else None, number=int(data.get('episode_nr')) if data.get('episode_nr') else None,
season=int(data.get('season')) if data.get('season') else None, season=int(data.get('season')) if data.get('season') else None,
genre=data.get('genre'), genre=data.get('genre'),
start=start, start=start,