<% title = HTML.escape(playlist.title) %> <% author = HTML.escape(playlist.author) %> <% content_for "header" do %> <%= title %> - Invidious <% end %>

<%= title %>

<% if playlist.is_a? InvidiousPlaylist %> <% if playlist.author == user.try &.email %> <%= author %> | <% else %> <%= author %> | <% end %> <%= translate(locale, "`x` videos", "#{playlist.video_count}") %> | <%= translate(locale, "Updated `x` ago", recode_date(playlist.updated, locale)) %> | <% case playlist.as(InvidiousPlaylist).privacy when %> <% when PlaylistPrivacy::Public %> <%= translate(locale, "Public") %> <% when PlaylistPrivacy::Unlisted %> <%= translate(locale, "Unlisted") %> <% when PlaylistPrivacy::Private %> <%= translate(locale, "Private") %> <% end %> <% else %> <%= author %> | <%= translate(locale, "`x` videos", "#{playlist.video_count}") %> | <%= translate(locale, "Updated `x` ago", recode_date(playlist.updated, locale)) %> <% end %> <% if !playlist.is_a? InvidiousPlaylist %> <% end %>

<% if playlist.is_a?(InvidiousPlaylist) && playlist.author == user.try &.email %>
<% else %> <% if PG_DB.query_one?("SELECT id FROM playlists WHERE id = $1", playlist.id, as: String).nil? %>
<% else %>
<% end %> <% end %>

<%= playlist.description_html %>

<% if playlist.is_a?(InvidiousPlaylist) && playlist.author == user.try &.email %>

<% end %>

<% if playlist.is_a?(InvidiousPlaylist) && playlist.author == user.try &.email %> <% end %>
<% videos.each do |item| %> <%= rendered "components/item" %> <% end %>
<% if page > 1 %> <%= translate(locale, "Previous page") %> <% end %>
<% if page_count != 1 && page < page_count %> <%= translate(locale, "Next page") %> <% end %>