mirror of
https://github.com/arsenetar/dupeguru.git
synced 2024-10-31 22:05:58 +00:00
Remove ContentsAusio scan type
It had few uses and had a confusing name. People though it did fuzzy audio data matching, which it does not.
This commit is contained in:
parent
61b219ff43
commit
13fb06a693
@ -80,7 +80,6 @@ http://www.gnu.org/licenses/gpl-3.0.html
|
|||||||
VTIsIntIn *vtScanTypeIsFuzzy = [[[VTIsIntIn alloc] initWithValues:i reverse:NO] autorelease];
|
VTIsIntIn *vtScanTypeIsFuzzy = [[[VTIsIntIn alloc] initWithValues:i reverse:NO] autorelease];
|
||||||
[NSValueTransformer setValueTransformer:vtScanTypeIsFuzzy forName:@"vtScanTypeIsFuzzy"];
|
[NSValueTransformer setValueTransformer:vtScanTypeIsFuzzy forName:@"vtScanTypeIsFuzzy"];
|
||||||
i = [NSMutableIndexSet indexSetWithIndex:4];
|
i = [NSMutableIndexSet indexSetWithIndex:4];
|
||||||
[i addIndex:5];
|
|
||||||
VTIsIntIn *vtScanTypeIsNotContent = [[[VTIsIntIn alloc] initWithValues:i reverse:YES] autorelease];
|
VTIsIntIn *vtScanTypeIsNotContent = [[[VTIsIntIn alloc] initWithValues:i reverse:YES] autorelease];
|
||||||
[NSValueTransformer setValueTransformer:vtScanTypeIsNotContent forName:@"vtScanTypeMusicIsNotContent"];
|
[NSValueTransformer setValueTransformer:vtScanTypeIsNotContent forName:@"vtScanTypeMusicIsNotContent"];
|
||||||
VTIsIntIn *vtScanTypeIsTag = [[[VTIsIntIn alloc] initWithValues:[NSIndexSet indexSetWithIndex:3] reverse:NO] autorelease];
|
VTIsIntIn *vtScanTypeIsTag = [[[VTIsIntIn alloc] initWithValues:[NSIndexSet indexSetWithIndex:3] reverse:NO] autorelease];
|
||||||
|
@ -21,7 +21,6 @@ class ScannerME(ScannerBase):
|
|||||||
ScanOption(ScanType.FieldsNoOrder, tr("Filename - Fields (No Order)")),
|
ScanOption(ScanType.FieldsNoOrder, tr("Filename - Fields (No Order)")),
|
||||||
ScanOption(ScanType.Tag, tr("Tags")),
|
ScanOption(ScanType.Tag, tr("Tags")),
|
||||||
ScanOption(ScanType.Contents, tr("Contents")),
|
ScanOption(ScanType.Contents, tr("Contents")),
|
||||||
ScanOption(ScanType.ContentsAudio, tr("Audio Contents")),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@ class ScanType:
|
|||||||
Tag = 3
|
Tag = 3
|
||||||
Folders = 4
|
Folders = 4
|
||||||
Contents = 5
|
Contents = 5
|
||||||
ContentsAudio = 6
|
|
||||||
|
|
||||||
#PE
|
#PE
|
||||||
FuzzyBlock = 10
|
FuzzyBlock = 10
|
||||||
@ -78,11 +77,8 @@ class Scanner:
|
|||||||
for f in j.iter_with_progress(files, tr("Read size of %d/%d files")):
|
for f in j.iter_with_progress(files, tr("Read size of %d/%d files")):
|
||||||
f.size # pre-read, makes a smoother progress if read here (especially for bundles)
|
f.size # pre-read, makes a smoother progress if read here (especially for bundles)
|
||||||
files = [f for f in files if f.size >= self.size_threshold]
|
files = [f for f in files if f.size >= self.size_threshold]
|
||||||
if self.scan_type in {ScanType.Contents, ScanType.ContentsAudio, ScanType.Folders}:
|
if self.scan_type in {ScanType.Contents, ScanType.Folders}:
|
||||||
sizeattr = 'audiosize' if self.scan_type == ScanType.ContentsAudio else 'size'
|
return engine.getmatches_by_contents(files, sizeattr='size', partial=False, j=j)
|
||||||
return engine.getmatches_by_contents(
|
|
||||||
files, sizeattr, partial=self.scan_type == ScanType.ContentsAudio, j=j
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
j = j.start_subjob([2, 8])
|
j = j.start_subjob([2, 8])
|
||||||
kw = {}
|
kw = {}
|
||||||
|
@ -306,36 +306,6 @@ def test_tag_scan_non_ascii(fake_fileexists):
|
|||||||
raise AssertionError()
|
raise AssertionError()
|
||||||
eq_(len(r), 1)
|
eq_(len(r), 1)
|
||||||
|
|
||||||
def test_audio_content_scan(fake_fileexists):
|
|
||||||
s = Scanner()
|
|
||||||
s.scan_type = ScanType.ContentsAudio
|
|
||||||
f = [no('foo'), no('bar'), no('bleh')]
|
|
||||||
f[0].md5 = 'foo'
|
|
||||||
f[1].md5 = 'bar'
|
|
||||||
f[2].md5 = 'bleh'
|
|
||||||
f[0].md5partial = 'foo'
|
|
||||||
f[1].md5partial = 'foo'
|
|
||||||
f[2].md5partial = 'bleh'
|
|
||||||
f[0].audiosize = 1
|
|
||||||
f[1].audiosize = 1
|
|
||||||
f[2].audiosize = 1
|
|
||||||
r = s.get_dupe_groups(f)
|
|
||||||
eq_(len(r), 1)
|
|
||||||
eq_(len(r[0]), 2)
|
|
||||||
|
|
||||||
def test_audio_content_scan_compare_sizes_first(fake_fileexists):
|
|
||||||
class MyFile(no):
|
|
||||||
@property
|
|
||||||
def md5partial(file):
|
|
||||||
raise AssertionError()
|
|
||||||
|
|
||||||
s = Scanner()
|
|
||||||
s.scan_type = ScanType.ContentsAudio
|
|
||||||
f = [MyFile('foo'), MyFile('bar')]
|
|
||||||
f[0].audiosize = 1
|
|
||||||
f[1].audiosize = 2
|
|
||||||
eq_(len(s.get_dupe_groups(f)), 0)
|
|
||||||
|
|
||||||
def test_ignore_list(fake_fileexists):
|
def test_ignore_list(fake_fileexists):
|
||||||
s = Scanner()
|
s = Scanner()
|
||||||
f1 = no('foobar')
|
f1 = no('foobar')
|
||||||
|
Loading…
Reference in New Issue
Block a user