|
|
@ -141,14 +141,22 @@ func AddOpml(content string) error {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func ExportOmpl() ([]byte, error) {
|
|
|
|
func ExportOmpl(usePodgrabLink bool, baseUrl string) ([]byte, error) {
|
|
|
|
|
|
|
|
|
|
|
|
podcasts := GetAllPodcasts("")
|
|
|
|
podcasts := GetAllPodcasts("")
|
|
|
|
|
|
|
|
|
|
|
|
var outlines []model.OpmlOutline
|
|
|
|
var outlines []model.OpmlOutline
|
|
|
|
for _, podcast := range *podcasts {
|
|
|
|
for _, podcast := range *podcasts {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xmlUrl := podcast.URL
|
|
|
|
|
|
|
|
if usePodgrabLink {
|
|
|
|
|
|
|
|
xmlUrl = fmt.Sprintf("%s/podcasts/%s/rss", baseUrl, podcast.ID)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
toAdd := model.OpmlOutline{
|
|
|
|
toAdd := model.OpmlOutline{
|
|
|
|
AttrText: podcast.Summary,
|
|
|
|
AttrText: podcast.Summary,
|
|
|
|
Type: "rss",
|
|
|
|
Type: "rss",
|
|
|
|
XmlUrl: podcast.URL,
|
|
|
|
XmlUrl: xmlUrl,
|
|
|
|
Title: podcast.Title,
|
|
|
|
Title: podcast.Title,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
outlines = append(outlines, toAdd)
|
|
|
|
outlines = append(outlines, toAdd)
|
|
|
|