Skip to content

Commit

Permalink
fix: disable album artist filter until provided by audio_metadata_rea…
Browse files Browse the repository at this point in the history
…der (#1068)

Ref #339
  • Loading branch information
Feichtmeier authored Nov 28, 2024
1 parent 45f647b commit 1fa6bae
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 15 deletions.
1 change: 1 addition & 0 deletions lib/common/data/audio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ class Audio {
artist: data.artist,
title: (data.title?.isNotEmpty == true ? data.title : fileName) ?? path,
album: data.album,
// TODO(#339): wait for https://github.com/ClementBeal/audio_metadata_reader/issues/13
albumArtist: data.artist,
discNumber: data.discNumber,
discTotal: data.totalDisc,
Expand Down
4 changes: 2 additions & 2 deletions lib/local_audio/local_audio_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import '../l10n/l10n.dart';
enum LocalAudioView {
titles,
artists,
albumArtists,
// albumArtists,
albums,
genres,
playlists;

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,
Expand Down
10 changes: 5 additions & 5 deletions lib/local_audio/view/local_audio_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 5 additions & 3 deletions lib/search/search_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,11 @@ class SearchModel extends SafeChangeNotifier {
setSearchType(SearchType.localAlbum);
} else if (localSearchResult?.artists?.isNotEmpty == true) {
setSearchType(SearchType.localArtist);
} else if (localSearchResult?.albumArtists?.isNotEmpty == true) {
setSearchType(SearchType.localAlbumArtist);
} else if (localSearchResult?.genres?.isNotEmpty == true) {
}
// else if (localSearchResult?.albumArtists?.isNotEmpty == true) {
// setSearchType(SearchType.localAlbumArtist);
// }
else if (localSearchResult?.genres?.isNotEmpty == true) {
setSearchType(SearchType.localGenreName);
} else if (localSearchResult?.playlists?.isNotEmpty == true) {
setSearchType(SearchType.localPlaylists);
Expand Down
4 changes: 2 additions & 2 deletions lib/search/search_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import '../l10n/l10n.dart';
enum SearchType {
localTitle,
localArtist,
localAlbumArtist,
// localAlbumArtist,
localAlbum,
localGenreName,
localPlaylists,
Expand All @@ -17,7 +17,7 @@ enum SearchType {
String localize(AppLocalizations l10n) => switch (this) {
localTitle => l10n.titles,
localArtist => l10n.artists,
localAlbumArtist => l10n.albumArtists,
// localAlbumArtist => l10n.albumArtists,
localAlbum => l10n.albums,
localGenreName => l10n.genres,
localPlaylists => l10n.playlists,
Expand Down
2 changes: 1 addition & 1 deletion lib/search/view/sliver_local_search_results.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class _SliverLocalSearchResultState extends State<SliverLocalSearchResult> {
(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,
Expand Down
4 changes: 2 additions & 2 deletions lib/search/view/sliver_search_type_filter_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class SearchTypeFilterBar extends StatelessWidget with WatchItMixin {
' (${localSearchResult?.albums?.length ?? '0'})',
SearchType.localArtist =>
' (${localSearchResult?.artists?.length ?? '0'})',
SearchType.localAlbumArtist =>
' (${localSearchResult?.albumArtists?.length ?? '0'})',
// SearchType.localAlbumArtist =>
// ' (${localSearchResult?.albumArtists?.length ?? '0'})',
SearchType.localGenreName =>
' (${localSearchResult?.genres?.length ?? '0'})',
SearchType.localPlaylists =>
Expand Down

0 comments on commit 1fa6bae

Please sign in to comment.