From 542fce1e82d2aef179b495a3068a4924e5f37e2e Mon Sep 17 00:00:00 2001 From: anke1460 Date: Wed, 18 Mar 2020 22:32:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=A7=86=E9=A2=91=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E6=97=B6=E9=95=BF=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/create_watch_video_service.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/services/create_watch_video_service.rb b/app/services/create_watch_video_service.rb index 49127a01f..4629d9c8e 100644 --- a/app/services/create_watch_video_service.rb +++ b/app/services/create_watch_video_service.rb @@ -16,11 +16,11 @@ class CreateWatchVideoService < ApplicationService if params[:log_id].present? watch_video_history = user.watch_video_histories.find(params[:log_id]) - if params[:total_duration] < params[:watch_duration] - return watch_video_history - end + # if params[:total_duration] < params[:watch_duration] + # return watch_video_history + # end # 更新观看时长 - if watch_video_history.present? && !watch_video_history.is_finished && watch_video_history.watch_duration <= params[:watch_duration] && watch_video_history.total_duration <= params[:total_duration] + if watch_video_history.present? && !watch_video_history.is_finished && watch_video_history.total_duration <= params[:total_duration] # 如果观看总时长没变,说明视频没有播放,无需再去记录 watch_video_history.end_at = current_time watch_video_history.total_duration = params[:total_duration]