From d3480a86c393fb7cbbb30267f94402fcd34d0c0e Mon Sep 17 00:00:00 2001 From: jeffvli Date: Tue, 15 Oct 2024 03:15:59 -0700 Subject: [PATCH] Fix release date parsing to use UTC (#794) --- src/renderer/api/navidrome/navidrome-normalize.ts | 2 +- src/renderer/api/subsonic/subsonic-normalize.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/api/navidrome/navidrome-normalize.ts b/src/renderer/api/navidrome/navidrome-normalize.ts index 37dabeb7..666192bb 100644 --- a/src/renderer/api/navidrome/navidrome-normalize.ts +++ b/src/renderer/api/navidrome/navidrome-normalize.ts @@ -121,7 +121,7 @@ const normalizeSong = ( playlistItemId, releaseDate: (item.releaseDate ? new Date(item.releaseDate) - : new Date(item.year, 0, 1) + : new Date(Date.UTC(item.year, 0, 1)) ).toISOString(), releaseYear: String(item.year), serverId: server?.id || 'unknown', diff --git a/src/renderer/api/subsonic/subsonic-normalize.ts b/src/renderer/api/subsonic/subsonic-normalize.ts index 42d257d9..43a4aad4 100644 --- a/src/renderer/api/subsonic/subsonic-normalize.ts +++ b/src/renderer/api/subsonic/subsonic-normalize.ts @@ -207,7 +207,7 @@ const normalizeAlbum = ( name: item.name, originalDate: null, playCount: null, - releaseDate: item.year ? new Date(item.year, 0, 1).toISOString() : null, + releaseDate: item.year ? new Date(Date.UTC(item.year, 0, 1)).toISOString() : null, releaseYear: item.year ? Number(item.year) : null, serverId: server?.id || 'unknown', serverType: ServerType.SUBSONIC,