file

package
v0.0.0-...-f263fae Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAudio

func IsAudio(path string) bool

True if the given file path is an audio file

func IsBook

func IsBook(path string) bool

True if the given file path is a book

func IsMedia

func IsMedia(path string) bool

Returns true if the path is to an audio, video or book file.

func IsMovie

func IsMovie(path string) bool

True if the given file path looks like a movie

func IsMusic

func IsMusic(path string) bool

True if the given file path looks like an music file

func IsTV

func IsTV(path string) bool

True if the given file path is a TV show

func IsVideo

func IsVideo(path string) bool

True if the given file path is a video

func MediaType

func MediaType(path string) string

For the given path, returns one of the available types ('video', 'tv', 'movie', 'audio', 'music' or 'book'), or ” (if none of the above).

func MimeType

func MimeType(path string) string

MediaType takes a path and returns the type of media associated with it. If the file isn't any known media type, an empty string is returned.

Types

type Audio

type Audio struct {
	File
	Duration string
}

Holds data related to an audio file

type Book

type Book struct {
	File
	Title  string
	Author string
	Date   string
	Series string
}

Holds data related to an eBook

type File

type File struct {
	Path      string
	MimeType  string
	MediaType string
	Error     error
}

func New

func New(path string) *File

Constructs a new File

type Movie

type Movie struct {
	Video
	Title  string
	Year   string
	TMDBID string
}

Holds data related to a Movie file

type Music

type Music struct {
	Audio
	Artist string
	Album  string
	Title  string
	Disc   string
	Number string
	MBID   string
}

Holds data related to a Music file

type TV

type TV struct {
	Video
	Title  string
	Show   string
	Season string
	Number string
	Year   string
	TVDBID string
	TMDBID string
}

Holds data related to a TV file

type Video

type Video struct {
	File
	Duration string
}

Holds data related to a video file

Jump to

Keyboard shortcuts

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