Fix scene marker issues (#3955)

* Fix scene marker NOT NULL constraint error
* similar changes to gallery chapters
* Fix NULL conversion error if names are NULL in DB
* Fix scene marker form resetting
This commit is contained in:
DingDongSoLong4
2023-07-28 03:22:43 +02:00
committed by GitHub
parent 7b77b8986f
commit 95a78de3aa
9 changed files with 84 additions and 75 deletions

View File

@@ -30,7 +30,7 @@ const (
type performerRow struct {
ID int `db:"id" goqu:"skipinsert"`
Name string `db:"name"`
Name null.String `db:"name"` // TODO: make schema non-nullable
Disambigation zero.String `db:"disambiguation"`
Gender zero.String `db:"gender"`
URL zero.String `db:"url"`
@@ -65,7 +65,7 @@ type performerRow struct {
func (r *performerRow) fromPerformer(o models.Performer) {
r.ID = o.ID
r.Name = o.Name
r.Name = null.StringFrom(o.Name)
r.Disambigation = zero.StringFrom(o.Disambiguation)
if o.Gender != nil && o.Gender.IsValid() {
r.Gender = zero.StringFrom(o.Gender.String())
@@ -101,7 +101,7 @@ func (r *performerRow) fromPerformer(o models.Performer) {
func (r *performerRow) resolve() *models.Performer {
ret := &models.Performer{
ID: r.ID,
Name: r.Name,
Name: r.Name.String,
Disambiguation: r.Disambigation.String,
URL: r.URL.String,
Twitter: r.Twitter.String,