mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
SQLite model refactoring (#3791)
* Remove ID from PerformerPartial * Separate studio model from sqlite model * Separate movie model from sqlite model * Separate tag model from sqlite model * Separate saved filter model from sqlite model * Separate scene marker model from sqlite model * Separate gallery chapter model from sqlite model * Move ErrNoRows checks into sqlite, improve empty result error messages * Move SQLiteDate and SQLiteTimestamp to sqlite * Use changesetTranslator everywhere, refactor for consistency * Make PerformerStore.DestroyImage private * Fix rating on movie create
This commit is contained in:
@@ -143,7 +143,7 @@ func GetStudioName(ctx context.Context, reader studio.Finder, scene *models.Scen
|
||||
}
|
||||
|
||||
if studio != nil {
|
||||
return studio.Name.String, nil
|
||||
return studio.Name, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,9 +221,9 @@ func GetSceneMoviesJSON(ctx context.Context, movieReader MovieFinder, scene *mod
|
||||
return nil, fmt.Errorf("error getting movie: %v", err)
|
||||
}
|
||||
|
||||
if movie.Name.Valid {
|
||||
if movie != nil {
|
||||
sceneMovieJSON := jsonschema.SceneMovie{
|
||||
MovieName: movie.Name.String,
|
||||
MovieName: movie.Name,
|
||||
}
|
||||
if sceneMovie.SceneIndex != nil {
|
||||
sceneMovieJSON.SceneIndex = *sceneMovie.SceneIndex
|
||||
@@ -273,8 +273,8 @@ func GetSceneMarkersJSON(ctx context.Context, markerReader MarkerFinder, tagRead
|
||||
Seconds: getDecimalString(sceneMarker.Seconds),
|
||||
PrimaryTag: primaryTag.Name,
|
||||
Tags: getTagNames(sceneMarkerTags),
|
||||
CreatedAt: json.JSONTime{Time: sceneMarker.CreatedAt.Timestamp},
|
||||
UpdatedAt: json.JSONTime{Time: sceneMarker.UpdatedAt.Timestamp},
|
||||
CreatedAt: json.JSONTime{Time: sceneMarker.CreatedAt},
|
||||
UpdatedAt: json.JSONTime{Time: sceneMarker.UpdatedAt},
|
||||
}
|
||||
|
||||
results = append(results, sceneMarkerJSON)
|
||||
|
||||
Reference in New Issue
Block a user