Documentation ¶
Index ¶
- func AppendJobLog(message string)
- func ClearFolderContent(source string) error
- func ClearJobLogs(newJobName string)
- func GetJobName() string
- func IsDirectoryExists(path string) bool
- func MoveFile(source, destination string) error
- func SanitizeMovieFilename(filename string) (string, string)
- func SanitizeTVShowFilename(filename string) (string, int, int)
- type AtomicMovieList
- type AtomicTVEpisodeList
- type AudioData
- type Category
- type JobLog
- type Media
- type MediaClient
- type MediaData
- type Movie
- type MovieFile
- type SubtitleData
- type TVEpisode
- type TVShowFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendJobLog ¶
func AppendJobLog(message string)
func ClearFolderContent ¶
func ClearJobLogs ¶
func ClearJobLogs(newJobName string)
func GetJobName ¶
func GetJobName() string
func IsDirectoryExists ¶
func SanitizeMovieFilename ¶
SanitizeMovieFilename sanitize a movie filename by removing non ASCII characters, removing non-relevant information, returning the name and the year
Types ¶
type AtomicMovieList ¶
type AtomicMovieList struct {
// contains filtered or unexported fields
}
func NewAtomicMovieList ¶
func NewAtomicMovieList() *AtomicMovieList
func (*AtomicMovieList) GetAll ¶
func (a *AtomicMovieList) GetAll() map[MovieFile]Movie
func (*AtomicMovieList) LinkMediaFile ¶
func (a *AtomicMovieList) LinkMediaFile(mediaFile MovieFile, media Movie)
type AtomicTVEpisodeList ¶
type AtomicTVEpisodeList struct {
// contains filtered or unexported fields
}
func NewAtomicTVEpisodeList ¶
func NewAtomicTVEpisodeList() *AtomicTVEpisodeList
func (*AtomicTVEpisodeList) Get ¶
func (a *AtomicTVEpisodeList) Get(mediaFile TVShowFile) (TVEpisode, bool)
func (*AtomicTVEpisodeList) GetAll ¶
func (a *AtomicTVEpisodeList) GetAll() map[TVShowFile]TVEpisode
func (*AtomicTVEpisodeList) LinkMediaFile ¶
func (a *AtomicTVEpisodeList) LinkMediaFile(mediaFile TVShowFile, media TVEpisode)
type AudioData ¶
type AudioData struct { Codec string // The codec used to encode the audio (e.g. AAC, MP3, etc) Language string // The language of the audio stream (e.g. English, Spanish, etc) Bitrate float64 // The bitrate of the audio stream in bits per second }
AudioData is a struct that holds information about an audio stream
type JobLog ¶
type JobLog struct { JobName string `json:"jobName" example:"upload movie"` Date string `json:"date" example:"2021-01-01 12:00:00"` Message string `json:"message" example:"Uploading movie test.mp4"` }
func GetJobLogs ¶
func GetJobLogs() []JobLog
func PopJobLogs ¶
func PopJobLogs() []JobLog
type MediaClient ¶
type MediaClient interface { SearchMovie(query string, year string) (Movie, error) SearchTVShow(query string, season, episode int) (TVEpisode, error) }
func NewMediaClient ¶
func NewMediaClient(apiKey string) MediaClient
func NewRedisMediaClient ¶
func NewRedisMediaClient(apiKey, redisHost, redisPassword string) MediaClient
type MediaData ¶
type MediaData struct { Size float64 // The size of the media file in bytes Duration float64 // The duration of the media file in seconds Codec string // The codec used to encode the video (e.g. H.264, H.265, etc) Mimetype string // File MIME Type Audios []AudioData // An array of AudioData structs representing the audio streams in the media file Subtitles []SubtitleData // An array of SubtitleData structs representing the subtitle streams in the media file }
MediaData is a struct that holds information about a media file
func RetrieveMediaData ¶
RetrieveMediaData retrieves media data from a file using ffprobe
type MovieFile ¶
type MovieFile struct { Path string Filename string SanitizedName string Year string Extension string }
func BuildMovieTree ¶
type SubtitleData ¶
type SubtitleData struct { Language string // The language of the subtitle stream (e.g. English, Spanish, etc) Codec string // The codec used to encode the subtitles (e.g. SRT, ASS, etc) }
SubtitleData is a struct that holds information about a subtitle stream
type TVEpisode ¶
type TVShowFile ¶
type TVShowFile struct { Path string SanitizedName string Season int Episode int Filename string Extension string }
func BuildTVShowTree ¶
func BuildTVShowTree(source string) ([]TVShowFile, error)
BuildTVShowTree recursively builds a tree of TV show files in the given source directory.
func (TVShowFile) String ¶
func (t TVShowFile) String() string
Click to show internal directories.
Click to hide internal directories.