mirror of
https://github.com/iv-org/invidious.git
synced 2025-11-23 01:45:41 +00:00
Add latest_only and sort options for subscription feed
This commit is contained in:
@@ -25,6 +25,8 @@ DEFAULT_USER_PREFERENCES = Preferences.from_json({
|
||||
"volume" => 100,
|
||||
"dark_mode" => false,
|
||||
"max_results" => 40,
|
||||
"sort" => "published",
|
||||
"latest_only" => false,
|
||||
}.to_json)
|
||||
|
||||
class Config
|
||||
@@ -144,6 +146,8 @@ class Preferences
|
||||
volume: Int32,
|
||||
dark_mode: Bool,
|
||||
max_results: Int32,
|
||||
sort: String,
|
||||
latest_only: Bool,
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
@@ -58,6 +58,20 @@ function update_value(element) {
|
||||
<input name="max_results" id="max_results" type="number" value="<%= user.preferences.max_results %>">
|
||||
</div>
|
||||
|
||||
<div class="pure-control-group">
|
||||
<label for="sort">Sort videos by: </label>
|
||||
<select name="sort" id="sort">
|
||||
<% ["published", "alphabetically", "alphabetically - reverse", "channel name", "channel name - reverse"].each do |option| %>
|
||||
<option <% if user.preferences.sort == option %> selected <% end %>><%= option %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="pure-control-group">
|
||||
<label for="latest_only">Only show latest video from channel: </label>
|
||||
<input name="latest_only" id="latest_only" type="checkbox" <% if user.preferences.latest_only %>checked<% end %>>
|
||||
</div>
|
||||
|
||||
<div class="pure-controls">
|
||||
<button type="submit" class="pure-button pure-button-primary">Save preferences</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user