fix: trakt tv not showing up in the folders
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_android_tv (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:
omkar 2025-01-11 15:15:30 +05:30
parent 4829d7470c
commit 91e0968cd8
3 changed files with 12 additions and 7 deletions

View file

@ -87,10 +87,10 @@ class StremioService extends BaseConnectionService {
},
).toList();
if (resources.contains("catalog")) {
if (resources.contains("catalog") ||
manifest.catalogs?.isNotEmpty == true) {
for (final item
in (manifest.catalogs ?? [] as List<StremioManifestCatalog>)) {
print(item.toJson());
result.add(
FolderItem(
title: item.name == null

View file

@ -175,9 +175,14 @@ class StremioConnectionService extends BaseConnectionService {
cacheDuration: const Duration(hours: 8),
),
queryFn: () async {
_logger.finer('Fetching catalog from URL: $url');
final httpBody = await http.get(Uri.parse(url));
return StrmioMeta.fromJson(jsonDecode(httpBody.body));
try {
_logger.finer('Fetching catalog from URL: $url');
final httpBody = await http.get(Uri.parse(url));
return StrmioMeta.fromJson(jsonDecode(httpBody.body));
} catch (e, stack) {
_logger.severe('Error parsing catalog', e, stack);
rethrow;
}
},
key: url,
)
@ -186,7 +191,7 @@ class StremioConnectionService extends BaseConnectionService {
.first
.then((docs) {
if (docs.error != null) {
_logger.severe('Error fetching catalog: ${docs.error}');
_logger.severe('Error fetching catalog', docs.error);
throw docs.error!;
}
return docs.data!;

View file

@ -489,7 +489,7 @@ class Meta extends LibraryItem {
class BehaviorHints {
@JsonKey(name: "defaultVideoId")
final dynamic defaultVideoId;
@JsonKey(name: "hasScheduledVideos")
@JsonKey(name: "hasScheduledVideos", defaultValue: false)
final bool hasScheduledVideos;
BehaviorHints({