Added more verbose mode for New Found Glory

This commit is contained in:
dbroqua 2019-12-18 16:38:10 +01:00
parent 929e691a68
commit f5e9f696b8

View file

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