mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
SQLite model refactoring, part 2 (#3839)
* Treat empty image input as null * Add validation to models.Date * Allow zero dates in database * Make scene_markers.scene_id non-nullable * Drop scraped_items table * Remove movie/studio checksum * Add migration notes --------- Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -36,14 +36,14 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
url = "url"
|
||||
title = "title"
|
||||
date = "2001-01-01"
|
||||
dateObj = models.NewDate(date)
|
||||
rating = 5
|
||||
ocounter = 2
|
||||
organized = true
|
||||
details = "details"
|
||||
url = "url"
|
||||
title = "title"
|
||||
date = "2001-01-01"
|
||||
dateObj, _ = models.ParseDate(date)
|
||||
rating = 5
|
||||
ocounter = 2
|
||||
organized = true
|
||||
details = "details"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -98,8 +98,10 @@ func (i *Importer) sceneJSONToScene(sceneJSON jsonschema.Scene) models.Scene {
|
||||
}
|
||||
|
||||
if sceneJSON.Date != "" {
|
||||
d := models.NewDate(sceneJSON.Date)
|
||||
newScene.Date = &d
|
||||
d, err := models.ParseDate(sceneJSON.Date)
|
||||
if err == nil {
|
||||
newScene.Date = &d
|
||||
}
|
||||
}
|
||||
if sceneJSON.Rating != 0 {
|
||||
newScene.Rating = &sceneJSON.Rating
|
||||
|
||||
Reference in New Issue
Block a user