From 1e7fc76817c595bb445e115239be32d4601fb47c Mon Sep 17 00:00:00 2001 From: Adam M Date: Sat, 8 Mar 2014 15:35:20 +0000 Subject: [PATCH] add threshold option to echosim command --- beetsplug/echonest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/beetsplug/echonest.py b/beetsplug/echonest.py index 18f70a90c..4f8e83de8 100644 --- a/beetsplug/echonest.py +++ b/beetsplug/echonest.py @@ -446,11 +446,14 @@ class EchonestMetadataPlugin(plugins.BeetsPlugin): fetch_cmd.func = fetch_func sim_cmd = ui.Subcommand('echosim', help='show related files') + sim_cmd.parser.add_option('-t', '--threshold', dest='threshold', + action='store', type='float', default=0.15, + help='Set difference threshold') def sim_func(lib, opts, args): self.config.set_args(opts) for item in lib.items(ui.decargs(args)): - similar(lib, item) + similar(lib, item, opts.threshold) sim_cmd.func = sim_func