2019-02-09 12:30:49 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
import (
|
2023-06-15 02:46:09 +00:00
|
|
|
"time"
|
2019-02-09 12:30:49 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type SceneMarker struct {
|
2023-06-15 02:46:09 +00:00
|
|
|
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
|
|
|
}
|
2021-01-18 01:23:20 +00:00
|
|
|
|
2023-09-11 02:24:15 +00:00
|
|
|
func NewSceneMarker() SceneMarker {
|
|
|
|
currentTime := time.Now()
|
|
|
|
return SceneMarker{
|
|
|
|
CreatedAt: currentTime,
|
|
|
|
UpdatedAt: currentTime,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-28 01:22:43 +00:00
|
|
|
// SceneMarkerPartial represents part of a SceneMarker object.
|
|
|
|
// It is used to update the database entry.
|
2023-07-26 23:44:06 +00:00
|
|
|
type SceneMarkerPartial struct {
|
|
|
|
Title OptionalString
|
|
|
|
Seconds OptionalFloat64
|
|
|
|
PrimaryTagID OptionalInt
|
|
|
|
SceneID OptionalInt
|
|
|
|
CreatedAt OptionalTime
|
|
|
|
UpdatedAt OptionalTime
|
2021-01-18 01:23:20 +00:00
|
|
|
}
|
|
|
|
|
2023-07-26 23:44:06 +00:00
|
|
|
func NewSceneMarkerPartial() SceneMarkerPartial {
|
2023-09-11 02:24:15 +00:00
|
|
|
currentTime := time.Now()
|
2023-07-26 23:44:06 +00:00
|
|
|
return SceneMarkerPartial{
|
2023-09-11 02:24:15 +00:00
|
|
|
UpdatedAt: NewOptionalTime(currentTime),
|
2023-07-26 23:44:06 +00:00
|
|
|
}
|
2021-01-18 01:23:20 +00:00
|
|
|
}
|