Show how many years ago for "On this day" records
This commit is contained in:
@@ -9,11 +9,12 @@ defmodule MusicLibraryWeb.StatsLive.Index do
|
||||
alias MusicLibraryWeb.StatsLive.{TopAlbums, TopArtists}
|
||||
|
||||
def mount(_params, _session, socket) do
|
||||
current_date = Date.utc_today()
|
||||
latest_record = Collection.get_latest_record!()
|
||||
recent_tracks = LastFm.get_scrobbled_tracks()
|
||||
records_by_artists = Collection.count_records_by_artist(limit: 20)
|
||||
records_by_genre = Collection.count_records_by_genre(limit: 20)
|
||||
records_on_this_day = Collection.get_records_on_this_day()
|
||||
records_on_this_day = Collection.get_records_on_this_day(current_date)
|
||||
|
||||
if connected?(socket) do
|
||||
LastFm.subscribe_to_feed()
|
||||
@@ -32,6 +33,7 @@ defmodule MusicLibraryWeb.StatsLive.Index do
|
||||
|> assign_counts()
|
||||
|> assign_scrobble_activity(recent_tracks)
|
||||
|> assign(
|
||||
current_date: current_date,
|
||||
scrobble_activity_mode: "albums",
|
||||
latest_record: latest_record,
|
||||
page_title: gettext("Stats"),
|
||||
|
||||
Reference in New Issue
Block a user