Skip to content

Commit

Permalink
only apply cover on album screen setting to album screen list tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaphasilor committed Oct 27, 2024
1 parent dec8495 commit cd71e24
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/components/AlbumScreen/album_screen_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ class _SongsSliverListState extends State<SongsSliverList> {
children: widget.childrenForQueue,
index: indexOffset,
showIndex: item.albumId == widget.parent.id,
showCover:
FinampSettingsHelper.finampSettings.showCoversOnAlbumScreen,
parentItem: widget.parent,
onRemoveFromList: () {
final item = removeItem();
Expand Down
19 changes: 16 additions & 3 deletions lib/components/AlbumScreen/track_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class TrackListTile extends StatelessWidget {

// if leading index number should be shown
this.showIndex = false,
// if leading album cover should be shown
this.showCover = true,

/// Whether we are in the songs tab, as opposed to a playlist/album
this.isSong = false,
Expand All @@ -80,6 +82,7 @@ class TrackListTile extends StatelessWidget {
final Future<List<jellyfin_models.BaseItemDto>>? children;
final Future<int>? index;
final bool showIndex;
final bool showCover;
final bool isSong;
final jellyfin_models.BaseItemDto? parentItem;
final VoidCallback? onRemoveFromList;
Expand Down Expand Up @@ -273,6 +276,7 @@ class TrackListTile extends StatelessWidget {
listIndex: index,
actualIndex: item.indexNumber ?? -1,
showIndex: showIndex,
showCover: showCover,
showArtists: !(
// "hide song artists if they're the same as album artists" == true
FinampSettingsHelper
Expand Down Expand Up @@ -357,6 +361,7 @@ class TrackListItem extends ConsumerStatefulWidget {
final Future<int>? listIndex;
final int actualIndex;
final bool showIndex;
final bool showCover;
final bool showArtists;
final bool showPlayCount;
final bool isPreviousTrack;
Expand All @@ -380,6 +385,7 @@ class TrackListItem extends ConsumerStatefulWidget {
this.isInPlaylist = false,
this.allowReorder = false,
this.showIndex = false,
this.showCover = true,
this.showArtists = true,
this.showPlayCount = false,
this.onRemoveFromList,
Expand Down Expand Up @@ -471,6 +477,7 @@ class TrackListItemState extends ConsumerState<TrackListItem>
listIndex: widget.listIndex,
actualIndex: widget.actualIndex,
showIndex: widget.showIndex,
showCover: widget.showCover,
showArtists: widget.showArtists,
showAlbum: showAlbum,
showPlayCount: widget.showPlayCount,
Expand All @@ -489,6 +496,7 @@ class TrackListItemState extends ConsumerState<TrackListItem>
listIndex: widget.listIndex,
actualIndex: widget.actualIndex,
showIndex: widget.showIndex,
showCover: widget.showCover,
showArtists: widget.showArtists,
showAlbum: showAlbum,
showPlayCount: widget.showPlayCount,
Expand Down Expand Up @@ -531,6 +539,7 @@ class ThemedTrackListTile extends ConsumerWidget {
final Future<int>? listIndex;
final int actualIndex;
final bool showIndex;
final bool showCover;
final bool showArtists;
final bool showAlbum;
final bool showPlayCount;
Expand All @@ -547,6 +556,7 @@ class ThemedTrackListTile extends ConsumerWidget {
required this.listIndex,
required this.actualIndex,
required this.showIndex,
required this.showCover,
required this.showArtists,
required this.showAlbum,
required this.showPlayCount,
Expand All @@ -557,7 +567,7 @@ class ThemedTrackListTile extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
return Opacity(
opacity: playable ? (isPreviousTrack ? 0.7 : 1.0) : 0.5,
opacity: playable ? (isPreviousTrack ? 0.8 : 1.0) : 0.5,
child: Card(
color: Colors.transparent,
elevation: 0,
Expand Down Expand Up @@ -601,6 +611,7 @@ class ThemedTrackListTile extends ConsumerWidget {
listIndex: listIndex,
actualIndex: actualIndex,
showIndex: showIndex,
showCover: showCover,
showArtists: showArtists,
showAlbum: showAlbum,
showPlayCount: showPlayCount,
Expand All @@ -624,6 +635,7 @@ class TrackListItemTile extends StatelessWidget {
required this.actualIndex,
this.listIndex,
this.showIndex = false,
this.showCover = true,
this.showArtists = true,
this.showAlbum = true,
this.showPlayCount = false,
Expand All @@ -636,6 +648,7 @@ class TrackListItemTile extends StatelessWidget {
final Future<int>? listIndex;
final int actualIndex;
final bool showIndex;
final bool showCover;
final bool showArtists;
final bool showAlbum;
final bool showPlayCount;
Expand Down Expand Up @@ -665,7 +678,7 @@ class TrackListItemTile extends StatelessWidget {
if (showIndex)
Padding(
padding:
FinampSettingsHelper.finampSettings.showCoversOnAlbumScreen
showCover
? const EdgeInsets.only(left: 2.0, right: 6.0)
: const EdgeInsets.only(left: 6.0, right: 0.0),
child: SizedBox.fromSize(
Expand All @@ -681,7 +694,7 @@ class TrackListItemTile extends StatelessWidget {
),
))),
),
if (FinampSettingsHelper.finampSettings.showCoversOnAlbumScreen)
if (showCover)
Stack(
children: [
AlbumImage(
Expand Down

0 comments on commit cd71e24

Please sign in to comment.