Not planning on submitting a merge request. Decoupling from upstream

This commit is contained in:
Ismael Arenzana 2020-12-21 09:45:20 -05:00
parent fb2777bfad
commit b4de14d039
Signed by: isma
GPG Key ID: D5586DE2A32CBC3C
11 changed files with 68 additions and 67 deletions

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2017 Eric Duncan Copyright (c) 2017 Ismael Arenzana
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
SHELL = /bin/bash SHELL = /bin/bash
GITHUB_REPO:=eduncan911/podcast GITHUB_REPO:=arenzana/podcast
README: README:
godoc2ghmd -play -ex -verify_import_links=0 github.com/$(GITHUB_REPO) > README.md.tmp godoc2ghmd -play -ex -verify_import_links=0 github.com/$(GITHUB_REPO) > README.md.tmp
@ -8,7 +8,7 @@ README:
echo "[![Build Status](https://github.com/$(GITHUB_REPO)/workflows/go-cicd/badge.svg)](https://github.com/$(GITHUB_REPO)/actions?workflow=go-cicd)" >> README.md echo "[![Build Status](https://github.com/$(GITHUB_REPO)/workflows/go-cicd/badge.svg)](https://github.com/$(GITHUB_REPO)/actions?workflow=go-cicd)" >> README.md
echo "[![Coverage Status](https://coveralls.io/repos/github/$(GITHUB_REPO)/badge.svg?branch=master)](https://coveralls.io/github/$(GITHUB_REPO)?branch=master)" >> README.md echo "[![Coverage Status](https://coveralls.io/repos/github/$(GITHUB_REPO)/badge.svg?branch=master)](https://coveralls.io/github/$(GITHUB_REPO)?branch=master)" >> README.md
echo "[![Go Report Card](https://goreportcard.com/badge/github.com/$(GITHUB_REPO))](https://goreportcard.com/report/github.com/$(GITHUB_REPO))" >> README.md echo "[![Go Report Card](https://goreportcard.com/badge/github.com/$(GITHUB_REPO))](https://goreportcard.com/report/github.com/$(GITHUB_REPO))" >> README.md
echo "[![MIT License](https://img.shields.io/npm/l/mediaelement.svg)](https://eduncan911.mit-license.org/)" >> README.md echo "[![MIT License](https://img.shields.io/npm/l/mediaelement.svg)](https://arenzana.mit-license.org/)" >> README.md
echo >>README.md echo >>README.md
cat README.md.tmp >> README.md cat README.md.tmp >> README.md
rm README.md.tmp rm README.md.tmp

View File

@ -1,21 +1,21 @@
[![GoDoc](https://godoc.org/github.com/eduncan911/podcast?status.svg)](https://godoc.org/github.com/eduncan911/podcast) [![GoDoc](https://godoc.org/github.com/arenzana/podcast?status.svg)](https://godoc.org/github.com/arenzana/podcast)
[![Build Status](https://github.com/eduncan911/podcast/workflows/go-cicd/badge.svg)](https://github.com/eduncan911/podcast/actions?workflow=go-cicd) [![Build Status](https://github.com/arenzana/podcast/workflows/go-cicd/badge.svg)](https://github.com/arenzana/podcast/actions?workflow=go-cicd)
[![Coverage Status](https://coveralls.io/repos/github/eduncan911/podcast/badge.svg?branch=master)](https://coveralls.io/github/eduncan911/podcast?branch=master) [![Coverage Status](https://coveralls.io/repos/github/arenzana/podcast/badge.svg?branch=master)](https://coveralls.io/github/arenzana/podcast?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/eduncan911/podcast)](https://goreportcard.com/report/github.com/eduncan911/podcast) [![Go Report Card](https://goreportcard.com/badge/github.com/arenzana/podcast)](https://goreportcard.com/report/github.com/arenzana/podcast)
[![MIT License](https://img.shields.io/npm/l/mediaelement.svg)](https://eduncan911.mit-license.org/) [![MIT License](https://img.shields.io/npm/l/mediaelement.svg)](https://arenzana.mit-license.org/)
# podcast # podcast
Package podcast generates a fully compliant iTunes and RSS 2.0 podcast feed Package podcast generates a fully compliant iTunes and RSS 2.0 podcast feed
for GoLang using a simple API. for GoLang using a simple API.
Full documentation with detailed examples located at <a href="https://godoc.org/github.com/eduncan911/podcast">https://godoc.org/github.com/eduncan911/podcast</a> Full documentation with detailed examples located at <a href="https://godoc.org/github.com/arenzana/podcast">https://godoc.org/github.com/arenzana/podcast</a>
### Usage ### Usage
To use, `go get` and `import` the package like your typical GoLang library. To use, `go get` and `import` the package like your typical GoLang library.
$ go get -u github.com/eduncan911/podcast $ go get -u github.com/arenzana/podcast
import "github.com/eduncan911/podcast" import "github.com/arenzana/podcast"
The API exposes a number of method receivers on structs that implements the The API exposes a number of method receivers on structs that implements the
logic required to comply with the specifications and ensure a compliant feed. logic required to comply with the specifications and ensure a compliant feed.
@ -25,7 +25,7 @@ Notably, the `Podcast.AddItem` function performs most
of the heavy lifting by taking the `Item` input and performing of the heavy lifting by taking the `Item` input and performing
validation, overrides and duplicate setters through the feed. validation, overrides and duplicate setters through the feed.
Full detailed Examples of the API are at <a href="https://godoc.org/github.com/eduncan911/podcast">https://godoc.org/github.com/eduncan911/podcast</a>. Full detailed Examples of the API are at <a href="https://godoc.org/github.com/arenzana/podcast">https://godoc.org/github.com/arenzana/podcast</a>.
### Go Modules ### Go Modules
This library is supported on GoLang 1.7 and higher. This library is supported on GoLang 1.7 and higher.
@ -57,8 +57,8 @@ of the inputs.
go get -u github.com/dvyukov/go-fuzz/go-fuzz go get -u github.com/dvyukov/go-fuzz/go-fuzz
go get -u github.com/dvyukov/go-fuzz/go-fuzz-build go get -u github.com/dvyukov/go-fuzz/go-fuzz-build
go get -u github.com/eduncan911/podcast go get -u github.com/arenzana/podcast
cd $GOPATH/src/github.com/eduncan911/podcast cd $GOPATH/src/github.com/arenzana/podcast
go-fuzz-build go-fuzz-build
go-fuzz -func FuzzPodcastAddItem go-fuzz -func FuzzPodcastAddItem
@ -175,15 +175,15 @@ Podcasts: <a href="https://help.apple.com/itc/podcasts_connect/#/itca5b22233">ht
// instantiate a new Podcast // instantiate a new Podcast
p := podcast.New( p := podcast.New(
"eduncan911 Podcasts", "arenzana Podcasts",
"http://eduncan911.com/", "http://arenzana.org/",
"An example Podcast", "An example Podcast",
&pubDate, &updatedDate, &pubDate, &updatedDate,
) )
// add some channel properties // add some channel properties
p.AddAuthor("Jane Doe", "me@janedoe.com") p.AddAuthor("Jane Doe", "me@janedoe.com")
p.AddAtomLink("http://eduncan911.com/feed.rss") p.AddAtomLink("http://arenzana.org/feed.rss")
p.AddImage("http://janedoe.com/i.jpg") p.AddImage("http://janedoe.com/i.jpg")
p.AddSummary(`link <a href="http://example.com">example.com</a>`) p.AddSummary(`link <a href="http://example.com">example.com</a>`)
p.IExplicit = "no" p.IExplicit = "no"
@ -232,20 +232,20 @@ Podcasts: <a href="https://help.apple.com/itc/podcasts_connect/#/itca5b22233">ht
// <?xml version="1.0" encoding="UTF-8"?> // <?xml version="1.0" encoding="UTF-8"?>
// <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"> // <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
// <channel> // <channel>
// <title>eduncan911 Podcasts</title> // <title>arenzana Podcasts</title>
// <link>http://eduncan911.com/</link> // <link>http://arenzana.org/</link>
// <description>An example Podcast</description> // <description>An example Podcast</description>
// <generator>go podcast v1.3.1 (github.com/eduncan911/podcast)</generator> // <generator>go podcast v1.3.1 (github.com/arenzana/podcast)</generator>
// <language>en-us</language> // <language>en-us</language>
// <lastBuildDate>Mon, 06 Feb 2017 08:21:52 +0000</lastBuildDate> // <lastBuildDate>Mon, 06 Feb 2017 08:21:52 +0000</lastBuildDate>
// <managingEditor>me@janedoe.com (Jane Doe)</managingEditor> // <managingEditor>me@janedoe.com (Jane Doe)</managingEditor>
// <pubDate>Sat, 04 Feb 2017 08:21:52 +0000</pubDate> // <pubDate>Sat, 04 Feb 2017 08:21:52 +0000</pubDate>
// <image> // <image>
// <url>http://janedoe.com/i.jpg</url> // <url>http://janedoe.com/i.jpg</url>
// <title>eduncan911 Podcasts</title> // <title>arenzana Podcasts</title>
// <link>http://eduncan911.com/</link> // <link>http://arenzana.org/</link>
// </image> // </image>
// <atom:link href="http://eduncan911.com/feed.rss" rel="self" type="application/rss+xml"></atom:link> // <atom:link href="http://arenzana.org/feed.rss" rel="self" type="application/rss+xml"></atom:link>
// <itunes:author>me@janedoe.com (Jane Doe)</itunes:author> // <itunes:author>me@janedoe.com (Jane Doe)</itunes:author>
// <itunes:summary><![CDATA[link <a href="http://example.com">example.com</a>]]></itunes:summary> // <itunes:summary><![CDATA[link <a href="http://example.com">example.com</a>]]></itunes:summary>
// <itunes:image href="http://janedoe.com/i.jpg"></itunes:image> // <itunes:image href="http://janedoe.com/i.jpg"></itunes:image>
@ -333,7 +333,7 @@ Podcasts: <a href="https://help.apple.com/itc/podcasts_connect/#/itca5b22233">ht
// <title>Sample Podcasts</title> // <title>Sample Podcasts</title>
// <link>http://example.com/</link> // <link>http://example.com/</link>
// <description>An example Podcast</description> // <description>An example Podcast</description>
// <generator>go podcast v1.3.1 (github.com/eduncan911/podcast)</generator> // <generator>go podcast v1.3.1 (github.com/arenzana/podcast)</generator>
// <language>en-us</language> // <language>en-us</language>
// <lastBuildDate>Mon, 06 Feb 2017 08:21:52 +0000</lastBuildDate> // <lastBuildDate>Mon, 06 Feb 2017 08:21:52 +0000</lastBuildDate>
// <managingEditor>jane.doe@example.com (Jane Doe)</managingEditor> // <managingEditor>jane.doe@example.com (Jane Doe)</managingEditor>
@ -1168,8 +1168,8 @@ Bytes returns an encoded []byte slice.
```go ```go
p := podcast.New( p := podcast.New(
"eduncan911 Podcasts", "arenzana Podcasts",
"http://eduncan911.com/", "http://arenzana.org/",
"An example Podcast", "An example Podcast",
&pubDate, &updatedDate, &pubDate, &updatedDate,
) )
@ -1203,18 +1203,18 @@ p := podcast.New(
// <?xml version="1.0" encoding="UTF-8"?> // <?xml version="1.0" encoding="UTF-8"?>
// <rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"> // <rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
// <channel> // <channel>
// <title>eduncan911 Podcasts</title> // <title>arenzana Podcasts</title>
// <link>http://eduncan911.com/</link> // <link>http://arenzana.org/</link>
// <description>An example Podcast</description> // <description>An example Podcast</description>
// <generator>go podcast v1.3.1 (github.com/eduncan911/podcast)</generator> // <generator>go podcast v1.3.1 (github.com/arenzana/podcast)</generator>
// <language>en-us</language> // <language>en-us</language>
// <lastBuildDate>Mon, 06 Feb 2017 08:21:52 +0000</lastBuildDate> // <lastBuildDate>Mon, 06 Feb 2017 08:21:52 +0000</lastBuildDate>
// <managingEditor>me@janedoe.com (Jane Doe)</managingEditor> // <managingEditor>me@janedoe.com (Jane Doe)</managingEditor>
// <pubDate>Sat, 04 Feb 2017 08:21:52 +0000</pubDate> // <pubDate>Sat, 04 Feb 2017 08:21:52 +0000</pubDate>
// <image> // <image>
// <url>http://janedoe.com/i.jpg</url> // <url>http://janedoe.com/i.jpg</url>
// <title>eduncan911 Podcasts</title> // <title>arenzana Podcasts</title>
// <link>http://eduncan911.com/</link> // <link>http://arenzana.org/</link>
// </image> // </image>
// <itunes:author>me@janedoe.com (Jane Doe)</itunes:author> // <itunes:author>me@janedoe.com (Jane Doe)</itunes:author>
// <itunes:summary><![CDATA[A very cool podcast with a long summary using Bytes()! // <itunes:summary><![CDATA[A very cool podcast with a long summary using Bytes()!
@ -1271,4 +1271,4 @@ type TextInput struct {
TextInput represents text inputs. TextInput represents text inputs.
- - - - - -
Generated by [godoc2ghmd](https://github.com/eduncan911/godoc2ghmd) Generated by [godoc2ghmd](https://github.com/arenzana/godoc2ghmd)

12
doc.go
View File

@ -1,15 +1,15 @@
// Package podcast generates a fully compliant iTunes and RSS 2.0 podcast feed // Package podcast generates a fully compliant iTunes and RSS 2.0 podcast feed
// for GoLang using a simple API. // for GoLang using a simple API.
// //
// Full documentation with detailed examples located at https://godoc.org/github.com/eduncan911/podcast // Full documentation with detailed examples located at https://godoc.org/github.com/arenzana/podcast
// //
// Usage // Usage
// //
// To use, `go get` and `import` the package like your typical GoLang library. // To use, `go get` and `import` the package like your typical GoLang library.
// //
// $ go get -u github.com/eduncan911/podcast // $ go get -u github.com/arenzana/podcast
// //
// import "github.com/eduncan911/podcast" // import "github.com/arenzana/podcast"
// //
// The API exposes a number of method receivers on structs that implements the // The API exposes a number of method receivers on structs that implements the
// logic required to comply with the specifications and ensure a compliant feed. // logic required to comply with the specifications and ensure a compliant feed.
@ -19,7 +19,7 @@
// of the heavy lifting by taking the `Item` input and performing // of the heavy lifting by taking the `Item` input and performing
// validation, overrides and duplicate setters through the feed. // validation, overrides and duplicate setters through the feed.
// //
// Full detailed Examples of the API are at https://godoc.org/github.com/eduncan911/podcast. // Full detailed Examples of the API are at https://godoc.org/github.com/arenzana/podcast.
// //
// Go Modules // Go Modules
// //
@ -54,8 +54,8 @@
// //
// go get -u github.com/dvyukov/go-fuzz/go-fuzz // go get -u github.com/dvyukov/go-fuzz/go-fuzz
// go get -u github.com/dvyukov/go-fuzz/go-fuzz-build // go get -u github.com/dvyukov/go-fuzz/go-fuzz-build
// go get -u github.com/eduncan911/podcast // go get -u github.com/arenzana/podcast
// cd $GOPATH/src/github.com/eduncan911/podcast // cd $GOPATH/src/github.com/arenzana/podcast
// go-fuzz-build // go-fuzz-build
// go-fuzz -func FuzzPodcastAddItem // go-fuzz -func FuzzPodcastAddItem
// //

View File

@ -3,7 +3,7 @@ package podcast_test
import ( import (
"testing" "testing"
"github.com/eduncan911/podcast" "github.com/arenzana/podcast"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -7,7 +7,7 @@ import (
"os" "os"
"strconv" "strconv"
"github.com/eduncan911/podcast" "github.com/arenzana/podcast"
) )
func Example_httpHandlers() { func Example_httpHandlers() {
@ -18,15 +18,15 @@ func Example_httpHandlers() {
// instantiate a new Podcast // instantiate a new Podcast
p := podcast.New( p := podcast.New(
"eduncan911 Podcasts", "arenzana Podcasts",
"http://eduncan911.com/", "https://arenzana.org/",
"An example Podcast", "An example Podcast",
&pubDate, &updatedDate, &pubDate, &updatedDate,
) )
// add some channel properties // add some channel properties
p.AddAuthor("Jane Doe", "me@janedoe.com") p.AddAuthor("Jane Doe", "me@janedoe.com")
p.AddAtomLink("http://eduncan911.com/feed.rss") p.AddAtomLink("http://arenzana.org/feed.rss")
p.AddImage("http://janedoe.com/i.jpg") p.AddImage("http://janedoe.com/i.jpg")
p.AddSummary(`link <a href="http://example.com">example.com</a>`) p.AddSummary(`link <a href="http://example.com">example.com</a>`)
p.IExplicit = "no" p.IExplicit = "no"
@ -75,20 +75,20 @@ func Example_httpHandlers() {
// <?xml version="1.0" encoding="UTF-8"?> // <?xml version="1.0" encoding="UTF-8"?>
// <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"> // <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
// <channel> // <channel>
// <title>eduncan911 Podcasts</title> // <title>arenzana Podcasts</title>
// <link>http://eduncan911.com/</link> // <link>http://arenzana.org/</link>
// <description>An example Podcast</description> // <description>An example Podcast</description>
// <generator>go podcast v1.3.1 (github.com/eduncan911/podcast)</generator> // <generator>go podcast v1.3.1 (github.com/arenzana/podcast)</generator>
// <language>en-us</language> // <language>en-us</language>
// <lastBuildDate>Mon, 06 Feb 2017 08:21:52 +0000</lastBuildDate> // <lastBuildDate>Mon, 06 Feb 2017 08:21:52 +0000</lastBuildDate>
// <managingEditor>me@janedoe.com (Jane Doe)</managingEditor> // <managingEditor>me@janedoe.com (Jane Doe)</managingEditor>
// <pubDate>Sat, 04 Feb 2017 08:21:52 +0000</pubDate> // <pubDate>Sat, 04 Feb 2017 08:21:52 +0000</pubDate>
// <image> // <image>
// <url>http://janedoe.com/i.jpg</url> // <url>http://janedoe.com/i.jpg</url>
// <title>eduncan911 Podcasts</title> // <title>arenzana Podcasts</title>
// <link>http://eduncan911.com/</link> // <link>http://arenzana.org/</link>
// </image> // </image>
// <atom:link href="http://eduncan911.com/feed.rss" rel="self" type="application/rss+xml"></atom:link> // <atom:link href="http://arenzana.org/feed.rss" rel="self" type="application/rss+xml"></atom:link>
// <itunes:author>me@janedoe.com (Jane Doe)</itunes:author> // <itunes:author>me@janedoe.com (Jane Doe)</itunes:author>
// <itunes:summary><![CDATA[link <a href="http://example.com">example.com</a>]]></itunes:summary> // <itunes:summary><![CDATA[link <a href="http://example.com">example.com</a>]]></itunes:summary>
// <itunes:image href="http://janedoe.com/i.jpg"></itunes:image> // <itunes:image href="http://janedoe.com/i.jpg"></itunes:image>
@ -170,7 +170,7 @@ func Example_ioWriter() {
// <title>Sample Podcasts</title> // <title>Sample Podcasts</title>
// <link>http://example.com/</link> // <link>http://example.com/</link>
// <description>An example Podcast</description> // <description>An example Podcast</description>
// <generator>go podcast v1.3.1 (github.com/eduncan911/podcast)</generator> // <generator>go podcast v1.3.1 (github.com/arenzana/podcast)</generator>
// <language>en-us</language> // <language>en-us</language>
// <lastBuildDate>Mon, 06 Feb 2017 08:21:52 +0000</lastBuildDate> // <lastBuildDate>Mon, 06 Feb 2017 08:21:52 +0000</lastBuildDate>
// <managingEditor>jane.doe@example.com (Jane Doe)</managingEditor> // <managingEditor>jane.doe@example.com (Jane Doe)</managingEditor>

View File

@ -5,7 +5,7 @@ import (
"os" "os"
"strconv" "strconv"
"github.com/eduncan911/podcast" "github.com/arenzana/podcast"
) )
func ExampleNew() { func ExampleNew() {
@ -145,8 +145,8 @@ See more at our website: <a href="http://example.com">example.com</a>
func ExamplePodcast_Bytes() { func ExamplePodcast_Bytes() {
p := podcast.New( p := podcast.New(
"eduncan911 Podcasts", "arenzana Podcasts",
"http://eduncan911.com/", "http://arenzana.org/",
"An example Podcast", "An example Podcast",
&pubDate, &updatedDate, &pubDate, &updatedDate,
) )
@ -180,18 +180,18 @@ See more at our website: <a href="http://example.com">example.com</a>
// <?xml version="1.0" encoding="UTF-8"?> // <?xml version="1.0" encoding="UTF-8"?>
// <rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"> // <rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
// <channel> // <channel>
// <title>eduncan911 Podcasts</title> // <title>arenzana Podcasts</title>
// <link>http://eduncan911.com/</link> // <link>http://arenzana.org/</link>
// <description>An example Podcast</description> // <description>An example Podcast</description>
// <generator>go podcast v1.3.1 (github.com/eduncan911/podcast)</generator> // <generator>go podcast v1.3.1 (github.com/arenzana/podcast)</generator>
// <language>en-us</language> // <language>en-us</language>
// <lastBuildDate>Mon, 06 Feb 2017 08:21:52 +0000</lastBuildDate> // <lastBuildDate>Mon, 06 Feb 2017 08:21:52 +0000</lastBuildDate>
// <managingEditor>me@janedoe.com (Jane Doe)</managingEditor> // <managingEditor>me@janedoe.com (Jane Doe)</managingEditor>
// <pubDate>Sat, 04 Feb 2017 08:21:52 +0000</pubDate> // <pubDate>Sat, 04 Feb 2017 08:21:52 +0000</pubDate>
// <image> // <image>
// <url>http://janedoe.com/i.jpg</url> // <url>http://janedoe.com/i.jpg</url>
// <title>eduncan911 Podcasts</title> // <title>arenzana Podcasts</title>
// <link>http://eduncan911.com/</link> // <link>http://arenzana.org/</link>
// </image> // </image>
// <itunes:author>me@janedoe.com (Jane Doe)</itunes:author> // <itunes:author>me@janedoe.com (Jane Doe)</itunes:author>
// <itunes:summary><![CDATA[A very cool podcast with a long summary using Bytes()! // <itunes:summary><![CDATA[A very cool podcast with a long summary using Bytes()!

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/eduncan911/podcast module github.com/arenzana/podcast
go 1.13 go 1.13

View File

@ -3,7 +3,7 @@ package podcast_test
import ( import (
"testing" "testing"
"github.com/eduncan911/podcast" "github.com/arenzana/podcast"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -36,6 +36,7 @@ type Podcast struct {
SkipDays string `xml:"skipDays,omitempty"` SkipDays string `xml:"skipDays,omitempty"`
TTL int `xml:"ttl,omitempty"` TTL int `xml:"ttl,omitempty"`
WebMaster string `xml:"webMaster,omitempty"` WebMaster string `xml:"webMaster,omitempty"`
Email string `xml:"email,omitempty"`
Image *Image Image *Image
TextInput *TextInput TextInput *TextInput
AtomLink *AtomLink AtomLink *AtomLink
@ -52,8 +53,8 @@ type Podcast struct {
INewFeedURL string `xml:"itunes:new-feed-url,omitempty"` INewFeedURL string `xml:"itunes:new-feed-url,omitempty"`
IOwner *Author // Author is formatted for itunes as-is IOwner *Author // Author is formatted for itunes as-is
ICategories []*ICategory ICategories []*ICategory
IType string `xml:"itunes:type,omitempty"` IType string `xml:"itunes:type,omitempty"`
Items []*Item Items []*Item
encode func(w io.Writer, o interface{}) error encode func(w io.Writer, o interface{}) error
} }
@ -72,7 +73,7 @@ func New(title, link, description string,
PubDate: parseDateRFC1123Z(pubDate), PubDate: parseDateRFC1123Z(pubDate),
LastBuildDate: parseDateRFC1123Z(lastBuildDate), LastBuildDate: parseDateRFC1123Z(lastBuildDate),
Language: "es-es", Language: "es-es",
IType: "episodic", IType: "episodic",
// setup dependency (could inject later) // setup dependency (could inject later)
encode: encoder, encode: encoder,
} }
@ -331,9 +332,9 @@ func (p *Podcast) AddItem(i Item) (int, error) {
//if episode number is not passed; we will just increase the items by one //if episode number is not passed; we will just increase the items by one
if i.IEpisode == 0 && p.IType == "episodic" { if i.IEpisode == 0 && p.IType == "episodic" {
i.IEpisode = len(p.Items) + 1 i.IEpisode = len(p.Items) + 1
} }
return len(p.Items), nil return len(p.Items), nil
} }
@ -393,7 +394,7 @@ func (p *Podcast) AddIType(iType string) {
if len(iType) == 0 { if len(iType) == 0 {
return return
} }
if iType == "serial" { if iType == "serial" {
p.IType = "serial" p.IType = "serial"
return return

View File

@ -5,7 +5,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/eduncan911/podcast" "github.com/arenzana/podcast"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )