savers

package
v0.0.0-...-9625bed Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: GPL-3.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanStatus

type CleanStatus struct {
	// Number of songs that are unavailable
	Unavailable int
	// Number of songs that were unavailable but replacement was found
	UnavailableReplaced int
	// Number of duplicates that were removed
	Duplicates int
	// List of possible duplicates that were not removed
	Similar []*SimilarTrack
	// Number of terrible song names that were removed
	Terrible int
}

func (*CleanStatus) String

func (c *CleanStatus) String() string

type SaverJob

type SaverJob struct {
	Playlist           string
	SaverType          string
	AllowChristmasSong bool
}

type SimilarTrack

type SimilarTrack struct {
	Title1        string
	Title2        string
	AvgMatchRatio int
}

type SongSaver

type SongSaver interface {
	// Cleans the playlist
	Clean(ctx context.Context, conf SaverJob) (*CleanStatus, error)

	// Saves song to the playlist. This method should block and return the result of saving.
	Save(ctx context.Context, conf SaverJob, artistTitle string) (*Status, error)
}

func Create

func Create(ctx context.Context, saverType string) (SongSaver, error)

type Status

type Status struct {
	// True if song was added.
	SongAdded bool
	// True if song already existed in the playlsit
	SongExists bool
	// Title of the song found by the saver, empty if not found.
	FoundTitle string
	// Match quality 0-100
	MatchQuality int
}

Jump to

Keyboard shortcuts

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