Skip to content

Commit

Permalink
Merge pull request ivandotv#78 from antoniovlx/geolocation_response
Browse files Browse the repository at this point in the history
Adding geolocation in response. Class types Station and StationRespon…
  • Loading branch information
ivandotv committed Mar 4, 2022
2 parents 649f476 + db84633 commit d42bf2e
Show file tree
Hide file tree
Showing 16 changed files with 31,258 additions and 69 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ type Station = {
clickTimestamp: Date // The time of the last click recorded for this stream
clickCount: number // Clicks within the last 24 hours
clickTrend: number // The difference of the clickcounts within the last 2 days. Positive values mean an increase, negative a decrease of clicks.
geoLat: number // Latitude on earth where the stream is located. Undefined if it doesn't exist.
geoLong: number // Longitude on earth where the stream is located. Undefined if it doesn't exist.
}
```
Expand Down
3 changes: 1 addition & 2 deletions docs/api/radio-browser-api.radiobrowserapi._constructor_.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ Creates an instance of radio browser api.
<b>Signature:</b>

```typescript
constructor(fetchImpl: typeof fetch, appName: string, hideBroken?: boolean);
constructor(appName: string, hideBroken?: boolean);
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| fetchImpl | typeof fetch | Fetch API |
| appName | string | App name to be used as user agent header to indentify the calls to the API |
| hideBroken | boolean | Hide broken stations for all future API calls |

2 changes: 1 addition & 1 deletion docs/api/radio-browser-api.radiobrowserapi.baseurl.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
protected baseUrl: string;
protected baseUrl: string | undefined;
```
4 changes: 2 additions & 2 deletions docs/api/radio-browser-api.radiobrowserapi.getbaseurl.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Get current base url
<b>Signature:</b>

```typescript
getBaseUrl(): string;
getBaseUrl(): string | undefined;
```
<b>Returns:</b>

string
string \| undefined

Base url

2 changes: 1 addition & 1 deletion docs/api/radio-browser-api.radiobrowserapi.hidebroken.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
hideBroken: boolean;
protected hideBroken: boolean;
```
8 changes: 4 additions & 4 deletions docs/api/radio-browser-api.radiobrowserapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ export declare class RadioBrowserApi

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(fetchImpl, appName, hideBroken)](./radio-browser-api.radiobrowserapi._constructor_.md) | | Creates an instance of radio browser api. |
| [(constructor)(appName, hideBroken)](./radio-browser-api.radiobrowserapi._constructor_.md) | | Creates an instance of radio browser api. |

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [appName](./radio-browser-api.radiobrowserapi.appname.md) | | string | |
| [baseUrl](./radio-browser-api.radiobrowserapi.baseurl.md) | | string | |
| [baseUrl](./radio-browser-api.radiobrowserapi.baseurl.md) | | string \| undefined | |
| [fetchConfig](./radio-browser-api.radiobrowserapi.fetchconfig.md) | | RequestInit | |
| [fetchImpl](./radio-browser-api.radiobrowserapi.fetchimpl.md) | | typeof fetch | |
| [hideBroken](./radio-browser-api.radiobrowserapi.hidebroken.md) | | boolean | |
| [version](./radio-browser-api.radiobrowserapi.version.md) | <code>static</code> | string | |

## Methods

Expand All @@ -49,7 +49,7 @@ export declare class RadioBrowserApi
| [getStationsByVotes(limit, fetchConfig)](./radio-browser-api.radiobrowserapi.getstationsbyvotes.md) | | Gets stations by votes. Returns most voted stations |
| [getTags(tag, query, fetchConfig)](./radio-browser-api.radiobrowserapi.gettags.md) | | Gets all available tags |
| [normalizeStations(stations, removeDuplicates)](./radio-browser-api.radiobrowserapi.normalizestations.md) | | Normalizes stations from the API response |
| [resolveBaseUrl(autoSet, config)](./radio-browser-api.radiobrowserapi.resolvebaseurl.md) | | Resolves API base url |
| [resolveBaseUrl(config)](./radio-browser-api.radiobrowserapi.resolvebaseurl.md) | | Resolves API base url this will be the default for all class instances. |
| [resolveGetStations(endPoint, limit, fetchConfig)](./radio-browser-api.radiobrowserapi.resolvegetstations.md) | | |
| [runRequest(url, fetchConfig)](./radio-browser-api.radiobrowserapi.runrequest.md) | | Fires of the request to the API |
| [searchStations(query, fetchConfig, removeDuplicates)](./radio-browser-api.radiobrowserapi.searchstations.md) | | Searches stations by particular params |
Expand Down
5 changes: 2 additions & 3 deletions docs/api/radio-browser-api.radiobrowserapi.resolvebaseurl.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

## RadioBrowserApi.resolveBaseUrl() method

Resolves API base url
Resolves API base url this will be the default for all class instances.

<b>Signature:</b>

```typescript
resolveBaseUrl(autoSet?: boolean, config?: RequestInit): Promise<{
resolveBaseUrl(config?: RequestInit): Promise<{
ip: string;
name: string;
}[]>;
Expand All @@ -19,7 +19,6 @@ resolveBaseUrl(autoSet?: boolean, config?: RequestInit): Promise<{

| Parameter | Type | Description |
| --- | --- | --- |
| autoSet | boolean | Automatically set first resolved base url |
| config | RequestInit | Fetch configuration |

<b>Returns:</b>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [radio-browser-api](./radio-browser-api.md) &gt; [RadioBrowserApi](./radio-browser-api.radiobrowserapi.md) &gt; [fetchImpl](./radio-browser-api.radiobrowserapi.fetchimpl.md)
[Home](./index.md) &gt; [radio-browser-api](./radio-browser-api.md) &gt; [RadioBrowserApi](./radio-browser-api.radiobrowserapi.md) &gt; [version](./radio-browser-api.radiobrowserapi.version.md)

## RadioBrowserApi.fetchImpl property
## RadioBrowserApi.version property

<b>Signature:</b>

```typescript
protected fetchImpl: typeof fetch;
static version: string;
```
2 changes: 2 additions & 0 deletions docs/api/radio-browser-api.station.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ export declare type Station = {
clickTimestamp: Date;
clickCount: number;
clickTrend: number;
geoLat?: number;
geoLong?: number;
};
```
2 changes: 2 additions & 0 deletions docs/api/radio-browser-api.stationresponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ export declare type StationResponse = {
clicktimestamp: string;
clickcount: number;
clicktrend: number;
geo_lat?: number;
geo_long?: number;
};
```
2 changes: 1 addition & 1 deletion docs/api/radio-browser-api.stationsearchtype.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ StationSearchType: {
readonly byState: "byState";
readonly byStateExact: "byStateExact";
readonly byLanguage: "byLanguage";
readonly byLanguageExact: "byLanguageexact";
readonly byLanguageExact: "byLanguageExact";
readonly byTag: "byTag";
readonly byTagExact: "byTagExact";
}
Expand Down
Loading

0 comments on commit d42bf2e

Please sign in to comment.