diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-11-24 08:37:53 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-11-24 08:37:53 +0100 |
commit | 1bf62485f701b52ae27433e3570ac24cd7da886f (patch) | |
tree | 0f7be6ad3efd0c75fdad81d8bef5513d477f8d11 /src/ThumbnailCache.vala | |
parent | 008bc99860fd353a5da5d06e6be5937f4a358aed (diff) | |
parent | a7f185a9852392d1d6290771db6289c97c401a36 (diff) |
Merge branch 'release/debian/0.32.3-1'debian/0.32.3-1
Diffstat (limited to 'src/ThumbnailCache.vala')
-rw-r--r-- | src/ThumbnailCache.vala | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/ThumbnailCache.vala b/src/ThumbnailCache.vala index 5585708..2664cf3 100644 --- a/src/ThumbnailCache.vala +++ b/src/ThumbnailCache.vala @@ -509,13 +509,26 @@ public class ThumbnailCache : Object { File src_file = get_source_cached_file(src_source); File dest_file = get_cached_file(dest_source.get_representative_id(), src_source.get_preferred_thumbnail_format()); + bool success = false; try { src_file.copy(dest_file, FileCopyFlags.ALL_METADATA | FileCopyFlags.OVERWRITE, null, null); + success = true; } catch (Error err) { - AppWindow.panic("%s".printf(err.message)); + debug("Failed to duplicate thumbnail: %s", err.message); } - + + if (success) { + return; + } + + try { + _import_from_source(dest_source, true); + _import_from_source(src_source, false); + } catch (Error err) { + debug("Failed to duplicate thumbnail: %s", err.message); + } + // Do NOT store in memory cache, for similar reasons as stated in _import(). } |