mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Add option to change max_results
This commit is contained in:
parent
cae8e1b883
commit
a6292d956d
3 changed files with 33 additions and 20 deletions
|
@ -18,12 +18,13 @@ macro rendered(filename)
|
|||
end
|
||||
|
||||
DEFAULT_USER_PREFERENCES = Preferences.from_json({
|
||||
"video_loop" => false,
|
||||
"autoplay" => false,
|
||||
"speed" => 1.0,
|
||||
"quality" => "hd720",
|
||||
"volume" => 100,
|
||||
"dark_mode" => false,
|
||||
"video_loop" => false,
|
||||
"autoplay" => false,
|
||||
"speed" => 1.0,
|
||||
"quality" => "hd720",
|
||||
"volume" => 100,
|
||||
"dark_mode" => false,
|
||||
"max_results" => 40,
|
||||
}.to_json)
|
||||
|
||||
class Config
|
||||
|
@ -136,12 +137,13 @@ end
|
|||
|
||||
class Preferences
|
||||
JSON.mapping({
|
||||
video_loop: Bool,
|
||||
autoplay: Bool,
|
||||
speed: Float32,
|
||||
quality: String,
|
||||
volume: Int32,
|
||||
dark_mode: Bool,
|
||||
video_loop: Bool,
|
||||
autoplay: Bool,
|
||||
speed: Float32,
|
||||
quality: String,
|
||||
volume: Int32,
|
||||
dark_mode: Bool,
|
||||
max_results: Int32,
|
||||
})
|
||||
end
|
||||
|
||||
|
|
|
@ -52,6 +52,12 @@ function update_value(element) {
|
|||
<input name="dark_mode" id="dark_mode" type="checkbox" <% if user.preferences.dark_mode %>checked<% end %>>
|
||||
</div>
|
||||
|
||||
<legend>Subscription preferences</legend>
|
||||
<div class="pure-control-group">
|
||||
<label for="max_results">Number of videos shown in feed: </label>
|
||||
<input name="max_results" id="max_results" type="number" value="<%= user.preferences.max_results %>">
|
||||
</div>
|
||||
|
||||
<div class="pure-controls">
|
||||
<button type="submit" class="pure-button pure-button-primary">Save preferences</button>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue