mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Fix date fields not being nulled correctly when cleared (#3243)
* Interpret empty string date as null * Fix setSQLiteDate for null
This commit is contained in:
@@ -143,7 +143,7 @@ func (t changesetTranslator) optionalDate(value *string, field string) models.Op
|
||||
return models.OptionalDate{}
|
||||
}
|
||||
|
||||
if value == nil {
|
||||
if value == nil || *value == "" {
|
||||
return models.OptionalDate{
|
||||
Set: true,
|
||||
Null: true,
|
||||
|
||||
@@ -102,11 +102,11 @@ func (r *updateRecord) setSQLiteDate(destField string, v models.OptionalDate) {
|
||||
if v.Set {
|
||||
if v.Null {
|
||||
r.set(destField, models.SQLiteDate{})
|
||||
} else {
|
||||
r.set(destField, models.SQLiteDate{
|
||||
String: v.Value.String(),
|
||||
Valid: true,
|
||||
})
|
||||
}
|
||||
|
||||
r.set(destField, models.SQLiteDate{
|
||||
String: v.Value.String(),
|
||||
Valid: true,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
* Changed performer aliases to be a list, rather than a string field. ([#3113](https://github.com/stashapp/stash/pull/3113))
|
||||
|
||||
### 🐛 Bug fixes
|
||||
* Fixed date fields not being nulled correctly when cleared. ([#3243](https://github.com/stashapp/stash/pull/3243))
|
||||
* Fixed scene wall items to show file base name where scene has no title set. ([#3242](https://github.com/stashapp/stash/pull/3242))
|
||||
* Fixed image exclusion pattern being applied to all files. ([#3241](https://github.com/stashapp/stash/pull/3241))
|
||||
* Fixed missing captions not being removed during scan. ([#3240](https://github.com/stashapp/stash/pull/3240))
|
||||
Reference in New Issue
Block a user