Skip to content

Commit

Permalink
fix: album images are small in certain places
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Mar 8, 2024
1 parent 60f2911 commit ca76a39
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/components/album/album_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion lib/pages/album/album.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class AlbumPage extends HookConsumerWidget {
image: TypeConversionUtils.image_X_UrlString(
album.images,
placeholder: ImagePlaceholder.albumArt,
index: 0,
),
title: album.name!,
description:
Expand Down
9 changes: 7 additions & 2 deletions lib/utils/type_conversion_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
}

Expand Down
30 changes: 30 additions & 0 deletions untranslated_messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ca76a39

Please sign in to comment.