fix(analytics): set initial value for duration and bandwidth

This commit is contained in:
Benjamin Bellamy 2022-01-31 16:49:26 +00:00
parent 06279cd90f
commit ee50539591
1 changed files with 2 additions and 2 deletions

View File

@ -50,8 +50,8 @@ class AddAnalyticsPodcastsProcedure extends Migration
SET @current_hour = HOUR(@current_datetime);
IF NOT `p_bot` THEN
INSERT INTO `{$prefix}analytics_podcasts`(`podcast_id`, `date`)
VALUES (p_podcast_id, @current_date)
INSERT INTO `{$prefix}analytics_podcasts`(`podcast_id`, `date`, `duration`, `bandwidth`)
VALUES (p_podcast_id, @current_date, `p_duration`, `p_filesize`)
ON DUPLICATE KEY UPDATE
`duration`=`duration`+`p_duration`,
`bandwidth`=`bandwidth`+`p_filesize`,