mirror of
https://github.com/apricote/Listory.git
synced 2026-02-07 10:17:02 +00:00
feat(api): fetch listens from spotify
This commit is contained in:
parent
f253a66f86
commit
f2065d3f1f
54 changed files with 1180 additions and 256 deletions
36
src/music-library/album.entity.ts
Normal file
36
src/music-library/album.entity.ts
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
ManyToMany,
|
||||
JoinTable,
|
||||
OneToMany
|
||||
} from "typeorm";
|
||||
import { SpotifyLibraryDetails } from "src/sources/spotify/spotify-library-details.entity";
|
||||
import { Artist } from "./artist.entity";
|
||||
import { Track } from "./track.entity";
|
||||
|
||||
@Entity()
|
||||
export class Album {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@ManyToMany(
|
||||
type => Artist,
|
||||
artist => artist.albums
|
||||
)
|
||||
@JoinTable()
|
||||
artists: Artist[];
|
||||
|
||||
@OneToMany(
|
||||
type => Track,
|
||||
track => track.album
|
||||
)
|
||||
tracks: Track[];
|
||||
|
||||
@Column(type => SpotifyLibraryDetails)
|
||||
spotify: SpotifyLibraryDetails;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue