Skip to content

Commit

Permalink
Manually matched scenes appear instantly in scene list (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
cld9x authored Jan 1, 2020
1 parent 9ba3e0e commit 710146c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/xbvr/api_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func (i FilesResource) matchFile(req *restful.Request, resp *restful.Response) {
}

var f models.File
err = db.Where(&models.File{ID: r.FileID}).First(&f).Error
err = db.Preload("Volume").Where(&models.File{ID: r.FileID}).First(&f).Error
if err == nil {
f.SceneID = scene.ID
f.Save()
Expand All @@ -231,6 +231,7 @@ func (i FilesResource) matchFile(req *restful.Request, resp *restful.Response) {

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

0 comments on commit 710146c

Please sign in to comment.