common

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPathTemplate = filepath.Join("%AUTHOR%", "%SHORT_TITLE%", "%TITLE%.mp4")
View Source
var SampleBook = audible.Book{
	Title:   "A Basic Book Title: And subtitle",
	Authors: []string{"First Author", "Second Author", "Third Author"},
}

Functions

func CompilePathTemplate

func CompilePathTemplate(t string, subs ...PathTemplateSub) func(b *audible.Book) string

CompilePathTemplate combines given template and PathTemplateSub fns into a fn taking an *audible.Book and returning the destination path

func InitShutdownSignals

func InitShutdownSignals(ctx context.Context) context.Context

func ListDownloadedBooks

func ListDownloadedBooks(dir string) ([]*audible.Book, error)

func WriteInfoFile

func WriteInfoFile(dir string, book *audible.Book) error

Types

type PathTemplateSub

type PathTemplateSub func(p string, b *audible.Book) string

func PathTemplateAuthor

func PathTemplateAuthor(max int, sep string) PathTemplateSub

func PathTemplateShortTitle

func PathTemplateShortTitle() PathTemplateSub

func PathTemplateTitle

func PathTemplateTitle() PathTemplateSub

Jump to

Keyboard shortcuts

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