We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3534104 commit 14d5d96Copy full SHA for 14d5d96
1 file changed
server/src/song/song.service.ts
@@ -260,9 +260,7 @@ export class SongService {
260
publicId: string,
261
user: UserDocument | null,
262
): Promise<SongViewDto> {
263
- const foundSong = await this.songModel.findOne({
264
- publicId: publicId,
265
- });
+ const foundSong = await this.songModel.findOne({ publicId: publicId });
266
267
if (!foundSong) {
268
throw new HttpException('Song not found', HttpStatus.NOT_FOUND);
@@ -280,11 +278,7 @@ export class SongService {
280
278
281
279
// increment view count
282
foundSong.playCount++;
283
-
284
- this.songModel.updateOne(
285
- { publicId: publicId },
286
- { playCount: foundSong.playCount },
287
- );
+ await foundSong.save();
288
289
const populatedSong = await foundSong.populate(
290
'uploader',
0 commit comments