diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-03-02 23:02:48 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-03-02 23:02:48 +1100 |
| commit | 4cb50fbb3982d741c3e32157d444dfe680bab857 (patch) | |
| tree | bbc2ee274ce43b158f425e9cb37a6724844a8b39 /src/services | |
| parent | media: fix null error (diff) | |
| download | caelestia-shell-4cb50fbb3982d741c3e32157d444dfe680bab857.tar.gz caelestia-shell-4cb50fbb3982d741c3e32157d444dfe680bab857.tar.bz2 caelestia-shell-4cb50fbb3982d741c3e32157d444dfe680bab857.zip | |
wallpapers: fix thumbnail duplicates
Duplicate file names in different dirs would override, so use full path instead
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 e7a8742..7d29a14 100644 --- a/src/services/wallpapers.ts +++ b/src/services/wallpapers.ts @@ -26,7 +26,8 @@ export default class Wallpapers extends GObject.Object { } async #thumbnail(path: string) { - const thumbPath = `${this.#thumbnailDir}/${basename(path)}.jpg`; + 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}`); return thumbPath; } |