better-lautfm
- Airtime
- Artist
- LautFMAPISearchResult
- LautFMGenre
- LautFMSearchOptions
- LautFMSearchResult
- LautFMStatus
- Playlist
- Track
better-lautfm / Station
- active
- color
- currentPlaylist
- description
- displayName
- djs
- genres
- location
- name
- nextPlaylist
- position
- updatedAt
• new Station(name
)
constructor for the station
Name | Type | Description |
---|---|---|
name |
string |
name of the station |
• Optional
active: boolean
• Optional
color: string
• Optional
currentPlaylist: Playlist
• Optional
description: string
• Optional
displayName: string
• Optional
djs: string
• Optional
genres: string
[]
• Optional
location: string
• name: string
• Optional
nextPlaylist: Playlist
• Optional
position: number
• Optional
updatedAt: Date
• get
pageUrl(): string
get station page url
string
• get
streamUrl(): string
get station stream url (including subdomain)
string
▸ fetch(): Promise
<undefined
| Station
>
fetch the data of the station
throws
{Error} station does not exist
Promise
<undefined
| Station
>
▸ getCurrentTrack(): Promise
<Track
>
get current track
Promise
<Track
>
▸ getHistory(): Promise
<Track
[]>
get last 10 tracks
Promise
<Track
[]>
▸ getListenerCount(): Promise
<number
>
get the count of currently listening people
Promise
<number
>
▸ getNextArtists(): Promise
<Artist
[]>
get next 3 artists
Promise
<Artist
[]>
▸ getPlaylists(): Promise
<Playlist
[]>
get all playlists with their airtimes
Promise
<Playlist
[]>
▸ getSchedule(): Promise
<Playlist
[][]>
return format schedule of station
Promise
<Playlist
[][]>
▸ Static
build(options
): Station
factory for Station
Name | Type |
---|---|
options |
Record <string , unknown > |
better-lautfm / default
- getAllLiveStations
- getAllStationNames
- getAvailableGenres
- getListeners
- getServerTime
- getStartingLetters
- getStatus
- isServerRunning
- searchStations
• new default()
▸ Static
getAllLiveStations(): Promise
<Station
[]>
get all live stations at the moment
Promise
<Station
[]>
▸ Static
getAllStationNames(): Promise
<string
[]>
get a list of all known names of stations
Promise
<string
[]>
▸ Static
getAvailableGenres(): Promise
<LautFMGenre
[]>
get a list of all known genres
Promise
<LautFMGenre
[]>
▸ Static
getListeners(): Promise
<LautFMListeners
>
get all listeners from all stations
Promise
<LautFMListeners
>
▸ Static
getServerTime(): Promise
<Date
>
get current serverTime
Promise
<Date
>
▸ Static
getStartingLetters(): Promise
<string
[]>
get all available starting letters of station
Promise
<string
[]>
▸ Static
getStatus(): Promise
<LautFMStatus
>
get server status
Promise
<LautFMStatus
>
▸ Static
isServerRunning(): Promise
<boolean
>
get running state of api
Promise
<boolean
>
▸ Static
searchStations(searchOptions
): Promise
<LautFMSearchResult
>
execute lautFM search query
Name | Type | Description |
---|---|---|
searchOptions |
LautFMSearchOptions |
the options |
Promise
<LautFMSearchResult
>
better-lautfm / Airtime
declaration for airtime
param
day shortcut
param
hour of start
param
hour of end
• day: "mon"
| "tue"
| "wed"
| "thu"
| "fri"
| "sat"
| "sun"
• endTime: number
• hour: number
better-lautfm / 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
• Optional
image: string
• Optional
lautId: number
• Optional
lautUrl: string
• name: string
• Optional
thumb: string
• Optional
url: string
better-lautfm / 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
• categories: string
[]
• items: Station
[] | string
[]
• total: number
better-lautfm / LautFMGenre
genre like we get it from /genres
• name: string
name of the genre
• related: string
[]
list of related genre names
• score: number
score of the genre
better-lautfm / 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
• Optional
limit: number
• Optional
offset: number
• Optional
onlyStationNames: boolean
• query: string
better-lautfm / LautFMSearchResult
declaration of our formatted response
param
matching stations / stationNames
param
total matched Stations (not 100% exact because of duplicates)
• result: Station
[] | string
[]
• totalCount: number
better-lautfm / LautFMStatus
declaration of status object
param
running state
param
description of status
• message: string
• running: boolean
better-lautfm / 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
• Optional
airtimes: Airtime
[]
• color: string
• Optional
day: string
• description: string
• Optional
endTime: number
• Optional
endsAt: Date
• Optional
hour: number
• id: number
• length: number
• name: string
• shuffled: boolean
• Optional
startsAt: Date
better-lautfm / 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
• album: string
• artist: Artist
• createdAt: Date
• endsAt: Date
• genre: string
• id: number
• length: number
• releaseyear: number
• startedAt: Date
• title: string
• type: string