source

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package source provides interfaces and types for media file scanning and processing. It handles the discovery and analysis of media files (movies and TV shows) within directory structures, preparing them for renaming operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Entry    fs.DirEntry
	Error    error
	Info     parser.Info
	Path     string
	Response provider.Response
}

Node represents a single file or directory rename operation. It contains the original path, the file info and metadata retrieved from providers.

func Scan

func Scan(path string, providers []provider.Interface, o Options) ([]Node, error)

Scan is a convenience function that creates a generic source scanner and performs a scan operation with the given parameters. It returns a list of nodes representing potential rename operations.

type Options

type Options struct {
	ExcludeGlob string // A glob pattern to exclude files or directories
	// TODO: add setting to prefer file name preference over parent directories when finding a match
	Recursive bool // Whether to scan directories recursively
	MinDepth  int  // Minimum directory depth to process
	MaxDepth  int  // Maximum directory depth to process
	// TODO: might be an options just for renaming and not sourcing
	SkipDirectories bool // Whether to skip processing directories themselves
}

Options configures the behavior of source scanning operations.

type Source

type Source interface {
	// Scan processes the given path using the provided metadata providers and options,
	// returning a list of nodes that represent potential rename operations.
	Scan(string, []provider.Interface, Options) ([]Node, error)
}

Source defines the interface for media source scanners. Implementations of this interface can scan directory structures to identify media files and generate rename operations based on metadata providers.

Directories

Path Synopsis
Package language provides language detection capabilities for media files and directories.
Package language provides language detection capabilities for media files and directories.

Jump to

Keyboard shortcuts

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