Merge pull request 'Finalize Version 2.0.0' (#38) from 7-create-playlist into main

Reviewed-on: #38
This commit is contained in:
2025-07-04 09:47:38 +00:00
3 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "moshing-mammut", "name": "moshing-mammut",
"version": "1.4.0", "version": "2.0.0",
"private": true, "private": true,
"license": "LGPL-3.0-or-later", "license": "LGPL-3.0-or-later",
"scripts": { "scripts": {

View File

@ -106,7 +106,7 @@ export class SpotifyPlaylistAdder extends OauthPlaylistAdder implements Playlist
const resp = await fetch(apiUrl, options); const resp = await fetch(apiUrl, options);
const respObj = await resp.json(); const respObj = await resp.json();
if (respObj.error) { 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) { if (respObj.error.status === 401) {
const token = await this.refreshToken(true); const token = await this.refreshToken(true);
if (token == null) { if (token == null) {

View File

@ -179,7 +179,7 @@ export class TimelineReader {
} }
} }
const spotify: Platform = 'spotify'; const spotify: Platform = 'spotify';
return { const songInfo = {
...info, ...info,
pageUrl: odesliInfo.pageUrl, pageUrl: odesliInfo.pageUrl,
youtubeUrl: odesliInfo.linksByPlatform[platform]?.url, youtubeUrl: odesliInfo.linksByPlatform[platform]?.url,
@ -187,6 +187,10 @@ export class TimelineReader {
spotifyUri: odesliInfo.linksByPlatform[spotify]?.nativeAppUriDesktop, spotifyUri: odesliInfo.linksByPlatform[spotify]?.nativeAppUriDesktop,
postedUrl: url.toString() postedUrl: url.toString()
} as SongInfo; } as SongInfo;
if (songInfo.youtubeUrl && !songInfo.spotifyUrl) {
this.logger.warn('SongInfo with YT, but no spotify URL', odesliInfo);
}
return songInfo;
} catch (e) { } catch (e) {
if (e instanceof Error && e.cause === 429) { if (e instanceof Error && e.cause === 429) {
this.logger.warn('song.link rate limit reached. Trying again in 10 seconds'); this.logger.warn('song.link rate limit reached. Trying again in 10 seconds');