diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index a52b9eb..b527312 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -45,6 +45,13 @@ UIApplicationSupportsIndirectInputEvents + LSApplicationQueriesSchemes + + infuse + open-vidhub + vlc + outplayer + CFBundleDocumentTypes diff --git a/lib/features/explore/containers/explore_addon.dart b/lib/features/explore/containers/explore_addon.dart index 07e07a3..0310d77 100644 --- a/lib/features/explore/containers/explore_addon.dart +++ b/lib/features/explore/containers/explore_addon.dart @@ -52,6 +52,8 @@ class _ExploreAddonState extends State { return "explorer_page_${selectedType}_${selectedId}_$selectedGenre"; } + final titles = {}; + InfiniteQuery, int> buildQuery() { return InfiniteQuery( key: queryKey, @@ -146,7 +148,11 @@ class _ExploreAddonState extends State { continue; } - types.add(value.id); + if (value.extraRequired?.where((res) => res != "genre").isEmpty == + true) { + titles[value.id] = value.name; + types.add(value.id); + } } } @@ -192,39 +198,43 @@ class _ExploreAddonState extends State { child: ListView.builder( shrinkWrap: true, itemCount: items.length, - itemBuilder: (context, index) => ListTile( - title: Text( - items[index] - .replaceAll(".", " ") - .split(" ") - .map((item) => item.capitalize) - .join(" "), - ), - selected: items[index] == current, - trailing: items[index] == current - ? Icon( - Icons.check_circle, - color: Theme.of(context).highlightColor, - ) - : null, - onTap: () { - onSelect(items[index]); + itemBuilder: (context, index) { + return ListTile( + title: Text( + titles.containsKey(items[index]) + ? titles[items[index]] + : items[index] + .replaceAll(".", " ") + .split(" ") + .map((item) => item.capitalize) + .join(" "), + ), + selected: items[index] == current, + trailing: items[index] == current + ? Icon( + Icons.check_circle, + color: Theme.of(context).highlightColor, + ) + : null, + onTap: () { + onSelect(items[index]); - if (resetTypes.contains('categories')) { - selectedId = null; - } + if (resetTypes.contains('categories')) { + selectedId = null; + } - if (resetTypes.contains('genres')) { - selectedGenre = null; - } - setFirstThing(); - setOptionValues(); + if (resetTypes.contains('genres')) { + selectedGenre = null; + } + setFirstThing(); + setOptionValues(); - setQuery(); + setQuery(); - Navigator.pop(context); - }, - ), + Navigator.pop(context); + }, + ); + }, ), ), ], diff --git a/lib/features/offline_ratings/pages/offline_ratings.dart b/lib/features/offline_ratings/pages/offline_ratings.dart index 6503112..de2c207 100644 --- a/lib/features/offline_ratings/pages/offline_ratings.dart +++ b/lib/features/offline_ratings/pages/offline_ratings.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import '../models/rating_model.dart' as rating_model; import '../services/ratings_service.dart'; @@ -20,6 +21,19 @@ class _OfflineRatingsState extends State { bool _isLoading = false; bool _isDownloadComplete = false; + @override + void initState() { + super.initState(); + + SharedPreferences.getInstance().then((pref) { + final result = pref.getString("offline_rating_preference_url"); + + if (result != null) { + _urlController.text = result; + } + }); + } + Future _downloadRatings(String url) async { if (url.isEmpty) { setState(() { @@ -29,6 +43,10 @@ class _OfflineRatingsState extends State { return; } + final pref = await SharedPreferences.getInstance(); + + pref.setString("offline_rating_preference_url", url); + setState(() { _isLoading = true; _error = null;