Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
djrandom-py
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ale
djrandom-py
Commits
e4f1f771
Commit
e4f1f771
authored
13 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
use cheap_dedup by default
parent
6fe887a4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
server/djrandom/fingerprint/cheap_dedup.py
+10
-4
10 additions, 4 deletions
server/djrandom/fingerprint/cheap_dedup.py
server/djrandom/fingerprint/dedup.py
+2
-0
2 additions, 0 deletions
server/djrandom/fingerprint/dedup.py
server/setup.py
+1
-1
1 addition, 1 deletion
server/setup.py
with
13 additions
and
5 deletions
server/djrandom/fingerprint/cheap_dedup.py
+
10
−
4
View file @
e4f1f771
"""
Deduplicator that uses perfect fingerprint-matching (fast, cheap).
"""
import
base64
import
os
import
optparse
...
...
@@ -57,7 +59,7 @@ class CheapDeDuper(object):
if
len
(
hashes
)
>
1
:
self
.
_dedup_songs
([
MP3
.
query
.
get
(
x
)
for
x
in
hashes
])
def
dedupe
(
self
,
dry_run
):
def
dedupe
(
self
):
dupes
=
[]
last_mp3
=
None
mp3s
=
MP3
.
query
.
filter
(
...
...
@@ -95,10 +97,13 @@ class CheapDeDuper(object):
self
.
_resolver
.
commit
()
def
run_cheap_deduper
(
db_url
,
solr_url
,
dry_run
):
def
run_cheap_deduper
(
db_url
,
solr_url
,
dry_run
,
use_fp
):
engine
=
init_db
(
db_url
,
solr_url
)
dup
=
CheapDeDuper
()
dup
.
dedupe_fp
(
engine
)
if
use_fp
:
dup
.
dedupe_fp
(
engine
)
else
:
dup
.
dedupe
()
if
not
dry_run
:
dup
.
commit
()
...
...
@@ -108,6 +113,7 @@ def main():
parser
.
add_option
(
'
--db_url
'
)
parser
.
add_option
(
'
--solr_url
'
,
default
=
'
http://localhost:8080/solr
'
)
parser
.
add_option
(
'
--apply
'
,
action
=
'
store_true
'
)
parser
.
add_option
(
'
--use_meta
'
,
action
=
'
store_true
'
)
daemonize
.
add_standard_options
(
parser
)
utils
.
read_config_defaults
(
parser
,
os
.
getenv
(
'
DJRANDOM_CONF
'
,
'
/etc/djrandom.conf
'
))
...
...
@@ -118,7 +124,7 @@ def main():
parser
.
error
(
'
Too many arguments
'
)
daemonize
.
daemonize
(
opts
,
run_cheap_deduper
,
(
opts
.
db_url
,
opts
.
solr_url
,
not
opts
.
apply
))
(
opts
.
db_url
,
opts
.
solr_url
,
not
opts
.
apply
,
not
opts
.
use_meta
))
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
server/djrandom/fingerprint/dedup.py
+
2
−
0
View file @
e4f1f771
"""
Deduplicator that uses a standalone Echoprint server instance.
"""
import
eyeD3
import
fp
import
os
...
...
This diff is collapsed.
Click to expand it.
server/setup.py
+
1
−
1
View file @
e4f1f771
...
...
@@ -18,7 +18,7 @@ setup(
"
djrandom-receiver = djrandom.receiver.receiver:main
"
,
"
djrandom-scanner = djrandom.scanner.scanner:main
"
,
"
djrandom-fingerprinter = djrandom.fingerprint.fingerprint:main
"
,
"
djrandom-dedup = djrandom.fingerprint.dedup:main
"
,
"
djrandom-dedup = djrandom.fingerprint.
cheap_
dedup:main
"
,
"
djrandom-streamer = djrandom.stream.stream:main
"
,
"
djrandom-frontend = djrandom.frontend.frontend:main
"
,
"
djrandom-update-markov = djrandom.model.markov:main
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment