Fix bug with fsnotify events getting confused about thumbnail creation
This commit is contained in:
parent
2aeea779b9
commit
aa15a59118
1 changed files with 6 additions and 0 deletions
|
@ -1,9 +1,11 @@
|
||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
fs "github.com/fsnotify/fsnotify"
|
fs "github.com/fsnotify/fsnotify"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// This is the amount of time to wait after changes before reacting to them.
|
// This is the amount of time to wait after changes before reacting to them.
|
||||||
|
@ -27,6 +29,10 @@ func startWatcher(a *App) {
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case e := <-a.Watcher.Events:
|
case e := <-a.Watcher.Events:
|
||||||
|
if filepath.Ext(e.Name) != ".mp4" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
log.Debugf("fsnotify event: %s", e)
|
||||||
if e.Op&removeFlags != 0 {
|
if e.Op&removeFlags != 0 {
|
||||||
removeEvents[e.Name] = struct{}{}
|
removeEvents[e.Name] = struct{}{}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue