summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJames Mills <prologic@shortcircuit.net.au>2020-03-22 21:59:52 +1000
committerJames Mills <prologic@shortcircuit.net.au>2020-03-22 21:59:52 +1000
commitaa15a591187fed35cf94b866adbca6f2ca8759c3 (patch)
treeafbad5e2d4a327cc694a9137d3b40bb926ba9789 /app
parent2aeea779b965046a40b246204bcde3344217bc21 (diff)
Fix bug with fsnotify events getting confused about thumbnail creation
Diffstat (limited to 'app')
-rw-r--r--app/watcher.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/watcher.go b/app/watcher.go
index 74db715..000df02 100644
--- a/app/watcher.go
+++ b/app/watcher.go
@@ -1,9 +1,11 @@
package app
import (
+ "path/filepath"
"time"
fs "github.com/fsnotify/fsnotify"
+ log "github.com/sirupsen/logrus"
)
// This is the amount of time to wait after changes before reacting to them.
@@ -27,6 +29,10 @@ func startWatcher(a *App) {
for {
select {
case e := <-a.Watcher.Events:
+ if filepath.Ext(e.Name) != ".mp4" {
+ continue
+ }
+ log.Debugf("fsnotify event: %s", e)
if e.Op&removeFlags != 0 {
removeEvents[e.Name] = struct{}{}
}