Mute audio from playing in ads (#2471)

* Mute audio from playing in ads

* Update tauri version, get rid of custom

* bump wry

* fix more

* Fix lint
This commit is contained in:
Geometrically authored and GitHub committed 2024-09-29 17:51:51 -07:00
1 parent e81a4ade97
commit 624abf0df4
25 files changed
+3254 -5114

No files matched your search

+2 -7
View File
@@ -41,9 +41,6 @@ jobs:
with:
components: rustfmt, clippy
- name: Install Tauri CLI
run: cargo install tauri-cli --git https://github.com/modrinth/tauri.git --rev 5e2942876c2266594ed1db516c1d9975c873c36a
- name: Setup rust cache
uses: actions/cache@v4
with:
@@ -65,7 +62,7 @@ jobs:
!target/release/bundle/msi/*.msi
!target/release/bundle/msi/*.msi.zip
!target/release/bundle/msi/*.msi.zip.sig
!target/release/bundle/nsis/*.exe
!target/release/bundle/nsis/*.nsis.zip
!target/release/bundle/nsis/*.nsis.zip.sig
@@ -121,7 +118,6 @@ jobs:
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
V1_COMPATIBLE_BIN_NAME: true
- name: build app
run: pnpm --filter=@modrinth/app run tauri build --config "tauri-release.conf.json"
@@ -131,7 +127,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
V1_COMPATIBLE_BIN_NAME: true
- name: upload ${{ matrix.platform }}
uses: actions/upload-artifact@v4
@@ -154,7 +149,7 @@ jobs:
target/release/bundle/msi/*.msi
target/release/bundle/msi/*.msi.zip
target/release/bundle/msi/*.msi.zip.sig
target/release/bundle/nsis/*.exe
target/release/bundle/nsis/*.nsis.zip
target/release/bundle/nsis/*.nsis.zip.sig
-3
View File
@@ -32,9 +32,6 @@ jobs:
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install Tauri CLI
run: cargo install tauri-cli --git https://github.com/modrinth/tauri.git --rev 5e2942876c2266594ed1db516c1d9975c873c36a
- name: Setup Node.JS environment
uses: actions/setup-node@v4
with:
Generated
+197 -308
View File
File diff suppressed because it is too large. Load diff
+1 -2
View File
@@ -18,5 +18,4 @@ strip = true # Remove debug symbols
opt-level = 3
[patch.crates-io]
wry = { git = "https://github.com/modrinth/wry", rev = "5840108" }
tauri = { git = "https://github.com/modrinth/tauri", rev = "5e29428" }
wry = { git = "https://github.com/modrinth/wry", rev = "27fb16b" }
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@modrinth/app-frontend",
"private": true,
"version": "0.8.7",
"version": "0.8.8",
"type": "module",
"scripts": {
"dev": "vite",
@@ -230,7 +230,7 @@ const createInstance = async () => {
@click="installModal.hide()"
>
<Avatar
:src="profile.icon_path ? tauri.convertFileSrc(profile.icon_path) : null"
:src="profile.icon_path ? convertFileSrc(profile.icon_path) : null"
class="profile-image"
/>
{{ profile.name }}
+19
View File
@@ -363,6 +363,25 @@ async function purgeCache() {
<span class="label__title size-card-header">Privacy</span>
</h3>
</div>
<div class="adjacent-input">
<label for="opt-out-analytics">
<span class="label__title">Personalized ads</span>
<span class="label__description">
Modrinth's ad provider, Aditude, shows ads based on your preferences. By disabling this
option, you opt out and ads will no longer be shown based on your interests.
</span>
</label>
<Toggle
id="opt-out-analytics"
:model-value="settings.personalized_ads"
:checked="settings.personalized_ads"
@update:model-value="
(e) => {
settings.personalized_ads = e
}
"
/>
</div>
<div class="adjacent-input">
<label for="opt-out-analytics">
<span class="label__title">Telemetry</span>
+3 -3
View File
@@ -1,6 +1,6 @@
[package]
name = "theseus_gui"
version = "0.8.7"
version = "0.8.8"
description = "The Modrinth App is a desktop application for managing your Minecraft mods"
license = "GPL-3.0-only"
repository = "https://github.com/modrinth/code/apps/app/"
@@ -8,7 +8,7 @@ edition = "2021"
build = "build.rs"
[build-dependencies]
tauri-build = { git = "https://github.com/modrinth/tauri", features = ["codegen"], rev = "5e29428" }
tauri-build = { version = "2.0.0-rc", features = ["codegen"] }
[dependencies]
theseus = { path = "../../packages/app-lib", features = ["tauri"] }
@@ -16,7 +16,7 @@ theseus = { path = "../../packages/app-lib", features = ["tauri"] }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { git = "https://github.com/modrinth/tauri", features = ["devtools", "macos-private-api", "protocol-asset", "unstable"], rev = "5e29428" }
tauri = { version = "2.0.0-rc", features = ["devtools", "macos-private-api", "protocol-asset", "unstable"] }
tauri-plugin-window-state = "2.0.0-rc"
tauri-plugin-deep-link = "2.0.0-rc"
tauri-plugin-os = "2.0.0-rc"
-1
View File
@@ -22,7 +22,6 @@ Before you begin, ensure you have the following installed on your machine:
Follow these steps to set up your development environment:
```bash
cargo install tauri-cli --git https://github.com/modrinth/tauri.git --rev 5e2942876c2266594ed1db516c1d9975c873c36a
pnpm install
pnpm app:dev
```
+1
View File
@@ -228,6 +228,7 @@ fn main() {
"show_ads_window",
"record_ads_click",
"open_link",
"get_ads_personalization",
])
.default_permission(
DefaultPermissionRule::AllowAllCommands,
+1 -1
View File
@@ -1 +1 @@
{"ads":{"default_permission":{"identifier":"default","description":"Default plugin permissions.","permissions":["allow-init-ads-window","allow-hide-ads-window","allow-scroll-ads-window","allow-show-ads-window","allow-record-ads-click","allow-open-link"]},"permissions":{"allow-hide-ads-window":{"identifier":"allow-hide-ads-window","description":"Enables the hide_ads_window command without any pre-configured scope.","commands":{"allow":["hide_ads_window"],"deny":[]}},"allow-init-ads-window":{"identifier":"allow-init-ads-window","description":"Enables the init_ads_window command without any pre-configured scope.","commands":{"allow":["init_ads_window"],"deny":[]}},"allow-open-link":{"identifier":"allow-open-link","description":"Enables the open_link command without any pre-configured scope.","commands":{"allow":["open_link"],"deny":[]}},"allow-record-ads-click":{"identifier":"allow-record-ads-click","description":"Enables the record_ads_click command without any pre-configured scope.","commands":{"allow":["record_ads_click"],"deny":[]}},"allow-scroll-ads-window":{"identifier":"allow-scroll-ads-window","description":"Enables the scroll_ads_window command without any pre-configured scope.","commands":{"allow":["scroll_ads_window"],"deny":[]}},"allow-show-ads-window":{"identifier":"allow-show-ads-window","description":"Enables the show_ads_window command without any pre-configured scope.","commands":{"allow":["show_ads_window"],"deny":[]}},"deny-hide-ads-window":{"identifier":"deny-hide-ads-window","description":"Denies the hide_ads_window command without any pre-configured scope.","commands":{"allow":[],"deny":["hide_ads_window"]}},"deny-init-ads-window":{"identifier":"deny-init-ads-window","description":"Denies the init_ads_window command without any pre-configured scope.","commands":{"allow":[],"deny":["init_ads_window"]}},"deny-open-link":{"identifier":"deny-open-link","description":"Denies the open_link command without any pre-configured scope.","commands":{"allow":[],"deny":["open_link"]}},"deny-record-ads-click":{"identifier":"deny-record-ads-click","description":"Denies the record_ads_click command without any pre-configured scope.","commands":{"allow":[],"deny":["record_ads_click"]}},"deny-scroll-ads-window":{"identifier":"deny-scroll-ads-window","description":"Denies the scroll_ads_window command without any pre-configured scope.","commands":{"allow":[],"deny":["scroll_ads_window"]}},"deny-show-ads-window":{"identifier":"deny-show-ads-window","description":"Denies the show_ads_window command without any pre-configured scope.","commands":{"allow":[],"deny":["show_ads_window"]}}},"permission_sets":{},"global_scope_schema":null},"auth":{"default_permission":{"identifier":"default","description":"Default plugin permissions.","permissions":["allow-login","allow-remove-user","allow-get-default-user","allow-set-default-user","allow-get-users"]},"permissions":{"allow-get-default-user":{"identifier":"allow-get-default-user","description":"Enables the get_default_user command without any pre-configured scope.","commands":{"allow":["get_default_user"],"deny":[]}},"allow-get-users":{"identifier":"allow-get-users","description":"Enables the get_users command without any pre-configured scope.","commands":{"allow":["get_users"],"deny":[]}},"allow-login":{"identifier":"allow-login","description":"Enables the login command without any pre-configured scope.","commands":{"allow":["login"],"deny":[]}},"allow-remove-user":{"identifier":"allow-remove-user","description":"Enables the remove_user command without any pre-configured scope.","commands":{"allow":["remove_user"],"deny":[]}},"allow-set-default-user":{"identifier":"allow-set-default-user","description":"Enables the set_default_user command without any pre-configured scope.","commands":{"allow":["set_default_user"],"deny":[]}},"deny-get-default-user":{"identifier":"deny-get-default-user","description":"Denies the get_default_user command without any pre-configured scope.","commands":{"allow":[],"deny":["get_default_user"]}},"deny-get-users":{"identifier":"deny-get-users","description":"Denies the get_users command without any pre-configured scope.","commands":{"allow":[],"deny":["get_users"]}},"deny-login":{"identifier":"deny-login","description":"Denies the login command without any pre-configured scope.","commands":{"allow":[],"deny":["login"]}},"deny-remove-user":{"identifier":"deny-remove-user","description":"Denies the remove_user command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_user"]}},"deny-set-default-user":{"identifier":"deny-set-default-user","description":"Denies the set_default_user command without any pre-configured scope.","commands":{"allow":[],"deny":["set_default_user"]}}},"permission_sets":{},"global_scope_schema":null},"cache":{"default_permission":{"identifier":"default","description":"Default plugin permissions.","permissions":["allow-get-project","allow-get-project-many","allow-get-version","allow-get-version-maLine truncated
{"ads":{"default_permission":{"identifier":"default","description":"Default plugin permissions.","permissions":["allow-init-ads-window","allow-hide-ads-window","allow-scroll-ads-window","allow-show-ads-window","allow-record-ads-click","allow-open-link","allow-get-ads-personalization"]},"permissions":{"allow-get-ads-personalization":{"identifier":"allow-get-ads-personalization","description":"Enables the get_ads_personalization command without any pre-configured scope.","commands":{"allow":["get_ads_personalization"],"deny":[]}},"allow-hide-ads-window":{"identifier":"allow-hide-ads-window","description":"Enables the hide_ads_window command without any pre-configured scope.","commands":{"allow":["hide_ads_window"],"deny":[]}},"allow-init-ads-window":{"identifier":"allow-init-ads-window","description":"Enables the init_ads_window command without any pre-configured scope.","commands":{"allow":["init_ads_window"],"deny":[]}},"allow-open-link":{"identifier":"allow-open-link","description":"Enables the open_link command without any pre-configured scope.","commands":{"allow":["open_link"],"deny":[]}},"allow-record-ads-click":{"identifier":"allow-record-ads-click","description":"Enables the record_ads_click command without any pre-configured scope.","commands":{"allow":["record_ads_click"],"deny":[]}},"allow-scroll-ads-window":{"identifier":"allow-scroll-ads-window","description":"Enables the scroll_ads_window command without any pre-configured scope.","commands":{"allow":["scroll_ads_window"],"deny":[]}},"allow-show-ads-window":{"identifier":"allow-show-ads-window","description":"Enables the show_ads_window command without any pre-configured scope.","commands":{"allow":["show_ads_window"],"deny":[]}},"deny-get-ads-personalization":{"identifier":"deny-get-ads-personalization","description":"Denies the get_ads_personalization command without any pre-configured scope.","commands":{"allow":[],"deny":["get_ads_personalization"]}},"deny-hide-ads-window":{"identifier":"deny-hide-ads-window","description":"Denies the hide_ads_window command without any pre-configured scope.","commands":{"allow":[],"deny":["hide_ads_window"]}},"deny-init-ads-window":{"identifier":"deny-init-ads-window","description":"Denies the init_ads_window command without any pre-configured scope.","commands":{"allow":[],"deny":["init_ads_window"]}},"deny-open-link":{"identifier":"deny-open-link","description":"Denies the open_link command without any pre-configured scope.","commands":{"allow":[],"deny":["open_link"]}},"deny-record-ads-click":{"identifier":"deny-record-ads-click","description":"Denies the record_ads_click command without any pre-configured scope.","commands":{"allow":[],"deny":["record_ads_click"]}},"deny-scroll-ads-window":{"identifier":"deny-scroll-ads-window","description":"Denies the scroll_ads_window command without any pre-configured scope.","commands":{"allow":[],"deny":["scroll_ads_window"]}},"deny-show-ads-window":{"identifier":"deny-show-ads-window","description":"Denies the show_ads_window command without any pre-configured scope.","commands":{"allow":[],"deny":["show_ads_window"]}}},"permission_sets":{},"global_scope_schema":null},"auth":{"default_permission":{"identifier":"default","description":"Default plugin permissions.","permissions":["allow-login","allow-remove-user","allow-get-default-user","allow-set-default-user","allow-get-users"]},"permissions":{"allow-get-default-user":{"identifier":"allow-get-default-user","description":"Enables the get_default_user command without any pre-configured scope.","commands":{"allow":["get_default_user"],"deny":[]}},"allow-get-users":{"identifier":"allow-get-users","description":"Enables the get_users command without any pre-configured scope.","commands":{"allow":["get_users"],"deny":[]}},"allow-login":{"identifier":"allow-login","description":"Enables the login command without any pre-configured scope.","commands":{"allow":["login"],"deny":[]}},"allow-remove-user":{"identifier":"allow-remove-user","description":"Enables the remove_user command without any pre-configured scope.","commands":{"allow":["remove_user"],"deny":[]}},"allow-set-default-user":{"identifier":"allow-set-default-user","description":"Enables the set_default_user command without any pre-configured scope.","commands":{"allow":["set_default_user"],"deny":[]}},"deny-get-default-user":{"identifier":"deny-get-default-user","description":"Denies the get_default_user command without any pre-configured scope.","commands":{"allow":[],"deny":["get_default_user"]}},"deny-get-users":{"identifier":"deny-get-users","description":"Denies the get_users command without any pre-configured scope.","commands":{"allow":[],"deny":["get_users"]}},"deny-login":{"identifier":"deny-login","description":"Denies the login command without any pre-configured scope.","commands":{"allow":[],"deny":["login"]}},"deny-remove-user":{"identifier":"deny-remove-user","description":"Denies the remove_user command without any pre-configured scope.","commLine truncated
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+6 -3
View File
@@ -1,13 +1,16 @@
{
"name": "@modrinth/app",
"scripts": {
"build": "cargo tauri build",
"tauri": "cargo tauri",
"dev": "cargo tauri dev",
"build": "tauri build",
"tauri": "tauri",
"dev": "tauri dev",
"test": "cargo test",
"lint": "cargo fmt --check && cargo clippy -- -D warnings",
"fix": "cargo fmt && cargo clippy --fix"
},
"devDependencies": {
"@tauri-apps/cli": "2.0.0-rc.16"
},
"dependencies": {
"@modrinth/app-frontend": "workspace:*",
"@modrinth/app-lib": "workspace:*"
+83
View File
@@ -21,3 +21,86 @@ document.addEventListener(
window.open = (url, target, features) => {
window.top.postMessage({ modrinthOpenUrl: url }, 'https://modrinth.com')
}
function muteAudioContext() {
if (window.AudioContext || window.webkitAudioContext) {
const AudioContext = window.AudioContext || window.webkitAudioContext
const originalCreateMediaElementSource = AudioContext.prototype.createMediaElementSource
const originalCreateMediaStreamSource = AudioContext.prototype.createMediaStreamSource
const originalCreateMediaStreamTrackSource = AudioContext.prototype.createMediaStreamTrackSource
const originalCreateBufferSource = AudioContext.prototype.createBufferSource
const originalCreateOscillator = AudioContext.prototype.createOscillator
AudioContext.prototype.createGain = function () {
const gain = originalCreateGain.call(this)
gain.gain.value = 0
return gain
}
AudioContext.prototype.createMediaElementSource = function (mediaElement) {
const source = originalCreateMediaElementSource.call(this, mediaElement)
source.connect(this.createGain())
return source
}
AudioContext.prototype.createMediaStreamSource = function (mediaStream) {
const source = originalCreateMediaStreamSource.call(this, mediaStream)
source.connect(this.createGain())
return source
}
AudioContext.prototype.createMediaStreamTrackSource = function (mediaStreamTrack) {
const source = originalCreateMediaStreamTrackSource.call(this, mediaStreamTrack)
source.connect(this.createGain())
return source
}
AudioContext.prototype.createBufferSource = function () {
const source = originalCreateBufferSource.call(this)
source.connect(this.createGain())
return source
}
AudioContext.prototype.createOscillator = function () {
const oscillator = originalCreateOscillator.call(this)
oscillator.connect(this.createGain())
return oscillator
}
}
}
function muteVideo(mediaElement) {
let count = Number(mediaElement.getAttribute('data-modrinth-muted-count') ?? 0)
if (!mediaElement.muted || mediaElement.volume !== 0) {
mediaElement.muted = true
mediaElement.volume = 0
mediaElement.setAttribute('data-modrinth-muted-count', count + 1)
}
if (count > 5) {
// Video is detected as malicious, so it is removed from the page
mediaElement.remove()
}
}
function muteVideos() {
document.querySelectorAll('video, audio').forEach(function (mediaElement) {
muteVideo(mediaElement)
if (!mediaElement.hasAttribute('data-modrinth-muted')) {
mediaElement.addEventListener('volumechange', () => muteVideo(mediaElement))
mediaElement.setAttribute('data-modrinth-muted', 'true')
}
})
}
document.addEventListener('DOMContentLoaded', () => {
muteVideos()
muteAudioContext()
const observer = new MutationObserver(muteVideos)
observer.observe(document.body, { childList: true, subtree: true })
})
+13 -13
View File
@@ -4,6 +4,7 @@ use std::time::{Duration, Instant};
use tauri::plugin::TauriPlugin;
use tauri::{Emitter, LogicalPosition, LogicalSize, Manager, Runtime};
use tauri_plugin_shell::ShellExt;
use theseus::settings;
use tokio::sync::RwLock;
pub struct AdsState {
@@ -14,6 +15,8 @@ pub struct AdsState {
pub malicious_origins: HashSet<String>,
}
const AD_LINK: &str = "https://modrinth.com/wrapper/app-ads-cookie";
pub fn init<R: Runtime>() -> TauriPlugin<R> {
tauri::plugin::Builder::<R>::new("ads")
.setup(|app, _api| {
@@ -31,11 +34,7 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
loop {
if let Some(webview) = app.webviews().get_mut("ads-window")
{
let _ = webview.navigate(
"https://modrinth.com/wrapper/app-ads-cookie"
.parse()
.unwrap(),
);
let _ = webview.navigate(AD_LINK.parse().unwrap());
}
tokio::time::sleep(std::time::Duration::from_secs(60 * 5))
@@ -52,6 +51,7 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
show_ads_window,
record_ads_click,
open_link,
get_ads_personalization,
])
.build()
}
@@ -84,11 +84,11 @@ pub async fn init_ads_window<R: Runtime>(
let _ = webview.set_size(LogicalSize::new(width, height));
}
} else if let Some(window) = app.get_window("main") {
let window = window.add_child(
let _ = window.add_child(
tauri::webview::WebviewBuilder::new(
"ads-window",
WebviewUrl::External(
"https://modrinth.com/wrapper/app-ads-cookie".parse().unwrap(),
AD_LINK.parse().unwrap(),
),
)
.initialization_script(LINK_SCRIPT)
@@ -102,12 +102,6 @@ pub async fn init_ads_window<R: Runtime>(
},
LogicalSize::new(width, height),
);
if let Ok(window) = window {
window.listen_any("click", |event| {
println!("click: {:?}", event);
});
}
}
Ok(())
@@ -214,3 +208,9 @@ pub async fn open_link<R: Runtime>(
Ok(())
}
#[tauri::command]
pub async fn get_ads_personalization() -> crate::api::Result<bool> {
let res = settings::get().await?;
Ok(res.personalized_ads)
}
+2 -1
View File
@@ -52,7 +52,8 @@
]
},
"productName": "Modrinth App",
"version": "0.8.7",
"version": "0.8.8",
"mainBinaryName": "Modrinth App",
"identifier": "ModrinthApp",
"plugins": {
"deep-link": {
+27 -10
View File
@@ -44,19 +44,27 @@
</head>
<body>
<div class="ads-container">
<a id="plus-link" href="https://modrinth.com/plus" target="_blank"></a>
<div id="plus-link"></div>
<div id="modrinth-rail-1" />
</div>
<script>
window.tude = window.tude || { cmd: [] };
tude.cmd.push(function () {
tude.refreshAdsViaDivMappings([
{
divId: "modrinth-rail-1",
baseDivId: "pb-slot-square-2",
},
]);
});
window.__TAURI_INTERNALS__.invoke("plugin:ads|get_ads_personalization", {})
.then((personalized) => {
window.tude = window.tude || { cmd: [] };
tude.cmd.push(function () {
tude.refreshAdsViaDivMappings([
{
divId: "modrinth-rail-1",
baseDivId: "pb-slot-square-2",
},
]);
tude.setPrivacySettings({
personalizedAds: personalized ?? true,
})
});
});
window.addEventListener(
"message",
@@ -84,6 +92,15 @@
});
document.addEventListener("contextmenu", (event) => event.preventDefault());
const plusLink = document.getElementById("plus-link");
plusLink.addEventListener('click', function() {
window.__TAURI_INTERNALS__.invoke("plugin:ads|record_ads_click", {});
window.__TAURI_INTERNALS__.invoke("plugin:ads|open_link", {
path: 'https://modrinth.com/plus',
origin: 'https://modrinth.com',
});
});
</script>
</body>
</html>
@@ -0,0 +1,12 @@
{
"db_name": "SQLite",
"query": "\n UPDATE settings\n SET\n max_concurrent_writes = $1,\n max_concurrent_downloads = $2,\n\n theme = $3,\n default_page = $4,\n collapsed_navigation = $5,\n advanced_rendering = $6,\n native_decorations = $7,\n\n discord_rpc = $8,\n developer_mode = $9,\n telemetry = $10,\n personalized_ads = $11,\n\n onboarded = $12,\n\n extra_launch_args = jsonb($13),\n custom_env_vars = jsonb($14),\n mc_memory_max = $15,\n mc_force_fullscreen = $16,\n mc_game_resolution_x = $17,\n mc_game_resolution_y = $18,\n hide_on_process_start = $19,\n\n hook_pre_launch = $20,\n hook_wrapper = $21,\n hook_post_exit = $22,\n\n custom_dir = $23,\n prev_custom_dir = $24,\n migrated = $25\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 25
},
"nullable": []
},
"hash": "26e3ed8680f6c492b03b458aabfb3f94fddc753b343ef705263188945d0e578d"
}
@@ -1,6 +1,6 @@
{
"db_name": "SQLite",
"query": "\n SELECT\n max_concurrent_writes, max_concurrent_downloads,\n theme, default_page, collapsed_navigation, advanced_rendering, native_decorations,\n discord_rpc, developer_mode, telemetry,\n onboarded,\n json(extra_launch_args) extra_launch_args, json(custom_env_vars) custom_env_vars,\n mc_memory_max, mc_force_fullscreen, mc_game_resolution_x, mc_game_resolution_y, hide_on_process_start,\n hook_pre_launch, hook_wrapper, hook_post_exit,\n custom_dir, prev_custom_dir, migrated\n FROM settings\n ",
"query": "\n SELECT\n max_concurrent_writes, max_concurrent_downloads,\n theme, default_page, collapsed_navigation, advanced_rendering, native_decorations,\n discord_rpc, developer_mode, telemetry, personalized_ads,\n onboarded,\n json(extra_launch_args) extra_launch_args, json(custom_env_vars) custom_env_vars,\n mc_memory_max, mc_force_fullscreen, mc_game_resolution_x, mc_game_resolution_y, hide_on_process_start,\n hook_pre_launch, hook_wrapper, hook_post_exit,\n custom_dir, prev_custom_dir, migrated\n FROM settings\n ",
"describe": {
"columns": [
{
@@ -54,73 +54,78 @@
"type_info": "Integer"
},
{
"name": "onboarded",
"name": "personalized_ads",
"ordinal": 10,
"type_info": "Integer"
},
{
"name": "extra_launch_args",
"name": "onboarded",
"ordinal": 11,
"type_info": "Text"
"type_info": "Integer"
},
{
"name": "custom_env_vars",
"name": "extra_launch_args",
"ordinal": 12,
"type_info": "Text"
},
{
"name": "mc_memory_max",
"name": "custom_env_vars",
"ordinal": 13,
"type_info": "Integer"
"type_info": "Text"
},
{
"name": "mc_force_fullscreen",
"name": "mc_memory_max",
"ordinal": 14,
"type_info": "Integer"
},
{
"name": "mc_game_resolution_x",
"name": "mc_force_fullscreen",
"ordinal": 15,
"type_info": "Integer"
},
{
"name": "mc_game_resolution_y",
"name": "mc_game_resolution_x",
"ordinal": 16,
"type_info": "Integer"
},
{
"name": "hide_on_process_start",
"name": "mc_game_resolution_y",
"ordinal": 17,
"type_info": "Integer"
},
{
"name": "hook_pre_launch",
"name": "hide_on_process_start",
"ordinal": 18,
"type_info": "Text"
"type_info": "Integer"
},
{
"name": "hook_wrapper",
"name": "hook_pre_launch",
"ordinal": 19,
"type_info": "Text"
},
{
"name": "hook_post_exit",
"name": "hook_wrapper",
"ordinal": 20,
"type_info": "Text"
},
{
"name": "custom_dir",
"name": "hook_post_exit",
"ordinal": 21,
"type_info": "Text"
},
{
"name": "prev_custom_dir",
"name": "custom_dir",
"ordinal": 22,
"type_info": "Text"
},
{
"name": "migrated",
"name": "prev_custom_dir",
"ordinal": 23,
"type_info": "Text"
},
{
"name": "migrated",
"ordinal": 24,
"type_info": "Integer"
}
],
@@ -139,6 +144,7 @@
false,
false,
false,
false,
null,
null,
false,
@@ -154,5 +160,5 @@
false
]
},
"hash": "03d1aeddf7788320530c447a82342aecdb4099ce183dd9106c4bcc47604cb080"
"hash": "8e19c9cdb0aaa48509724e82f6e8f212c9cd2112fdba77cfeee206025af47761"
}
@@ -1,12 +0,0 @@
{
"db_name": "SQLite",
"query": "\n UPDATE settings\n SET\n max_concurrent_writes = $1,\n max_concurrent_downloads = $2,\n\n theme = $3,\n default_page = $4,\n collapsed_navigation = $5,\n advanced_rendering = $6,\n native_decorations = $7,\n\n discord_rpc = $8,\n developer_mode = $9,\n telemetry = $10,\n\n onboarded = $11,\n\n extra_launch_args = jsonb($12),\n custom_env_vars = jsonb($13),\n mc_memory_max = $14,\n mc_force_fullscreen = $15,\n mc_game_resolution_x = $16,\n mc_game_resolution_y = $17,\n hide_on_process_start = $18,\n\n hook_pre_launch = $19,\n hook_wrapper = $20,\n hook_post_exit = $21,\n\n custom_dir = $22,\n prev_custom_dir = $23,\n migrated = $24\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 24
},
"nullable": []
},
"hash": "d645daf951ff6fead3c86df685d99bacc81cb0a999c0f8d2ff7755b0089a79d8"
}
+2 -2
View File
@@ -1,6 +1,6 @@
[package]
name = "theseus"
version = "0.8.7"
version = "0.8.8"
authors = ["Jai A <jaiagr+gpg@pm.me>"]
edition = "2021"
@@ -36,7 +36,7 @@ tracing-error = "0.2.0"
paste = { version = "1.0" }
tauri = { git = "https://github.com/modrinth/tauri", rev = "5e29428", optional = true }
tauri = { version = "2.0.0-rc", optional = true }
indicatif = { version = "0.17.3", optional = true }
async-tungstenite = { version = "0.27.0", features = ["tokio-runtime", "tokio-rustls-webpki-roots"] }
@@ -0,0 +1 @@
ALTER TABLE settings ADD COLUMN personalized_ads INTEGER NOT NULL DEFAULT TRUE;
+19 -15
View File
@@ -17,6 +17,7 @@ pub struct Settings {
pub telemetry: bool,
pub discord_rpc: bool,
pub developer_mode: bool,
pub personalized_ads: bool,
pub onboarded: bool,
@@ -42,7 +43,7 @@ impl Settings {
SELECT
max_concurrent_writes, max_concurrent_downloads,
theme, default_page, collapsed_navigation, advanced_rendering, native_decorations,
discord_rpc, developer_mode, telemetry,
discord_rpc, developer_mode, telemetry, personalized_ads,
onboarded,
json(extra_launch_args) extra_launch_args, json(custom_env_vars) custom_env_vars,
mc_memory_max, mc_force_fullscreen, mc_game_resolution_x, mc_game_resolution_y, hide_on_process_start,
@@ -65,6 +66,7 @@ impl Settings {
telemetry: res.telemetry == 1,
discord_rpc: res.discord_rpc == 1,
developer_mode: res.developer_mode == 1,
personalized_ads: res.personalized_ads == 1,
onboarded: res.onboarded == 1,
extra_launch_args: res
.extra_launch_args
@@ -123,24 +125,25 @@ impl Settings {
discord_rpc = $8,
developer_mode = $9,
telemetry = $10,
personalized_ads = $11,
onboarded = $11,
onboarded = $12,
extra_launch_args = jsonb($12),
custom_env_vars = jsonb($13),
mc_memory_max = $14,
mc_force_fullscreen = $15,
mc_game_resolution_x = $16,
mc_game_resolution_y = $17,
hide_on_process_start = $18,
extra_launch_args = jsonb($13),
custom_env_vars = jsonb($14),
mc_memory_max = $15,
mc_force_fullscreen = $16,
mc_game_resolution_x = $17,
mc_game_resolution_y = $18,
hide_on_process_start = $19,
hook_pre_launch = $19,
hook_wrapper = $20,
hook_post_exit = $21,
hook_pre_launch = $20,
hook_wrapper = $21,
hook_post_exit = $22,
custom_dir = $22,
prev_custom_dir = $23,
migrated = $24
custom_dir = $23,
prev_custom_dir = $24,
migrated = $25
",
max_concurrent_writes,
max_concurrent_downloads,
@@ -152,6 +155,7 @@ impl Settings {
self.discord_rpc,
self.developer_mode,
self.telemetry,
self.personalized_ads,
self.onboarded,
extra_launch_args,
custom_env_vars,
+112
View File
@@ -31,6 +31,10 @@ importers:
'@modrinth/app-lib':
specifier: workspace:*
version: link:../../packages/app-lib
devDependencies:
'@tauri-apps/cli':
specifier: 2.0.0-rc.16
version: 2.0.0-rc.16
apps/app-frontend:
dependencies:
@@ -2002,6 +2006,71 @@ packages:
'@tauri-apps/api@2.0.0-rc.4':
resolution: {integrity: sha512-UNiIhhKG08j4ooss2oEEVexffmWkgkYlC2M3GcX3VPtNsqFgVNL8Mcw/4Y7rO9M9S+ffAMnLOF5ypzyuyb8tyg==}
'@tauri-apps/cli-darwin-arm64@2.0.0-rc.16':
resolution: {integrity: sha512-lISZU4gG0c9PbY7h/j/gW7nJLxZEygNBrYEET6zN8R99Znf5rSO+CfjenaMcJUUj6yTAd8gzdakRpLqNSAWegA==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [darwin]
'@tauri-apps/cli-darwin-x64@2.0.0-rc.16':
resolution: {integrity: sha512-D9uxPCxpyYcTSQulJGFX3POAKPOJd8WcWHFH8x6YVM1cIx6EWRXIE1sZnPUOjFr7qCg+bSdYdr8/BFHcZGcApQ==}
engines: {node: '>= 10'}
cpu: [x64]
os: [darwin]
'@tauri-apps/cli-linux-arm-gnueabihf@2.0.0-rc.16':
resolution: {integrity: sha512-WsVdKm4D1I1XV8I9yRnmOINZRwwWfh6xcLV3m19+B9g6TohK8RkRxWfxvs3TLQlWOLQ6lo8BzS9rzXB+KtjDpg==}
engines: {node: '>= 10'}
cpu: [arm]
os: [linux]
'@tauri-apps/cli-linux-arm64-gnu@2.0.0-rc.16':
resolution: {integrity: sha512-2jpZDagNs6rrqposHJihHBayttgOl5aB2+bYiVEC6ye+haiFtmYmpdaPOaVIw+YVQs6lepf5PVrisCoU9DmYsg==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
'@tauri-apps/cli-linux-arm64-musl@2.0.0-rc.16':
resolution: {integrity: sha512-SNEDcB+sWOls/B0a+UpUHVa/oegvlXXKYWsTxuXtgWIr5VbWG7rXLZ3fZpLLP3SpRVGTGTnABcyqshFbWSqqKQ==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
'@tauri-apps/cli-linux-x64-gnu@2.0.0-rc.16':
resolution: {integrity: sha512-Zsq29MM1ooeH1+chQBa7ffDFnzAZebBBFdsvs4e05tS1H8gn4oKE+PSMn9p/okzVXykEk9ri2/n7BG1XFeifMA==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
'@tauri-apps/cli-linux-x64-musl@2.0.0-rc.16':
resolution: {integrity: sha512-g+pwSuis2YMxhJJ/pJYwp/Nps5CWvlv/5MV5UfDvClkCkeAyzIqVX+HbBLPcs5S0CePUQNeP0j4d4jBWUqZZQg==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
'@tauri-apps/cli-win32-arm64-msvc@2.0.0-rc.16':
resolution: {integrity: sha512-PpPqdMTwJSDAK4KnNjvh77ShSkY+7pih1f6e50EtXar8bjC17e3XcEqFhDNne5mxEVTLYhibs6p1JLPad0ZjRA==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [win32]
'@tauri-apps/cli-win32-ia32-msvc@2.0.0-rc.16':
resolution: {integrity: sha512-io2yIcEcG7YLP+9n13NbilB93SjcB7jIl8GbURC4XZT4/4t9D1PWHpJr5hySVsGRLCz5e8NzwC5RlnenNzmpPQ==}
engines: {node: '>= 10'}
cpu: [ia32]
os: [win32]
'@tauri-apps/cli-win32-x64-msvc@2.0.0-rc.16':
resolution: {integrity: sha512-Rfkmxe3k+cBVA/kVYt8O25QrQqWKJlH9AiH7Q3C6xBzzG9PCSRMBszCp+JhBF8jhVlwNmOBv6UG+lm85kspwGg==}
engines: {node: '>= 10'}
cpu: [x64]
os: [win32]
'@tauri-apps/cli@2.0.0-rc.16':
resolution: {integrity: sha512-wdjZg/M3dcxiqgWG6VRnABpX0dYxRww93t0d1MYoZxFDrnyoUz5kYwFQ0v4J9u0qenEgskjoypvon7V/Nj9qrg==}
engines: {node: '>= 10'}
hasBin: true
'@tauri-apps/plugin-dialog@2.0.0-rc.0':
resolution: {integrity: sha512-DPOXYe8SQ6Radk/67EOdaomlxL7oF99JO/ZUaPp1IBEs3Wro7lhlz63CfdKIBfKIZTLJLzP1R7/EiPL/GTA3Bg==}
@@ -8041,6 +8110,49 @@ snapshots:
'@tauri-apps/api@2.0.0-rc.4': {}
'@tauri-apps/cli-darwin-arm64@2.0.0-rc.16':
optional: true
'@tauri-apps/cli-darwin-x64@2.0.0-rc.16':
optional: true
'@tauri-apps/cli-linux-arm-gnueabihf@2.0.0-rc.16':
optional: true
'@tauri-apps/cli-linux-arm64-gnu@2.0.0-rc.16':
optional: true
'@tauri-apps/cli-linux-arm64-musl@2.0.0-rc.16':
optional: true
'@tauri-apps/cli-linux-x64-gnu@2.0.0-rc.16':
optional: true
'@tauri-apps/cli-linux-x64-musl@2.0.0-rc.16':
optional: true
'@tauri-apps/cli-win32-arm64-msvc@2.0.0-rc.16':
optional: true
'@tauri-apps/cli-win32-ia32-msvc@2.0.0-rc.16':
optional: true
'@tauri-apps/cli-win32-x64-msvc@2.0.0-rc.16':
optional: true
'@tauri-apps/cli@2.0.0-rc.16':
optionalDependencies:
'@tauri-apps/cli-darwin-arm64': 2.0.0-rc.16
'@tauri-apps/cli-darwin-x64': 2.0.0-rc.16
'@tauri-apps/cli-linux-arm-gnueabihf': 2.0.0-rc.16
'@tauri-apps/cli-linux-arm64-gnu': 2.0.0-rc.16
'@tauri-apps/cli-linux-arm64-musl': 2.0.0-rc.16
'@tauri-apps/cli-linux-x64-gnu': 2.0.0-rc.16
'@tauri-apps/cli-linux-x64-musl': 2.0.0-rc.16
'@tauri-apps/cli-win32-arm64-msvc': 2.0.0-rc.16
'@tauri-apps/cli-win32-ia32-msvc': 2.0.0-rc.16
'@tauri-apps/cli-win32-x64-msvc': 2.0.0-rc.16
'@tauri-apps/plugin-dialog@2.0.0-rc.0':
dependencies:
'@tauri-apps/api': 2.0.0-rc.3