Skip to content

Commit b2f46d6

Browse files
authored
Merge pull request owncloud#816 from Jon-Schneider/instant-upload-new-date-handling
Revised Instant Upload Date Handling
2 parents 3956c34 + 98cf09e commit b2f46d6

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

Owncloud iOs Client/InstantUpload/InstantUpload.m

+5-15
Original file line numberDiff line numberDiff line change
@@ -233,21 +233,11 @@ - (void) attemptUpload {
233233

234234
AppDelegate *app = (AppDelegate *)[[UIApplication sharedApplication] delegate];
235235

236-
for (PHAsset *asset in newAssets) {
237-
if (asset.mediaType == PHAssetMediaTypeImage) {
238-
NSTimeInterval assetCreatedDate = [asset.creationDate timeIntervalSince1970];
239-
if (assetCreatedDate > ACTIVE_USER.timestampInstantUploadImage) {
240-
ACTIVE_USER.timestampInstantUploadImage = assetCreatedDate;
241-
[ManageAppSettingsDB updateTimestampInstantUploadImage:assetCreatedDate];
242-
}
243-
} else if (asset.mediaType == PHAssetMediaTypeVideo) {
244-
NSTimeInterval assetCreatedDate = [asset.creationDate timeIntervalSince1970];
245-
if (assetCreatedDate > ACTIVE_USER.timestampInstantUploadVideo) {
246-
ACTIVE_USER.timestampInstantUploadVideo = assetCreatedDate;
247-
[ManageAppSettingsDB updateTimestampInstantUploadVideo:assetCreatedDate];
248-
}
249-
}
250-
}
236+
NSTimeInterval now = [[NSDate date] timeIntervalSince1970];
237+
ACTIVE_USER.timestampInstantUploadImage = now;
238+
ACTIVE_USER.timestampInstantUploadVideo = now;
239+
[ManageAppSettingsDB updateTimestampInstantUploadImage:now];
240+
[ManageAppSettingsDB updateTimestampInstantUploadVideo:now];
251241

252242
if (app.prepareFiles == nil) {
253243
app.prepareFiles = [[PrepareFilesToUpload alloc] init];

0 commit comments

Comments
 (0)