model

package
v0.0.0-...-0d50a59 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyFilePath = errors.New("file path cannot be empty")
)

Functions

This section is empty.

Types

type Episode

type Episode struct {
	// contains filtered or unexported fields
}

Holds information about an episode such as its index and subtitles.

func (Episode) Basename

func (f Episode) Basename() string

func (Episode) Extension

func (f Episode) Extension() string

func (Episode) FilePath

func (f Episode) FilePath() string

func (*Episode) FullName

func (e *Episode) FullName() string

func (Episode) ID

func (f Episode) ID() uuid.UUID

func (*Episode) Index

func (e *Episode) Index() int

func (*Episode) Name

func (e *Episode) Name() string

func (*Episode) Season

func (e *Episode) Season() *Season

func (Episode) SetFilePath

func (f Episode) SetFilePath(path string)

func (Episode) Subtitles

func (f Episode) Subtitles(languages ...string) map[string]string

type File

type File struct {
	// contains filtered or unexported fields
}

func Files

func Files(wd string, extensions []string, recursive bool) ([]*File, error)

Lists files in given folder.

Result can be filtered by extensions.

func (File) Basename

func (f File) Basename() string

func (File) Extension

func (f File) Extension() string

func (File) FilePath

func (f File) FilePath() string

func (File) FullName

func (f File) FullName() string

func (File) ID

func (f File) ID() uuid.UUID

func (File) Name

func (f File) Name() string

func (File) SetFilePath

func (f File) SetFilePath(path string)

func (File) Subtitles

func (f File) Subtitles(languages ...string) map[string]string

type Kind

type Kind string
const (
	KindAnime  Kind = "anime"
	KindMovie  Kind = "movie"
	KindTVShow Kind = "tvshow"
)

func (Kind) String

func (k Kind) String() string

type MediaFile

type MediaFile interface {
	Basename() string
	Extension() string
	FilePath() string
	FullName() string
	ID() uuid.UUID
	Name() string
	SetFilePath(path string)
	Subtitles(languages ...string) map[string]string
}

type Movie

type Movie struct {
	// contains filtered or unexported fields
}

Holds information about a file parsed as a movie such as its title and year.

func Movies

func Movies(wd string, extensions []string, recursive bool) ([]*Movie, error)

Lists movies in given folder.

Result can be filtered by extensions.

func (Movie) Basename

func (f Movie) Basename() string

func (Movie) Extension

func (f Movie) Extension() string

func (Movie) FilePath

func (f Movie) FilePath() string

func (*Movie) FullName

func (m *Movie) FullName() string

func (Movie) ID

func (f Movie) ID() uuid.UUID

func (*Movie) Name

func (m *Movie) Name() string

func (Movie) SetFilePath

func (f Movie) SetFilePath(path string)

func (*Movie) SetName

func (m *Movie) SetName(name string)

func (*Movie) SetYear

func (m *Movie) SetYear(year int)

func (Movie) Subtitles

func (f Movie) Subtitles(languages ...string) map[string]string

func (*Movie) Year

func (m *Movie) Year() int

type Season

type Season struct {
	// contains filtered or unexported fields
}

Holds information about a season such as its index and episodes.

func (*Season) Episodes

func (s *Season) Episodes() []*Episode

func (*Season) Index

func (s *Season) Index() int

func (*Season) Name

func (s *Season) Name() string

func (*Season) Show

func (s *Season) Show() *Show

type Show

type Show struct {
	// contains filtered or unexported fields
}

Holds information about a show such as its name and seasons.

func Shows

func Shows(wd string, extensions []string, recursive bool, subtitleExtension string, subtitleLangs []string, anyFiles bool) ([]*Show, error)

func (*Show) EpisodesCount

func (s *Show) EpisodesCount() int

func (*Show) Name

func (s *Show) Name() string

func (*Show) Seasons

func (s *Show) Seasons() []*Season

func (*Show) SeasonsCount

func (s *Show) SeasonsCount() int

func (*Show) SetName

func (s *Show) SetName(name string)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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