fix(engine): broaden media cookie source support

This commit is contained in:
NimBold
2026-07-02 23:11:47 +03:30
parent ae9f14ad6e
commit 63abf23622
9 changed files with 66 additions and 39 deletions
+7 -9
View File
@@ -215,15 +215,13 @@ pub enum ProxyMode {
}
#[derive(Clone, Debug, Serialize, Deserialize, TS)]
#[serde(rename_all = "lowercase")]
#[ts(export, export_to = "../../src/bindings/")]
pub enum MediaCookieSource {
None,
Safari,
Chrome,
Firefox,
Edge,
Brave,
pub struct MediaCookieSource(#[ts(type = "string")] pub String);
impl Default for MediaCookieSource {
fn default() -> Self {
Self("none".to_string())
}
}
#[derive(Clone, Debug, Serialize, Deserialize, TS)]
@@ -275,7 +273,7 @@ pub struct PersistedSettings {
pub prevents_sleep_while_downloading: bool,
pub media_cookie_source: MediaCookieSource,
pub site_logins: Vec<SiteLogin>,
/// The HMAC shared secret for the browser extension. It is persisted in the
/// HMAC shared secret for the browser extension. It is persisted in the
/// settings database so that startup never needs to touch the OS keychain.
/// The keychain is still used as defence-in-depth — grant_keychain_access
/// writes the token there — but the DB copy is the primary read path,
+4 -2
View File
@@ -6,7 +6,9 @@ use serde_json::{Map, Value};
use std::collections::HashMap;
use tauri::{AppHandle, Manager};
pub fn load_settings<R: tauri::Runtime>(app_handle: &AppHandle<R>) -> Result<PersistedSettings, String> {
pub fn load_settings<R: tauri::Runtime>(
app_handle: &AppHandle<R>,
) -> Result<PersistedSettings, String> {
let database = app_handle.state::<crate::db::DbState>();
let connection = database.lock()?;
let stored = crate::db::load_settings(&connection)?
@@ -296,7 +298,7 @@ fn default_settings() -> PersistedSettings {
custom_user_agent: String::new(),
ask_where_to_save_each_file: false,
prevents_sleep_while_downloading: true,
media_cookie_source: MediaCookieSource::None,
media_cookie_source: MediaCookieSource::default(),
site_logins: Vec::new(),
extension_pairing_token: String::new(),
auto_check_updates: true,