Documentation
¶
Index ¶
- Variables
- func CapitalizeArtist(s string) string
- func Caser(s string) string
- func CleanAlbumName(s string) string
- func CleanTrackName(n string) string
- func CreateHelpScreen(listen func(event *tcell.EventKey) *tcell.EventKey) *tview.Modal
- func EscapeStyleTag(s string) string
- func ExtractAlbumYear(y string) (int, error)
- func ExtractYearFromPath(path string) (int, error)
- func FormatDuration(d int) string
- func HackAlbumYear(key string) (int, error)
- func JWSimilarity(s1, s2 string) float64
- func Log(data ...interface{}) error
- func RemoveAccents(s string) string
Constants ¶
This section is empty.
Variables ¶
var CustomBorders = &tview.BoxBorders{ HorizontalFocus: rune('\u2500'), Horizontal: rune('\u2500'), VerticalFocus: rune('\u2502'), Vertical: rune('\u2502'), TopRightFocus: rune('\u2510'), TopRight: rune('\u2510'), TopLeftFocus: rune('\u250C'), TopLeft: rune('\u250C'), BottomRightFocus: rune('\u2518'), BottomRight: rune('\u2518'), BottomLeftFocus: rune('\u2514'), BottomLeft: rune('\u2514'), }
var NoBorders = &tview.BoxBorders{}
Functions ¶
func CapitalizeArtist ¶
func CleanAlbumName ¶
CleanAlbumName removes all tview style tags and album year annotations that are suffixed to the album name.
func CleanTrackName ¶
CleanTrackName removes prefixes such as track numbers.
func CreateHelpScreen ¶
This is a library help screen TODO: bind to Library
func EscapeStyleTag ¶
EscapeStyleTag disables tview style tagging when, for example, literal square brackets are needed to be printed. In example, album name "Chilombo [clean]" should be printed as is. To enable this, a closing square bracket needs to be prepended by an opening square bracket. This will result in "Chilombo [clean[]".
func ExtractAlbumYear ¶
func ExtractYearFromPath ¶
ExtractYearFromPath extracts a 4-digit year from a file path, e.g. [2002] or (2002)
func FormatDuration ¶
func HackAlbumYear ¶
HackAlbumYear extracts year from ContextMenuKey URL. This function is used as a fallback way of getting album's release year, because the API sometimes doesn't return it. It searches key for substrings such as [2002] or (2002) and used the last occurence of it to extract the year.
func JWSimilarity ¶
JWSimilarity is the implementation of Jaro-Winkler similarity metric It returns 1 if there's a 100% match and 0% if there's no matching characters.
func RemoveAccents ¶
RemoveAccents strips accent marks from a Unicode string.
Types ¶
This section is empty.