From 1a7c2820239df21eb2f01fec582db5db747d3874 Mon Sep 17 00:00:00 2001 From: Paul fauchon Date: Wed, 24 Jul 2024 17:57:13 +0800 Subject: [PATCH 1/2] fix issue where servers are missing the genreUrl fix issue where server are missing channel banner fix #569 --- lib/channels/views/components/info.dart | 32 ++++++++++++------------- lib/videos/models/video.dart | 2 +- lib/videos/models/video.g.dart | 2 +- pubspec.yaml | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/channels/views/components/info.dart b/lib/channels/views/components/info.dart index df2072cb..2f8f9e68 100644 --- a/lib/channels/views/components/info.dart +++ b/lib/channels/views/components/info.dart @@ -24,7 +24,6 @@ class ChannelInfo extends StatelessWidget { var textTheme = Theme.of(context).textTheme; final deviceType = getDeviceType(); - List widgets = [ Row( crossAxisAlignment: CrossAxisAlignment.center, @@ -106,26 +105,27 @@ class ChannelInfo extends StatelessWidget { }).toList() ?? [])); + final bannerUrl = ImageObject.getBestThumbnail(channel.authorBanners)?.url; + + print('BANNER URL: ${bannerUrl}'); return SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: - const EdgeInsets.symmetric(horizontal: innerHorizontalPadding), - child: SizedBox( - height: deviceType == DeviceType.phone ? 100 : 230, - child: Thumbnail( - width: double.infinity, - thumbnailUrl: - ImageObject.getBestThumbnail(channel.authorBanners) - ?.url ?? - '', - decoration: BoxDecoration( - color: colors.secondaryContainer, - borderRadius: BorderRadius.circular(10))), + if (bannerUrl != null) + Padding( + padding: const EdgeInsets.symmetric( + horizontal: innerHorizontalPadding), + child: SizedBox( + height: deviceType == DeviceType.phone ? 100 : 230, + child: Thumbnail( + width: double.infinity, + thumbnailUrl: bannerUrl, + decoration: BoxDecoration( + color: colors.secondaryContainer, + borderRadius: BorderRadius.circular(10))), + ), ), - ), const SizedBox( height: 10, ), diff --git a/lib/videos/models/video.dart b/lib/videos/models/video.dart index bef80f27..3a9370fa 100644 --- a/lib/videos/models/video.dart +++ b/lib/videos/models/video.dart @@ -27,7 +27,7 @@ class Video extends BaseVideo { bool isFamilyFriendly; List allowedRegions; String genre; - String genreUrl; + String? genreUrl; List authorThumbnails; String subCountText; diff --git a/lib/videos/models/video.g.dart b/lib/videos/models/video.g.dart index 0750a4a6..76a7d486 100644 --- a/lib/videos/models/video.g.dart +++ b/lib/videos/models/video.g.dart @@ -27,7 +27,7 @@ Video _$VideoFromJson(Map json) => Video( .map((e) => e as String) .toList(), json['genre'] as String, - json['genreUrl'] as String, + json['genreUrl'] as String?, json['dashUrl'] as String, json['author'] as String?, json['authorUrl'] as String?, diff --git a/pubspec.yaml b/pubspec.yaml index bf831d41..b212aeec 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: invidious -version: 1.19.11+4056 +version: 1.19.12+4057 publish_to: none description: A new Flutter project. environment: From 82c0a53c5d8d3e04dbf11a04ac4c2a25cd8bcb0e Mon Sep 17 00:00:00 2001 From: Paul fauchon Date: Wed, 24 Jul 2024 18:01:38 +0800 Subject: [PATCH 2/2] remove print --- lib/channels/views/components/info.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/channels/views/components/info.dart b/lib/channels/views/components/info.dart index 2f8f9e68..d45be510 100644 --- a/lib/channels/views/components/info.dart +++ b/lib/channels/views/components/info.dart @@ -107,7 +107,6 @@ class ChannelInfo extends StatelessWidget { final bannerUrl = ImageObject.getBestThumbnail(channel.authorBanners)?.url; - print('BANNER URL: ${bannerUrl}'); return SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start,