parse

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Codecs = makeMatcher(codecMap)

Codecs is a list of parseable codecs

View Source
var Qualities = makeMatcher(qualityMap)

Qualities list all possible qualities to parse

View Source
var Sources = makeMatcher(sourceMap)

Sources lists all prossible sources to parse

Functions

func Capitalize

func Capitalize(str string) string

Capitalize returns the string with proper english capitalization

func CleanName

func CleanName(name string) string

CleanName returns the media name cleaned from punctuation

func Codec

func Codec(str string) codec.Tag

Codec returns the codec tag, if found, in a string

func CodecIndex

func CodecIndex(str string) ([]int, codec.Tag)

CodecIndex returns the codec tag and the index in the string

func Duration

func Duration(str string) (time.Duration, error)

Duration takes a textual representation of a duration (e.g. 2h38m) and returns the parsed duration from the time package. An error is returned if the input was invalid (i.e. could not be parsed into a duration)

func Filename

func Filename(filename string) string

Filename returns the filename of the file without extension

func Group

func Group(str string) string

Group parses and returns the release group

func GroupAfter

func GroupAfter(idx int, str string) string

GroupAfter returns the release group of the string only occuring after the position of idx

func GroupIndex

func GroupIndex(str string) ([]int, string)

GroupIndex returns the release group as well as the index for the match

func Identity

func Identity(str string) string

Identity returns a string where special characters are removed. The returned string is suitable for use in an identity string

func Language

func Language(lang string) (language.Tag, error)

Language returns a language taken when given the english word for a language (e.g. english). If the string is not a known language an error is returned

func Miscellaneous

func Miscellaneous(str string) misc.List

Miscellaneous returns a list of miscellaneous media tags from a string

func MiscellaneousIndex

func MiscellaneousIndex(str string) ([]int, misc.List)

MiscellaneousIndex returns all miscellaneous tags with all their indexes

func PhoneticNumber

func PhoneticNumber(num int) string

PhoneticNumber converts an integer into a human readable string

func Quality

func Quality(str string) quality.Tag

Quality returns the quality tag, if found, in the string

func QualityIndex

func QualityIndex(str string) ([]int, quality.Tag)

QualityIndex returns the quality tag and the index in the string

func Source

func Source(str string) source.Tag

Source returns the source tag, if found, in a string

func SourceIndex

func SourceIndex(str string) ([]int, source.Tag)

SourceIndex returns the source tag and the index in the string

func Tags

func Tags(name string) []string

Tags returns a string as tags split by non-word characters

Types

This section is empty.

Jump to

Keyboard shortcuts

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