Skip to content
Snippets Groups Projects
Commit 101ee3ce authored by Robert J. Newmark's avatar Robert J. Newmark
Browse files

Merge branch 'master' of git.autistici.org:djrandom

parents 09fed4d0 7440f7f3
No related branches found
No related tags found
No related merge requests found
......@@ -45,20 +45,21 @@ def dedupe_db():
& (MP3.echoprint_fp != None))
for mp3 in mp3s:
code = generate_code_json(mp3.echoprint_fp, mp3.sha1)
codes[mp3.sha1] = code
if not code:
continue
codes[mp3.sha1] = code['fp']
fp.ingest([code], do_commit=False, local=True)
fp.commit()
# Now dedupe by going through all our codes over again.
for sha1, code in codes.iteritems():
results = fp.query_fp(code, local=True)
results = fp.query_fp(code, local=True).results
if len(results) < 2:
continue
print 'SHA1: %s' % sha1
for track_id, score in results:
if track_id == sha1:
continue
print ' --> %s (%f)' % track_id, score
print ' --> %s (%f)' % (track_id, score)
def run_deduper(db_url):
......@@ -66,7 +67,7 @@ def run_deduper(db_url):
dedupe_db()
if __name__ == '__main__':
def main():
parser = optparse.OptionParser()
parser.add_option('--db_url')
daemonize.add_standard_options(parser)
......
......@@ -2,8 +2,6 @@
{% block title %}User Details{% endblock %}
{% block main %}
<div id="form">
{%- for msg in get_flashed_messages() -%}
<p class="flash">{{ msg | e }}</p>
{%- endfor -%}
......@@ -47,6 +45,4 @@
</div>
</div>
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment