diff --git a/lib/features/explore/containers/explore_addon.dart b/lib/features/explore/containers/explore_addon.dart index c9a0bea..dbdf7da 100644 --- a/lib/features/explore/containers/explore_addon.dart +++ b/lib/features/explore/containers/explore_addon.dart @@ -27,7 +27,8 @@ class _ExploreAddonState extends State { String? selectedType; String? selectedId; String? selectedGenre; - StremioManifest? selectedAddon; + final Map _selectedAddon = {}; + static const int pageSize = 20; final service = StremioAddonService.instance; @@ -71,7 +72,9 @@ class _ExploreAddonState extends State { _logger.info('Fetching catalog for page: $page'); try { final addonManifest = await service - .validateManifest(selectedAddon!.manifestUrl!) + .validateManifest( + _selectedAddon["${selectedType}_$selectedId"]!.manifestUrl!, + ) .queryFn(); List items = []; @@ -117,6 +120,8 @@ class _ExploreAddonState extends State { } if (selectedType == value.type && selectedId == value.id) { + _selectedAddon["${value.type}_${value.id}"] = item; + final extra = value.extra?.firstWhereOrNull((extra) { return extra.name == "genre"; }); @@ -134,8 +139,6 @@ class _ExploreAddonState extends State { } } - this.selectedAddon = selectedAddon; - this.genres = genres.toList(); } diff --git a/lib/features/settings/pages/settings_page.dart b/lib/features/settings/pages/settings_page.dart index 0145574..d31ee55 100644 --- a/lib/features/settings/pages/settings_page.dart +++ b/lib/features/settings/pages/settings_page.dart @@ -6,7 +6,9 @@ import 'package:madari_client/features/settings/pages/settings/profile_selector. import 'package:madari_client/features/settings/service/selected_profile.dart'; class SettingsPage extends StatelessWidget { - const SettingsPage({super.key}); + const SettingsPage({ + super.key, + }); @override Widget build(BuildContext context) { diff --git a/lib/features/widgetter/plugins/stremio/widgets/catalog_grid.dart b/lib/features/widgetter/plugins/stremio/widgets/catalog_grid.dart index 4a1b6b2..151a6b3 100644 --- a/lib/features/widgetter/plugins/stremio/widgets/catalog_grid.dart +++ b/lib/features/widgetter/plugins/stremio/widgets/catalog_grid.dart @@ -318,32 +318,34 @@ class _CatalogGridState extends State implements Refreshable { ), ), const Spacer(), - SizedBox( - height: 34, - child: TextButton( - onPressed: () { - final query = getQuery(); + if (!widget.pluginContext.hasSearch) + SizedBox( + height: 34, + child: TextButton( + onPressed: () { + final query = getQuery(); - Navigator.of(context).push( - MaterialPageRoute( - builder: (context) => CatalogFullView( - title: title, - initialItems: allItems, - queryBuilder: () { - return query; - }, - prefix: widget.pluginContext.hasSearch.toString() + - widget.pluginContext.index.toString() + - widget.config["description"] + - widget.config["id"] + - widget.config["type"], + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => CatalogFullView( + title: title, + initialItems: allItems, + queryBuilder: () { + return query; + }, + prefix: + widget.pluginContext.hasSearch.toString() + + widget.pluginContext.index.toString() + + widget.config["description"] + + widget.config["id"] + + widget.config["type"], + ), ), - ), - ); - }, - child: const Text("Show more"), + ); + }, + child: const Text("Show more"), + ), ), - ), ], ), SizedBox(