File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -260,9 +260,7 @@ export class SongService {
260
260
publicId : string ,
261
261
user : UserDocument | null ,
262
262
) : Promise < SongViewDto > {
263
- const foundSong = await this . songModel . findOne ( {
264
- publicId : publicId ,
265
- } ) ;
263
+ const foundSong = await this . songModel . findOne ( { publicId : publicId } ) ;
266
264
267
265
if ( ! foundSong ) {
268
266
throw new HttpException ( 'Song not found' , HttpStatus . NOT_FOUND ) ;
@@ -280,11 +278,7 @@ export class SongService {
280
278
281
279
// increment view count
282
280
foundSong . playCount ++ ;
283
-
284
- this . songModel . updateOne (
285
- { publicId : publicId } ,
286
- { playCount : foundSong . playCount } ,
287
- ) ;
281
+ await foundSong . save ( ) ;
288
282
289
283
const populatedSong = await foundSong . populate (
290
284
'uploader' ,
You can’t perform that action at this time.
0 commit comments