internal

package
v0.0.0-...-85325a9 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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'),
}
View Source
var NoBorders = &tview.BoxBorders{}

Functions

func CapitalizeArtist

func CapitalizeArtist(s string) string

func Caser

func Caser(s string) string

func CleanAlbumName

func CleanAlbumName(s string) string

CleanAlbumName removes all tview style tags and album year annotations that are suffixed to the album name.

func CleanTrackName

func CleanTrackName(n string) string

CleanTrackName removes prefixes such as track numbers.

func CreateHelpScreen

func CreateHelpScreen(listen func(event *tcell.EventKey) *tcell.EventKey) *tview.Modal

This is a library help screen TODO: bind to Library

func EscapeStyleTag

func EscapeStyleTag(s string) string

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 ExtractAlbumYear(y string) (int, error)

func ExtractYearFromPath

func ExtractYearFromPath(path string) (int, error)

ExtractYearFromPath extracts a 4-digit year from a file path, e.g. [2002] or (2002)

func FormatDuration

func FormatDuration(d int) string

func HackAlbumYear

func HackAlbumYear(key string) (int, error)

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

func JWSimilarity(s1, s2 string) float64

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 Log

func Log(data ...interface{}) error

func RemoveAccents

func RemoveAccents(s string) string

RemoveAccents strips accent marks from a Unicode string.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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