Skip to content

Commit

Permalink
fix: Use max res thumb in Artwork if available
Browse files Browse the repository at this point in the history
khaled-0 committed Dec 1, 2024
1 parent c16db59 commit 50c7c3c
Showing 5 changed files with 200 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/app/player/components/artwork.dart
Original file line number Diff line number Diff line change
@@ -32,9 +32,9 @@ class Artwork extends StatelessWidget {
angle: angle.toPrecision(5),
child: CircleAvatar(
foregroundImage: NetworkToFileImage(
url: media.thumbnail.high,
url: media.thumbnail.max,
file: MediaClient().thumbnailFile(
media.thumbnail.high,
media.thumbnail.max,
),
),
backgroundImage: NetworkToFileImage(
20 changes: 12 additions & 8 deletions lib/model/common.dart
Original file line number Diff line number Diff line change
@@ -8,14 +8,18 @@ part 'common.g.dart';

@Embedded(ignore: {"props", "stringify"})
class Thumbnails with EquatableMixin {
// low has vertical black borders
// high might not always be available
final String low, medium, high;

Thumbnails(this.low, this.medium, this.high);

factory Thumbnails.fromYTThumbnails(yt.ThumbnailSet thumbs) =>
Thumbnails(thumbs.lowResUrl, thumbs.mediumResUrl, thumbs.maxResUrl);
/// low ,high has vertical black borders
/// max might not always be available
final String low, medium, high, max;

Thumbnails(this.low, this.medium, this.high, this.max);

factory Thumbnails.fromYTThumbnails(yt.ThumbnailSet thumbs) => Thumbnails(
thumbs.lowResUrl,
thumbs.mediumResUrl,
thumbs.highResUrl,
thumbs.maxResUrl,
);

@override
bool get stringify => true;
182 changes: 182 additions & 0 deletions lib/model/common.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/model/media.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/model/playlist.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 50c7c3c

Please sign in to comment.