Resolve timezone from user browser

This commit is contained in:
Claudio Ortolina
2025-09-11 22:14:15 +03:00
parent c67fd27ea1
commit 21783f5dbf
9 changed files with 23 additions and 10 deletions
+2 -2
View File
@@ -214,7 +214,7 @@ defmodule MusicLibrary.ScrobbleActivity do
def get_top_albums_by_days(days, opts) do
limit = Keyword.get(opts, :limit, 10)
current_time = Keyword.get_lazy(opts, :current_time, &DateTime.utc_now/0)
timezone = Keyword.get(opts, :timezone, &MusicLibrary.timezone/0)
timezone = Keyword.get(opts, :timezone, &MusicLibrary.default_timezone/0)
cutoff_timestamp =
current_time
@@ -304,7 +304,7 @@ defmodule MusicLibrary.ScrobbleActivity do
def get_top_artists_by_days(days, opts) do
limit = Keyword.get(opts, :limit, 10)
current_time = Keyword.get_lazy(opts, :current_time, &DateTime.utc_now/0)
timezone = Keyword.get(opts, :timezone, &MusicLibrary.timezone/0)
timezone = Keyword.get(opts, :timezone, &MusicLibrary.default_timezone/0)
cutoff_timestamp =
current_time