Skip to content

Commit

Permalink
Fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
shiibe committed Aug 30, 2024
1 parent f72f86e commit b5bbbd8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions music-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ async function getTrackExtras(props: iTunesProps): Promise<TrackExtras> {
await kv.set(["extras", cacheIndex], infos);
}

return infos;
return infos ?? { artworkUrl: null, iTunesUrl: null };
}

async function _getTrackExtras(
song: string,
artist: string,
album: string,
retryCount: number = 3
): Promise<TrackExtras | undefined> {
): Promise<TrackExtras | null> {
// Asterisks tend to result in no songs found, and songs are usually able to be found without it
const query = `${song} ${artist} ${album}`.replace("*", "");
const params = new URLSearchParams({
Expand Down Expand Up @@ -170,6 +170,8 @@ async function _getTrackExtras(
}
}
}

return null;
}
//#endregion

Expand Down

0 comments on commit b5bbbd8

Please sign in to comment.