Added more verbose mode for New Found Glory
This commit is contained in:
parent
929e691a68
commit
f5e9f696b8
1 changed files with 7 additions and 0 deletions
7
libs.js
7
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
|
||||
|
|
Loading…
Reference in a new issue