Fix live photo field usage

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2023-11-07 11:13:17 +01:00
parent a923d577ba
commit 56a86538bc
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF
4 changed files with 11 additions and 7 deletions

View file

@ -511,7 +511,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.getLivePhoto()));
cv.put(ProviderTableMeta.FILE_METADATA_LIVE_PHOTO, file.getLivePhoto());
return cv;
}

View file

@ -198,6 +198,7 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
lockTimestamp = source.readLong();
lockTimeout = source.readLong();
lockToken = source.readString();
livePhoto = source.readString();
}
@Override
@ -241,13 +242,17 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
dest.writeLong(lockTimestamp);
dest.writeLong(lockTimeout);
dest.writeString(lockToken);
// TODO add live photo availability
dest.writeString(livePhoto);
}
public String getLivePhoto() {
return livePhoto;
}
public void setLivePhoto(String livePhoto) {
this.livePhoto = livePhoto;
}
public void setDecryptedRemotePath(String path) {
decryptedRemotePath = path;
}
@ -528,7 +533,7 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
lockTimestamp = 0;
lockTimeout = 0;
lockToken = null;
livePhoto = null;
imageDimension = null;
}
@ -919,10 +924,6 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
this.note = note;
}
public void setLivePhoto(String livePhoto) {
this.livePhoto = livePhoto;
}
public void setSharees(List<ShareeUser> sharees) {
this.sharees = sharees;
}

View file

@ -88,6 +88,7 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.Set;
import androidx.annotation.NonNull;
@ -393,6 +394,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
holder.getLivePhotoIndicator().setVisibility(isLivePhoto ? (View.VISIBLE) : (View.GONE));
// FIXME Interface segregation principle violation
// 594c962d71b
// Not needed for Grid mode unfortunately ListGridImageViewHolder interface used for List and Grid mode
holder.getLivePhotoIndicatorSeparator().setVisibility(isLivePhoto ? (View.VISIBLE) : (View.GONE));
}

View file

@ -260,6 +260,7 @@ public final class FileStorageUtils {
file.setTags(new ArrayList<>(Arrays.asList(remote.getTags())));
file.setImageDimension(remote.getImageDimension());
file.setGeoLocation(remote.getGeoLocation());
file.setLivePhoto(remote.getLivePhoto());
return file;
}