variables

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegexReplace

func RegexReplace(
	regex *regexp.Regexp,
	input, replacement string,
	replaceLimit int,
) string

RegexReplace replaces matched substrings in the input with the replacement. It respects the specified replacement limit. A negative limit indicates that replacement should start from the end of the fileName.

func Replace

func Replace(
	conf *config.Config,
	change *file.Change,
	vars *Variables,
) error

Replace checks if any variables are present in the target filename and delegates the variable replacement to the appropriate function.

Types

type Exif

type Exif struct {
	Latitude              string
	DateTimeOriginal      string
	Make                  string
	Model                 string
	Longitude             string
	Software              string
	LensModel             string
	ImageLength           []int
	ImageWidth            []int
	FNumber               []string
	FocalLength           []string
	FocalLengthIn35mmFilm []int
	PixelYDimension       []int
	PixelXDimension       []int
	ExposureTime          []string
	ISOSpeedRatings       []int
}

Exif represents exif information from an image file.

type ID3

type ID3 struct {
	Format      string
	FileType    string
	Title       string
	Album       string
	Artist      string
	AlbumArtist string
	Genre       string
	Composer    string
	Year        int
	Track       int
	TotalTracks int
	Disc        int
	TotalDiscs  int
}

ID3 represents id3 data from an audio file.

type Variables

type Variables struct {
	// contains filtered or unexported fields
}

func Extract

func Extract(replacement string) (Variables, error)

Extract retrieves all the variables present in the replacement string.

func (*Variables) IndexMatches

func (v *Variables) IndexMatches() int

Jump to

Keyboard shortcuts

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