Log errors for failure to generate thumbnails
This commit is contained in:
parent
a7e88fbcac
commit
7492a150eb
1 changed files with 4 additions and 1 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/apex/log"
|
||||
"github.com/dhowden/tag"
|
||||
|
||||
"github.com/wybiral/tube/utils"
|
||||
|
@ -78,7 +79,9 @@ func ParseVideo(p *Path, name string) (*Video, error) {
|
|||
v.Thumb = pic.Data
|
||||
v.ThumbType = pic.MIMEType
|
||||
} else if utils.CmdExists("mt") {
|
||||
if err := utils.RunCmd(3, "mt", "-s", "-n", "1", pth); err != nil {
|
||||
if err := utils.RunCmd(10, "mt", "-s", "-n", "1", pth); err != nil {
|
||||
err := fmt.Errorf("error generating thumbnail: %w", err)
|
||||
log.Error(err.Error())
|
||||
return nil, err
|
||||
}
|
||||
data, err := ioutil.ReadFile(fmt.Sprintf("%s.jpg", strings.TrimSuffix(pth, filepath.Ext(pth))))
|
||||
|
|
Loading…
Reference in a new issue