filesystem

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

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

func CopyFile(src, dst string) error

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

func DetectDiscType(ctx context.Context, root string) (string, error)

DetectDiscType scans the path for disc folder markers. It returns "BDMV", "DVD", "HDDVD", or "" when no disc type is found.

func FormatDuration

func FormatDuration(seconds float64) string

FormatDuration converts seconds to HH:MM:SS format for display.

func GatherQueuePaths

func GatherQueuePaths(ctx context.Context, root string) ([]string, error)

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 IsVideoFile(name string) bool

func LimitQueuePaths

func LimitQueuePaths(paths []string, limit int) []string

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

type PlaylistItem struct {
	File string
	Size int64
}

PlaylistItem represents a single file reference within a playlist.

func ParseMPLS

func ParseMPLS(mpslPath string) (float64, []PlaylistItem, error)

ParseMPLS parses an MPLS file and extracts duration and file references. Returns (duration in seconds, []PlaylistItem, error).

type PlaylistItemInfo

type PlaylistItemInfo struct {
	ClipName string
	InTime   uint32
	OutTime  uint32
}

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

func NewValidatorWithLogger

func NewValidatorWithLogger(logger api.Logger) *Validator

func (*Validator) ValidatePaths

func (v *Validator) ValidatePaths(ctx context.Context, paths []string) ([]string, error)

Jump to

Keyboard shortcuts

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