Add setting to autoplay videos

This commit is contained in:
spikecodes 2021-10-25 21:27:55 -07:00
parent 546c8a4cda
commit 1d4ea50a45
No known key found for this signature in database
GPG key ID: 004CECFF9B463BCB
8 changed files with 95 additions and 85 deletions

View file

@ -18,7 +18,7 @@ struct SettingsTemplate {
// CONSTANTS
const PREFS: [&str; 9] = [
const PREFS: [&str; 10] = [
"theme",
"front_page",
"layout",
@ -28,6 +28,7 @@ const PREFS: [&str; 9] = [
"show_nsfw",
"use_hls",
"hide_hls_notification",
"autoplay_videos",
];
// FUNCTIONS

View file

@ -388,6 +388,7 @@ pub struct Preferences {
pub show_nsfw: String,
pub hide_hls_notification: String,
pub use_hls: String,
pub autoplay_videos: String,
pub comment_sort: String,
pub post_sort: String,
pub subscriptions: Vec<String>,
@ -404,6 +405,7 @@ impl Preferences {
show_nsfw: setting(&req, "show_nsfw"),
use_hls: setting(&req, "use_hls"),
hide_hls_notification: setting(&req, "hide_hls_notification"),
autoplay_videos: setting(&req, "autoplay_videos"),
comment_sort: setting(&req, "comment_sort"),
post_sort: setting(&req, "post_sort"),
subscriptions: setting(&req, "subscriptions").split('+').map(String::from).filter(|s| !s.is_empty()).collect(),