Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Tauri Support #677

Draft
wants to merge 89 commits into
base: v2
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
cf48b63
Initial Tauri project
Nyabsi Dec 16, 2023
7e1fbd3
Add more checks to prevent Electron code running on Tauri & Implement…
Nyabsi Dec 16, 2023
10a52b4
Set temporary APPDATA_PATH
Nyabsi Dec 16, 2023
c2bb93c
Remove electron IPC from TopBar, if using Tauri
Nyabsi Dec 16, 2023
54452f1
Add Rust native Menu
Nyabsi Dec 16, 2023
36203b4
Make sure that App.vue doesn't show TopBar on MacOS
Nyabsi Dec 16, 2023
c5759ea
Remove APPDATA_PATH since it is no longer needed.
Nyabsi Dec 16, 2023
d728fdc
Implement Tauri specific filesystem API
Nyabsi Dec 16, 2023
e822317
Remove redundant debug message
Nyabsi Dec 16, 2023
d0fde19
Implement Javascript Tauri emitters
Nyabsi Dec 16, 2023
b4d8d59
Implement rest of the native emitters
Nyabsi Dec 16, 2023
a2a6b23
Add disclaimer
Nyabsi Dec 16, 2023
65a95ca
Change identifier to allow deployment
Nyabsi Dec 16, 2023
bc4c9dd
Update csp security policy to allow image loading in release builds
Nyabsi Dec 16, 2023
934b992
Change the icon to the amethyst icon
Nyabsi Dec 16, 2023
743fd68
Implement "update_presence" command for Tauri
Nyabsi Dec 16, 2023
17b7dfa
Disallow use of default "contextmenu" on Tauri
Nyabsi Dec 16, 2023
d77526b
Set the default windows size for Tauri
Nyabsi Dec 16, 2023
c110d37
Fix tauri application category
Nyabsi Dec 16, 2023
0a3dab9
Try to preload music, so buffering wouldn't have issues.
Nyabsi Dec 16, 2023
c7fff1c
Fix folder importing mechanism
Nyabsi Dec 16, 2023
291d44d
Update Tauri version to match upstream
Nyabsi Dec 16, 2023
52b85a6
CSP changes to allow blobs and images to properly load
Nyabsi Dec 16, 2023
dcc248b
Set language to "en-US" for now, fixes release builds
Nyabsi Dec 16, 2023
43acec1
Change application version in rich-presence
Nyabsi Dec 16, 2023
9707966
Let's no preload the file after all, it is stupid.
Nyabsi Dec 16, 2023
686fb33
Fix memory leak
Nyabsi Dec 16, 2023
f3d7dd0
Don't load Tauri at the beginning
Nyabsi Dec 16, 2023
a662da1
Improve memory management
Nyabsi Dec 16, 2023
0510a35
Remove forgotten debug lines
Nyabsi Dec 16, 2023
cb8be1b
Use let instead of var :P
Nyabsi Dec 16, 2023
0834f51
Revert source attribute removal
Nyabsi Dec 16, 2023
ceb3186
Catch rpc crash, if discord is not open.
Nyabsi Dec 16, 2023
d3ef581
Fix incorrectly set menu urls
Nyabsi Dec 16, 2023
2f93ee4
Instead of handling error, just ignore them entirely
Nyabsi Dec 16, 2023
3597684
Make DiscordIpcClient non-mutable
Nyabsi Dec 16, 2023
3b1a6fd
Merge remote-tracking branch 'origin/v2_clone' into tauri
Nyabsi Dec 17, 2023
54c2a52
Implement Tauri support for mediaSources and fix circular dependecy
Nyabsi Dec 17, 2023
c4464d7
Add rust changes to reflect new source behaviour
Nyabsi Dec 17, 2023
7105f35
Add JavaScript changes to reflect new source behaviour
Nyabsi Dec 17, 2023
6622e0e
Implement tauriGetRootDirectory for mediaSources
Nyabsi Dec 17, 2023
662986d
Remove extra semicolon
Nyabsi Dec 17, 2023
d29da9d
Implement Tauri shell open
Nyabsi Dec 17, 2023
8196557
instead of importing use this.amethyst
Nyabsi Dec 17, 2023
ecfcaac
Implement more Amethyst helpers for Tauri
Nyabsi Dec 17, 2023
1e3a527
Reduce the amount of re-used code.
Nyabsi Dec 17, 2023
36b9537
Add forgotten Tauri check for dialog return path
Nyabsi Dec 17, 2023
8d69e0b
put "fetchAsyncData" back, deleted by accident.
Nyabsi Dec 17, 2023
e5de46e
Update Tauri shell logic to support showing file locations
Nyabsi Dec 17, 2023
87d04f0
Implement Tauri specific APIs for Graph saving/loading
Nyabsi Dec 17, 2023
305a9d7
Delete redundant tauri example icons
Nyabsi Dec 17, 2023
e3ddbab
Fix Tauri detection logic
Nyabsi Dec 17, 2023
fbcf28c
Fix a massive memory leak when emitting "play" event
Nyabsi Dec 17, 2023
e30d04c
Set crossOrigin to anonymous to make sure player works on Windows (Ta…
Nyabsi Dec 17, 2023
42afc07
Implement proper data path management for Tauri
Nyabsi Dec 17, 2023
a42ad46
Umm remove unnecessary debug message
Nyabsi Dec 17, 2023
25e8190
Fix yet another memory leak, don't use Tauri API for large files (songs)
Nyabsi Dec 17, 2023
76df0c8
Implement proper platform check for Tauri
Nyabsi Dec 17, 2023
4cbcd7b
For now, remove native menu from Windows
Nyabsi Dec 17, 2023
4ca484e
Fetch package version properly for rich presence
Nyabsi Dec 17, 2023
01d8386
Add getting language from settings back
Nyabsi Dec 17, 2023
abec5a6
Do not show control-buttons on Tauri because it will always force nat…
Nyabsi Dec 17, 2023
3609455
Implement setting import/export handling on tauri
Nyabsi Dec 18, 2023
6660314
It's "macos" not "mac_os" (fix target_os)
Nyabsi Dec 18, 2023
78fbe32
Just use Tauri emitters for reusable emits
Nyabsi Dec 18, 2023
295dc1a
Just use Tauri emitters for reusable emits pt2
Nyabsi Dec 18, 2023
e6087ae
update csp policy to allow asset: path
Nyabsi Dec 18, 2023
2813df3
Add check to load default language if setting item does not exist
Nyabsi Dec 18, 2023
89adfce
make AmbientColor work with Tauri as well.
Nyabsi Dec 18, 2023
d634adf
Implement getCurrentRuntime to manage platform specific implementations.
Nyabsi Dec 18, 2023
82d798e
Refactor more of the code to be uniform with rest of the codebase
Nyabsi Dec 18, 2023
d3cef95
Cleanup more of the code
Nyabsi Dec 18, 2023
37b2440
Implement more tree-based imports instead of global.
Nyabsi Dec 18, 2023
fe3a7b2
Adding missing struct to rust code
Nyabsi Dec 18, 2023
9b4ea43
Revert README
Nyabsi Dec 18, 2023
8bd9752
Re-write Rust rich-presence logic to use Tauri states
Nyabsi Dec 19, 2023
1d96105
Fix & remove more Tauri specific logic
Nyabsi Dec 19, 2023
a098a8a
Create dummy menu on linux
Nyabsi Dec 19, 2023
8a147d9
Let's not make path into Reference, otherwise it will not update prop…
Nyabsi Dec 28, 2023
1fa4ec7
Create "RelWithDebug" target for further debugging.
Nyabsi Dec 28, 2023
f338cb5
Remove unused import
Nyabsi Dec 29, 2023
88e58ad
Add missing menu item
Nyabsi Dec 29, 2023
88f34b0
Merge remote-tracking branch 'geoxor/v2' into tauri
Nyabsi Dec 29, 2023
a60ecf0
Add missing locale keys
Nyabsi Dec 29, 2023
59018fa
Solve tracks not resuming properly
Nyabsi Dec 29, 2023
0237e30
Add initial Tauri CI for MacOS
Nyabsi Dec 29, 2023
989b4e8
Change few minor tweaks for Tauri CI
Nyabsi Dec 29, 2023
c5c984e
Change the disclaimer
Nyabsi Dec 29, 2023
83dc875
Merge branch 'v2' into tauri
Geoxor Feb 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make DiscordIpcClient non-mutable
Nyabsi committed Dec 16, 2023
commit 3597684c1555b2784645ca43b35001e611450d29
6 changes: 3 additions & 3 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ struct FolderPayload {

lazy_static! {
static ref client: Mutex<DiscordIpcClient> = Mutex::new({
let mut c = DiscordIpcClient::new("976036303156162570").unwrap();
let c = DiscordIpcClient::new("976036303156162570").unwrap();
c
});
}
@@ -43,12 +43,12 @@ fn update_presence(title: String, time: String, format: String) {
.details(&title)
.assets(assets);

let _ = client.lock().unwrap().set_activity(payload)?;
let _ = client.lock().unwrap().set_activity(payload).unwrap();
}

fn main() {

let _ = client.lock().unwrap().connect()?;
let _ = client.lock().unwrap().connect().unwrap();

#[cfg(debug_assertions)]
let menu = Menu::new()