Documentation ¶
Index ¶
- Constants
- Variables
- func AssociateCaptions(ctx context.Context, captionPath string, txnMgr txn.Manager, fqb file.Getter, ...)
- func CleanCaptions(scenePath string, captions []*models.VideoCaption) (cleanedCaptions []*models.VideoCaption, changed bool)
- func GetCaptionPath(path, lang, suffix string) string
- func GetFunscriptPath(path string) string
- func IsLangInCaptions(lang string, ext string, captions []*models.VideoCaption) bool
- func IsValidLanguage(lang string) bool
- func ReadSubs(path string) (*astisub.Subtitles, error)
- type CaptionUpdater
- type Decorator
Constants ¶
View Source
const LangUnknown = "00"
to be used for captions without a language code in the filename ISO 639-1 uses 2 or 3 a-z chars for codes so 00 is a safe non valid choise https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
Variables ¶
View Source
var CaptionExts = []string{"vtt", "srt"} // in a case where vtt and srt files are both provided prioritize vtt file due to native support
Functions ¶
func AssociateCaptions ¶
func AssociateCaptions(ctx context.Context, captionPath string, txnMgr txn.Manager, fqb file.Getter, w CaptionUpdater)
associates captions to scene/s with the same basename
func CleanCaptions ¶
func CleanCaptions(scenePath string, captions []*models.VideoCaption) (cleanedCaptions []*models.VideoCaption, changed bool)
CleanCaptions removes non existent/accessible language codes from captions
func GetCaptionPath ¶
GetCaptionPath generates the path of a caption from a given file path, wanted language and caption sufffix
func GetFunscriptPath ¶
GetFunscriptPath returns the path of a file with the extension changed to .funscript
func IsLangInCaptions ¶
func IsLangInCaptions(lang string, ext string, captions []*models.VideoCaption) bool
IsLangInCaptions returns true if lang is present in the captions
func IsValidLanguage ¶
IsValidLanguage checks whether the given string is a valid ISO 639 language code
Types ¶
type CaptionUpdater ¶
Click to show internal directories.
Click to hide internal directories.