A music player that connects to your cloud/distributed storage.
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Tauri dev server issues

+75 -26
+5 -5
src-tauri/Cargo.lock
··· 206 206 207 207 [[package]] 208 208 name = "cargo_toml" 209 - version = "0.13.0" 209 + version = "0.13.3" 210 210 source = "registry+https://github.com/rust-lang/crates.io-index" 211 - checksum = "aa0e3586af56b3bfa51fca452bd56e8dbbbd5d8d81cbf0b7e4e35b695b537eb8" 211 + checksum = "497049e9477329f8f6a559972ee42e117487d01d1e8c2cc9f836ea6fa23a9e1a" 212 212 dependencies = [ 213 213 "serde", 214 214 "toml", ··· 500 500 501 501 [[package]] 502 502 name = "diffuse" 503 - version = "3.2.0" 503 + version = "3.3.0" 504 504 dependencies = [ 505 505 "serde", 506 506 "serde_json", ··· 2625 2625 [[package]] 2626 2626 name = "tauri-plugin-localhost" 2627 2627 version = "0.1.0" 2628 - source = "registry+https://github.com/rust-lang/crates.io-index" 2629 - checksum = "f20786ccff879045f6bafec445fb5c6740c0c057372d2f992ae1281e4658c681" 2628 + source = "git+https://github.com/tauri-apps/tauri-plugin-localhost.git?rev=a759df6a42d1a3986c9551a7130dd7f81a47d248#a759df6a42d1a3986c9551a7130dd7f81a47d248" 2630 2629 dependencies = [ 2630 + "http", 2631 2631 "serde_json", 2632 2632 "tauri", 2633 2633 "tiny_http",
+4 -4
src-tauri/Cargo.toml
··· 1 1 [package] 2 2 name = "diffuse" 3 - version = "3.2.0" 3 + version = "3.3.0" 4 4 description = "A music player that connects to your cloud/distributed storage" 5 - authors = ["you"] 5 + authors = ["Steven Vandevelde"] 6 6 license = "" 7 7 repository = "" 8 8 default-run = "diffuse" ··· 17 17 [dependencies] 18 18 serde_json = "^1.0" 19 19 serde = { version = "^1.0", features = ["derive"] } 20 - tauri = { version = "^1.2.3", features = ["dialog-all", "fs-all", "http-all", "path-all", "shell-open", "shell-open-api", "window-all"] } 21 - tauri-plugin-localhost = { version = "^0.1.0" } 20 + tauri = { version = "^1.2.3", features = ["clipboard-all", "dialog-all", "fs-all", "global-shortcut-all", "http-all", "path-all", "protocol-all", "shell-open", "shell-open-api", "window-all"] } 21 + tauri-plugin-localhost = { git = "https://github.com/tauri-apps/tauri-plugin-localhost.git", rev = "a759df6a42d1a3986c9551a7130dd7f81a47d248" } 22 22 tauri-plugin-window-state = { version = "^0.1.0" } 23 23 24 24 [features]
+57 -17
src-tauri/src/main.rs
··· 4 4 )] 5 5 6 6 use std::path::PathBuf; 7 - use tauri::TitleBarStyle; 8 - use tauri::{utils::config::AppUrl, WindowBuilder, WindowUrl}; 7 + use tauri::{TitleBarStyle, WindowBuilder, WindowUrl}; 8 + use tauri::utils::config::AppUrl; 9 + 10 + 11 + // 🚀 PRODUCTION 9 12 13 + 14 + #[cfg(not(dev))] 10 15 fn main() { 11 16 let port = 44999; 12 17 let mut context = tauri::generate_context!("tauri.conf.json"); ··· 21 26 .plugin(tauri_plugin_localhost::Builder::new(port).build()) 22 27 .plugin(tauri_plugin_window_state::Builder::default().build()) 23 28 .setup(move |app| { 24 - WindowBuilder::new( 25 - app, 26 - "main", 27 - WindowUrl::App(PathBuf::from("index.html")) 28 - ) 29 - .title("Diffuse") 30 - .title_bar_style(TitleBarStyle::Overlay) 31 - .hidden_title(true) 32 - .maximized(true) 33 - .resizable(true) 34 - .theme(None) 35 - .enable_clipboard_access() 36 - .user_agent("Chrome") 37 - .build()?; 29 + build_window(app.handle()); 30 + Ok(()) 31 + }) 32 + .run(context) 33 + .expect("Error while running tauri application"); 34 + } 35 + 36 + 37 + 38 + // 💣 DEVELOPMENT 39 + 38 40 39 - // Fin 41 + #[cfg(dev)] 42 + fn main() { 43 + let mut context = tauri::generate_context!("tauri.conf.json"); 44 + 45 + // Need to run Diffuse's dev server command on port 8000 46 + // instead of Tauri's dev server which doesn't to work very well. 47 + let url = format!("http://localhost:{}", 8000).parse().unwrap(); 48 + let window_url = WindowUrl::External(url); 49 + 50 + context.config_mut().build.dist_dir = AppUrl::Url(window_url.clone()); 51 + context.config_mut().build.dev_path = AppUrl::Url(window_url.clone()); 52 + 53 + tauri::Builder::default() 54 + .plugin(tauri_plugin_window_state::Builder::default().build()) 55 + .setup(move |app| { 56 + build_window(app.handle()); 40 57 Ok(()) 41 58 }) 42 59 .run(context) 43 60 .expect("Error while running tauri application"); 61 + } 62 + 63 + 64 + 65 + // WINDOWS 66 + 67 + 68 + fn build_window(app: tauri::AppHandle) { 69 + WindowBuilder::new( 70 + &app, 71 + "main", 72 + WindowUrl::App(PathBuf::from("index.html")) 73 + ) 74 + .title("Diffuse") 75 + .title_bar_style(TitleBarStyle::Overlay) 76 + .hidden_title(true) 77 + .maximized(true) 78 + .resizable(true) 79 + .theme(None) 80 + .enable_clipboard_access() 81 + .user_agent("Chrome") 82 + .build() 83 + .unwrap(); 44 84 }
+9
src-tauri/tauri.conf.json
··· 43 43 "active": false 44 44 }, 45 45 "allowlist": { 46 + "clipboard": { 47 + "all": true 48 + }, 46 49 "dialog": { 47 50 "all": true 48 51 }, 49 52 "fs": { 50 53 "all": true 51 54 }, 55 + "globalShortcut": { 56 + "all": true 57 + }, 52 58 "http": { 53 59 "all": true, 54 60 "request": true 55 61 }, 56 62 "path": { 63 + "all": true 64 + }, 65 + "protocol": { 57 66 "all": true 58 67 }, 59 68 "shell": {