From 3f25702e8e8439a8ceaec6e628669859fcf23e79 Mon Sep 17 00:00:00 2001 From: dbroqua Date: Tue, 3 Dec 2019 09:55:13 +0100 Subject: [PATCH] =?UTF-8?q?Fixed=20bugs=20for=20KO=D0=AFN=20and=20Rx3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libs.js b/libs.js index f3547d4..6868b63 100644 --- a/libs.js +++ b/libs.js @@ -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 })