Add new property

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2023-11-06 16:53:42 +01:00
parent cab9abe5bb
commit 6a34f81799
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF
5 changed files with 1169 additions and 1153 deletions

View file

@ -102,6 +102,8 @@ data class FileEntity(
val richWorkspace: String?,
@ColumnInfo(name = ProviderTableMeta.FILE_METADATA_SIZE)
val metadataSize: String?,
@ColumnInfo(name = ProviderTableMeta.FILE_METADATA_LIVE_PHOTO)
val metadataLivePhoto: String?,
@ColumnInfo(name = ProviderTableMeta.FILE_LOCKED)
val locked: Int?,
@ColumnInfo(name = ProviderTableMeta.FILE_LOCK_TYPE)

View file

@ -510,6 +510,7 @@ public class FileDataStorageManager {
cv.put(ProviderTableMeta.FILE_MODIFIED, file.getModificationTimestamp());
cv.put(ProviderTableMeta.FILE_METADATA_SIZE, gson.toJson(file.getImageDimension()));
cv.put(ProviderTableMeta.FILE_METADATA_GPS, gson.toJson(file.getGeoLocation()));
cv.put(ProviderTableMeta.FILE_METADATA_LIVE_PHOTO, gson.toJson(file.isLivePhoto()));
return cv;
}
@ -939,6 +940,7 @@ public class FileDataStorageManager {
ocFile.setLockTimestamp(nullToZero(fileEntity.getLockTimestamp()));
ocFile.setLockTimeout(nullToZero(fileEntity.getLockTimeout()));
ocFile.setLockToken(fileEntity.getLockToken());
ocFile.setLivePhotoAvailable(fileEntity.getMetadataLivePhoto() == "TODO");
String sharees = fileEntity.getSharees();
// Surprisingly JSON deserialization causes significant overhead.

View file

@ -918,6 +918,10 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
this.note = note;
}
public void setLivePhotoAvailable(Boolean livePhotoAvailable) {
this.livePhotoAvailable = livePhotoAvailable;
}
public void setSharees(List<ShareeUser> sharees) {
this.sharees = sharees;
}

View file

@ -118,6 +118,7 @@ public class ProviderMeta {
public static final String FILE_RICH_WORKSPACE = "rich_workspace";
public static final String FILE_METADATA_SIZE = "metadata_size";
public static final String FILE_METADATA_GPS = "metadata_gps";
public static final String FILE_METADATA_LIVE_PHOTO = "metadata_live_photo";
public static final String FILE_LOCKED = "locked";
public static final String FILE_LOCK_TYPE = "lock_type";
public static final String FILE_LOCK_OWNER = "lock_owner";
@ -174,6 +175,7 @@ public class ProviderMeta {
FILE_LOCK_TIMEOUT,
FILE_LOCK_TOKEN,
FILE_METADATA_SIZE,
FILE_METADATA_LIVE_PHOTO,
FILE_TAGS,
FILE_METADATA_GPS));
public static final String FILE_DEFAULT_SORT_ORDER = FILE_NAME + " collate nocase asc";