Skip to content

Commit

Permalink
rename some vars
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Mayer <jonas.a.mayer@gmx.net>
  • Loading branch information
JonasMayerDev committed Apr 16, 2024
1 parent 4bd0e2e commit d79899f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions app/src/main/java/com/owncloud/android/utils/FilesSyncHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

import static com.owncloud.android.datamodel.OCFile.PATH_SEPARATOR;

Expand Down Expand Up @@ -116,30 +115,30 @@ private static void insertAllDBEntriesForSyncedFolder(SyncedFolder syncedFolder)

if (syncedFolder.isEnabled() && (syncedFolder.isExisting() || enabledTimestampMs >= 0)) {
MediaFolderType mediaType = syncedFolder.getType();
final long lastCheck = syncedFolder.getLastScanTimestampMs();
final long thisCheck = System.currentTimeMillis();
final long lastCheckTimestampMs = syncedFolder.getLastScanTimestampMs();
final long thisCheckTimestampMs = System.currentTimeMillis();

Log_OC.d(TAG,"File-sync start check folder "+syncedFolder.getLocalPath());
long startTime = System.nanoTime();

if (mediaType == MediaFolderType.IMAGE) {
FilesSyncHelper.insertContentIntoDB(MediaStore.Images.Media.INTERNAL_CONTENT_URI,
syncedFolder,
lastCheck, thisCheck);
lastCheckTimestampMs, thisCheckTimestampMs);
FilesSyncHelper.insertContentIntoDB(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
syncedFolder,
lastCheck, thisCheck);
lastCheckTimestampMs, thisCheckTimestampMs);
} else if (mediaType == MediaFolderType.VIDEO) {
FilesSyncHelper.insertContentIntoDB(MediaStore.Video.Media.INTERNAL_CONTENT_URI,
syncedFolder,
lastCheck, thisCheck);
lastCheckTimestampMs, thisCheckTimestampMs);
FilesSyncHelper.insertContentIntoDB(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
syncedFolder,
lastCheck, thisCheck);
lastCheckTimestampMs, thisCheckTimestampMs);
} else {
FilesystemDataProvider filesystemDataProvider = new FilesystemDataProvider(contentResolver);
Path path = Paths.get(syncedFolder.getLocalPath());
FilesSyncHelper.insertCustomFolderIntoDB(path, syncedFolder, filesystemDataProvider, lastCheck, thisCheck);
FilesSyncHelper.insertCustomFolderIntoDB(path, syncedFolder, filesystemDataProvider, lastCheckTimestampMs, thisCheckTimestampMs);
}

Log_OC.d(TAG,"File-sync finished full check for custom folder "+syncedFolder.getLocalPath()+" within "+(System.nanoTime() - startTime)+ "ns");
Expand Down Expand Up @@ -191,7 +190,8 @@ private static String getFileFromURI(String uri){
return filePath;
}

private static void insertContentIntoDB(Uri uri, SyncedFolder syncedFolder, long lastCheckMs, long thisCheckMs) {
private static void insertContentIntoDB(Uri uri, SyncedFolder syncedFolder,
long lastCheckTimestampMs, long thisCheckTimestampMs) {
final Context context = MainApp.getAppContext();
final ContentResolver contentResolver = context.getContentResolver();

Expand Down Expand Up @@ -225,7 +225,7 @@ private static void insertContentIntoDB(Uri uri, SyncedFolder syncedFolder, long
isFolder = new File(contentPath).isDirectory();

if (syncedFolder.getLastScanTimestampMs() != SyncedFolder.NOT_SCANNED_YET &&
cursor.getLong(column_index_date_modified) < (lastCheckMs / 1000)) {
cursor.getLong(column_index_date_modified) < (lastCheckTimestampMs / 1000)) {
continue;
}

Expand All @@ -238,7 +238,7 @@ private static void insertContentIntoDB(Uri uri, SyncedFolder syncedFolder, long
}
}
cursor.close();
syncedFolder.setLastScanTimestampMs(thisCheckMs);
syncedFolder.setLastScanTimestampMs(thisCheckTimestampMs);
}
}

Expand Down

0 comments on commit d79899f

Please sign in to comment.