mirror of
https://github.com/madari-media/madari-oss.git
synced 2026-03-11 17:15:39 +00:00
fix: titles in the explore page and permission for the iOS and offline ratings url persistent
Some checks are pending
Build and Deploy / build_windows (push) Waiting to run
Build and Deploy / build_android (push) Waiting to run
Build and Deploy / build_ipa (push) Waiting to run
Build and Deploy / build_linux (push) Waiting to run
Build and Deploy / build_macos (push) Waiting to run
Some checks are pending
Build and Deploy / build_windows (push) Waiting to run
Build and Deploy / build_android (push) Waiting to run
Build and Deploy / build_ipa (push) Waiting to run
Build and Deploy / build_linux (push) Waiting to run
Build and Deploy / build_macos (push) Waiting to run
This commit is contained in:
parent
2a55da488c
commit
0d7573ee22
3 changed files with 65 additions and 30 deletions
|
|
@ -45,6 +45,13 @@
|
|||
<true/>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
<key>LSApplicationQueriesSchemes</key>
|
||||
<array>
|
||||
<string>infuse</string>
|
||||
<string>open-vidhub</string>
|
||||
<string>vlc</string>
|
||||
<string>outplayer</string>
|
||||
</array>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ class _ExploreAddonState extends State<ExploreAddon> {
|
|||
return "explorer_page_${selectedType}_${selectedId}_$selectedGenre";
|
||||
}
|
||||
|
||||
final titles = {};
|
||||
|
||||
InfiniteQuery<List<Meta>, int> buildQuery() {
|
||||
return InfiniteQuery(
|
||||
key: queryKey,
|
||||
|
|
@ -146,9 +148,13 @@ class _ExploreAddonState extends State<ExploreAddon> {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (value.extraRequired?.where((res) => res != "genre").isEmpty ==
|
||||
true) {
|
||||
titles[value.id] = value.name;
|
||||
types.add(value.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
categories = types.toList();
|
||||
}
|
||||
|
|
@ -192,9 +198,12 @@ class _ExploreAddonState extends State<ExploreAddon> {
|
|||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: items.length,
|
||||
itemBuilder: (context, index) => ListTile(
|
||||
itemBuilder: (context, index) {
|
||||
return ListTile(
|
||||
title: Text(
|
||||
items[index]
|
||||
titles.containsKey(items[index])
|
||||
? titles[items[index]]
|
||||
: items[index]
|
||||
.replaceAll(".", " ")
|
||||
.split(" ")
|
||||
.map((item) => item.capitalize)
|
||||
|
|
@ -224,7 +233,8 @@ class _ExploreAddonState extends State<ExploreAddon> {
|
|||
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -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<OfflineRatings> {
|
|||
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<void> _downloadRatings(String url) async {
|
||||
if (url.isEmpty) {
|
||||
setState(() {
|
||||
|
|
@ -29,6 +43,10 @@ class _OfflineRatingsState extends State<OfflineRatings> {
|
|||
return;
|
||||
}
|
||||
|
||||
final pref = await SharedPreferences.getInstance();
|
||||
|
||||
pref.setString("offline_rating_preference_url", url);
|
||||
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
_error = null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue