diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-03-27 18:13:20 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-03-27 18:13:20 +1100 |
| commit | 93f1dd5131252412956d70096f6bcecd01f3cc0b (patch) | |
| tree | 90ac12572beb50c94cf2cf55b5d85774df2e17e3 /src/services | |
| parent | sidebar: no vexpand no wp message (diff) | |
| download | caelestia-shell-93f1dd5131252412956d70096f6bcecd01f3cc0b.tar.gz caelestia-shell-93f1dd5131252412956d70096f6bcecd01f3cc0b.tar.bz2 caelestia-shell-93f1dd5131252412956d70096f6bcecd01f3cc0b.zip | |
wallpapers: don't thumbnail if already exists
Have to clear cache if you change a wallpaper's contents but not name
Fixes small freeze on startup
Diffstat (limited to 'src/services')
| -rw-r--r-- | src/services/wallpapers.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/services/wallpapers.ts b/src/services/wallpapers.ts index 0e0e1de..4c7c49b 100644 --- a/src/services/wallpapers.ts +++ b/src/services/wallpapers.ts @@ -40,7 +40,8 @@ export default class Wallpapers extends GObject.Object { async #thumbnail(path: string) { const dir = path.slice(1, path.lastIndexOf("/")).replaceAll("/", "-"); const thumbPath = `${this.#thumbnailDir}/${dir}-${basename(path)}.jpg`; - await execAsync(`magick -define jpeg:size=1000x500 ${path} -thumbnail 500x250 -unsharp 0x.5 ${thumbPath}`); + if (!GLib.file_test(thumbPath, GLib.FileTest.EXISTS)) + await execAsync(`magick -define jpeg:size=1000x500 ${path} -thumbnail 500x250 -unsharp 0x.5 ${thumbPath}`); return thumbPath; } |