Fix Creators not being written to ComicInfo.xml
This commit is contained in:
parent
903f7142ce
commit
82ea2beb9e
2 changed files with 15 additions and 8 deletions
14
jnc/jnc.go
14
jnc/jnc.go
|
@ -115,17 +115,17 @@ type Creator struct {
|
||||||
OriginalName string `json:"originalName "`
|
OriginalName string `json:"originalName "`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (creators *Creators) Contains(name string) bool {
|
func (creators Creators) Contains(role string) bool {
|
||||||
return slices.ContainsFunc(*creators, func(c Creator) bool {
|
return slices.ContainsFunc(creators, func(c Creator) bool {
|
||||||
return c.Name == name
|
return c.Role == role
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (creators *Creators) Get(name string) *Creator {
|
func (creators Creators) Get(role string) *Creator {
|
||||||
idx := slices.IndexFunc(*creators, func(c Creator) bool {
|
idx := slices.IndexFunc(creators, func(c Creator) bool {
|
||||||
return c.Name == name
|
return c.Role == role
|
||||||
})
|
})
|
||||||
return &(*creators)[idx]
|
return &(creators)[idx]
|
||||||
}
|
}
|
||||||
|
|
||||||
type VolumeAugmented struct {
|
type VolumeAugmented struct {
|
||||||
|
|
9
main.go
9
main.go
|
@ -574,8 +574,15 @@ func GenerateChapterMetadata(volume jnc.VolumeAugmented, serie jnc.SerieAugmente
|
||||||
comicInfo.Writer = vInfo.Creators.Get("AUTHOR").Name
|
comicInfo.Writer = vInfo.Creators.Get("AUTHOR").Name
|
||||||
}
|
}
|
||||||
|
|
||||||
if vInfo.Creators.Contains("ILLUSTRATOR") {
|
if vInfo.Creators.Contains("LETTERER") {
|
||||||
|
comicInfo.Letterer = vInfo.Creators.Get("LETTERER").Name
|
||||||
|
} else if vInfo.Creators.Contains("ILLUSTRATOR") {
|
||||||
comicInfo.Letterer = vInfo.Creators.Get("ILLUSTRATOR").Name
|
comicInfo.Letterer = vInfo.Creators.Get("ILLUSTRATOR").Name
|
||||||
|
}
|
||||||
|
|
||||||
|
if vInfo.Creators.Contains("ARTIST") {
|
||||||
|
comicInfo.CoverArtist = vInfo.Creators.Get("ARTIST").Name
|
||||||
|
} else if vInfo.Creators.Contains("ILLUSTRATOR") {
|
||||||
comicInfo.CoverArtist = vInfo.Creators.Get("ILLUSTRATOR").Name
|
comicInfo.CoverArtist = vInfo.Creators.Get("ILLUSTRATOR").Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue