Statistics cards: don't list unplayed songs #46

Closed
opened 2026-10-09 16:06:04 +02:00 by Sansan · 1 comment
Owner

The soundtrack cards in the statistics list songs played 0 times as "most played" or "least played", which says nothing.

Wanted

  • Hide unplayed songs on the cards. The cards never list songs with 0 plays.
  • Few played songs.
    • With 1–5 played songs, show them all under "Most played" and hide "Least played". With exactly one played song, only that song is shown.
    • So a song is never listed twice and the lists never overlap.
  • 6 or more played songs: 3 most played and 3 least played, as today.
  • No played songs: no song lists, only "Never played".
  • The popup is unchanged. SoundtrackStatsPopup still lists every song, 0 plays included.

Plan

  • statistics/soundtrack_card.gd, show_soundtrack():
    • Filter data.songs to times_played > 0 first.
    • If fewer than SONGS_SHOWN * 2 (6) songs remain, put all of them, most played first, in "Most played" and hide the least played header and list.
    • Otherwise keep the current 3 + 3 split.
  • Header text: "Most played" when there are played songs. With none, hide the header (instead of "No songs") or show "No songs played yet". Put "No songs" only on a soundtrack with no songs at all.
  • Check the card heights in the grid still line up when cards have different list lengths (StatisticsGrid).

Tests (tests/unit/test_soundtrack_card.gd or similar)

  • Soundtracks with 0, 1, 5, 6 and 10 played songs mixed with unplayed ones → which songs and headers are shown.
  • The popup still lists songs with 0 plays.

MusicPlayer only.

The soundtrack cards in the statistics list songs played 0 times as "most played" or "least played", which says nothing. ## Wanted - **Hide unplayed songs on the cards.** The cards never list songs with 0 plays. - **Few played songs.** - With 1–5 played songs, show them all under "Most played" and hide "Least played". With exactly one played song, only that song is shown. - So a song is never listed twice and the lists never overlap. - **6 or more played songs:** 3 most played and 3 least played, as today. - **No played songs:** no song lists, only "Never played". - **The popup is unchanged.** `SoundtrackStatsPopup` still lists every song, 0 plays included. ## Plan - `statistics/soundtrack_card.gd`, `show_soundtrack()`: - Filter `data.songs` to `times_played > 0` first. - If fewer than `SONGS_SHOWN * 2` (6) songs remain, put all of them, most played first, in "Most played" and hide the least played header and list. - Otherwise keep the current 3 + 3 split. - Header text: "Most played" when there are played songs. With none, hide the header (instead of "No songs") or show "No songs played yet". Put "No songs" only on a soundtrack with no songs at all. - Check the card heights in the grid still line up when cards have different list lengths (`StatisticsGrid`). ## Tests (`tests/unit/test_soundtrack_card.gd` or similar) - Soundtracks with 0, 1, 5, 6 and 10 played songs mixed with unplayed ones → which songs and headers are shown. - The popup still lists songs with 0 plays. MusicPlayer only.
Sansan added the improvement label 2026-10-09 16:06:04 +02:00
Sansan added this to the 2.0.0 milestone 2026-10-09 17:49:01 +02:00
Author
Owner

Done in cd43318 on develop.

Done in cd43318 on develop.
Sign in to join this conversation.