Documentation ¶
Index ¶
- Constants
- Variables
- func AssociateCaptions(ctx context.Context, captionPath string, txnMgr txn.Manager, ...)
- func CleanCaptions(ctx context.Context, f *models.VideoFile, txnMgr txn.Manager, w CaptionUpdater) error
- 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 models.FileFinder, w CaptionUpdater)
associates captions to scene/s with the same basename
func CleanCaptions ¶
func CleanCaptions(ctx context.Context, f *models.VideoFile, txnMgr txn.Manager, w CaptionUpdater) error
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.