From 7492a150ebf1d81782bd113140ad213354d6c107 Mon Sep 17 00:00:00 2001 From: James Mills Date: Sun, 22 Mar 2020 18:37:29 +1000 Subject: [PATCH] Log errors for failure to generate thumbnails --- media/video.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/media/video.go b/media/video.go index 6e88a8c..f37c697 100644 --- a/media/video.go +++ b/media/video.go @@ -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))))