headless

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartServer

func StartServer(m *ui.SafeModel, dbusMessageChan *chan types.DBusMessage)

Types

type AddTrackToQueue

type AddTrackToQueue struct {
	Track types.PlaylistTrackObject `json:"track"`
	Index int                       `json:"index"`
}

type PlayRequestBodyType

type PlayRequestBodyType struct {
	TrackID string `json:"trackID"`
	//this is a flag that whether the user skips the track or not
	// b/c during cache mode if the skip we need to remove the track from the cache to prevent saving it b/c it may not be fully downloaded
	IsSkip bool   `json:"isSkip"`
	Queue  *Queue `json:"queue"`
}

type Queue

type Queue struct {
	Tracks       []*types.PlaylistTrackObject `json:"tracks"`
	CurrentIndex int                          `json:"currentIndex"`
}

func NewMusicQueue

func NewMusicQueue() *Queue

func (*Queue) AddTrack

func (h *Queue) AddTrack(track *types.PlaylistTrackObject, index int)

func (*Queue) RemoveTrack

func (h *Queue) RemoveTrack(index int)

type RemoveTrackFromQueue

type RemoveTrackFromQueue struct {
	Track types.PlaylistTrackObject `json:"track"`
}

type SSEMessage

type SSEMessage struct {
	Player *struct {
		IsPlaying     bool    `json:"isPlaying"`
		CurrentIndex  int     `json:"currentIndex"`
		SecondsPlayed float64 `json:"secondsPlayed"`
	} `json:"player,omitempty"`
	YtDlp *struct {
		Message string            `json:"message"`
		LogType youtube.YtDlpLogs `json:"logType"`
	} `json:"ytDlp,omitempty"`
}

type TracksResponse

type TracksResponse struct {
	Tracks []*types.PlaylistTrackObject `json:"tracks"`
}

type TracksType

type TracksType string
const (
	PlaylistType   TracksType = "playlist"
	FollowedArtist TracksType = "followed_artist"
	LikedSongs     TracksType = "saved_tracks"
	AlbumTracks    TracksType = "album_tracks"
)

type UserLibrary

type UserLibrary struct {
	Playlist           []types.Playlist `json:"playlist"`
	UserFollowedArtist []types.Artist   `json:"artist"`
	Album              []types.Album    `json:"album"`
}

Jump to

Keyboard shortcuts

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