From c92f4729690ab081e62c3b4f0630208758895877 Mon Sep 17 00:00:00 2001 From: tiefseetauchner Date: Mon, 11 Dec 2023 22:15:57 +0100 Subject: [PATCH] revert unneeded changes to albumScreen --- .../AlbumScreen/album_screen_content.dart | 42 ++++++++----------- .../AlbumScreen/song_list_tile.dart | 11 +---- 2 files changed, 18 insertions(+), 35 deletions(-) diff --git a/lib/components/AlbumScreen/album_screen_content.dart b/lib/components/AlbumScreen/album_screen_content.dart index ac647a8d2..446a9b21a 100644 --- a/lib/components/AlbumScreen/album_screen_content.dart +++ b/lib/components/AlbumScreen/album_screen_content.dart @@ -124,7 +124,6 @@ class SongsSliverList extends StatefulWidget { required this.childrenForList, required this.childrenForQueue, required this.parent, - this.showPlayCount = false, this.onDelete, }) : super(key: key); @@ -132,7 +131,6 @@ class SongsSliverList extends StatefulWidget { final List childrenForQueue; final BaseItemDto parent; final BaseItemDtoCallback? onDelete; - final bool showPlayCount; @override State createState() => _SongsSliverListState(); @@ -149,15 +147,15 @@ class _SongsSliverListState extends State { @override Widget build(BuildContext context) { + // When user selects song from disc other than first, index number is + // incorrect and song with the same index on first disc is played instead. + // Adding this offset ensures playback starts for nth song on correct disc. + final int indexOffset = + widget.childrenForQueue.indexOf(widget.childrenForList[0]); + return SliverList( delegate: SliverChildBuilderDelegate( (BuildContext context, int index) { - // When user selects song from disc other than first, index number is - // incorrect and song with the same index on first disc is played instead. - // Adding this offset ensures playback starts for nth song on correct disc. - final indexOffset = - widget.childrenForQueue.indexOf(widget.childrenForList[0]); - final BaseItemDto item = widget.childrenForList[index]; BaseItemDto removeItem() { @@ -185,23 +183,17 @@ class _SongsSliverListState extends State { isInPlaylist: widget.parent.type == "Playlist", // show artists except for this one scenario showArtists: !( - // we're on album screen - widget.parent.type == "MusicAlbum" - // "hide song artists if they're the same as album artists" == true - && - FinampSettingsHelper - .finampSettings.hideSongArtistsIfSameAsAlbumArtists - // song artists == album artists - && - setEquals( - widget.parent.albumArtists - ?.map((e) => e.name) - .toSet(), - item.artists?.toSet())) - // hide song artist if on the artist screen - && - widget.parent.type != "MusicArtist", - showPlayCount: widget.showPlayCount, + // we're on album screen + widget.parent.type == "MusicAlbum" + // "hide song artists if they're the same as album artists" == true + && + FinampSettingsHelper + .finampSettings.hideSongArtistsIfSameAsAlbumArtists + // song artists == album artists + && + setEquals( + widget.parent.albumArtists?.map((e) => e.name).toSet(), + item.artists?.toSet())), ); }, childCount: widget.childrenForList.length, diff --git a/lib/components/AlbumScreen/song_list_tile.dart b/lib/components/AlbumScreen/song_list_tile.dart index 056ac63b7..4f5028b9b 100644 --- a/lib/components/AlbumScreen/song_list_tile.dart +++ b/lib/components/AlbumScreen/song_list_tile.dart @@ -51,7 +51,6 @@ class SongListTile extends StatefulWidget { this.parentName, this.isSong = false, this.showArtists = true, - this.showPlayCount = false, this.onDelete, /// Whether this widget is being displayed in a playlist. If true, will show @@ -66,7 +65,6 @@ class SongListTile extends StatefulWidget { final String? parentId; final String? parentName; final bool showArtists; - final bool showPlayCount; final VoidCallback? onDelete; final bool isInPlaylist; @@ -177,12 +175,6 @@ class _SongListTileState extends State { text: " ยท ${processArtist(widget.item.artists?.join(", ") ?? widget.item.albumArtist, context)}", style: TextStyle(color: Theme.of(context).disabledColor), - ), - if (widget.showPlayCount) - TextSpan( - text: AppLocalizations.of(context)! - .playCountInline(widget.item.userData?.playCount ?? 0), - style: TextStyle(color: Theme.of(context).disabledColor), ) ], ), @@ -491,8 +483,7 @@ class _SongListTileState extends State { if (!mounted) return false; ScaffoldMessenger.of(context).showSnackBar(SnackBar( - content: Text(AppLocalizations.of(context)! - .confirmAddToNextUp("track")), + content: Text(AppLocalizations.of(context)!.confirmAddToNextUp("track")), )); return false;