mirror of
https://github.com/madari-media/madari-oss.git
synced 2026-04-21 15:11:57 +00:00
fix: explore page issue with other addons
This commit is contained in:
parent
a38b3d1235
commit
ca8fb57c2f
3 changed files with 35 additions and 28 deletions
|
|
@ -27,7 +27,8 @@ class _ExploreAddonState extends State<ExploreAddon> {
|
||||||
String? selectedType;
|
String? selectedType;
|
||||||
String? selectedId;
|
String? selectedId;
|
||||||
String? selectedGenre;
|
String? selectedGenre;
|
||||||
StremioManifest? selectedAddon;
|
final Map<String, StremioManifest> _selectedAddon = {};
|
||||||
|
|
||||||
static const int pageSize = 20;
|
static const int pageSize = 20;
|
||||||
final service = StremioAddonService.instance;
|
final service = StremioAddonService.instance;
|
||||||
|
|
||||||
|
|
@ -71,7 +72,9 @@ class _ExploreAddonState extends State<ExploreAddon> {
|
||||||
_logger.info('Fetching catalog for page: $page');
|
_logger.info('Fetching catalog for page: $page');
|
||||||
try {
|
try {
|
||||||
final addonManifest = await service
|
final addonManifest = await service
|
||||||
.validateManifest(selectedAddon!.manifestUrl!)
|
.validateManifest(
|
||||||
|
_selectedAddon["${selectedType}_$selectedId"]!.manifestUrl!,
|
||||||
|
)
|
||||||
.queryFn();
|
.queryFn();
|
||||||
|
|
||||||
List<ConnectionFilterItem> items = [];
|
List<ConnectionFilterItem> items = [];
|
||||||
|
|
@ -117,6 +120,8 @@ class _ExploreAddonState extends State<ExploreAddon> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedType == value.type && selectedId == value.id) {
|
if (selectedType == value.type && selectedId == value.id) {
|
||||||
|
_selectedAddon["${value.type}_${value.id}"] = item;
|
||||||
|
|
||||||
final extra = value.extra?.firstWhereOrNull((extra) {
|
final extra = value.extra?.firstWhereOrNull((extra) {
|
||||||
return extra.name == "genre";
|
return extra.name == "genre";
|
||||||
});
|
});
|
||||||
|
|
@ -134,8 +139,6 @@ class _ExploreAddonState extends State<ExploreAddon> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.selectedAddon = selectedAddon;
|
|
||||||
|
|
||||||
this.genres = genres.toList();
|
this.genres = genres.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,9 @@ import 'package:madari_client/features/settings/pages/settings/profile_selector.
|
||||||
import 'package:madari_client/features/settings/service/selected_profile.dart';
|
import 'package:madari_client/features/settings/service/selected_profile.dart';
|
||||||
|
|
||||||
class SettingsPage extends StatelessWidget {
|
class SettingsPage extends StatelessWidget {
|
||||||
const SettingsPage({super.key});
|
const SettingsPage({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
|
||||||
|
|
@ -318,32 +318,34 @@ class _CatalogGridState extends State<CatalogGrid> implements Refreshable {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
SizedBox(
|
if (!widget.pluginContext.hasSearch)
|
||||||
height: 34,
|
SizedBox(
|
||||||
child: TextButton(
|
height: 34,
|
||||||
onPressed: () {
|
child: TextButton(
|
||||||
final query = getQuery();
|
onPressed: () {
|
||||||
|
final query = getQuery();
|
||||||
|
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) => CatalogFullView(
|
builder: (context) => CatalogFullView(
|
||||||
title: title,
|
title: title,
|
||||||
initialItems: allItems,
|
initialItems: allItems,
|
||||||
queryBuilder: () {
|
queryBuilder: () {
|
||||||
return query;
|
return query;
|
||||||
},
|
},
|
||||||
prefix: widget.pluginContext.hasSearch.toString() +
|
prefix:
|
||||||
widget.pluginContext.index.toString() +
|
widget.pluginContext.hasSearch.toString() +
|
||||||
widget.config["description"] +
|
widget.pluginContext.index.toString() +
|
||||||
widget.config["id"] +
|
widget.config["description"] +
|
||||||
widget.config["type"],
|
widget.config["id"] +
|
||||||
|
widget.config["type"],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
},
|
||||||
},
|
child: const Text("Show more"),
|
||||||
child: const Text("Show more"),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue