Skip to content

Commit

Permalink
Fix regression when views_recent is unset
Browse files Browse the repository at this point in the history
  • Loading branch information
danirod committed Aug 25, 2024
1 parent 9e7783c commit 68c62eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/components/six/search/related_playlists_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(tag:)

def playlists
@playlists ||= Playlist.includes(:videos).where(id: playlist_ids, exclude_from_search: false).sort_by do |p|
p.views_recent + (p.video_views_recent / p.videos.length)
(p.views_recent || 0) + (p.video_views_recent / p.videos.length)
end.reverse
end

Expand Down

0 comments on commit 68c62eb

Please sign in to comment.