objects

package
v0.0.0-...-23e2505 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package objects provides the data types that represent the various, eh, "things" we want to, uh, "represent". Like, videos, actors/actresses, directors/directors? (directices?), genres, series, seasons, ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	ID       int64
	FolderID int64
	Path     string
	Title    string
	Year     int64
	Hidden   bool
}

File represents a simple video file.

func (*File) DisplayTitle

func (f *File) DisplayTitle() string

DisplayTitle returns the File's Title, or its basename, if the Title is not set.

func (*File) Size

func (f *File) Size() int64

type Folder

type Folder struct {
	ID       int64
	Path     string
	LastScan time.Time
}

Folder represents the root of a directory tree that is scanned for Files.

func (*Folder) IsKnown

func (f *Folder) IsKnown() bool

IsKnown returns true if the Folder's timestamp from the most recent scan is not the epoch, i.e. if the Folder has been scanned before.

type Link struct {
	ID          int64
	URL         *url.URL
	Title       string
	Description string
}

Link represents a URL, along with a human-readable title and an optional description, that can be attached to a Person or a File.

func (*Link) DisplayTitle

func (l *Link) DisplayTitle() string

DisplayTitle returns the Link's Title if it is non-empty, otherwise the URL itself.

type Person

type Person struct {
	ID       int64
	Name     string
	Birthday time.Time
}

Person is ... a Person that can be linked to File as a Director or Actor/Actress.

func (*Person) BDayString

func (p *Person) BDayString() string

BDayString returns the Person's birthday as an ISO 8601-formatted string.

type Tag

type Tag struct {
	ID   int64
	Name string
}

Tag is a ... tag that can be attached to videos. Duh.

type TagList

type TagList []Tag

TagList is a helper type to sort Tags by Name.

func (TagList) Len

func (tl TagList) Len() int

func (TagList) Less

func (tl TagList) Less(i, j int) bool

func (TagList) Swap

func (tl TagList) Swap(i, j int)

Jump to

Keyboard shortcuts

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