Source kind is now declared per-file via a `dvd` / `bluray` / `webdl` / `tvrip` token in the basename (case-insensitive, word-bounded). Matches the existing `tt…` / `tvm…` filename convention. When no token is present, falls back to the pixel-count guess in DetectMediaType, which still only chooses between DVD and Blu-ray. The parsed media type drives both ORIGINAL_MEDIA_TYPE in the muxed metadata and the CRF/preset profile used for encoding. EncodingConfig gains `webdl` and `tvrip` sub-blocks with conservative defaults (WebDL 30/3, TVRip 32/2); user can override in config.yaml. Manual updated with the new tokens, config fields, and pipeline description.
70 lines
1.4 KiB
Go
70 lines
1.4 KiB
Go
package types
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type MediaType string
|
|
|
|
const (
|
|
MediaTypeDVD MediaType = "DVD"
|
|
MediaTypeBluRay MediaType = "Blu-ray"
|
|
MediaTypeWebDL MediaType = "WebDL"
|
|
MediaTypeTVRip MediaType = "TVRip"
|
|
)
|
|
|
|
type Job struct {
|
|
InputPath string
|
|
OutputPath string
|
|
MediaType MediaType
|
|
Metadata *Metadata
|
|
CRF int
|
|
Preset int
|
|
DeleteOrigin bool
|
|
}
|
|
|
|
type Metadata struct {
|
|
Title string
|
|
Collection string
|
|
Season string
|
|
Episode string
|
|
DateReleased string
|
|
IMDBID string
|
|
TVMazeID string
|
|
OriginalMedia MediaType
|
|
IsSeries bool
|
|
}
|
|
|
|
type Config struct {
|
|
OMDBAPIKey string `yaml:"omdb_api_key"`
|
|
Encoding EncodingConfig
|
|
Paths PathsConfig
|
|
}
|
|
|
|
type EncodingConfig struct {
|
|
DVD EncodingParams `yaml:"dvd"`
|
|
Bluray EncodingParams `yaml:"bluray"`
|
|
WebDL EncodingParams `yaml:"webdl"`
|
|
TVRip EncodingParams `yaml:"tvrip"`
|
|
}
|
|
|
|
type EncodingParams struct {
|
|
CRF int `yaml:"crf"`
|
|
Preset int `yaml:"preset"`
|
|
}
|
|
|
|
type PathsConfig struct {
|
|
Input string `yaml:"input"`
|
|
Output string `yaml:"output"`
|
|
Originals string `yaml:"originals"`
|
|
Failed string `yaml:"failed"`
|
|
}
|
|
|
|
type LogEntry struct {
|
|
Timestamp time.Time `json:"timestamp"`
|
|
Level string `json:"level"`
|
|
Message string `json:"message"`
|
|
File string `json:"file,omitempty"`
|
|
Error string `json:"error,omitempty"`
|
|
}
|