models

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManualOriginType   = "manual"
	FeedItemOriginType = "feed-item"
)
View Source
const (
	FeedTypeYoutubeChannel  = "youtube-channel"
	FeedTypeYoutubePlaylist = "youtube-playlist"
)
View Source
const ExtIDPrefixYoutube = "yt:"
View Source
const (
	YoutubeVideoRefSource = "youtube"
)

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 Favourite added in v0.0.8

type Favourite struct {
	ID         uuid.UUID       `json:"id" storm:"id"`
	VideoRef   VideoRef        `json:"videoRef" storm:"unique"`
	Origin     FavouriteOrigin `json:"origin" storm:"index"`
	Title      string          `json:"title"`
	Link       string          `json:"link"`
	Published  time.Time       `json:"published"`
	Favourited time.Time       `json:"favourited"`
}

type FavouriteOrigin added in v0.0.8

type FavouriteOrigin struct {
	Type OriginType `json:"type"`
	ID   string     `json:"id"`
}

type FavouriteWithOrigin added in v0.0.8

type FavouriteWithOrigin struct {
	Favourite   Favourite
	OriginTitle string
	OriginURL   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"`
	Title     string
	Link      string
	Published time.Time
}

type FeedItemFilter added in v0.0.5

type FeedItemFilter struct {
	ContainKeyword []string
}

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
	LastUpdate  JobUpdate
	Messages    []string
	Error       string
}

func (Job) LastMessage

func (j Job) LastMessage() string

type JobUpdate

type JobUpdate struct {
	Summary string
	Percent float64
}

type Metadata

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

type OriginType added in v0.0.8

type OriginType string

type RecentFeedItem

type RecentFeedItem struct {
	FeedItem    FeedItem
	Feed        Feed
	FavouriteID string
}

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
}

type VideoRef added in v0.0.8

type VideoRef struct {
	Source VideoRefSource `json:"source"`
	ID     string         `json:"id"`
}

func ParseVideoRef added in v0.0.8

func ParseVideoRef(str string) (VideoRef, error)

type VideoRefSource added in v0.0.8

type VideoRefSource string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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