Skip to content

Latest commit

 

History

History
1284 lines (676 loc) · 22.8 KB

API.md

File metadata and controls

1284 lines (676 loc) · 22.8 KB

better-lautfm

better-lautfm

Table of contents

Classes

Interfaces

Classes

better-lautfm / Station

Class: Station

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Station(name)

constructor for the station

Parameters
Name Type Description
name string name of the station
Defined in

station/Station.ts:62

Properties

active

Optional active: boolean

Defined in

station/Station.ts:46


color

Optional color: string

Defined in

station/Station.ts:42


currentPlaylist

Optional currentPlaylist: Playlist

Defined in

station/Station.ts:53


description

Optional description: string

Defined in

station/Station.ts:36


displayName

Optional displayName: string

Defined in

station/Station.ts:34


djs

Optional djs: string

Defined in

station/Station.ts:38


genres

Optional genres: string[]

Defined in

station/Station.ts:50


location

Optional location: string

Defined in

station/Station.ts:40


name

name: string

Defined in

station/Station.ts:32


nextPlaylist

Optional nextPlaylist: Playlist

Defined in

station/Station.ts:55


position

Optional position: number

Defined in

station/Station.ts:48


updatedAt

Optional updatedAt: Date

Defined in

station/Station.ts:44

Accessors

pageUrl

get pageUrl(): string

get station page url

Returns

string

Defined in

station/Station.ts:117


streamUrl

get streamUrl(): string

get station stream url (including subdomain)

Returns

string

Defined in

station/Station.ts:125

Methods

fetch

fetch(): Promise<undefined | Station>

fetch the data of the station

throws {Error} station does not exist

Returns

Promise<undefined | Station>

Defined in

station/Station.ts:96


getCurrentTrack

getCurrentTrack(): Promise<Track>

get current track

Returns

Promise<Track>

Defined in

station/Station.ts:147


getHistory

getHistory(): Promise<Track[]>

get last 10 tracks

Returns

Promise<Track[]>

Defined in

station/Station.ts:133


getListenerCount

getListenerCount(): Promise<number>

get the count of currently listening people

Returns

Promise<number>

Defined in

station/Station.ts:172


getNextArtists

getNextArtists(): Promise<Artist[]>

get next 3 artists

Returns

Promise<Artist[]>

Defined in

station/Station.ts:161


getPlaylists

getPlaylists(): Promise<Playlist[]>

get all playlists with their airtimes

Returns

Promise<Playlist[]>

Defined in

station/Station.ts:183


getSchedule

getSchedule(): Promise<Playlist[][]>

return format schedule of station

Returns

Promise<Playlist[][]>

Defined in

station/Station.ts:234


build

Static build(options): Station

factory for Station

Parameters
Name Type
options Record<string, unknown>
Returns

Station

Defined in

station/Station.ts:71

better-lautfm / default

Class: default

Table of contents

Constructors

Methods

Constructors

constructor

new default()

Methods

getAllLiveStations

Static getAllLiveStations(): Promise<Station[]>

get all live stations at the moment

Returns

Promise<Station[]>

Defined in

core/LautFM.ts:210


getAllStationNames

Static getAllStationNames(): Promise<string[]>

get a list of all known names of stations

Returns

Promise<string[]>

Defined in

core/LautFM.ts:201


getAvailableGenres

Static getAvailableGenres(): Promise<LautFMGenre[]>

get a list of all known genres

Returns

Promise<LautFMGenre[]>

Defined in

core/LautFM.ts:192


getListeners

Static getListeners(): Promise<LautFMListeners>

get all listeners from all stations

Returns

Promise<LautFMListeners>

Defined in

core/LautFM.ts:220


getServerTime

Static getServerTime(): Promise<Date>

get current serverTime

Returns

Promise<Date>

Defined in

core/LautFM.ts:105


getStartingLetters

Static getStartingLetters(): Promise<string[]>

get all available starting letters of station

Returns

Promise<string[]>

Defined in

core/LautFM.ts:183


getStatus

Static getStatus(): Promise<LautFMStatus>

get server status

Returns

Promise<LautFMStatus>

Defined in

core/LautFM.ts:115


isServerRunning

Static isServerRunning(): Promise<boolean>

get running state of api

Returns

Promise<boolean>

Defined in

core/LautFM.ts:125


searchStations

Static searchStations(searchOptions): Promise<LautFMSearchResult>

execute lautFM search query

Parameters
Name Type Description
searchOptions LautFMSearchOptions the options
Returns

Promise<LautFMSearchResult>

Defined in

core/LautFM.ts:136

Interfaces

better-lautfm / Airtime

Interface: Airtime

declaration for airtime

param day shortcut

param hour of start

param hour of end

Table of contents

Properties

Properties

day

day: "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun"

Defined in

station/interface.ts:113


endTime

endTime: number

Defined in

station/interface.ts:115


hour

hour: number

Defined in

station/interface.ts:114

better-lautfm / Artist

Interface: Artist

declaration for formatted artists

param name of artist

param internal lautFM id

param url to personal page

param url to lautFM page

param image of artist

param thumbnail of artist

Table of contents

Properties

Properties

image

Optional image: string

Defined in

station/interface.ts:72


lautId

Optional lautId: number

Defined in

station/interface.ts:69


lautUrl

Optional lautUrl: string

Defined in

station/interface.ts:71


name

name: string

Defined in

station/interface.ts:68


thumb

Optional thumb: string

Defined in

station/interface.ts:73


url

Optional url: string

Defined in

station/interface.ts:70

better-lautfm / LautFMAPISearchResult

Interface: LautFMAPISearchResult

declaration of direct api response

param categories matching query, for further information visit https://api.laut.fm/documentation/search (german documentation)

param number of total results in this categories

param matching stations / stationNames

Table of contents

Properties

Properties

categories

categories: string[]

Defined in

core/LautFM.ts:65


items

items: Station[] | string[]

Defined in

core/LautFM.ts:67


total

total: number

Defined in

core/LautFM.ts:66

better-lautfm / LautFMGenre

Interface: LautFMGenre

genre like we get it from /genres

Table of contents

Properties

Properties

name

name: string

name of the genre

Defined in

core/LautFM.ts:87


related

related: string[]

list of related genre names

Defined in

core/LautFM.ts:91


score

score: number

score of the genre

Defined in

core/LautFM.ts:89

better-lautfm / LautFMSearchOptions

Interface: LautFMSearchOptions

declaration of search options

param max length of result

param the value to search for

param toggle station fetch (server side, not our fetch)

param offset of the results

Table of contents

Properties

Properties

limit

Optional limit: number

Defined in

core/LautFM.ts:51


offset

Optional offset: number

Defined in

core/LautFM.ts:54


onlyStationNames

Optional onlyStationNames: boolean

Defined in

core/LautFM.ts:53


query

query: string

Defined in

core/LautFM.ts:52

better-lautfm / LautFMSearchResult

Interface: LautFMSearchResult

declaration of our formatted response

param matching stations / stationNames

param total matched Stations (not 100% exact because of duplicates)

Table of contents

Properties

Properties

result

result: Station[] | string[]

Defined in

core/LautFM.ts:77


totalCount

totalCount: number

Defined in

core/LautFM.ts:78

better-lautfm / LautFMStatus

Interface: LautFMStatus

declaration of status object

param running state

param description of status

Table of contents

Properties

Properties

message

message: string

Defined in

core/LautFM.ts:38


running

running: boolean

Defined in

core/LautFM.ts:37

better-lautfm / Playlist

Interface: Playlist

declaration for formatted Playlists

param lautFM intern number

param name of the playlist

param shortcut of day

param starting hour of playlist

param ending hour of playlist

param description of playlist

param hex color

param length in seconds

param is playlist shuffled

param starting timestamp

param ending timestamp

param

Table of contents

Properties

Properties

airtimes

Optional airtimes: Airtime[]

Defined in

station/interface.ts:54


color

color: string

Defined in

station/interface.ts:49


day

Optional day: string

Defined in

station/interface.ts:45


description

description: string

Defined in

station/interface.ts:48


endTime

Optional endTime: number

Defined in

station/interface.ts:47


endsAt

Optional endsAt: Date

Defined in

station/interface.ts:53


hour

Optional hour: number

Defined in

station/interface.ts:46


id

id: number

Defined in

station/interface.ts:43


length

length: number

Defined in

station/interface.ts:50


name

name: string

Defined in

station/interface.ts:44


shuffled

shuffled: boolean

Defined in

station/interface.ts:51


startsAt

Optional startsAt: Date

Defined in

station/interface.ts:52

better-lautfm / Track

Interface: Track

declaration of formatted track

param internal lautID

param type of track (for Example: 'Jingle' or 'Song')

param

param

param length of track in seconds

param genre of track

param year of release

param inserted into playlist timestamp

param start timestamp

param end timestamp

param

Table of contents

Properties

Properties

album

album: string

Defined in

station/interface.ts:95


artist

artist: Artist

Defined in

station/interface.ts:102


createdAt

createdAt: Date

Defined in

station/interface.ts:99


endsAt

endsAt: Date

Defined in

station/interface.ts:101


genre

genre: string

Defined in

station/interface.ts:97


id

id: number

Defined in

station/interface.ts:92


length

length: number

Defined in

station/interface.ts:96


releaseyear

releaseyear: number

Defined in

station/interface.ts:98


startedAt

startedAt: Date

Defined in

station/interface.ts:100


title

title: string

Defined in

station/interface.ts:94


type

type: string

Defined in

station/interface.ts:93