An open API service indexing awesome lists of open source software.

https://github.com/charlypoly/spotifycollector

SpotifyCollector
https://github.com/charlypoly/spotifycollector

Last synced: 5 months ago
JSON representation

SpotifyCollector

Awesome Lists containing this project

README

          

# SpotifyCollector

### Types
```typescript
enum TrackSource {
Playlist
Saved
Recommended
History
Manual
}

interface BaseTrack {
id: string
name: string
uri: string
genres: string[]
}

interface AnalyzedTrack {
popularity: float
danceability: float
duration_ms: float
energy: float
tempo: float
valence: float
acousticness: float
}

interface Track extends BaseTrack, AnalyzedTrack {}

interface UserTrack {
source: TrackSource
track: Track
}

interface WeightedTrack extends UserTrack {
weight: float;
}
```

#### Track weights


source
weight


Manual
5


Recommendations
3


Saved
2


Playlist
1

### Fetcher
```typescript
UserPlaylistTracks(accessToken): UserTrack[]
UserSavedTracks(accessToken): UserTrack[]
UserHistoryTracks(accessToken): UserTrack[]
UserRecommendedTracks(accessToken): UserTrack[]
```

### Transformers
```typescript
UserUniqTracks(UserTrack[]): Set
UserWeightedTracks(UserTrack[] | Set): Set
```