mirror of
https://github.com/apricote/Listory.git
synced 2026-02-07 02:07:03 +00:00
fix: improve top-artists response time
By calculating the necessary counts in the database, we avoid unncessary joins and data transmissions.
This commit is contained in:
parent
2ea7366a58
commit
aecc82576a
4 changed files with 44 additions and 39 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, PrimaryGeneratedColumn, Column, ManyToMany } from "typeorm";
|
||||
import { SpotifyLibraryDetails } from "src/sources/spotify/spotify-library-details.entity";
|
||||
import { Column, Entity, ManyToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { Album } from "./album.entity";
|
||||
|
||||
@Entity()
|
||||
|
|
@ -11,7 +11,7 @@ export class Artist {
|
|||
name: string;
|
||||
|
||||
@ManyToMany((type) => Album, (album) => album.artists)
|
||||
albums: Album[];
|
||||
albums?: Album[];
|
||||
|
||||
@Column((type) => SpotifyLibraryDetails)
|
||||
spotify: SpotifyLibraryDetails;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue