From 5037c728bc15ff60ffffd82563c99dd1adfc1a77 Mon Sep 17 00:00:00 2001 From: Oliver Jakoubek Date: Fri, 24 Mar 2023 17:04:31 +0100 Subject: [PATCH] Support Issue Reference in Title Info Fixes #12 --- title_info.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/title_info.go b/title_info.go index 366d3e2..2478c21 100644 --- a/title_info.go +++ b/title_info.go @@ -11,6 +11,7 @@ type TitleInfo struct { printObjectName string titleName string publicationDate time.Time + issueReference string countryCode string printObjectColor string additionalInfo string @@ -97,12 +98,24 @@ func (ti *TitleInfo) Payload() string { data := ti.PrintObjectName() data += ti.TitleName() data += ti.PublicationDate() + data += ti.IssueReference() data += ti.CountryCode() data += ti.PrintObjectColor() data += ti.AdditionalInfo() return data } +func (ti *TitleInfo) SetIssueReference(issueReference string) { + ti.issueReference = issueReference +} + +func (ti *TitleInfo) IssueReference() string { + if ti.issueReference == "" { + return "" + } + return fmt.Sprintf("+99195%8s", ti.issueReference) +} + // PrintObjectName returns the print object name segment (+93) FERAG-formatted func (ti *TitleInfo) PrintObjectName() string { if ti.printObjectName == "" {