models

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FeedTypeYoutubeChannel  = "youtube-channel"
	FeedTypeYoutubePlaylist = "youtube-playlist"
)
View Source
const ExtIDPrefixYoutube = "yt:"

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadOptions

type DownloadOptions struct {
	YoutubeID string
	TargetDir string
}

type DownloadStatus

type DownloadStatus int
const (
	StatusUnknown DownloadStatus = iota
	StatusNotDownloaded
	StatusDownloaded
	StatusMissing
)

func (DownloadStatus) String

func (ds DownloadStatus) String() string

type Feed

type Feed struct {
	ID            uuid.UUID `storm:"id"`
	Name          string    `req:"name"`
	Type          string    `req:"type"`
	ExtID         string    `req:"ext_id"`
	TargetDir     string    `req:"target_dir"`
	CreatedAt     time.Time
	LastUpdatedAt time.Time
}

func (Feed) Validate

func (f Feed) Validate() error

type FeedItem

type FeedItem struct {
	ID        uuid.UUID `storm:"id"`
	EntryID   string    `storm:"unique"`
	FeedID    uuid.UUID `storm:"index"`
	VideoID   string
	Title     string
	Link      string
	Published time.Time
	Favourite bool `storm:"index"`
}

type FeedItemFilter added in v0.0.5

type FeedItemFilter struct {
	ContainKeyword []string
	Favourites     bool
}

func ParseFeedItemFilter added in v0.0.5

func ParseFeedItemFilter(queryString string) FeedItemFilter

type Job

type Job struct {
	ID          uuid.UUID `storm:"unique"`
	CreatedAt   time.Time `storm:"index"`
	CompletedAt time.Time
	Name        string
	VideoExtID  string
	VideoTitle  string
	State       jobs.JobState
	Progress    Progress
	Updates     []JobUpdate
	Error       string
}

func (Job) LastMessage

func (j Job) LastMessage() string

func (*Job) SetLastUpdate

func (j *Job) SetLastUpdate(update JobUpdate)

type JobUpdate

type JobUpdate struct {
	Message string
}

type Metadata

type Metadata struct {
	Title        string
	Description  string
	ThumbnailURL string
	UploadTime   time.Time
	Duration     int
}

type Progress

type Progress struct {
	Percent float64
	Size    string
	Rate    string
	ETA     string
}

func ParseProgress

func ParseProgress(message string) (Progress, bool)

type RecentFeedItem

type RecentFeedItem struct {
	FeedItem FeedItem
	Feed     Feed
}

type SavedVideo

type SavedVideo struct {
	ID       uuid.UUID `storm:"id"`
	ExtID    string    `storm:"unique"`
	Title    string
	FeedID   uuid.UUID
	Source   string
	SavedOn  time.Time
	Location string
	FileSize int64
}

type Video

type Video struct {
	ExtID        string
	ChannelID    string
	ChannelName  string
	Title        string
	Description  string
	ThumbnailURL string
	UploadedOn   time.Time
	Duration     int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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