mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Identify task (#1839)
* Add identify task * Change type naming * Debounce folder select text input * Add generic slice comparison function
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user