Identify task (#1839)

* Add identify task
* Change type naming
* Debounce folder select text input
* Add generic slice comparison function
This commit is contained in:
WithoutPants
2021-10-28 14:25:17 +11:00
committed by GitHub
parent c93b5e12b7
commit 0f64954e5b
70 changed files with 5882 additions and 291 deletions

View File

@@ -3,6 +3,7 @@ package models
import (
"database/sql"
"path/filepath"
"strconv"
"time"
)
@@ -119,6 +120,29 @@ type ScenePartial struct {
Interactive *bool `db:"interactive" json:"interactive"`
}
// UpdateInput constructs a SceneUpdateInput using the populated fields in the ScenePartial object.
func (s ScenePartial) UpdateInput() SceneUpdateInput {
boolPtrCopy := func(v *bool) *bool {
if v == nil {
return nil
}
vv := *v
return &vv
}
return SceneUpdateInput{
ID: strconv.Itoa(s.ID),
Title: nullStringPtrToStringPtr(s.Title),
Details: nullStringPtrToStringPtr(s.Details),
URL: nullStringPtrToStringPtr(s.URL),
Date: s.Date.StringPtr(),
Rating: nullInt64PtrToIntPtr(s.Rating),
Organized: boolPtrCopy(s.Organized),
StudioID: nullInt64PtrToStringPtr(s.StudioID),
}
}
func (s *ScenePartial) SetFile(f File) {
path := f.Path
s.Path = &path