diff options
| author | RanXom <saiyedshizain@gmail.com> | 2026-07-13 13:59:28 +0530 |
|---|---|---|
| committer | RanXom <saiyedshizain@gmail.com> | 2026-07-13 13:59:28 +0530 |
| commit | 473123b1337dfca7c07da440d1f0ed23ac63e1e7 (patch) | |
| tree | 53b04292097b3a65526a7737a241b015b48d556e /internal/thumbnail/cache_check.go | |
| parent | b6baa98390bd57357351395915f45234edc9bcbc (diff) | |
| download | galleryd-473123b1337dfca7c07da440d1f0ed23ac63e1e7.tar.xz galleryd-473123b1337dfca7c07da440d1f0ed23ac63e1e7.zip | |
feat(thumbnail): reuse cached thumbnails
Diffstat (limited to 'internal/thumbnail/cache_check.go')
| -rw-r--r-- | internal/thumbnail/cache_check.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/thumbnail/cache_check.go b/internal/thumbnail/cache_check.go new file mode 100644 index 0000000..ee9d46f --- /dev/null +++ b/internal/thumbnail/cache_check.go @@ -0,0 +1,20 @@ +package thumbnail + +import ( + "errors" + "os" +) + +// thumbnailExists reports wether a cached thumbnail exists +func thumbnailExists(path string) (bool, error) { + _, err := os.Stat(path) + if err != nil { + return true, err + } + + if errors.Is(err, os.ErrNotExist) { + return false, nil + } + + return false, nil +} |