diff --git a/resources/lib/chn_class.py b/resources/lib/chn_class.py index 044645e9..0d631e3f 100644 --- a/resources/lib/chn_class.py +++ b/resources/lib/chn_class.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later import urllib.parse as parse +from typing import Optional from resources.lib.mediaitem import MediaItem, FolderItem, MediaStream from resources.lib import contenttype @@ -40,6 +41,7 @@ def __init__(self, channel_info): # noinspection PyTypeChecker self.parentItem = None # type: MediaItem + self.currentParser = None # type: Optional[ParserData] # More and more API's need a specific set of headers. This set is used for the self.mainListUri, and is set to # all items generated by the chn_class.py. @@ -217,6 +219,7 @@ def process_folder_list(self, item=None): # NOSONAR for data_parser in pre_procs: # remove it from the list + self.currentParser = data_parser data_parsers.remove(data_parser) # and process it @@ -236,6 +239,7 @@ def process_folder_list(self, item=None): # NOSONAR handler_json = None for data_parser in data_parsers: Logger.debug("[DataParsers] Processing %s", data_parser) + self.currentParser = data_parser # Check for preprocessors if data_parser.PreProcessor: @@ -319,9 +323,11 @@ def process_folder_list(self, item=None): # NOSONAR "order that Python likes which might result in unexpected result.", num_post_procs) for data_parser in generic_post_procs: + self.currentParser = data_parser Logger.debug("[DataParsers] Post-processing Generic %s", data_parser) items = data_parser.PostProcessor(data, items) Logger.trace("Post-processing returned %d items", len(items)) + self.currentParser = None # should we exclude DRM/GEO? hide_geo_locked = AddonSettings.hide_geo_locked_items_for_location(self.language)