aboutsummaryrefslogtreecommitdiff
path: root/internal/thumbnail/cache_check.go
blob: ee9d46f5406445a9f3f6f54db3e85b875b0b2aff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
}