renamer

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package renamer provides functionality for renaming media files based on metadata from external providers.

The package supports renaming movies, TV shows, seasons, and episodes by:

  • Scanning source paths for media files
  • Fetching metadata from configured providers
  • Formatting new filenames using customizable formatters
  • Creating organized directory structures
  • Supporting multiple rename modes (symlink, copy)

The renamer handles duplicate detection, path deduplication, and provides detailed logging of all operations. It supports dry-run mode for previewing changes before applying them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	// Destination is the target path for the renamed file
	Destination string
	// Error contains any error encountered while processing this entry
	Error error
	// Source is the original path of the file
	Source string
}

Entry represents a single file rename operation.

type Options

type Options struct {
	// Force enables overwriting existing files at the destination
	Force bool
	// Formatter defines how to format the destination filenames
	Formatter format.Formatter
	// Output specifies the base directory for renamed files
	Output string
	// RenameMode determines how files are renamed ("symlink" or "copy")
	RenameMode string
	// SkipExisting skips renaming if the destination already exists
	SkipExisting bool
	// Write enables actual file operations; false enables dry-run mode
	Write bool
}

Options configures the behavior of the renamer.

type Renamer

type Renamer interface {
	// Run executes the renaming process with the given source options
	Run(source.Options) error
}

Renamer defines the interface for renaming media files based on provider metadata.

func New

func New(paths []string, providers []provider.Interface, o Options) (Renamer, error)

New creates a new Renamer instance with the given paths, providers, and options. It returns an error if no paths or providers are specified.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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