feat: add top-artists report

This commit is contained in:
Julian Tölle 2020-05-31 23:26:06 +02:00
parent 6a6ba493f6
commit 6fc10c40ca
18 changed files with 345 additions and 30 deletions

View file

@ -0,0 +1,7 @@
import { SpotifyInfo } from "./spotify-info";
export interface Album {
id: string;
name: string;
spotify?: SpotifyInfo;
}

View file

@ -0,0 +1,7 @@
import { SpotifyInfo } from "./spotify-info";
export interface Artist {
id: string;
name: string;
spotify?: SpotifyInfo;
}

View file

@ -1,32 +1,7 @@
import { Track } from "./track";
export interface Listen {
id: string;
playedAt: string;
track: Track;
}
interface Track {
id: string;
name: string;
album: Album;
artists: Artist[];
spotify?: SpotifyInfo;
}
interface Album {
id: string;
name: string;
spotify?: SpotifyInfo;
}
interface Artist {
id: string;
name: string;
spotify?: SpotifyInfo;
}
interface SpotifyInfo {
id: string;
uri: string;
type: string;
href: string;
}

View file

@ -0,0 +1,6 @@
export interface SpotifyInfo {
id: string;
uri: string;
type: string;
href: string;
}

View file

@ -0,0 +1,9 @@
export enum TimePreset {
LAST_7_DAYS = "last_7_days",
LAST_30_DAYS = "last_30_days",
LAST_90_DAYS = "last_90_days",
LAST_180_DAYS = "last_180_days",
LAST_365_DAYS = "last_365_days",
ALL_TIME = "all_time",
CUSTOM = "custom",
}

View file

@ -0,0 +1,6 @@
import { Artist } from "./artist";
export interface TopArtistsItem {
artist: Artist;
count: number;
}

View file

@ -0,0 +1,7 @@
import { TimePreset } from "./time-preset.enum";
export interface TopArtistsOptions {
timePreset: TimePreset;
customTimeStart: Date;
customTimeEnd: Date;
}

View file

@ -0,0 +1,11 @@
import { Album } from "./album";
import { Artist } from "./artist";
import { SpotifyInfo } from "./spotify-info";
export interface Track {
id: string;
name: string;
album: Album;
artists: Artist[];
spotify?: SpotifyInfo;
}