https://github.com/charlypoly/spotifycollector
SpotifyCollector
https://github.com/charlypoly/spotifycollector
Last synced: 5 months ago
JSON representation
SpotifyCollector
- Host: GitHub
- URL: https://github.com/charlypoly/spotifycollector
- Owner: charlypoly
- License: mit
- Created: 2017-04-13T11:42:20.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-13T11:55:45.000Z (about 9 years ago)
- Last Synced: 2025-04-07T11:34:04.183Z (about 1 year ago)
- Size: 1.95 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```