Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public GallerySearchTask(GalleryFragment photoFragment,
}

@Override
protected GallerySearchTask.Result doInBackground(Void... voids) {
protected Result doInBackground(Void... voids) {
if (photoFragmentWeakReference.get() == null) {
return new Result(false, false, -1);
}
Expand Down Expand Up @@ -98,7 +98,7 @@ protected GallerySearchTask.Result doInBackground(Void... voids) {
}

@Override
protected void onPostExecute(GallerySearchTask.Result result) {
protected void onPostExecute(Result result) {
if (photoFragmentWeakReference.get() != null) {
GalleryFragment photoFragment = photoFragmentWeakReference.get();
photoFragment.searchCompleted(result.emptySearch, result.lastTimestamp);
Expand Down Expand Up @@ -147,9 +147,11 @@ private boolean parseMedia(long startDate, long endDate, List<Object> remoteFile
continue;
}


final OCFile existingFile = storageManager.getFileByDecryptedRemotePath(remoteFile.getRemotePath());

// add missing values from local storage to prevent override with null values

if (existingFile != null) {
final var imageDimension = existingFile.getImageDimension();
if (imageDimension != null) {
Expand All @@ -160,8 +162,15 @@ private boolean parseMedia(long startDate, long endDate, List<Object> remoteFile
remoteFile.setUploadTimestamp(existingFile.getUploadTimestamp());
}

// initialize oc file from remote file
OCFile ocFile = FileStorageUtils.fillOCFile(remoteFile);

// since remote does not contains parent id information use existing file to prevent overriding parent id with 0
Copy link
Collaborator Author

@alperozturk96 alperozturk96 Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remote file does not contains the parent id thus fix needs to be in client. @tobiasKaminsky What do you think?

if (existingFile != null) {
ocFile.setParentId(existingFile.getParentId());
ocFile.setCreationTimestamp(existingFile.getCreationTimestamp());
}

if (BuildConfig.DEBUG) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);
Log_OC.d(this,
Expand Down
Loading