IDs: string -> int

This commit is contained in:
Simon Martens
2025-02-19 22:03:40 +01:00
parent aa7c5f4d6c
commit 107a9d9f70
21 changed files with 94 additions and 63 deletions

View File

@@ -92,11 +92,11 @@ func (a *Agent) SetAnnotation(annotation string) {
a.Set(ANNOTATION_FIELD, annotation)
}
func (a *Agent) MusenalmID() string {
return a.GetString(MUSENALMID_FIELD)
func (a *Agent) MusenalmID() int {
return a.GetInt(MUSENALMID_FIELD)
}
func (a *Agent) SetMusenalmID(id string) {
func (a *Agent) SetMusenalmID(id int) {
a.Set(MUSENALMID_FIELD, id)
}

View File

@@ -173,11 +173,11 @@ func (c *Content) SetEntry(entry string) {
c.Set(ENTRIES_TABLE, entry)
}
func (c *Content) MusenalmID() string {
return c.GetString(MUSENALMID_FIELD)
func (c *Content) MusenalmID() int {
return c.GetInt(MUSENALMID_FIELD)
}
func (c *Content) SetMusenalmID(musenalmID string) {
func (c *Content) SetMusenalmID(musenalmID int) {
c.Set(MUSENALMID_FIELD, musenalmID)
}

View File

@@ -200,11 +200,11 @@ func (e *Entry) SetDeprecated(deprecated Deprecated) {
e.Set(MUSENALM_DEPRECATED_FIELD, deprecated)
}
func (e *Entry) MusenalmID() string {
return e.GetString(MUSENALMID_FIELD)
func (e *Entry) MusenalmID() int {
return e.GetInt(MUSENALMID_FIELD)
}
func (e *Entry) SetMusenalmID(musenalmID string) {
func (e *Entry) SetMusenalmID(musenalmID int) {
e.Set(MUSENALMID_FIELD, musenalmID)
}

View File

@@ -220,7 +220,6 @@ func FTS5ValuesContent(content *Content, entry *Entry, agents []*Agent) []string
entrystring += "; [o.J.]"
}
strconv.Itoa(entry.Year())
return []string{
content.PreferredTitle(),
content.VariantTitle(),
@@ -237,7 +236,7 @@ func FTS5ValuesContent(content *Content, entry *Entry, agents []*Agent) []string
strconv.FormatFloat(content.Numbering(), 'f', 3, 64),
entrystring,
agentstring,
content.MusenalmID(),
strconv.Itoa(content.MusenalmID()),
datatypes.DeleteTags(content.Annotation()),
datatypes.DeleteTags(content.Comment()),
}
@@ -291,7 +290,7 @@ func FTS5ValuesEntry(entry *Entry, places []*Place, agents []*Agent, series []*S
placestring,
agentstring,
seriesstring,
entry.MusenalmID(),
strconv.Itoa(entry.MusenalmID()),
datatypes.DeleteTags(entry.Annotation()),
datatypes.DeleteTags(entry.Comment()),
}

View File

@@ -13,7 +13,7 @@ func SetCreatedUpdatedFields(fieldlist *core.FieldsList) {
}
func SetMusenalmIDField(fieldlist *core.FieldsList) {
fieldlist.Add(&core.TextField{Name: MUSENALMID_FIELD, Max: 64, Required: false})
fieldlist.Add(&core.NumberField{Name: MUSENALMID_FIELD, Required: true})
}
func SetEditorStateField(fieldlist *core.FieldsList) {

View File

@@ -58,11 +58,11 @@ func (p *Place) SetAnnotation(annotation string) {
p.Set(ANNOTATION_FIELD, annotation)
}
func (p *Place) MusenalmID() string {
return p.GetString(MUSENALMID_FIELD)
func (p *Place) MusenalmID() int {
return p.GetInt(MUSENALMID_FIELD)
}
func (p *Place) SetMusenalmID(id string) {
func (p *Place) SetMusenalmID(id int) {
p.Set(MUSENALMID_FIELD, id)
}

View File

@@ -56,11 +56,11 @@ func (s *Series) SetAnnotation(annotation string) {
s.Set(ANNOTATION_FIELD, annotation)
}
func (s *Series) MusenalmID() string {
return s.GetString(MUSENALMID_FIELD)
func (s *Series) MusenalmID() int {
return s.GetInt(MUSENALMID_FIELD)
}
func (s *Series) SetMusenalmID(id string) {
func (s *Series) SetMusenalmID(id int) {
s.Set(MUSENALMID_FIELD, id)
}