utils

package
v0.0.0-...-3e47a36 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AV

type AV struct {
	Url    string `xml:"url,attr"`
	Type   string `xml:"type,attr"`
	Length string `xml:"length,attr"`
}

func (AV) SmartType

func (av AV) SmartType() string

type Channel

type Channel struct {
	FeedURL struct {
		Href string `xml:"href,attr"`
	} `xml:"atom link"`
	Title       string `xml:"title"`
	Description string `xml:"description"`
	Language    string `xml:"language"`
	Link        string `xml:"_ link"`
	Copyright   string `xml:"copyright"`
	Image       Image  `xml:"image"`
	Items       []Item `xml:"item"`
}

func ParseFeed

func ParseFeed(xmlSource string) (Channel, error)

func ParseFile

func ParseFile(path string) (Channel, error)

type Collection

type Collection struct {
	Channel  string
	Episodes []Item
}

type Image

type Image struct {
	Link  string `xml:"link"`
	Url   string `xml:"url"`
	Title string `xml:"title"`
}

type Item

type Item struct {
	Title       string `xml:"title"`
	PubDate     string `xml:"pubDate"`
	Guid        string `xml:"guid"`
	Duration    string `xml:"duration"`
	Explicit    string `xml:"explicit"`
	Subtitle    string `xml:"subtitle"`
	Description string `xml:"description"`
	Link        string `xml:"link"`
	AV          AV     `xml:"enclosure"`
}

func (Item) FileName

func (item Item) FileName() string

type Store

type Store struct {
	RootFolder string
	FeedName   string
}

func (Store) Add

func (s Store) Add(link string) error

func (Store) ChannelList

func (s Store) ChannelList() ([]string, error)

func (Store) Clear

func (s Store) Clear(channel string) error

func (Store) ClearAll

func (s Store) ClearAll() error

func (Store) DownloadedEpisodeList

func (s Store) DownloadedEpisodeList(channel string) ([]Item, error)

func (Store) FindChannel

func (s Store) FindChannel(search string) (result string, options []string, err error)

func (Store) GetEpisode

func (s Store) GetEpisode(channel string, index int, overwrite bool) (string, error)

func (Store) Refresh

func (s Store) Refresh(title string) ([]Item, error)

func (Store) RefreshAll

func (s Store) RefreshAll() ([]Collection, error)

func (Store) Remove

func (s Store) Remove(channel string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL