Helper functions for the migration scripts
This commit is contained in:
parent
fd0b9cf53d
commit
b62b303995
2 changed files with 7 additions and 3 deletions
|
@ -27,7 +27,7 @@ func EpubMetadata(epub *epubgo.Epub) database.Book {
|
|||
case "description":
|
||||
book.Description = parseDescription(data)
|
||||
case "subject":
|
||||
book.Tags = parseSubject(data)
|
||||
book.Tags = ParseSubject(data)
|
||||
case "date":
|
||||
book.Date = parseDate(data)
|
||||
case "language":
|
||||
|
@ -88,7 +88,7 @@ func parseDescription(description []string) string {
|
|||
return str
|
||||
}
|
||||
|
||||
func parseSubject(subject []string) []string {
|
||||
func ParseSubject(subject []string) []string {
|
||||
parsed := subject
|
||||
for _, sep := range []string{"/", ","} {
|
||||
p2 := []string{}
|
||||
|
|
Reference in a new issue