1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

Push edition-specific scan option listing down to the core

... rather than have each UI layer repeat them.

Did qt, but not cocoa yet.
This commit is contained in:
Virgil Dupras
2016-05-24 22:53:03 -04:00
parent de9122c3cb
commit 2ed1b82ecf
9 changed files with 112 additions and 135 deletions

View File

@@ -1,6 +1,4 @@
# Created By: Virgil Dupras
# Created On: 2006/03/03
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
@@ -9,6 +7,7 @@
import logging
import re
import os.path as op
from collections import namedtuple
from hscommon.jobprogress import job
from hscommon.util import dedupe, rem_file_ext, get_file_ext
@@ -34,6 +33,8 @@ class ScanType:
FuzzyBlock = 10
ExifTimestamp = 11
ScanOption = namedtuple('ScanOption', 'scan_type label')
SCANNABLE_TAGS = ['track', 'artist', 'album', 'title', 'genre', 'year']
RE_DIGIT_ENDING = re.compile(r'\d+|\(\d+\)|\[\d+\]|{\d+}')
@@ -125,6 +126,13 @@ class Scanner:
return True
return len(dupe.path) > len(ref.path)
def get_scan_options(self):
"""Returns a list of scanning options for this scanner.
Returns a list of ``ScanOption``.
"""
raise NotImplementedError()
def get_dupe_groups(self, files, j=job.nulljob):
j = j.start_subjob([8, 2])
for f in (f for f in files if not hasattr(f, 'is_ref')):