sharedutil

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: GPL-3.0 Imports: 3 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 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 ReorderTracks

func ReorderTracks(tracks []*mediaprovider.Track, idxToMove []int, op TrackReorderOp) []*mediaprovider.Track

Reorder tracks 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 TrackIDOrEmptyStr

func TrackIDOrEmptyStr(track *mediaprovider.Track) string

func TracksToIDs

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

Types

type TrackReorderOp

type TrackReorderOp int
const (
	MoveToTop TrackReorderOp = iota
	MoveToBottom
	MoveUp
	MoveDown
)

Jump to

Keyboard shortcuts

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