hmkv

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	System configFileLocation = iota
	User
	WorkingDirectory
)
View Source
const (
	Pending statusValue = iota
	InProgress
	Complete
)

Variables

View Source
var ErrConfigNotFound = errors.New("config file not found")
View Source
var ErrInvalidInput = errors.New("invalid input")
View Source
var ErrTitlesDiscRead = errors.New("cannot read titles from disc")

Functions

func Exec

func Exec(mkv *MakeMKV, hb *HandBrakeCLI, discIds []int) error

Executes the main functionality of the program. Reads the configuration file, reads titles from the disc, prompts the user for which titles they want to rip, and processes the selected titles.

func GetHandBrakeCLIExecutable

func GetHandBrakeCLIExecutable() (string, error)

func GetMakeMKVExecutable

func GetMakeMKVExecutable() (string, error)

func NewDiscError

func NewDiscError(discId int, msg string) error
func PrintLogo()

Prints the application logo

func ReadConfig

func ReadConfig() (*handyMKVConfig, error)

Reads the config file and returns a config struct.

func Setup

func Setup(hb *HandBrakeCLI) error

Prompts the user to create a configuration file.

Types

type DiscError

type DiscError struct {
	DiscId int
	Msg    string
}

func (*DiscError) Error

func (e *DiscError) Error() string

type DiscInfo

type DiscInfo struct {
	Index int
	Name  string
}

type EncodingParams

type EncodingParams struct {
	TitleIndex                  int      `json:"-"`
	DiscId                      int      `json:"-"`
	MKVOutputPath               string   `json:"-"`
	HandBrakeOutputPath         string   `json:"-"`
	Encoder                     string   `json:"encoder,omitempty"`
	EncoderPreset               string   `json:"encoder_preset,omitempty"`
	Quality                     int      `json:"quality,omitempty"`
	SubtitleLanguages           []string `json:"subtitle_languages,omitempty"`
	IncludeAllRelevantSubtitles bool     `json:"include_all_relevant_subtitles,omitempty"`
	AudioLanguages              []string `json:"audio_languages,omitempty"`
	IncludeAllRelevantAudio     bool     `json:"include_all_relevant_audio,omitempty"`
	OutputFileFormat            string   `json:"output_file_format,omitempty"`
	Preset                      string   `json:"handbrake_preset,omitempty"`
	PresetFile                  string   `json:"preset_file,omitempty"`
}

type ExternalProcessError

type ExternalProcessError struct {
	Err          error
	ProcessOuput string
}

func NewExternalProcessError

func NewExternalProcessError(err error, output string) *ExternalProcessError

func (*ExternalProcessError) Error

func (e *ExternalProcessError) Error() string

type HandBrakeCLI

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

func NewHandBrakeCLI

func NewHandBrakeCLI(executable string) *HandBrakeCLI

type HandBrakePreset

type HandBrakePreset struct {
	PresetName string `json:"PresetName"`
	FileFormat string `json:"FileFormat"`
}

type HandBrakePresetFile

type HandBrakePresetFile struct {
	PresetList []HandBrakePreset `json:"PresetList"`
}

type MakeMKV

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

func NewMakeMKV

func NewMakeMKV(executable string) *MakeMKV

func (*MakeMKV) ListDiscs

func (mkv *MakeMKV) ListDiscs() ([]DiscInfo, error)

type TitleInfo

type TitleInfo struct {
	// Index on disc
	Index     int
	DiscTitle string
	DiscId    int
	Chapters  int
	Length    string
	FileSize  string
	FileName  string
	// contains filtered or unexported fields
}

2 - Disc Title 8 - Number of chapters in file 9 - Length of file in seconds 10 - File size (GB) 11 - File size (Bytes) 27 - File name 28 - Audio Short Code 29 - Audio Long Code

func (*TitleInfo) GetEncodingFileName

func (t *TitleInfo) GetEncodingFileName(config *handyMKVConfig) string

func (*TitleInfo) SetPrependDiscToSubdirectory

func (t *TitleInfo) SetPrependDiscToSubdirectory(val bool)

func (*TitleInfo) Subdirectory

func (t *TitleInfo) Subdirectory() string

Jump to

Keyboard shortcuts

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