diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-11-20 18:25:30 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-11-20 18:25:30 +0100 |
commit | 87ba373882f475f02a524a120b59ea9fcccf14e5 (patch) | |
tree | 9ad3592a2dc3561b9919408869e38b07247ee9e3 /src/ThumbnailCache.vala | |
parent | d0aaad443a88968dc61172c050084d3d9faa7602 (diff) |
New upstream version 0.32.3upstream/0.32.3
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(). } |