aboutsummaryrefslogtreecommitdiff
path: root/internal/thumbnail/cache_check.go
blob: 9e26341bdc2992dbe0a595725ed77913db3edd92 (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, nil
	}

	if errors.Is(err, os.ErrNotExist) {
		return false, nil
	}

	return false, err
}