mirror of
https://github.com/apricote/Listory.git
synced 2026-02-07 02:07:03 +00:00
chore(api): update dependencies
This commit is contained in:
parent
05f230a7ce
commit
d881a78757
37 changed files with 4804 additions and 2700 deletions
|
|
@ -4,7 +4,7 @@ import {
|
|||
Column,
|
||||
ManyToMany,
|
||||
JoinTable,
|
||||
OneToMany
|
||||
OneToMany,
|
||||
} from "typeorm";
|
||||
import { SpotifyLibraryDetails } from "src/sources/spotify/spotify-library-details.entity";
|
||||
import { Artist } from "./artist.entity";
|
||||
|
|
@ -18,19 +18,13 @@ export class Album {
|
|||
@Column()
|
||||
name: string;
|
||||
|
||||
@ManyToMany(
|
||||
type => Artist,
|
||||
artist => artist.albums
|
||||
)
|
||||
@ManyToMany((type) => Artist, (artist) => artist.albums)
|
||||
@JoinTable()
|
||||
artists: Artist[];
|
||||
|
||||
@OneToMany(
|
||||
type => Track,
|
||||
track => track.album
|
||||
)
|
||||
@OneToMany((type) => Track, (track) => track.album)
|
||||
tracks: Track[];
|
||||
|
||||
@Column(type => SpotifyLibraryDetails)
|
||||
@Column((type) => SpotifyLibraryDetails)
|
||||
spotify: SpotifyLibraryDetails;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,9 @@ export class Artist {
|
|||
@Column()
|
||||
name: string;
|
||||
|
||||
@ManyToMany(
|
||||
type => Album,
|
||||
album => album.artists
|
||||
)
|
||||
@ManyToMany((type) => Album, (album) => album.artists)
|
||||
albums: Album[];
|
||||
|
||||
@Column(type => SpotifyLibraryDetails)
|
||||
@Column((type) => SpotifyLibraryDetails)
|
||||
spotify: SpotifyLibraryDetails;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ import { TrackRepository } from "./track.repository";
|
|||
TypeOrmModule.forFeature([
|
||||
AlbumRepository,
|
||||
ArtistRepository,
|
||||
TrackRepository
|
||||
])
|
||||
TrackRepository,
|
||||
]),
|
||||
],
|
||||
providers: [MusicLibraryService],
|
||||
exports: [MusicLibraryService]
|
||||
exports: [MusicLibraryService],
|
||||
})
|
||||
export class MusicLibraryModule {}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ describe("MusicLibraryService", () => {
|
|||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [MusicLibraryService]
|
||||
providers: [MusicLibraryService],
|
||||
}).compile();
|
||||
|
||||
service = module.get<MusicLibraryService>(MusicLibraryService);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ export class MusicLibraryService {
|
|||
|
||||
async findArtist(query: FindArtistDto): Promise<Artist | undefined> {
|
||||
return this.artistRepository.findOne({
|
||||
where: { spotify: { id: query.spotify.id } }
|
||||
where: { spotify: { id: query.spotify.id } },
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ export class MusicLibraryService {
|
|||
|
||||
async findAlbum(query: FindAlbumDto): Promise<Album | undefined> {
|
||||
return this.albumRepository.findOne({
|
||||
where: { spotify: { id: query.spotify.id } }
|
||||
where: { spotify: { id: query.spotify.id } },
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ export class MusicLibraryService {
|
|||
|
||||
async findTrack(query: FindTrackDto): Promise<Track | undefined> {
|
||||
return this.trackRepository.findOne({
|
||||
where: { spotify: { id: query.spotify.id } }
|
||||
where: { spotify: { id: query.spotify.id } },
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import {
|
|||
JoinTable,
|
||||
ManyToMany,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn
|
||||
PrimaryGeneratedColumn,
|
||||
} from "typeorm";
|
||||
import { Album } from "./album.entity";
|
||||
import { Artist } from "./artist.entity";
|
||||
|
|
@ -18,16 +18,13 @@ export class Track {
|
|||
@Column()
|
||||
name: string;
|
||||
|
||||
@ManyToOne(
|
||||
type => Album,
|
||||
album => album.tracks
|
||||
)
|
||||
@ManyToOne((type) => Album, (album) => album.tracks)
|
||||
album: Album;
|
||||
|
||||
@ManyToMany(type => Artist)
|
||||
@ManyToMany((type) => Artist)
|
||||
@JoinTable()
|
||||
artists: Artist[];
|
||||
|
||||
@Column(type => SpotifyLibraryDetails)
|
||||
@Column((type) => SpotifyLibraryDetails)
|
||||
spotify?: SpotifyLibraryDetails;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue