worldveil / dejavu

Audio fingerprinting and recognition in Python
MIT License
6.36k stars 1.43k forks source link

Inserting twice the same music #100

Open fazelmk opened 7 years ago

fazelmk commented 7 years ago

there is a issue in the validation of duplicated songs, its in the in the init.py on dejavu folder start around line 56.

Change

    filenames_to_fingerprint = []
    for filename, _ in decoder.find_files(path, extensions):

        # don't refingerprint already fingerprinted files
        if decoder.unique_hash(filename) in self.songhashes_set:
            print "%s already fingerprinted, continuing..." % filename
            continue

        filenames_to_fingerprint.append(filename)

by

   filenames_to_fingerprint = []
    for filename, _ in decoder.find_files(path, extensions):

        # don't refingerprint already fingerprinted files
        songHash = decoder.unique_hash(filename)
        if songHash in self.songhashes_set:
            print "%s already fingerprinted, continuing..." % filename
            continue

        filenames_to_fingerprint.append(filename)
        self.songhashes_set.add(songHash)

this way it adds the new song hash to the self.songhashes_set and find duplicated songs in the folder.

thesunlover commented 7 years ago

seems good suggestion, but nobody can merge it ... :(