Skip to content

Commit

Permalink
fix: Make local music genre menu case insensitive (#1082)
Browse files Browse the repository at this point in the history
Ref #1081
  • Loading branch information
Feichtmeier authored Dec 8, 2024
1 parent 651d43b commit 726c3c6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/common/data/audio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,8 @@ class Audio {
final fileName = File(path).uri.pathSegments.lastOrNull;
final genre = data.genres.firstOrNull?.startsWith('(') == true &&
data.genres.firstOrNull?.endsWith(')') == true
? tagGenres[data.genres.firstOrNull
?.replaceAll('(', '')
.replaceAll(')', '')]
?.everyWordCapitalized
? tagGenres[
data.genres.firstOrNull?.replaceAll('(', '').replaceAll(')', '')]
: data.genres.firstOrNull;

return Audio(
Expand All @@ -302,7 +300,7 @@ class Audio {
discTotal: data.totalDisc,
durationMs: data.duration?.inMilliseconds.toDouble(),
// fileSize: data.,
genre: genre,
genre: genre?.everyWordCapitalized,
pictureData:
data.pictures.firstWhereOrNull((e) => e.bytes.isNotEmpty)?.bytes,
pictureMimeType: data.pictures.firstOrNull?.mimetype,
Expand Down

0 comments on commit 726c3c6

Please sign in to comment.