Closes #11. (Allow singles from albums coming out in the future)

This commit is contained in:
Chase 2023-01-26 08:02:41 -06:00
parent 7a6cf53ec0
commit 925c995302
Signed by: chase
GPG Key ID: 9EC29E797878008C
1 changed files with 5 additions and 1 deletions

View File

@ -27,7 +27,7 @@ catch
let artists = await fetch(`${ lidarrUrl }/api/v1/artist?apikey=${ apiKey }`);
artists = await artists.json();
const artistIdsObject = artists.map((artist) => artist.artistMetadataId);
const artistIdsObject = artists.map((artist) => artist.id); // Used to be artist.artistMetadataId but it wasn't returning the correct results?
for (const artistId of artistIdsObject)
{
@ -51,6 +51,10 @@ for (const artistId of artistIdsObject)
for (const album of everythingElse)
{
if (album.releaseDate > new Date().toISOString())
// eslint-disable-next-line no-continue
continue; // Allow duplicate singles to be monitored if the album they are on is not released yet.
let trackList = await fetch(`${ lidarrUrl }/api/v1/track?artistId=${ artistId }&albumId=${ album.id }&apikey=${ apiKey }`);
trackList = await trackList.json();