Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions app/src/AlbumListView.purs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ renderSortOptions postEvent = Html.div $ do
let onClickPost field = Html.onClick $ void $ launchAff $ postEvent $ Event.SetSortField field
optReleaseDate <- Html.div $ do
Html.addClass "config-option"
Html.text "Release Date"
Html.text "Date"
onClickPost SortReleaseDate
ask
optFirstSeen <- Html.div $ do
Expand All @@ -216,17 +216,23 @@ renderSortOptions postEvent = Html.div $ do
Html.text "Trending"
onClickPost SortTrending
ask
optForNow <- Html.div $ do
Html.addClass "config-option"
Html.text "For Now"
onClickPost SortForNow
ask

pure $ case _ of
SortReleaseDate -> optReleaseDate
SortFirstSeen -> optFirstSeen
SortDiscover -> optDiscover
SortTrending -> optTrending
SortForNow -> optForNow

setSortMode :: SortMode -> AlbumListView -> Effect Unit
setSortMode { field, direction } state =
let
allFields = [SortReleaseDate, SortFirstSeen, SortDiscover, SortTrending]
allFields = [SortReleaseDate, SortFirstSeen, SortDiscover, SortTrending, SortForNow]
unsort = do
Html.removeClass "increasing"
Html.removeClass "decreasing"
Expand Down
1 change: 1 addition & 0 deletions app/src/Event.purs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ data SortField
| SortFirstSeen
| SortDiscover
| SortTrending
| SortForNow

derive instance sortFieldEq :: Eq SortField

Expand Down
3 changes: 3 additions & 0 deletions app/src/Model.purs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ newtype Album = Album
, firstSeen :: String
, discoverScore :: Number
, trendingScore :: Number
, forNowScore :: Number
}

instance decodeJsonAlbum :: DecodeJson Album where
Expand All @@ -156,6 +157,7 @@ instance decodeJsonAlbum :: DecodeJson Album where
firstSeen <- Json.getField obj "first_seen"
discoverScore <- Json.getField obj "discover_score"
trendingScore <- Json.getField obj "trending_score"
forNowScore <- Json.getField obj "for_now_score"
pure $ Album
{ id
, title
Expand All @@ -165,6 +167,7 @@ instance decodeJsonAlbum :: DecodeJson Album where
, firstSeen
, discoverScore
, trendingScore
, forNowScore
}

getAlbums :: Aff (Array Album)
Expand Down
1 change: 1 addition & 0 deletions app/src/State.purs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ sortAlbums {field, direction} albums =
SortFirstSeen -> Array.sortWith (\(Album album) -> album.firstSeen) albums
SortDiscover -> Array.sortWith (\(Album album) -> album.discoverScore) albums
SortTrending -> Array.sortWith (\(Album album) -> album.trendingScore) albums
SortForNow -> Array.sortWith (\(Album album) -> album.forNowScore) albums

toggleSortDirection :: SortDirection -> SortDirection
toggleSortDirection = case _ of
Expand Down
7 changes: 6 additions & 1 deletion app/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,16 @@ body {
display: none;
}

.list-config {
white-space: nowrap;
overflow: hidden;
}

.list-config .config-option {
display: inline-block;
height: 1.5rem;
line-height: 1.5rem;
padding: 1rem;
padding: 0.9rem;
padding-bottom: 0;
padding-top: 0;
margin-top: 1rem;
Expand Down
12 changes: 10 additions & 2 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,18 @@ Musium versions are named `MAJOR.MINOR.PATCH`.

## Next

* The ranking behind the _discover_ sort mode now better balances past and
recent popularity to show you albums worth listening to again.
* A new sort option is available in the album list: _For Now_. This ranking
shows you albums that you played at similar times of the day, week, and year
in the past. For example, if you tend to listen to more quiet music in the
morning, and more intense music on Friday nights, this will surface those
albums at the right times.
* The ranking behind the _Discover_ sort mode now better balances past and
recent popularity to show you albums worth listening to again. Like the
_For Now_ ranking, it takes into account the time of the day, week, and year,
to show the most relevant suggestions.
* The queue tab in the webinterface is now implemented, including buttons to
shuffle and clear the queue.
* Add support for Czech diacritics in text normalization.

## 0.16.0

Expand Down
Loading