Skip to content

Commit

Permalink
Update scene status as soon as it's matched to file
Browse files Browse the repository at this point in the history
  • Loading branch information
cld9x committed Jul 31, 2019
1 parent 6c57ae5 commit 0af75ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pkg/xbvr/api_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,14 @@ func (i FilesResource) matchFile(req *restful.Request, resp *restful.Response) {
tmp, err := json.Marshal(pfTxt)
if err == nil {
scene.FilenamesArr = string(tmp)
scene.Save()
}

// Finally, update scene available/accessible status
scene.IsAvailable = true
if f.Exists() {
scene.IsAccessible = true
}
scene.Save()

resp.WriteHeaderAndEntity(http.StatusOK, nil)
}
2 changes: 1 addition & 1 deletion pkg/xbvr/task_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func RescanVolumes() {
}
}

log.WithFields(logrus.Fields{"task": "rescan"}).Infof("Scanning complete")
tlog.Infof("Scanning complete")

// Inform UI about state change
publisher, err := client.ConnectNet("ws://"+wsAddr+"/ws", client.Config{Realm: "default"})
Expand Down

0 comments on commit 0af75ca

Please sign in to comment.