wallpapers: fix thumbnail duplicates
Duplicate file names in different dirs would override, so use full path instead
This commit is contained in:
parent
34f49aa450
commit
4cb50fbb39
1 changed files with 2 additions and 1 deletions
|
|
@ -26,7 +26,8 @@ export default class Wallpapers extends GObject.Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
async #thumbnail(path: string) {
|
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}`);
|
await execAsync(`magick -define jpeg:size=1000x500 ${path} -thumbnail 500x250 -unsharp 0x.5 ${thumbPath}`);
|
||||||
return thumbPath;
|
return thumbPath;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue