diff --git a/src/resources/lib/listitem.py b/src/resources/lib/listitem.py index 9786110..df1458b 100644 --- a/src/resources/lib/listitem.py +++ b/src/resources/lib/listitem.py @@ -53,6 +53,13 @@ def __init__( if addContextMenuItems: self.addPredefinedContextMenuItems() + def _addInputstreamadaptivesettingsContextMenuItem( + self, menu_items: List[Tuple[str, str]] + ) -> None: + label = "InputStream Adaptive settings" + url = self.plugin.routing.build_url("inputstream_adaptive_settings", self.getProperty("id")) + menu_items.append((label, f"Container.Update({url})")) + def _addWatchlistContextMenuItem(self, menu_items: List[Tuple[str, str]]) -> None: is_subscribed = self.getProperty("is_subscribed") if is_subscribed == "": @@ -115,7 +122,19 @@ def _addSeparatorContextMenuItem(self, menu_items: List[Tuple[str, str]]) -> Non menu_items.append(("─" * 21, "")) def addPredefinedContextMenuItems(self, items: Optional[List[str]] = None) -> None: - items = items or ["watched", "watchlist", "bookmarks", "comments", "similar", "separator"] + items = items or ( + [ + "watched", + "watchlist", + "bookmarks", + "comments", + "similar", + "inputstreamadaptivesettings", + "separator", + ] + if self.plugin.is_hls_enabled + else ["watched", "watchlist", "bookmarks", "comments", "similar", "separator"] + ) menu_items: List[str] = [] for item in items: getattr(self, f"_add{item.capitalize()}ContextMenuItem")(menu_items) diff --git a/src/resources/lib/main.py b/src/resources/lib/main.py index 83f0afd..4cd1242 100644 --- a/src/resources/lib/main.py +++ b/src/resources/lib/main.py @@ -495,6 +495,11 @@ def profile() -> None: dialog.ok(localize(32038), message) +@plugin.routing.route("/inputstream_adaptive_settings/") +def inputstream_adaptive_settings(item_id: str) -> None: + xbmcaddon.Addon("inputstream.adaptive").openSettings() + + @plugin.routing.route("/comments/") def comments(item_id: str) -> None: response = plugin.client("items/comments").get(data={"id": item_id})