From a521d2d5f5a33d8faa24ca9e4a6ae6d24ac26676 Mon Sep 17 00:00:00 2001 From: driesenj <120774271+driesenj@users.noreply.github.com> Date: Sat, 24 Oct 2026 20:53:10 +0200 Subject: [PATCH] Play movies instead of showing them as unavailable Movies on Play have no playlists: the program's nextVideo is the movie itself. Show it as a single playable item instead of the 'not available in the catalogue' dialog. Co-Authored-By: Claude Opus 5.5 --- resources/lib/modules/catalog.py | 8 ++++++++ resources/lib/play/content.py | 17 ++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/resources/lib/modules/catalog.py b/resources/lib/modules/catalog.py index f5481ee..4813ce7 100644 --- a/resources/lib/modules/catalog.py +++ b/resources/lib/modules/catalog.py @@ -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() diff --git a/resources/lib/play/content.py b/resources/lib/play/content.py index 309d439..29bebf3 100644 --- a/resources/lib/play/content.py +++ b/resources/lib/play/content.py @@ -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 @@ -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 @@ -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__ @@ -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