Skip to content

Commit

Permalink
- Added "Album View: Always Show Everything" (for playlist index numb…
Browse files Browse the repository at this point in the history
…ers)

- Removed "Album View: Hide Duplicate Track Name" because it's obsolete
- Text balancing now kicks in slightly sooner
  • Loading branch information
Selbi182 committed Jun 26, 2023
1 parent 654b8f2 commit 681bd3b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ private PlaybackContext.Context getPlaylistContext(Context context, boolean forc
.map(PlaylistTrack::getTrack)
.map(TrackElement::fromPlaylistItem)
.collect(Collectors.toList());
for (int i = 1; i <= listTracks.size(); i++) {
this.listTracks.get(i - 1).setTrackNumber(i);
}

Integer realTrackCount = contextPlaylist.getTracks().getTotal();
setTrackCount(realTrackCount);
Expand Down
10 changes: 6 additions & 4 deletions src/main/resources/static/design/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,8 @@ div#context-main {
text-align: center;
}

#content-center:not(.queue):not(.podcast).title-duplicate #center-info-main.hide-title-in-album-view.big-text.big-text-scrolling,
#content-center:not(.podcast) #center-info-main.big-text:not(.big-text-scrolling.hide-title-in-album-view) {
#content-center:not(.queue):not(.podcast).title-duplicate #center-info-main.big-text.big-text-scrolling,
#content-center:not(.podcast) #center-info-main.big-text:not(.big-text-scrolling) {
--font-scale: 2vmin;
}

Expand All @@ -583,7 +583,6 @@ div#context-main {
font-weight: bold;
}

#content-center:not(.queue) #center-info-main.hide-title-in-album-view #title,
#center-info-main.title-duplicate #title {
display: none;
}
Expand Down Expand Up @@ -764,6 +763,9 @@ div#description {
#track-list.show-timestamps {
grid-template-columns: auto auto auto;
}
#content-center:not(.queue) #track-list.show-tracklist-numbers.always-show-track-numbers-album-view {
grid-template-columns: auto auto auto auto;
}

#track-list.increase-min-scale {
--scale-min: 3;
Expand Down Expand Up @@ -849,7 +851,7 @@ div#description {
display: none !important;
}

#track-list.show-tracklist-numbers .track-artist {
#content-center:not(.queue) #track-list.show-tracklist-numbers:not(.always-show-track-numbers-album-view) .track-artist {
display: none !important;
}

Expand Down
25 changes: 12 additions & 13 deletions src/main/resources/static/js/spotify-big-picture.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ function setCorrectTracklistView(changes) {
setClass(mainContainer, "title-duplicate", !titleDisplayed && !queueMode);
setClass(mainContainer, "queue", queueMode);

let displayTrackNumbers = listViewType === "ALBUM" && !shuffle && !queueMode;
let displayTrackNumbers = !shuffle && !queueMode && (listViewType === "ALBUM" || listViewType === "PLAYLIST_ALBUM" && isPrefEnabled("always-show-track-numbers-album-view"));
setClass(trackListContainer, "show-tracklist-numbers", displayTrackNumbers)
setClass(trackListContainer, "show-discs", !queueMode && totalDiscCount > 1)

Expand Down Expand Up @@ -498,7 +498,7 @@ function setCorrectTracklistView(changes) {
setTimeout(() => {
refreshScrollPositions(queueMode, trackNumber, totalDiscCount, currentDiscNumber);
refreshTextBalance();
}, getTransitionFromCss() * 2);
}, getTransitionFromCss());
}
}

Expand Down Expand Up @@ -1388,7 +1388,7 @@ const PREFERENCES = [
name: "Enable Tracklist",
description: "If enabled, show the queue/tracklist for playlists and albums. Otherwise, only the current track is displayed",
category: "Tracklist",
requiredFor: ["scrollable-track-list", "album-view", "hide-title-album-view", "hide-single-item-album-view", "show-timestamps-track-list", "show-featured-artists-track-list",
requiredFor: ["scrollable-track-list", "album-view", "always-show-track-numbers-album-view", "hide-single-item-album-view", "show-timestamps-track-list", "show-featured-artists-track-list",
"full-track-list", "increase-min-track-list-scaling", "increase-max-track-list-scaling", "xl-main-info-scrolling", "hide-tracklist-podcast-view"],
css: {
"title": "!force-display",
Expand Down Expand Up @@ -1428,10 +1428,10 @@ const PREFERENCES = [
{
id: "album-view",
name: "Enable Album View",
description: "If enabled, while playing an album with shuffle DISABLED, the tracklist is replaced by an alternate design that displays the surrounding tracks in an automatically scrolling list. "
description: "If enabled, while playing an album or playlist with shuffle DISABLED, the tracklist is replaced by an alternate design that displays the surrounding tracks in an automatically scrolling list. "
+ "(Only works for 200 tracks or fewer, for performance reasons)",
category: "Tracklist",
requiredFor: ["hide-title-album-view", "hide-single-item-album-view", "xl-main-info-scrolling"],
requiredFor: ["always-show-track-numbers-album-view", "hide-single-item-album-view", "xl-main-info-scrolling"],
callback: () => refreshTrackList()
},
{
Expand All @@ -1442,13 +1442,13 @@ const PREFERENCES = [
callback: () => refreshTrackList()
},
{
id: "hide-title-album-view",
name: "Album View: Hide Duplicate Track Name",
description: "If 'Album View' is enabled, the current track's name will not be displayed in the main content container "
+ "(since it's already visible in the tracklist)",
id: "always-show-track-numbers-album-view",
name: "Album View: Always Show Everything",
description: "If 'Album View' is enabled, the track numbers and artists are always displayed as well (four columns). " +
"Otherwise, track numbers are hidden for playlists and artists are hidden for albums",
category: "Tracklist",
requiredFor: ["xl-main-info-scrolling"],
css: {"center-info-main": "hide-title-in-album-view"}
css: {"track-list": "always-show-track-numbers-album-view"},
callback: () => refreshTrackList()
},
{
id: "hide-tracklist-podcast-view",
Expand Down Expand Up @@ -1580,7 +1580,6 @@ const PREFERENCES = [
name: "Show Titles",
description: "Show the title of the currently playing track",
category: "Main Content",
requiredFor: ["hide-title-album-view"],
css: {"title": "!hide"}
},
{
Expand Down Expand Up @@ -2069,7 +2068,6 @@ const PREFERENCES_DEFAULT = {
"center-lr-margins",
"reduced-center-margins",
"xl-main-info-scrolling",
"hide-title-album-view",
"increase-min-track-list-scaling",
"increase-max-track-list-scaling",
"swap-top",
Expand Down Expand Up @@ -2103,6 +2101,7 @@ const PREFERENCES_DEFAULT = {
"text-shadows",
"slow-transitions",
"track-first-in-website-title",
"always-show-track-numbers-album-view",
"smooth-progress-bar",
"playback-control",
"scrollable-track-list",
Expand Down

0 comments on commit 681bd3b

Please sign in to comment.