Compare commits
2 Commits
ea505e0474
...
0be87c4700
Author | SHA1 | Date | |
---|---|---|---|
0be87c4700 | |||
9a50a7ce91 |
@ -78,11 +78,12 @@ class SpotifyDownloader extends Downloader
|
||||
const [ , id ] = match;
|
||||
if (!id)
|
||||
throw new Error('Could not parse ID from url');
|
||||
this.logger.debug('Song ID', id);
|
||||
|
||||
this.logger.debug('Song ID', id);
|
||||
const existing = this.#getSongData(id);
|
||||
if (existing)
|
||||
{
|
||||
this.logger.debug('Found existing entry for', id);
|
||||
const { artist, song, ext, album } = existing;
|
||||
return Promise.resolve({
|
||||
existing: true,
|
||||
@ -142,9 +143,9 @@ class SpotifyDownloader extends Downloader
|
||||
this.#processing = false;
|
||||
return reject(new Error('Got bad output from zotify (could not find file name) and could not find by ID from cache file'));
|
||||
}
|
||||
const { file, name } = match.groups!;
|
||||
fs.appendFileSync(path.join(this.downloadDir!, '.song_ids'), `${id}\t${(new Date()).toLocaleString('sv')}\t${name}\t${file}`);
|
||||
const { file } = match.groups!;
|
||||
data = this.#parseFilename(file);
|
||||
fs.appendFileSync(path.join(this.downloadDir!, '.song_ids'), `${id}\t${(new Date()).toLocaleString('sv')}\t${data.artist}\t${data.song}\t${file}\n`);
|
||||
}
|
||||
if (!data)
|
||||
return reject(new Error('Failed to find file reference'));
|
||||
|
Loading…
Reference in New Issue
Block a user