|  |  |  | @ -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] | 
			
		
	
	
		
			
				
					|  |  |  | 
 |