|
@@ -54,7 +54,7 @@
|
|
//
|
|
//
|
|
// orderByField : nil, date, typeFile
|
|
// orderByField : nil, date, typeFile
|
|
//
|
|
//
|
|
-+ (CCSectionDataSourceMetadata *)creataDataSourseSectionMetadata:(NSArray *)records listProgressMetadata:(NSMutableDictionary *)listProgressMetadata groupByField:(NSString *)groupByField replaceDateToExifDate:(BOOL)replaceDateToExifDate activeAccount:(NSString *)activeAccount
|
|
|
|
|
|
++ (CCSectionDataSourceMetadata *)creataDataSourseSectionMetadata:(NSArray *)records listProgressMetadata:(NSMutableDictionary *)listProgressMetadata groupByField:(NSString *)groupByField activeAccount:(NSString *)activeAccount
|
|
{
|
|
{
|
|
id dataSection;
|
|
id dataSection;
|
|
long counterSessionDownload = 0;
|
|
long counterSessionDownload = 0;
|
|
@@ -73,15 +73,6 @@
|
|
|
|
|
|
for (tableMetadata* metadata in records) {
|
|
for (tableMetadata* metadata in records) {
|
|
|
|
|
|
- // if exists replace date with exif date
|
|
|
|
- if (replaceDateToExifDate) {
|
|
|
|
-
|
|
|
|
- tableLocalFile *localFile = [[NCManageDatabase sharedInstance] getTableLocalFileWithPredicate:[NSPredicate predicateWithFormat:@"fileID = %@", metadata.fileID]];
|
|
|
|
- if (localFile)
|
|
|
|
- if (localFile.exifDate)
|
|
|
|
- metadata.date = localFile.exifDate;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if ([listProgressMetadata objectForKey:metadata.fileID] && [groupByField isEqualToString:@"session"]) {
|
|
if ([listProgressMetadata objectForKey:metadata.fileID] && [groupByField isEqualToString:@"session"]) {
|
|
[copyRecords insertObject:metadata atIndex:0];
|
|
[copyRecords insertObject:metadata atIndex:0];
|
|
} else {
|
|
} else {
|
|
@@ -151,7 +142,7 @@
|
|
|
|
|
|
BOOL ascending;
|
|
BOOL ascending;
|
|
|
|
|
|
- if (replaceDateToExifDate || [groupByField isEqualToString:@"date"]) ascending = NO;
|
|
|
|
|
|
+ if ([groupByField isEqualToString:@"date"]) ascending = NO;
|
|
else ascending = YES;
|
|
else ascending = YES;
|
|
|
|
|
|
NSArray *sortSections = [[sectionDataSource.sectionArrayRow allKeys] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
|
|
NSArray *sortSections = [[sectionDataSource.sectionArrayRow allKeys] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
|