mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Add marker end seconds import/export (#5777)
* skip importing markers if scene is skipped
This commit is contained in:
@@ -235,6 +235,10 @@ func GetSceneMarkersJSON(ctx context.Context, markerReader models.SceneMarkerFin
|
||||
UpdatedAt: json.JSONTime{Time: sceneMarker.UpdatedAt},
|
||||
}
|
||||
|
||||
if sceneMarker.EndSeconds != nil {
|
||||
sceneMarkerJSON.EndSeconds = getDecimalString(*sceneMarker.EndSeconds)
|
||||
}
|
||||
|
||||
results = append(results, sceneMarkerJSON)
|
||||
}
|
||||
|
||||
|
||||
@@ -27,12 +27,20 @@ type MarkerImporter struct {
|
||||
|
||||
func (i *MarkerImporter) PreImport(ctx context.Context) error {
|
||||
seconds, _ := strconv.ParseFloat(i.Input.Seconds, 64)
|
||||
|
||||
var endSeconds *float64
|
||||
if i.Input.EndSeconds != "" {
|
||||
parsedEndSeconds, _ := strconv.ParseFloat(i.Input.EndSeconds, 64)
|
||||
endSeconds = &parsedEndSeconds
|
||||
}
|
||||
|
||||
i.marker = models.SceneMarker{
|
||||
Title: i.Input.Title,
|
||||
Seconds: seconds,
|
||||
SceneID: i.SceneID,
|
||||
CreatedAt: i.Input.CreatedAt.GetTime(),
|
||||
UpdatedAt: i.Input.UpdatedAt.GetTime(),
|
||||
Title: i.Input.Title,
|
||||
Seconds: seconds,
|
||||
EndSeconds: endSeconds,
|
||||
SceneID: i.SceneID,
|
||||
CreatedAt: i.Input.CreatedAt.GetTime(),
|
||||
UpdatedAt: i.Input.UpdatedAt.GetTime(),
|
||||
}
|
||||
|
||||
if err := i.populateTags(ctx); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user