sorter

package
v0.0.0-...-e7831ac Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClonePlaylist

func ClonePlaylist(
	client spotify.Client,
	sourcePlaylist spotify.ID,
	newName string,
) error

ClonePlaylist will clone the given playlist and name it with the given name

func NoTotoAfrica

func NoTotoAfrica(
	client spotify.Client,
) error

NoTotoAfrica will remove the track toto africa from every single playlist and libary for the given client.

func Purge

func Purge(
	client spotify.Client,
	start time.Time,
	end time.Time,
	pid spotify.ID,
) error

Purge will remove all tracks in a playlist which released outside of the given start and end time

func SortBy

func SortBy(
	client spotify.Client,
	sourcePlaylist spotify.ID,
	sortBy []SortRule,
) error

SortBy will sort the target playlist by the list of sort rykes

Types

type FeatureName

type FeatureName string

FeatureName refer to Val function switch to a complete list

type SortRule

type SortRule struct {
	Name       FeatureName `json:"feature_name"`
	Descending bool        `json:"descending"`
}

SortRule Used to sort a playlist

func (*SortRule) Val

func (r *SortRule) Val(track TrackComplete) (float64, error)

Val returns the value for the rule from the given track

type TrackComplete

type TrackComplete struct {
	spotify.AudioFeatures
	spotify.FullTrack
}

TrackComplete combines audioFeatures and full track data

Jump to

Keyboard shortcuts

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