allow thumbnail.png to not exist
This commit is contained in:
parent
2fcbc31f77
commit
234caa159e
3 changed files with 30 additions and 22 deletions
|
|
@ -2,6 +2,7 @@ package scanner
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
|
|
@ -65,6 +66,9 @@ func ScanThumbnail(directory string) (string, int64, error) {
|
|||
thumbnailPath := path.Join(directory, "thumbnail.png")
|
||||
stat, err := os.Stat(thumbnailPath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return "", 0, err
|
||||
}
|
||||
return "", 0, err
|
||||
}
|
||||
if stat.IsDir() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue