diff --git a/libs.js b/libs.js index 1c5f0e7..a0e131d 100644 --- a/libs.js +++ b/libs.js @@ -32,6 +32,8 @@ const saveSong = (values, callback) => { last.length === 0 || (last[0] !== undefined && last[0].id !== values.id) ) { + console.log('[INFO][saveSong] song not found:', values.title, values.artist) + const history = new mongo.Histories(values) history.save(callback) } @@ -113,6 +115,8 @@ const findCover = (song, callback) => { if (metadata) { // On a déjà une pochette pour ce morceau if (metadata.cover) { + console.log('[INFO][findCover] cover exists:', metadata.cover) + callback(null, metadata.cover) return true } @@ -123,6 +127,7 @@ const findCover = (song, callback) => { callback(err) return false } + console.log('[INFO][findCover] cover does not exists but found on discogs:', coverUrl) metadata.updateOne({ cover: coverUrl }) callback(null, coverUrl) }) @@ -132,6 +137,7 @@ const findCover = (song, callback) => { callback(err) return false } + console.log('[INFO][findCover] cover does not exists but found on discogs (2):', coverUrl) song.cover = coverUrl const metadata = new mongo.Metadata(song) @@ -164,6 +170,7 @@ const getStream = (callback) => { } if (res !== null && res.artist !== undefined && res.title !== undefined) { + console.log('[INFO][getStream] CURRENT SONG:', res.title, res.artist) callback(null, res) } else { error = true