mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-09 21:24:36 +00:00
Moved DELTA_COLUMNS from app to result_table.
This commit is contained in:
parent
fca66d5108
commit
fc5a0d914b
@ -48,7 +48,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
- (NSNumber *)getMarkCount;
|
||||
- (BOOL)scanWasProblematic;
|
||||
- (BOOL)resultsAreModified;
|
||||
- (NSArray *)deltaColumns;
|
||||
|
||||
//Scanning options
|
||||
- (void)setScanType:(NSNumber *)scan_type;
|
||||
|
@ -14,6 +14,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
- (void)setPowerMarkerMode:(BOOL)aPowerMarkerMode;
|
||||
- (BOOL)deltaValuesMode;
|
||||
- (void)setDeltaValuesMode:(BOOL)aDeltaValuesMode;
|
||||
- (NSArray *)deltaColumns;
|
||||
|
||||
- (NSString *)valueForRow:(NSInteger)rowIndex column:(NSString *)aColumn;
|
||||
- (BOOL)renameSelected:(NSString *)aNewName;
|
||||
|
@ -24,7 +24,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
- (void)setPowerMarkerMode:(BOOL)aPowerMarkerMode;
|
||||
- (BOOL)deltaValuesMode;
|
||||
- (void)setDeltaValuesMode:(BOOL)aDeltaValuesMode;
|
||||
- (void)setDeltaColumns:(NSSet *)aDeltaColumns;
|
||||
- (NSInteger)selectedDupeCount;
|
||||
- (void)removeSelected;
|
||||
@end;
|
@ -22,6 +22,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
{
|
||||
self = [super initWithPy:aPy view:aTableView];
|
||||
columns = [[HSColumns alloc] initWithPy:[[self py] columns] tableView:aTableView];
|
||||
_deltaColumns = [[NSSet setWithArray:[[self py] deltaColumns]] retain];
|
||||
[self connect];
|
||||
return self;
|
||||
}
|
||||
@ -85,12 +86,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
[[self py] setDeltaValuesMode:aDeltaValuesMode];
|
||||
}
|
||||
|
||||
- (void)setDeltaColumns:(NSSet *)aDeltaColumns
|
||||
{
|
||||
[_deltaColumns release];
|
||||
_deltaColumns = [aDeltaColumns retain];
|
||||
}
|
||||
|
||||
- (NSInteger)selectedDupeCount
|
||||
{
|
||||
return [[self py] selectedDupeCount];
|
||||
|
@ -31,7 +31,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
[self fillColumnsMenu];
|
||||
[matches setTarget:self];
|
||||
[matches setDoubleAction:@selector(openClicked:)];
|
||||
[table setDeltaColumns:[NSSet setWithArray:[py deltaColumns]]];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobCompleted:) name:JobCompletedNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobStarted:) name:JobStarted object:nil];
|
||||
|
@ -127,9 +127,6 @@ class PyDupeGuruBase(PyFairware):
|
||||
def resultsAreModified(self):
|
||||
return self.py.results.is_modified
|
||||
|
||||
def deltaColumns(self):
|
||||
return list(self.py.DELTA_COLUMNS)
|
||||
|
||||
#---Properties
|
||||
@signature('v@:c')
|
||||
def setMixFileKind_(self, mix_file_kind):
|
||||
|
@ -17,6 +17,9 @@ class PyResultTable(PyTable):
|
||||
def setDeltaValuesMode_(self, value):
|
||||
self.py.delta_values = value
|
||||
|
||||
def deltaColumns(self):
|
||||
return list(self.py.DELTA_COLUMNS)
|
||||
|
||||
@signature('@@:i@')
|
||||
def valueForRow_column_(self, row_index, column):
|
||||
return self.py.get_row_value(row_index, column)
|
||||
|
@ -16,7 +16,6 @@ from .result_table import ResultTable
|
||||
|
||||
class DupeGuru(DupeGuruBase):
|
||||
NAME = __appname__
|
||||
DELTA_COLUMNS = {'size', 'duration', 'bitrate', 'samplerate', 'mtime'}
|
||||
METADATA_TO_READ = ['size', 'mtime', 'duration', 'bitrate', 'samplerate', 'title', 'artist',
|
||||
'album', 'genre', 'year', 'track', 'comment']
|
||||
|
||||
@ -74,7 +73,7 @@ class DupeGuru(DupeGuruBase):
|
||||
if key == 'dupe_count':
|
||||
return 0
|
||||
r = cmp_value(dupe, key)
|
||||
if delta and (key in self.DELTA_COLUMNS):
|
||||
if delta and (key in self.result_table.DELTA_COLUMNS):
|
||||
r -= cmp_value(get_group().ref, key)
|
||||
return r
|
||||
|
||||
|
@ -34,3 +34,4 @@ class ResultTable(ResultTableBase):
|
||||
Column('words', coltr("Words Used"), visible=False, optional=True),
|
||||
Column('dupe_count', coltr("Dupe Count"), visible=False, optional=True),
|
||||
]
|
||||
DELTA_COLUMNS = {'size', 'duration', 'bitrate', 'samplerate', 'mtime'}
|
||||
|
@ -24,7 +24,6 @@ def get_delta_dimensions(value, ref_value):
|
||||
|
||||
class DupeGuru(DupeGuruBase):
|
||||
NAME = __appname__
|
||||
DELTA_COLUMNS = {'size', 'dimensions', 'mtime'}
|
||||
METADATA_TO_READ = ['size', 'mtime', 'dimensions']
|
||||
|
||||
def __init__(self, view, appdata):
|
||||
@ -71,7 +70,7 @@ class DupeGuru(DupeGuruBase):
|
||||
dupe_folder_path = getattr(dupe, 'display_folder_path', dupe.folder_path)
|
||||
return str(dupe_folder_path).lower()
|
||||
r = cmp_value(dupe, key)
|
||||
if delta and (key in self.DELTA_COLUMNS):
|
||||
if delta and (key in self.result_table.DELTA_COLUMNS):
|
||||
ref_value = cmp_value(get_group().ref, key)
|
||||
if key == 4: # dimensions
|
||||
r = get_delta_dimensions(r, ref_value)
|
||||
|
@ -24,3 +24,4 @@ class ResultTable(ResultTableBase):
|
||||
Column('percentage', coltr("Match %"), optional=True),
|
||||
Column('dupe_count', coltr("Dupe Count"), visible=False, optional=True),
|
||||
]
|
||||
DELTA_COLUMNS = {'size', 'dimensions', 'mtime'}
|
||||
|
@ -15,7 +15,6 @@ from .result_table import ResultTable
|
||||
|
||||
class DupeGuru(DupeGuruBase):
|
||||
NAME = __appname__
|
||||
DELTA_COLUMNS = {'size', 'mtime'}
|
||||
METADATA_TO_READ = ['size', 'mtime']
|
||||
|
||||
def __init__(self, view, appdata):
|
||||
@ -54,7 +53,7 @@ class DupeGuru(DupeGuruBase):
|
||||
if key == 'dupe_count':
|
||||
return 0
|
||||
r = cmp_value(dupe, key)
|
||||
if delta and (key in self.DELTA_COLUMNS):
|
||||
if delta and (key in self.result_table.DELTA_COLUMNS):
|
||||
r -= cmp_value(get_group().ref, key)
|
||||
return r
|
||||
|
||||
|
@ -24,3 +24,4 @@ class ResultTable(ResultTableBase):
|
||||
Column('words', coltr("Words Used"), visible=False, optional=True),
|
||||
Column('dupe_count', coltr("Dupe Count"), visible=False, optional=True),
|
||||
]
|
||||
DELTA_COLUMNS = {'size', 'mtime'}
|
||||
|
Loading…
x
Reference in New Issue
Block a user