A photo manager for VRChat.

jhkjhkljklhhjkl

Changed files
+18 -6
src
src-tauri
src
+1 -1
src-tauri/src/frontend_calls/config.rs
··· 5 5 pub fn get_config_path() -> PathBuf{ 6 6 let path = dirs::config_dir() 7 7 .unwrap() 8 - .join("PhazeDev\\VRChatPhotoManager\\.config"); 8 + .join("PhazeDev/VRChatPhotoManager/.config"); 9 9 10 10 match fs::metadata(&path){ 11 11 Ok(_) => {}
+8
src-tauri/src/frontend_calls/get_os.rs
··· 1 + #[tauri::command] 2 + pub fn get_os() -> String{ 3 + #[cfg(windows)] 4 + return "windows".into(); 5 + 6 + #[cfg(unix)] 7 + return "unix".into(); 8 + }
+2 -1
src-tauri/src/frontend_calls/mod.rs
··· 11 11 pub mod change_final_path; 12 12 pub mod delete_photo; 13 13 pub mod relaunch; 14 - pub mod config; 14 + pub mod config; 15 + pub mod get_os;
-2
src-tauri/src/util/handle_uri_proto.rs
··· 32 32 #[cfg(unix)] 33 33 let path = uri.path(); 34 34 35 - dbg!(path); 36 - 37 35 let file = fs::File::open(path); 38 36 39 37 match file {
+6 -1
src/Components/PhotoList.tsx
··· 64 64 let filterType: FilterType = FilterType.USER; 65 65 let filter = ''; 66 66 67 + let os = "unknown"; 68 + (async () => { 69 + os = await invoke('get_os'); 70 + })(); 71 + 67 72 let filteredPhotos: Photo[] = []; 68 73 69 74 let closeWithKey = ( e: KeyboardEvent ) => { ··· 168 173 this.imageEl = document.createElement('img'); 169 174 this.imageEl.crossOrigin = 'anonymous'; 170 175 171 - this.imageEl.src = "photo://localhost" + photoPath + this.path + "?downscale"; 176 + this.imageEl.src = os === "windows" ? "http://photo.localhost/" : "photo://localhost" + photoPath + this.path + "?downscale"; 172 177 173 178 this.imageEl.onload = () => { 174 179 this.image!.width = this.scaledWidth!;
+1 -1
src/Components/PhotoViewer.tsx
··· 262 262 if(!photoPath) 263 263 photoPath = await invoke('get_user_photos_path') + '/'; 264 264 265 - imageViewer.src = 'photo://localhost' + (photoPath + props.currentPhotoView().path).split('\\').join('/') + "?full"; 265 + imageViewer.src = await invoke('get_os') === "windows" ? "http://photo.localhost/" : 'photo://localhost' + (photoPath + props.currentPhotoView().path).split('\\').join('/') + "?full"; 266 266 imageViewer.crossOrigin = 'anonymous'; 267 267 })(); 268 268