common

package
v0.0.0-...-f06971b Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Requesting  bool   `json:"requesting"`
	Listeners   int    `json:"listeners"`
	CurrentTime int64  `json:"current"`
	StartTime   int64  `json:"start_time"`
	EndTime     int64  `json:"end_time"`
	NowPlaying  string `json:"np"`
	Thread      string `json:"thread"`
	DJ          struct {
		ID    int    `json:"id"`
		Image string `json:"djimage"`
		Name  string `json:"djname"`
	} `json:"dj"`
	Queue      []Song `json:"queue"`
	LastPlayed []Song `json:"lp"`
}

Data retrieved from the JSON API

type SearchSong

type SearchSong struct {
	ID            int    `json:"id"`
	Requests      int    `json:"requests"`
	LastRequested int64  `json:"lastrequested"`
	LastPlayed    int64  `json:"lastplayed"`
	RequestDelay  int64  `json:"-"`
	Artist        string `json:"artist"`
	Title         string `json:"title"`
}

Song returned by Elastic Search

func (*SearchSong) CalculateRequestDelay

func (s *SearchSong) CalculateRequestDelay()

Calculate request delay and requestability for a song FIXME: For some reason this returns incorrect results on some songs, but not others. Need to investigate.

func (*SearchSong) CanRequest

func (s *SearchSong) CanRequest() bool

Return, if song can be requested

type Song

type Song struct {
	Timestamp int64  `json:"timestamp"`
	Meta      string `json:"meta"`
}

Song-related data

Jump to

Keyboard shortcuts

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