diff --git a/package.json b/package.json index 8b2f3e7..1d446c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "moshing-mammut", - "version": "1.4.0", + "version": "2.0.0", "private": true, "license": "LGPL-3.0-or-later", "scripts": { diff --git a/src/lib/server/playlist/spotifyPlaylistAdder.ts b/src/lib/server/playlist/spotifyPlaylistAdder.ts index adc36ea..5fa21fe 100644 --- a/src/lib/server/playlist/spotifyPlaylistAdder.ts +++ b/src/lib/server/playlist/spotifyPlaylistAdder.ts @@ -106,7 +106,7 @@ export class SpotifyPlaylistAdder extends OauthPlaylistAdder implements Playlist const resp = await fetch(apiUrl, options); const respObj = await resp.json(); if (respObj.error) { - this.logger.debug('Add to playlist failed', respObj.error); + this.logger.debug('Add to playlist failed', song.spotifyUri, respObj.error); if (respObj.error.status === 401) { const token = await this.refreshToken(true); if (token == null) { diff --git a/src/lib/server/timeline.ts b/src/lib/server/timeline.ts index 7b88aed..653711a 100644 --- a/src/lib/server/timeline.ts +++ b/src/lib/server/timeline.ts @@ -179,7 +179,7 @@ export class TimelineReader { } } const spotify: Platform = 'spotify'; - return { + const songInfo = { ...info, pageUrl: odesliInfo.pageUrl, youtubeUrl: odesliInfo.linksByPlatform[platform]?.url, @@ -187,6 +187,10 @@ export class TimelineReader { spotifyUri: odesliInfo.linksByPlatform[spotify]?.nativeAppUriDesktop, postedUrl: url.toString() } as SongInfo; + if (songInfo.youtubeUrl && !songInfo.spotifyUrl) { + this.logger.warn('SongInfo with YT, but no spotify URL', odesliInfo); + } + return songInfo; } catch (e) { if (e instanceof Error && e.cause === 429) { this.logger.warn('song.link rate limit reached. Trying again in 10 seconds');