Skip to content

Explo will fail to get the exploration playlist if ListenBrainz timezone is ahead of UTC #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
firewalkwithm3 opened this issue Apr 9, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@firewalkwithm3
Copy link

I have set my timezone to UTC+8 at https://listenbrainz.org/settings/select_timezone
Therefore, ListenBrainz generates my exploration playlist every Monday at 00:00 UTC+8.

However, the API returns the playlist's created time in UTC+0 meaning Explo thinks the playlist was created on Sunday and therefore will never return any playlist.

I made the following change and it works correctly for my case at least:

diff --git a/src/listenbrainz.go b/src/listenbrainz.go
index c4dfb47..b48b74a 100644
--- a/src/listenbrainz.go
+++ b/src/listenbrainz.go
@@ -194,7 +194,7 @@ func getWeeklyExploration(cfg Listenbrainz) (string, error) {
 	for _, playlist := range playlists.Playlist {
 
 		_, currentWeek := time.Now().Local().ISOWeek()
-		_, creationWeek := playlist.Data.Date.ISOWeek()
+		_, creationWeek := playlist.Data.Date.Local().ISOWeek()
 
 		if strings.Contains(playlist.Data.Title, "Weekly Exploration") && currentWeek == creationWeek {
 			id := strings.Split(playlist.Data.Identifier, "/")
@@ -271,4 +271,4 @@ func lbRequest(path string) ([]byte, error) { // Handle ListenBrainz API request
 		return nil, err
 	}
 	return body, nil
-}
\ No newline at end of file
+}
@LumePart
Copy link
Owner

Thanks for reporting and giving a fix! It will be incorporated in the refactor.

@LumePart LumePart added the bug Something isn't working label Apr 10, 2025
LumePart added a commit that referenced this issue Apr 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants