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[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