Skip to content

Commit 14d5d96

Browse files
committed
fix: revert play count logic update (views not registering)
This reverts commit 50a9c70.
1 parent 3534104 commit 14d5d96

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

server/src/song/song.service.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,7 @@ export class SongService {
260260
publicId: string,
261261
user: UserDocument | null,
262262
): Promise<SongViewDto> {
263-
const foundSong = await this.songModel.findOne({
264-
publicId: publicId,
265-
});
263+
const foundSong = await this.songModel.findOne({ publicId: publicId });
266264

267265
if (!foundSong) {
268266
throw new HttpException('Song not found', HttpStatus.NOT_FOUND);
@@ -280,11 +278,7 @@ export class SongService {
280278

281279
// increment view count
282280
foundSong.playCount++;
283-
284-
this.songModel.updateOne(
285-
{ publicId: publicId },
286-
{ playCount: foundSong.playCount },
287-
);
281+
await foundSong.save();
288282

289283
const populatedSong = await foundSong.populate(
290284
'uploader',

0 commit comments

Comments
 (0)