models

package
v0.1.1-0...-1792a0a Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const IMVDB_API_HOST = "https://imvdb.com/api/v1"
View Source
const SONG_BPM_API = "https://api.getsongbpm.com"

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	Name    string          `json:"name"`
	Artists []Artist        `json:"artists"`
	ID      spotify.ID      `json:"id"`
	Images  []spotify.Image `json:"images"`
}

type Artist

type Artist struct {
	Name string     `json:"name"`
	ID   spotify.ID `json:"id"`
}

type ExternalAPI

type ExternalAPI struct {
	Spotify   *spotify.Client
	Imvdb     *resty.Client
	SongBPM   *resty.Client
	Firestore *firestore.Client
	YouTube   *youtube.Client
}

func InitializeSources

func InitializeSources() ExternalAPI

func (*ExternalAPI) FindTrack

func (api *ExternalAPI) FindTrack(ctx *gin.Context, artist string, title string) SongFlongTrack

func (*ExternalAPI) GetTrack

func (api *ExternalAPI) GetTrack(ctx *gin.Context, id spotify.ID) (SongFlongTrack, error)

Gets the SongFlongTrack for the given Spotify ID

type MusicVideoID

type MusicVideoID = int // ID used by IMVDB

type SongFlongTrack

type SongFlongTrack struct {
	Track
	Tempo       int               `json:"tempo"`
	ExternalIDs map[string]string `json:"external_ids"`
}

func (*SongFlongTrack) GetYouTubeID

func (track *SongFlongTrack) GetYouTubeID() string

type SourceData

type SourceData struct {
	Sources []struct {
		Source     string `json:"source"`
		SourceData string `json:"source_data"`
	}
}

type Track

type Track struct {
	Artists []Artist   `json:"artists"`
	ID      spotify.ID `json:"id"`
	Name    string     `json:"name"`
	Album   Album      `json:"album"`
}

func MapToTrack

func MapToTrack(track spotify.FullTrack) Track

type VideoSearchResults

type VideoSearchResults struct {
	Results []struct {
		Id int `json:"id"`
	} `json:"results"`
}

type YouTubeID

type YouTubeID = string

Jump to

Keyboard shortcuts

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