File tree Expand file tree Collapse file tree 5 files changed +6
-7
lines changed Expand file tree Collapse file tree 5 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,6 @@ import { UserModule } from './user/user.module';
75
75
UserModule ,
76
76
AuthModule . forRootAsync ( ) ,
77
77
FileModule . forRootAsync ( ) ,
78
- SongBrowserModule ,
79
78
SeedModule . forRoot ( ) ,
80
79
EmailLoginModule ,
81
80
MailingModule ,
Original file line number Diff line number Diff line change @@ -94,7 +94,6 @@ export class SongController {
94
94
@Query ( ) query : PageQueryDTO ,
95
95
@Query ( 'q' ) q ?: 'featured' | 'recent' | 'categories' | 'random' ,
96
96
@Param ( 'id' ) id ?: string ,
97
- @Query ( 'count' ) count ?: string ,
98
97
@Query ( 'category' ) category ?: string ,
99
98
) : Promise < SongPreviewDto [ ] | Record < string , number > > {
100
99
if ( q ) {
@@ -109,12 +108,11 @@ export class SongController {
109
108
}
110
109
return await this . songBrowserService . getCategories ( ) ;
111
110
case 'random' : {
112
- const countInt = parseInt ( count ) ;
113
- if ( isNaN ( countInt ) || countInt < 1 || countInt > 10 ) {
111
+ if ( query . limit && ( query . limit < 1 || query . limit > 10 ) ) {
114
112
throw new BadRequestException ( 'Invalid query parameters' ) ;
115
113
}
116
114
return await this . songBrowserService . getRandomSongs (
117
- countInt ,
115
+ query . limit ?? 1 ,
118
116
category ,
119
117
) ;
120
118
}
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { FileModule } from '@server/file/file.module';
8
8
import { UserModule } from '@server/user/user.module' ;
9
9
10
10
import { MySongsController } from './my-songs/my-songs.controller' ;
11
+ import { SongBrowserService } from './song-browser/song-browser.service' ;
11
12
import { SongUploadService } from './song-upload/song-upload.service' ;
12
13
import { SongWebhookService } from './song-webhook/song-webhook.service' ;
13
14
import { SongController } from './song.controller' ;
@@ -24,6 +25,7 @@ import { SongService } from './song.service';
24
25
SongService ,
25
26
SongUploadService ,
26
27
SongWebhookService ,
28
+ SongBrowserService ,
27
29
{
28
30
inject : [ ConfigService ] ,
29
31
provide : 'DISCORD_WEBHOOK_URL' ,
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export const RandomSongButton = () => {
22
22
{
23
23
params : {
24
24
q : 'random' ,
25
- count : 1 ,
25
+ limit : 1 ,
26
26
} ,
27
27
} ,
28
28
) ;
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export async function SongPage({ id }: { id: string }) {
45
45
{
46
46
params : {
47
47
q : 'random' ,
48
- count : 4 ,
48
+ limit : 4 ,
49
49
category : song . category ,
50
50
} ,
51
51
} ,
You can’t perform that action at this time.
0 commit comments