add support for subsonic podcast api

This commit is contained in:
Alex McGrath
2021-02-03 20:38:01 +00:00
committed by Senan Kelly
parent ce96b9f6fa
commit 9c4286b0e2
21 changed files with 2011 additions and 1000 deletions

View File

@@ -0,0 +1,29 @@
package podcasts
import (
"os"
"testing"
"time"
"github.com/mmcdole/gofeed"
)
func TestGetMoreRecentEpisodes(t *testing.T) {
fp := gofeed.NewParser()
newFile, err := os.Open("testdata/rss.new")
if err != nil {
t.Fatal(err)
}
newFeed, err := fp.Parse(newFile)
if err != nil {
t.Fatal(err)
}
after, err := time.Parse(time.RFC1123, "Mon, 27 Jun 2016 06:33:43 +0000")
if err != nil {
t.Fatal(err)
}
entries := getEntriesAfterDate(newFeed.Items, after)
if len(entries) != 2 {
t.Errorf("Expected 2 entries, got %d", len(entries))
}
}