fix: album images are small in certain places

This commit is contained in:
Kingkor Roy Tirtho 2024-03-08 19:10:33 +06:00
parent 60f2911eb9
commit ca76a39910
4 changed files with 39 additions and 5 deletions

View File

@ -21,8 +21,8 @@ class AlbumCard extends HookConsumerWidget {
final AlbumSimple album;
const AlbumCard(
this.album, {
Key? key,
}) : super(key: key);
super.key,
});
@override
Widget build(BuildContext context, ref) {

View File

@ -47,7 +47,6 @@ class AlbumPage extends HookConsumerWidget {
image: TypeConversionUtils.image_X_UrlString(
album.images,
placeholder: ImagePlaceholder.albumArt,
index: 0,
),
title: album.name!,
description:

View File

@ -2,6 +2,7 @@
import 'dart:io';
import 'package:collection/collection.dart';
import 'package:flutter/widgets.dart' hide Image;
import 'package:metadata_god/metadata_god.dart';
import 'package:path/path.dart';
@ -32,8 +33,12 @@ abstract class TypeConversionUtils {
"https://avatars.dicebear.com/api/bottts/${PrimitiveUtils.uuid.v4()}.png",
}[placeholder]!;
return images != null && images.isNotEmpty
? images[index > images.length - 1 ? images.length - 1 : index].url!
final sortedImage = images?.sorted((a, b) => a.width!.compareTo(b.width!));
return sortedImage != null && sortedImage.isNotEmpty
? sortedImage[
index > sortedImage.length - 1 ? sortedImage.length - 1 : index]
.url!
: placeholderUrl;
}

View File

@ -299,6 +299,36 @@
"browse_anonymously"
],
"ko": [
"sort_duration",
"start_a_radio",
"how_to_start_radio",
"replace_queue_question",
"endless_playback",
"delete_playlist",
"delete_playlist_confirmation",
"local_tracks",
"song_link",
"skip_this_nonsense",
"freedom_of_music",
"freedom_of_music_palm",
"get_started",
"youtube_source_description",
"piped_source_description",
"jiosaavn_source_description",
"highest_quality",
"select_audio_source",
"endless_playback_description",
"choose_your_region",
"choose_your_region_description",
"choose_your_language",
"help_project_grow",
"help_project_grow_description",
"contribute_on_github",
"donate_on_open_collective",
"browse_anonymously"
],
"ne": [
"sort_duration",
"start_a_radio",