models

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YoutubeVideoRefSource  = "youtube"
	AppleDevVideoRefSource = "apple-dev"
)
View Source
const (
	ManualOriginType   = "manual"
	FeedItemOriginType = "feed-item"
)
View Source
const (
	FeedTypeYoutubeChannel  = "youtube-channel"
	FeedTypeYoutubePlaylist = "youtube-playlist"
	FeedTypeAppleDev        = "apple-dev"
)
View Source
const (
	ChronologicalFeedItemOrdering = "pub-desc"
	AlphabeticalFeedItemOrdering  = "title-asc"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadOptions

type DownloadOptions struct {
	// TargetDir returns the directory the video is to be downloaded to.
	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"`
	Ordering        string    `req:"ordering"`
	CheckForUpdates bool      `req:"check_for_updates"`
	CreatedAt       time.Time
	LastUpdatedAt   time.Time
}

func (Feed) Validate

func (f Feed) Validate() error

type FeedHints added in v0.0.10

type FeedHints struct {
	Ordering        string
	CheckForUpdates bool
}

type FeedItem

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

type FeedItemFilter added in v0.0.5

type FeedItemFilter struct {
	ContainKeyword []string
	Ordering       string
}

func ParseFeedItemFilter added in v0.0.5

func ParseFeedItemFilter(queryString string) FeedItemFilter

type FetchedFeedItem added in v0.0.10

type FetchedFeedItem struct {
	VideoRef    VideoRef
	Title       string
	Description string
	Link        string
	Published   time.Time
}

FetchedFeedItem is a feed item fetched from a RSS source

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 LogMessage added in v0.0.10

type LogMessage struct {
	Message  string
	Permille int           // Download in per-mille (or -1 if none)
	ETA      time.Duration // ETA (or -1 if not availabe)
}

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
	Downloaded  bool
}

type Rule added in v0.0.9

type Rule struct {
	ID        uuid.UUID     `storm:"unique"`
	Name      string        `req:"name"`
	Active    bool          `req:"active,zero"`
	Condition RuleCondition `req:"condition"`
	Action    RuleAction    `req:"action"`
}

type RuleAction added in v0.0.9

type RuleAction struct {
	Download       bool `req:"download,zero"`
	MarkFavourite  bool `req:"markFavourite,zero"`
	MarkDownloaded bool `req:"markDownloaded,zero"`
}

func (RuleAction) Combine added in v0.0.9

func (a RuleAction) Combine(b RuleAction) RuleAction

type RuleCondition added in v0.0.9

type RuleCondition struct {
	FeedID      uuid.UUID `req:"feedId"`
	Title       string    `req:"title"`
	Description string    `req:"description"`
}

func (RuleCondition) Matches added in v0.0.9

func (rs RuleCondition) Matches(target RuleTarget) bool

type RuleTarget added in v0.0.9

type RuleTarget struct {
	FeedID      uuid.UUID
	Title       string
	Description string
}

type RuleWithDescription added in v0.0.9

type RuleWithDescription struct {
	Rule
	Description string
}

type SavedVideo

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

type Video

type Video struct {
	VideoRef     VideoRef
	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)

func (VideoRef) String added in v0.0.10

func (vr VideoRef) String() string

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