descrob

package module
v0.0.0-...-9c88522 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2022 License: MIT Imports: 11 Imported by: 0

README

descrob

A less click intensive way to unscrobble tracks from Last.FM. Provides a package to programmatically unscrobble and a TUI app to navigate scrobble history an unscrobble directly from the shell.

Getting started

Still in early stages of development, so only distributed via go toolchain for now.

Requires a Last.FM developer account and an application API key (see here).

go get github.com/Morley93/descrob/...

LASTFM_USERNAME=<username> LASTFM_PASSWORD=<password> LASTFM_API_KEY=<api_key> $GOPATH/bin/descrob

Motivation

After experiencing some double-scrobbles and getting frustrated while dutifully removing them via the web UI, I wanted a way to make selective unscrobbling easier.

The Last.FM API doesn't support unscrobbling tracks, so this tool achieves it by emulating a web session.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LastFMWebClient

type LastFMWebClient struct {
	// contains filtered or unexported fields
}

func NewLastFMWebClient

func NewLastFMWebClient(username, password string) (*LastFMWebClient, error)

func (LastFMWebClient) DeleteTrack

func (c LastFMWebClient) DeleteTrack(track Scrobble) error

type Scrobble

type Scrobble struct {
	Name     string
	Artist   string
	Datetime time.Time
}

type ScrobbleExplorer

type ScrobbleExplorer struct {
	// contains filtered or unexported fields
}

func NewScrobbleExplorer

func NewScrobbleExplorer(username string, sr ScrobbleRetriever, windowSize int) *ScrobbleExplorer

func (*ScrobbleExplorer) BufferNextWindow

func (se *ScrobbleExplorer) BufferNextWindow() error

func (*ScrobbleExplorer) BufferWindows

func (se *ScrobbleExplorer) BufferWindows(windows int) error

func (*ScrobbleExplorer) CurrentPage

func (se *ScrobbleExplorer) CurrentPage() []Scrobble

func (*ScrobbleExplorer) FirstPage

func (se *ScrobbleExplorer) FirstPage() ([]Scrobble, error)

func (*ScrobbleExplorer) NextPage

func (se *ScrobbleExplorer) NextPage() ([]Scrobble, error)

func (*ScrobbleExplorer) PreBufferedWindows

func (se *ScrobbleExplorer) PreBufferedWindows() int

func (*ScrobbleExplorer) PrevPage

func (se *ScrobbleExplorer) PrevPage() []Scrobble

func (*ScrobbleExplorer) Uncache

func (se *ScrobbleExplorer) Uncache(scrobble Scrobble)

type ScrobbleRetriever

type ScrobbleRetriever interface {
	FetchScrobbles(username string, before *time.Time) ([]Scrobble, error)
	PageSize() int
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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