OverviewFilesCommitsIssuesDocsReleasesPeers

kodi-jacktook commits / a6abd2f

Genre picker, and hide browse rows for search-only catalogs (1.15.3)
Two catalog-menu fixes. Genre picker: addon_manager already parsed a catalog genre extra onto Catalog.genres, but nothing ever offered them -- list_catalog forwards a genre param that no menu set, so genre-filtered catalogs were unreachable. Adds list_catalog_genres, which renders the declared options; a catalog advertising genres now opens the picker instead of entering unfiltered. Search-only rows: upstream appends the plain browse row unconditionally, so a catalog whose search extra is isRequired got a second row that can only return empty -- the dead Titles row. Gated on isRequired, so it fixes any such addon. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
a6abd2f5db4b32af55dd1ae805ce18704b0981b6
by plankatron <fleeky@gmail.com> · 2026-07-28T23:13:47.000Z

Changed files (3) +60 -3

plugin.video.jacktook/addon.xml +1 -1
……@@ -1,5 +1,5 @@
11<?xml version="1.0" encoding="utf-8"?>
2 <addon id="plugin.video.jacktook" name="Jacktook" version="1.15.2" provider-name="Sam-Max">
2 <addon id="plugin.video.jacktook" name="Jacktook" version="1.15.3" provider-name="Sam-Max">
33 <requires>
44 <import addon="xbmc.python" version="3.00.0"/>
55 <import addon="script.module.requests" version="2.25.1"/>
plugin.video.jacktook/lib/clients/stremio/catalog_menus.py +56 -2
……@@ -253,6 +253,14 @@ def list_stremio_catalogs(menu_type="", sub_menu_type=""):
253253 continue
254254
255255 search_capabilities = any(extra.get("name") == "search" for extra in catalog.extra)
256 # A catalog whose search extra is REQUIRED has nothing to list without
257 # a query, so the plain browse row below can only ever come back empty.
258 # Upstream adds it unconditionally, which is where the dead second
259 # "Titles" row came from.
260 search_required = any(
261 extra.get("name") == "search" and extra.get("isRequired")
262 for extra in catalog.extra
263 )
256264
257265 if search_capabilities:
258266 listitem = make_list_item(label=f"{translation(90006)} {catalog_name}")
……@@ -276,7 +284,7 @@ def list_stremio_catalogs(menu_type="", sub_menu_type=""):
276284 )
277285 )
278286
279 if catalog_name or catalog_id:
287 if not search_required and (catalog_name or catalog_id):
280288 if addon.manifest.name == "Cinemeta":
281289 label = f"{addon_name} - {catalog_name or catalog_id}"
282290 else:
……@@ -285,10 +293,16 @@ def list_stremio_catalogs(menu_type="", sub_menu_type=""):
285293 listitem = make_list_item(label=label)
286294 listitem.setArt({"icon": addon.manifest.logo})
287295
296 # A catalog advertising genre options opens a picker first;
297 # entering it directly would filter by nothing.
288298 directory_items.append(
289299 (
290300 build_url(
291 action="list_catalog",
301 action=(
302 "list_catalog_genres"
303 if getattr(catalog, "genres", None)
304 else "list_catalog"
305 ),
292306 addon_url=addon.url(),
293307 menu_type=menu_type,
294308 sub_menu_type=sub_menu_type,
……@@ -323,6 +337,46 @@ def _catalog_supports_extra(addon_url, catalog_type, catalog_id, extra_name):
323337 return any(extra.get("name") == extra_name for extra in (catalog.extra or []))
324338
325339
340def list_catalog_genres(params):
341 """Render a catalog's declared genre options as a picker.
342
343 Stremio addons advertise genres as `extra: [{name: "genre", options: [...]}]`,
344 and addon_manager parses them onto Catalog.genres -- but nothing ever offered
345 them to the user, so a genre-filtered catalog was unreachable: list_catalog
346 forwards a `genre` param that no menu ever set. Each entry here re-enters
347 list_catalog with the genre chosen.
348 """
349 catalog = _get_manifest_catalog(
350 params["addon_url"], params["catalog_type"], params["catalog_id"]
351 )
352 genres = getattr(catalog, "genres", None) or []
353 if not genres:
354 notification(translation(90516))
355 end_of_directory()
356 return
357
358 directory_items = []
359 for genre in genres:
360 listitem = make_list_item(label=genre)
361 directory_items.append(
362 (
363 build_url(
364 "list_catalog",
365 addon_url=params["addon_url"],
366 menu_type=params["menu_type"],
367 sub_menu_type=params.get("sub_menu_type", ""),
368 catalog_type=params["catalog_type"],
369 catalog_id=params["catalog_id"],
370 genre=genre,
371 ),
372 listitem,
373 True,
374 )
375 )
376 add_directory_items_batch(directory_items)
377 end_of_directory()
378
379
326380def list_catalog(params):
327381 content_type = "movies" if params["menu_type"] == "movie" else "tvshows"
328382 setContent(ADDON_HANDLE, content_type)
plugin.video.jacktook/lib/router.py +3 -0
……@@ -113,6 +113,7 @@ def _is_stremio_action(action):
113113 return action.startswith(("stremio_", "list_stremio")) or action in {
114114 "clear_stremio_search_history",
115115 "list_catalog",
116 "list_catalog_genres",
116117 "search_catalog",
117118 "add_custom_stremio_addon",
118119 "remove_custom_stremio_addon",
……@@ -280,6 +281,7 @@ def _route_stremio(action, params):
280281 from lib.clients.stremio.catalog_menus import (
281282 clear_stremio_search_history,
282283 list_catalog,
284 list_catalog_genres,
283285 list_stremio_episodes,
284286 list_stremio_movie,
285287 list_stremio_seasons,
……@@ -291,6 +293,7 @@ def _route_stremio(action, params):
291293 actions = {
292294 "clear_stremio_search_history": clear_stremio_search_history,
293295 "list_catalog": list_catalog,
296 "list_catalog_genres": list_catalog_genres,
294297 "list_stremio_seasons": list_stremio_seasons,
295298 "list_stremio_episodes": list_stremio_episodes,
296299 "list_stremio_movie": list_stremio_movie,