mirror of https://github.com/iv-org/invidious.git
Add custom item for CompilationVideo
This commit is contained in:
parent
696ca42274
commit
7c92b051b3
|
@ -174,6 +174,7 @@
|
|||
"Delete playlist `x`?": "Delete playlist `x`?",
|
||||
"Delete playlist": "Delete playlist",
|
||||
"Create playlist": "Create playlist",
|
||||
"Create compilation": "Create compilation",
|
||||
"Title": "Title",
|
||||
"Playlist privacy": "Playlist privacy",
|
||||
"Editing playlist `x`": "Editing playlist `x`",
|
||||
|
@ -413,6 +414,7 @@
|
|||
"Audio mode": "Audio mode",
|
||||
"Video mode": "Video mode",
|
||||
"Playlists": "Playlists",
|
||||
"Compilations": "Compilations",
|
||||
"search_filters_title": "Filters",
|
||||
"search_filters_date_label": "Upload date",
|
||||
"search_filters_date_option_none": "Any date",
|
||||
|
@ -469,6 +471,7 @@
|
|||
"download_subtitles": "Subtitles - `x` (.vtt)",
|
||||
"user_created_playlists": "`x` created playlists",
|
||||
"user_saved_playlists": "`x` saved playlists",
|
||||
"user_created_compilations": "`x` created compilations",
|
||||
"Video unavailable": "Video unavailable",
|
||||
"preferences_save_player_pos_label": "Save playback position: ",
|
||||
"crash_page_you_found_a_bug": "It looks like you found a bug in Invidious!",
|
||||
|
|
|
@ -240,9 +240,9 @@ struct InvidiousCompilation
|
|||
end
|
||||
|
||||
def create_compilation(title, privacy, user)
|
||||
plid = "IVPL#{Random::Secure.urlsafe_base64(24)[0, 31]}"
|
||||
compid = "IVPL#{Random::Secure.urlsafe_base64(24)[0, 31]}"
|
||||
|
||||
playlist = InvidiousCompilation.new({
|
||||
compilation = InvidiousCompilation.new({
|
||||
title: title.byte_slice(0, 150),
|
||||
id: compid,
|
||||
author: user.email,
|
||||
|
|
|
@ -166,6 +166,8 @@ end
|
|||
module Invidious::Database::CompilationVideos
|
||||
extend self
|
||||
|
||||
private alias VideoIndex = Int64 | Array(Int64)
|
||||
|
||||
# -------------------
|
||||
# Insert / Delete
|
||||
# -------------------
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<%-
|
||||
thin_mode = env.get("preferences").as(Preferences).thin_mode
|
||||
item_watched = !item.is_a?(SearchChannel | SearchHashtag | SearchPlaylist | InvidiousPlaylist | Category) && env.get?("user").try &.as(User).watched.index(item.id) != nil
|
||||
item_watched = !item.is_a?(SearchChannel | SearchHashtag | SearchPlaylist | InvidiousPlaylist | InvidiousCompilation | Category) && env.get?("user").try &.as(User).watched.index(item.id) != nil
|
||||
author_verified = item.responds_to?(:author_verified) && item.author_verified
|
||||
-%>
|
||||
|
||||
|
@ -53,7 +53,7 @@
|
|||
<p><%= translate_count(locale, "generic_channels_count", item.channel_count, NumberFormatting::Separator) %></p>
|
||||
<%- end -%>
|
||||
</div>
|
||||
<% when SearchPlaylist, InvidiousPlaylist %>
|
||||
<% when SearchPlaylist, InvidiousPlaylist, InvidiousCompilation %>
|
||||
<%-
|
||||
if item.id.starts_with? "RD"
|
||||
link_url = "/mix?list=#{item.id}&continuation=#{URI.parse(item.thumbnail || "/vi/-----------").request_target.split("/")[2]}"
|
||||
|
@ -87,6 +87,11 @@
|
|||
</p>
|
||||
</a></div>
|
||||
</div>
|
||||
<% when CompilationVideo %>
|
||||
<a style="width:100%" href="/watch?v=<%= item.id %>&list=<%= item.compid %>&index=<%= item.index %>">
|
||||
<% if !env.get("preferences").as(Preferences).thin_mode %>
|
||||
<% end %>
|
||||
</a>
|
||||
<% when Category %>
|
||||
<% else %>
|
||||
<%-
|
||||
|
|
|
@ -3,3 +3,27 @@
|
|||
<% end %>
|
||||
|
||||
<%= rendered "components/feed_menu" %>
|
||||
|
||||
<div class="pure-g h-box">
|
||||
<div class="pure-u-1-3">
|
||||
<h3><%= translate(locale, "user_created_compilations", %(<span id="count">#{items_created.size}</span>)) %></h3>
|
||||
</div>
|
||||
<div class="pure-u-1-3">
|
||||
<h3 style="text-align:center">
|
||||
<a href="/create_compilations?referer=<%= URI.encode_www_form("/feed/compilations") %>"><%= translate(locale, "Create compilation") %></a>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="pure-u-1-3">
|
||||
<h3 style="text-align:right">
|
||||
<a href="/data_control?referer=<%= URI.encode_www_form("/feed/compilations") %>">
|
||||
<%= translate(locale, "Import") %>
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pure-g">
|
||||
<% items_created.each do |item| %>
|
||||
<%= rendered "components/item" %>
|
||||
<% end %>
|
||||
</div>
|
Loading…
Reference in New Issue