Fixed bugs for KOЯN and Rx3

This commit is contained in:
dbroqua 2019-12-03 09:55:13 +01:00
parent b8d9c1f28d
commit 3f25702e8e

13
libs.js
View file

@ -64,6 +64,11 @@ const getLastSong = (callback) => {
* @param {Function} callback
*/
const getRemoteCover = (song, callback) => {
// Si c'est KOЯN on remplace par KORN (merci discogs)
if (song.artist === 'KOЯN') {
song.artist = 'KORN'
}
dis.search({ q: song.album, artist: song.artist, page: 1, per_page: 1 }, (err, res) => {
if (err) {
console.log('ERR:', err)
@ -86,6 +91,14 @@ const getRemoteCover = (song, callback) => {
* @param {Function} callback
*/
const findCover = (song, callback) => {
// Si c'est Rx3 on ne met pas de cover
if (song.artist === 'Rx3') {
const metadata = new mongo.Metadata(song)
metadata.save()
callback(null, null)
return true
}
mongo.Metadata.findOne({
id: song.id
})