Item-shaped results now omit empty fields and drop low-value metadata (overview, lyrics, file_path, creation_date, premiere_date, bitrate); absent numeric fields drop the key instead of emitting "". Player sessions report hh:mm:ss times only; playlists drop overview/date_created. The lyrics_or_description search parameter is removed, along with the unused DTO fields, and upstream Fields requests are slimmed to match. Module path renamed to git.i3omb.com/gronod/emby-mcp.
26 lines
717 B
Go
26 lines
717 B
Go
// Package textutil provides Unicode-aware text folding used for user-name
|
|
// matching, mirroring Python's unidecode(s).casefold().
|
|
package textutil
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/rainycape/unidecode"
|
|
)
|
|
|
|
// Fold converts s to a lower-cased ASCII approximation, equivalent to
|
|
// Python's unidecode(s.casefold()).
|
|
func Fold(s string) string {
|
|
return unidecode.Unidecode(strings.ToLower(s))
|
|
}
|
|
|
|
// ContainsFold reports whether haystack contains needle after folding both.
|
|
func ContainsFold(haystack, needle string) bool {
|
|
return strings.Contains(Fold(haystack), Fold(needle))
|
|
}
|
|
|
|
// EqualFoldASCII reports whether a and b are equal after folding.
|
|
func EqualFoldASCII(a, b string) bool {
|
|
return Fold(a) == Fold(b)
|
|
}
|