model

package
v0.0.0-...-8dea4bf Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFormat        = FormatVideo
	DefaultQuality       = QualityHigh
	DefaultPageSize      = 50
	DefaultUpdatePeriod  = 6 * time.Hour
	DefaultLogMaxSize    = 50 // megabytes
	DefaultLogMaxAge     = 30 // days
	DefaultLogMaxBackups = 7
	PathRegex            = `^[A-Za-z0-9]+$`
)
View Source
const (
	QualityHigh = Quality("high")
	QualityLow  = Quality("low")
)
View Source
const (
	FormatAudio  = Format("audio")
	FormatVideo  = Format("video")
	FormatCustom = Format("custom")
)
View Source
const (
	SortingDesc = Sorting("desc")
	SortingAsc  = Sorting("asc")
)
View Source
const (
	EpisodeNew        = EpisodeStatus("new")        // New episode received via API
	EpisodeDownloaded = EpisodeStatus("downloaded") // Downloaded, encoded and available for download
	EpisodeError      = EpisodeStatus("error")      // Could not download, will retry
	EpisodeCleaned    = EpisodeStatus("cleaned")    // Downloaded and later removed from disk due to update strategy
)
View Source
const (
	TypeChannel  = Type("channel")
	TypePlaylist = Type("playlist")
	TypeUser     = Type("user")
	TypeGroup    = Type("group")
)
View Source
const (
	ProviderYoutube    = Provider("youtube")
	ProviderVimeo      = Provider("vimeo")
	ProviderSoundcloud = Provider("soundcloud")
)

Variables

View Source
var (
	ErrAlreadyExists = errors.New("object already exists")
	ErrNotFound      = errors.New("not found")
	ErrQuotaExceeded = errors.New("query limit is exceeded")
)

Functions

This section is empty.

Types

type Episode

type Episode struct {
	// ID of episode
	ID          string        `json:"id"`
	Title       string        `json:"title"`
	Description string        `json:"description"`
	Thumbnail   string        `json:"thumbnail"`
	Duration    int64         `json:"duration"`
	VideoURL    string        `json:"video_url"`
	PubDate     time.Time     `json:"pub_date"`
	Size        int64         `json:"size"`
	Order       string        `json:"order"`
	Status      EpisodeStatus `json:"status"` // Disk status
}

type EpisodeStatus

type EpisodeStatus string

type Feed

type Feed struct {
	ID              string     `json:"feed_id"`
	ItemID          string     `json:"item_id"`
	LinkType        Type       `json:"link_type"` // Either group, channel or user
	Provider        Provider   `json:"provider"`  // Youtube or Vimeo
	CreatedAt       time.Time  `json:"created_at"`
	LastAccess      time.Time  `json:"last_access"`
	ExpirationTime  time.Time  `json:"expiration_time"`
	Format          Format     `json:"format"`
	Quality         Quality    `json:"quality"`
	CoverArtQuality Quality    `json:"cover_art_quality"`
	PageSize        int        `json:"page_size"`
	CoverArt        string     `json:"cover_art"`
	Title           string     `json:"title"`
	Description     string     `json:"description"`
	PubDate         time.Time  `json:"pub_date"`
	Author          string     `json:"author"`
	ItemURL         string     `json:"item_url"` // Platform specific URL
	Episodes        []*Episode `json:"-"`        // Array of episodes
	UpdatedAt       time.Time  `json:"updated_at"`
	PlaylistSort    Sorting    `json:"playlist_sort"`
	PrivateFeed     bool       `json:"private_feed"`
}

type Format

type Format string

Format to convert episode when downloading episodes

type Info

type Info struct {
	LinkType Type     // Either group, channel or user
	Provider Provider // Youtube, Vimeo, or SoundCloud
	ItemID   string
}

Info represents data extracted from URL

type Provider

type Provider string

type Quality

type Quality string

Quality to use when downloading episodes

type Sorting

type Sorting string

Playlist sorting style

type Type

type Type string

Jump to

Keyboard shortcuts

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