stash/pkg/models/model_scene_marker.go

42 lines
962 B
Go
Raw Normal View History

2019-02-09 12:30:49 +00:00
package models
import (
"time"
2019-02-09 12:30:49 +00:00
)
type SceneMarker struct {
ID int `json:"id"`
Title string `json:"title"`
Seconds float64 `json:"seconds"`
PrimaryTagID int `json:"primary_tag_id"`
SceneID int `json:"scene_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
2019-02-09 12:30:49 +00:00
}
func NewSceneMarker() SceneMarker {
currentTime := time.Now()
return SceneMarker{
CreatedAt: currentTime,
UpdatedAt: currentTime,
}
}
// SceneMarkerPartial represents part of a SceneMarker object.
// It is used to update the database entry.
type SceneMarkerPartial struct {
Title OptionalString
Seconds OptionalFloat64
PrimaryTagID OptionalInt
SceneID OptionalInt
CreatedAt OptionalTime
UpdatedAt OptionalTime
}
func NewSceneMarkerPartial() SceneMarkerPartial {
currentTime := time.Now()
return SceneMarkerPartial{
UpdatedAt: NewOptionalTime(currentTime),
}
}