diff --git a/internal/reader/opml/opml.go b/internal/reader/opml/opml.go index 2f7147a0335..05aefd6453a 100644 --- a/internal/reader/opml/opml.go +++ b/internal/reader/opml/opml.go @@ -34,6 +34,23 @@ type opmlOutline struct { Outlines opmlOutlineCollection `xml:"outline,omitempty"` } +func (outline opmlOutline) MarshalXML() ([]byte, error) { + type opmlOutlineXml opmlOutline + + outlineType := "" + if IsSubscription(outline) { + outlineType = "rss" + } + + return xml.Marshal(struct { + opmlOutlineXml + Type string `xml:"type,attr,omitempty"` + }{ + opmlOutlineXml: opmlOutlineXml(outline), + Type: outlineType, + }) +} + func (o *opmlOutline) IsSubscription() bool { return strings.TrimSpace(o.FeedURL) != "" }