Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions resources/lib/modules/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ def show_program(self, uuid):
kodiutils.end_of_directory()
return

# Show the movie as a single playable item
if not program.seasons and program.video:
title_item = Menu.generate_titleitem(program.video)
title_item.info_dict['mediatype'] = 'movie'
title_item.art_dict['poster'] = program.poster
kodiutils.show_listing([title_item], 30003, content='movies')
return

if not program.seasons:
kodiutils.ok_dialog(message=kodiutils.localize(30717)) # This program is not available in the catalogue.
kodiutils.end_of_directory()
Expand Down
17 changes: 16 additions & 1 deletion resources/lib/play/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Program:
""" Defines a Program. """

def __init__(self, uuid=None, path=None, channel=None, category_id=None, category_name=None, title=None, description=None, aired=None, expiry=None, poster=None, thumb=None, fanart=None, seasons=None,
my_list=False):
my_list=False, video=None):
"""
:type uuid: str
:type path: str
Expand All @@ -42,6 +42,7 @@ def __init__(self, uuid=None, path=None, channel=None, category_id=None, categor
:type fanart: str
:type seasons: list[Season]
:type my_list: bool
:type video: Episode
"""
self.uuid = uuid
self.path = path
Expand All @@ -57,6 +58,7 @@ def __init__(self, uuid=None, path=None, channel=None, category_id=None, categor
self.fanart = fanart
self.seasons = seasons
self.my_list = my_list
self.video = video

def __repr__(self):
return "%r" % self.__dict__
Expand Down Expand Up @@ -620,6 +622,19 @@ def _parse_program_data(data):
for key, playlist in enumerate(data.get('playlists', [])) if playlist.get('title')
}

# Movies have no playlists, nextVideo is the movie itself
if not program.seasons and data.get('nextVideo'):
program.video = Episode(
uuid=data.get('nextVideo'),
channel=data.get('brand'),
program_title=data.get('title'),
title=data.get('title'),
description=program.description,
thumb=program.fanart,
duration=data.get('duration'),
content_type='long_form',
)

return program


Expand Down
Loading