beets: fix keyfinder plugin by addind keyfinder-cli dependency

This commit is contained in:
Michal Rus 2016-09-10 01:44:10 +02:00
parent 37a61d357a
commit 328180bc2f
No known key found for this signature in database
GPG Key ID: 396762D2C75A20A7
2 changed files with 41 additions and 1 deletions

View File

@ -8,6 +8,7 @@
, enableDiscogs ? true
, enableEmbyupdate ? true
, enableFetchart ? true
, enableKeyfinder ? true, keyfinder-cli ? null
, enableLastfm ? true
, enableMpd ? true
, enableReplaygain ? true, bs1770gain ? null
@ -26,6 +27,7 @@ assert enableBadfiles -> flac != null && mp3val != null;
assert enableConvert -> ffmpeg != null;
assert enableDiscogs -> pythonPackages.discogs_client != null;
assert enableFetchart -> pythonPackages.responses != null;
assert enableKeyfinder -> keyfinder-cli != null;
assert enableLastfm -> pythonPackages.pylast != null;
assert enableMpd -> pythonPackages.mpd != null;
assert enableReplaygain -> bs1770gain != null;
@ -43,6 +45,7 @@ let
discogs = enableDiscogs;
embyupdate = enableEmbyupdate;
fetchart = enableFetchart;
keyfinder = enableKeyfinder;
lastgenre = enableLastfm;
lastimport = enableLastfm;
mpdstats = enableMpd;
@ -55,7 +58,7 @@ let
pluginsWithoutDeps = [
"beatport" "bench" "bpd" "bpm" "bucket" "cue" "duplicates" "edit" "embedart"
"export" "filefilter" "freedesktop" "fromfilename" "ftintitle" "fuzzy" "hook" "ihate"
"importadded" "importfeeds" "info" "inline" "ipfs" "keyfinder" "lyrics"
"importadded" "importfeeds" "info" "inline" "ipfs" "lyrics"
"mbcollection" "mbsubmit" "mbsync" "metasync" "missing" "permissions" "play"
"plexupdate" "random" "rewrite" "scrub" "smartplaylist" "spotify" "the"
"types" "zero"
@ -99,6 +102,7 @@ in buildPythonApplication rec {
pythonPackages.requests2
++ optional enableConvert ffmpeg
++ optional enableDiscogs pythonPackages.discogs_client
++ optional enableKeyfinder keyfinder-cli
++ optional enableLastfm pythonPackages.pylast
++ optional enableMpd pythonPackages.mpd
++ optional enableThumbnails pythonPackages.pyxdg
@ -121,6 +125,7 @@ in buildPythonApplication rec {
patches = [
./replaygain-default-bs1770gain.patch
./keyfinder-default-bin.patch
];
postPatch = ''

View File

@ -0,0 +1,35 @@
diff --git a/beetsplug/keyfinder.py b/beetsplug/keyfinder.py
index b6131a4..b493792 100644
--- a/beetsplug/keyfinder.py
+++ b/beetsplug/keyfinder.py
@@ -30,7 +30,7 @@ class KeyFinderPlugin(BeetsPlugin):
def __init__(self):
super(KeyFinderPlugin, self).__init__()
self.config.add({
- u'bin': u'KeyFinder',
+ u'bin': u'keyfinder-cli',
u'auto': True,
u'overwrite': False,
})
@@ -59,7 +59,7 @@ class KeyFinderPlugin(BeetsPlugin):
continue
try:
- output = util.command_output([bin, b'-f',
+ output = util.command_output([bin,
util.syspath(item.path)])
except (subprocess.CalledProcessError, OSError) as exc:
self._log.error(u'execution failed: {0}', exc)
diff --git a/test/test_keyfinder.py b/test/test_keyfinder.py
index 00952fe..01ff8d4 100644
--- a/test/test_keyfinder.py
+++ b/test/test_keyfinder.py
@@ -46,7 +46,7 @@ class KeyFinderTest(unittest.TestCase, TestHelper):
item.load()
self.assertEqual(item['initial_key'], 'C#m')
self.command_output.assert_called_with(
- ['KeyFinder', '-f', util.syspath(item.path)])
+ ['keyfinder-cli', util.syspath(item.path)])
def test_add_key_on_import(self):
self.command_output.return_value = 'dbm'