tagname

package
v0.0.0-...-9f5860f Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CheckNone = iota - 1
	CheckNormal
	CheckStrict
	CheckDeep

	CheckDeepNormal = CheckDeep | CheckNormal
	CheckDeepStrict = CheckDeep | CheckStrict
)

-

Variables

View Source
var ErrTagnameIsNil = fmt.Errorf("Tagname object is <nil>")

Functions

func CheckTags

func CheckTags(tags *TTags) error

func GatherATag

func GatherATag(info *ffinfo.File) (string, error)

GatherATag -

func GatherExtension

func GatherExtension(info *ffinfo.File) (string, error)

GatherExtension -

func GatherSDHD

func GatherSDHD(info *ffinfo.File) (string, error)

GatherSDHD -

func GatherSTag

func GatherSTag(info *ffinfo.File) (string, error)

GatherSTag -

func GatherSizeTag

func GatherSizeTag(info *ffinfo.File) (string, error)

GatherSizeTag -

func HMSMSToSeconds

func HMSMSToSeconds(hhmmssms string) float64

HMSMSToSeconds - converts timecode (H:M:S.MS) to seconds float64 (S.MS).

func RegisterSchema

func RegisterSchema(name string, schema *TSchema)

RegisterSchema - parameter name is caseinsensitive

func Schemas

func Schemas() []string

Schemas -

func ToString

func ToString(tags *TTags, schemaName string) (string, error)

ToString -

Types

type TAudio

type TAudio struct {
	Language string
	Channels int
}

TAudio -

type TFormat

type TFormat struct {
	Sar       string
	Audio     []TAudio
	Subtitle  []string
	Quality   int
	CacheType int
	Sbs       bool
	// contains filtered or unexported fields
}

TFormat -

type TQuality

type TQuality struct {
	Quality    int
	Widescreen bool
	CacheType  int
}

TQuality -

type TResolution

type TResolution struct {
	W, H int
}

TResolution -

func (TResolution) String

func (o TResolution) String() string

type TSchema

type TSchema struct {

	// MustHaveByType          []string
	// NonUniqueByType         []string // can be placed multiple times
	// Valid                   []string
	// ValidByType             []string // if empty then any tag is valid
	// Invalid                 []string
	// InvalidByType           []string
	ToStringHeadOrderByType []string
	ToStringTailOrderByType []string
	// ReadFilter              func(typ, val string) (string, string, error)
	// WriteFilter             func(typ, val string) (string, string, error)
	UnmarshallFilter func(in, out *TTags, typ, val string, firstRun bool) error
	MarshallFilter   func(in, out *TTags, typ, val string, firstRun bool) error
	// contains filtered or unexported fields
}

TSchema -

func Schema

func Schema(name string) (*TSchema, error)

Schema -

type TScript

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

func NewScript

func NewScript(src string) (*TScript, error)

func (*TScript) Run

func (o *TScript) Run(arg string) ([]*TTagname, error)

type TTagname

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

TTagname -

func NewFromFilename

func NewFromFilename(path string, isDeepCheck bool, schemaNames ...string) (*TTagname, error)

NewFromFilename -

func NewFromString

func NewFromString(dir string, str string, isDeepCheck bool, schemaNames ...string) (*TTagname, error)

NewFromString -

func (*TTagname) AddTag

func (o *TTagname) AddTag(typ string, val string)

AddTag -

func (*TTagname) Check

func (o *TTagname) Check(isDeepCheck bool) error

Check -

func (*TTagname) ConvertTo

func (o *TTagname) ConvertTo(schemaName string) (string, error)

ConvertTo -

func (*TTagname) Describe

func (o *TTagname) Describe() (*TFormat, error)

Describe -

func (*TTagname) FFInfo

func (o *TTagname) FFInfo() (*ffinfo.File, error)

FFInfo -

func (*TTagname) GatherATag

func (o *TTagname) GatherATag() (string, error)

GatherATag -

func (*TTagname) GatherExtension

func (o *TTagname) GatherExtension() (string, error)

GatherExtension -

func (*TTagname) GatherSDHD

func (o *TTagname) GatherSDHD() (string, error)

GatherSDHD -

func (*TTagname) GatherSTag

func (o *TTagname) GatherSTag() (string, error)

GatherSTag -

func (*TTagname) GatherSizeTag

func (o *TTagname) GatherSizeTag() (string, error)

GatherSizeTag -

func (*TTagname) GetAudio

func (o *TTagname) GetAudio() ([]TAudio, error)

GetAudio -

func (*TTagname) GetFormat

func (o *TTagname) GetFormat() (string, error)

GetFormat -

func (*TTagname) GetQuality

func (o *TTagname) GetQuality() (*TQuality, error)

GetQuality -

func (*TTagname) GetSubtitle

func (o *TTagname) GetSubtitle() ([]string, error)

GetSubtitle -

func (*TTagname) GetTag

func (o *TTagname) GetTag(typ string) (string, error)

GetTag -

func (*TTagname) GetTags

func (o *TTagname) GetTags(typ string) []string

GetTags -

func (*TTagname) GetType

func (o *TTagname) GetType() (string, error)

GetType -

func (*TTagname) Len

func (o *TTagname) Len() int

Len -

func (*TTagname) ListTags

func (o *TTagname) ListTags() []string

ListTags -

func (*TTagname) RemoveHash

func (o *TTagname) RemoveHash()

RemoveHash -

func (*TTagname) RemoveTags

func (o *TTagname) RemoveTags(typ string)

RemoveTags -

func (*TTagname) RtimgCheck

func (o *TTagname) RtimgCheck(filepath string) error

RtimgCheck -

func (*TTagname) RtimgStrip

func (o *TTagname) RtimgStrip(filepath string) error

RtimgStrip -

func (*TTagname) Schema

func (o *TTagname) Schema() string

Schema -

func (*TTagname) SetSource

func (o *TTagname) SetSource(path string)

func (*TTagname) SetTag

func (o *TTagname) SetTag(typ string, val string)

SetTag -

func (*TTagname) Source

func (o *TTagname) Source() string

Source -

func (*TTagname) State

func (o *TTagname) State() error

State -

type TTags

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

TTags -

func NewTags

func NewTags(tree *ptool.TNode, parser *ptool.TParser, schema *TSchema) (*TTags, error)

NewTags -

func Parse

func Parse(s string, schemaName string) (*TTags, error)

Parse -

func TranslateTags

func TranslateTags(srcTags *TTags, fnFilter func(in, out *TTags, typ, val string, done bool) error) (*TTags, error)

TranslateTags -

func (*TTags) AddTag

func (o *TTags) AddTag(typ, val string)

AddTag -

func (*TTags) GetTag

func (o *TTags) GetTag(typ string) (string, error)

GetTag -

func (*TTags) GetTags

func (o *TTags) GetTags(typ string) []string

GetTags -

func (*TTags) MustHave

func (o *TTags) MustHave(args ...string) error

MustHave -

func (*TTags) MustNotHave

func (o *TTags) MustNotHave(args ...string) error

MustNotHave -

func (*TTags) RemoveTags

func (o *TTags) RemoveTags(typ string)

RemoveTags -

func (*TTags) State

func (o *TTags) State() error

State -

type Tag

type Tag struct {
	Type  *string
	Value *string
}

Tag - nil means any value

Jump to

Keyboard shortcuts

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