From e30236a1033d78164f023f6783d2b63c14befe7d Mon Sep 17 00:00:00 2001 From: Frederik Feichtmeier Date: Mon, 16 Dec 2024 18:54:06 +0100 Subject: [PATCH] chore: disable album artists until lib fix (#1099) Ref #339 --- lib/app/view/master_tile.dart | 19 +++++++------------ lib/common/data/audio.dart | 4 ++-- lib/local_audio/local_audio_model.dart | 5 ++++- lib/local_audio/local_audio_view.dart | 4 ++-- lib/local_audio/view/local_audio_body.dart | 10 +++++----- .../view/sliver_local_search_results.dart | 2 +- 6 files changed, 21 insertions(+), 23 deletions(-) diff --git a/lib/app/view/master_tile.dart b/lib/app/view/master_tile.dart index cb1ff28cf..7fde1a1f5 100644 --- a/lib/app/view/master_tile.dart +++ b/lib/app/view/master_tile.dart @@ -36,18 +36,13 @@ class MasterTile extends StatelessWidget { @override Widget build(BuildContext context) { - final yaruMasterTile = Padding( - padding: pageId == kLocalAudioPageId - ? const EdgeInsets.only(top: 5) - : EdgeInsets.zero, - child: YaruMasterTile( - title: title, - onTap: onTap, - selected: selected, - leading: leading, - subtitle: subtitle, - trailing: trailing, - ), + final yaruMasterTile = YaruMasterTile( + title: title, + onTap: onTap, + selected: selected, + leading: leading, + subtitle: subtitle, + trailing: trailing, ); final Widget tile; diff --git a/lib/common/data/audio.dart b/lib/common/data/audio.dart index 90cf2e85d..667340ddd 100644 --- a/lib/common/data/audio.dart +++ b/lib/common/data/audio.dart @@ -294,8 +294,8 @@ class Audio { artist: data.artist, title: (data.title?.isNotEmpty == true ? data.title : fileName) ?? path, album: data.album, - albumArtist: - data.performers.isEmpty ? data.artist : data.performers.toString(), + // TODO(#339): wait for fix + albumArtist: data.artist, discNumber: data.discNumber, discTotal: data.totalDisc, durationMs: data.duration?.inMilliseconds.toDouble(), diff --git a/lib/local_audio/local_audio_model.dart b/lib/local_audio/local_audio_model.dart index 1c940bf4b..6766f7b99 100644 --- a/lib/local_audio/local_audio_model.dart +++ b/lib/local_audio/local_audio_model.dart @@ -95,7 +95,10 @@ class LocalAudioModel extends SafeChangeNotifier { bool forceInit = false, String? directory, }) async { - _localAudioIndex = _settingsService.localAudioIndex; + _localAudioIndex = + _settingsService.localAudioIndex > LocalAudioView.values.length - 1 + ? 0 + : _settingsService.localAudioIndex; await _localAudioService.init( forceInit: forceInit, directory: directory, diff --git a/lib/local_audio/local_audio_view.dart b/lib/local_audio/local_audio_view.dart index 37b03c0a7..0688dc2fd 100644 --- a/lib/local_audio/local_audio_view.dart +++ b/lib/local_audio/local_audio_view.dart @@ -3,7 +3,7 @@ import '../l10n/l10n.dart'; enum LocalAudioView { titles, artists, - albumArtists, + // albumArtists, albums, genres, playlists; @@ -11,7 +11,7 @@ enum LocalAudioView { String localize(AppLocalizations l10n) => switch (this) { titles => l10n.titles, artists => l10n.artists, - albumArtists => l10n.albumArtists, + // albumArtists => l10n.albumArtists, albums => l10n.albums, genres => l10n.genres, playlists => l10n.playlists, diff --git a/lib/local_audio/view/local_audio_body.dart b/lib/local_audio/view/local_audio_body.dart index dfbecd367..ac7466163 100644 --- a/lib/local_audio/view/local_audio_body.dart +++ b/lib/local_audio/view/local_audio_body.dart @@ -43,11 +43,11 @@ class LocalAudioBody extends StatelessWidget { noResultMessage: noResultMessage, noResultIcon: noResultIcon, ), - LocalAudioView.albumArtists => AlbumArtistsView( - albumArtists: albumArtists, - noResultMessage: noResultMessage, - noResultIcon: noResultIcon, - ), + // LocalAudioView.albumArtists => AlbumArtistsView( + // albumArtists: albumArtists, + // noResultMessage: noResultMessage, + // noResultIcon: noResultIcon, + // ), LocalAudioView.albums => AlbumsView( albums: albums, noResultMessage: noResultMessage, diff --git a/lib/search/view/sliver_local_search_results.dart b/lib/search/view/sliver_local_search_results.dart index d6bab43d7..e3c9ff89f 100644 --- a/lib/search/view/sliver_local_search_results.dart +++ b/lib/search/view/sliver_local_search_results.dart @@ -42,7 +42,7 @@ class _SliverLocalSearchResultState extends State { (SearchModel m) => switch (m.searchType) { SearchType.localAlbum => LocalAudioView.albums, SearchType.localArtist => LocalAudioView.artists, - SearchType.localAlbumArtist => LocalAudioView.albumArtists, + // SearchType.localAlbumArtist => LocalAudioView.albumArtists, SearchType.localTitle => LocalAudioView.titles, SearchType.localGenreName => LocalAudioView.genres, _ => LocalAudioView.playlists,