Documentation
¶
Index ¶
- func CollectVideoFiles(ctx context.Context, source string, preferLargest bool) (string, []string, error)
- func CopyFile(src, dst string) error
- func DetectDiscType(ctx context.Context, root string) (string, error)
- func FormatDuration(seconds float64) string
- func GatherQueuePaths(ctx context.Context, root string) ([]string, error)
- func IsVideoFile(name string) bool
- func LimitQueuePaths(paths []string, limit int) []string
- func SourceSize(ctx context.Context, sourcePath, discType string, fileList []string, ...) (int64, error)
- func SupportedVideoExtensions() []string
- type MoviePlaylistHeader
- type PlaylistData
- type PlaylistInfo
- type PlaylistItem
- type PlaylistItemInfo
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectVideoFiles ¶
func CollectVideoFiles(ctx context.Context, source string, preferLargest bool) (string, []string, error)
CollectVideoFiles returns the selected video path and file list for a non-disc source. When preferLargest is true, the selected video is the largest file by size.
func CopyFile ¶
CopyFile copies a file from src to dst. If dst does not exist, it will be created. If dst exists, it will be overwritten.
func DetectDiscType ¶
DetectDiscType scans the path for disc folder markers. It returns "BDMV", "DVD", "HDDVD", or "" when no disc type is found.
func FormatDuration ¶
FormatDuration converts seconds to HH:MM:SS format for display.
func GatherQueuePaths ¶
GatherQueuePaths expands a queue root into first-level upload candidates. Files are included directly; subdirectories are included as single units when they contain video files or disc folder markers.
func IsVideoFile ¶
func LimitQueuePaths ¶
func SourceSize ¶
func SourceSize(ctx context.Context, sourcePath, discType string, fileList []string, videoPath string) (int64, error)
SourceSize returns the total size of the content in bytes. For disc sources, it walks the entire tree; otherwise it sums the file list or video path.
func SupportedVideoExtensions ¶
func SupportedVideoExtensions() []string
Types ¶
type MoviePlaylistHeader ¶
type MoviePlaylistHeader struct {
TypeIndicator string
VersionNumber string
PlaylistStartAddress uint32
PlaylistMarkStartAddress uint32
ExtensionDataStartAddress uint32
}
MoviePlaylistHeader represents the MPLS file header.
type PlaylistData ¶
type PlaylistData struct {
Length uint32
NbPlayItems uint16
NbSubPaths uint16
PlayItems []PlaylistItem
}
PlaylistInfo represents a parsed playlist structure.
type PlaylistInfo ¶
type PlaylistInfo struct {
File string
Duration float64
Items []PlaylistItem
Score float64
Edition string
}
PlaylistInfo represents a discovered playlist file with its metrics and scoring.
func DiscoverPlaylists ¶
func DiscoverPlaylists(ctx context.Context, bdmvRoot string) ([]PlaylistInfo, error)
DiscoverPlaylists discovers and scores all MPLS playlists in a BDMV folder. Returns playlists sorted by score (highest first), or an error if the BDMV directory is invalid.
type PlaylistItem ¶
PlaylistItem represents a single file reference within a playlist.
type PlaylistItemInfo ¶
PlaylistItemInfo represents a single play item in a playlist with timing info.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func NewValidator() *Validator