sharedutil

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlbumIDOrEmptyStr added in v0.10.0

func AlbumIDOrEmptyStr(track *mediaprovider.Track) string

func FilterMapSlice added in v0.10.0

func FilterMapSlice[T any, U any](ts []T, f func(T) (U, bool)) []U

func FilterSlice

func FilterSlice[T any](ss []T, test func(T) bool) []T

func FindMediaItemByID added in v0.11.0

func FindMediaItemByID(id string, items []mediaprovider.MediaItem) mediaprovider.MediaItem

func FindTrackByID

func FindTrackByID(id string, tracks []*mediaprovider.Track) *mediaprovider.Track

func MapSlice

func MapSlice[T any, U any](ts []T, f func(T) U) []U

func MediaItemIDOrEmptyStr added in v0.11.0

func MediaItemIDOrEmptyStr(item mediaprovider.MediaItem) string

func ReorderItems added in v0.11.0

func ReorderItems[T any](items []T, idxToMove []int, insertIdx int) []T

Reorder items and return a new track slice. idxToMove must contain only valid indexes into tracks, and no repeats

func Reversed

func Reversed[T any](ts []T) []T

func ToSet added in v0.3.1

func ToSet[T comparable](ts []T) map[T]struct{}

func TracksToIDs

func TracksToIDs(tracks []*mediaprovider.Track) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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