Compare commits
No commits in common. "c2dafe4ee1c3de0852ae93dda2581e2f37ba9415" and "007246da68b155b898d195dfde1e2c4698b98725" have entirely different histories.
c2dafe4ee1
...
007246da68
10 changed files with 722 additions and 5360 deletions
1885
src-tauri/Cargo.lock
generated
1885
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -8,7 +8,7 @@ edition = "2021"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tauri-build = { version = "2", features = [] }
|
tauri-build = { version = "1", features = [] }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = { version = "1.0", features = [] }
|
anyhow = { version = "1.0", features = [] }
|
||||||
|
@ -18,8 +18,7 @@ r621 = "0.2"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
simplelog = "0.12"
|
simplelog = "0.12"
|
||||||
tauri = { version = "2", features = [] }
|
tauri = { version = "1", features = ["shell-open"] }
|
||||||
tauri-plugin-shell = "2"
|
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
tokio = { version = "1.35", features = ["full"] }
|
tokio = { version = "1.35", features = ["full"] }
|
||||||
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"identifier": "migrated",
|
|
||||||
"description": "permissions that were migrated from v1",
|
|
||||||
"local": true,
|
|
||||||
"windows": [
|
|
||||||
"main"
|
|
||||||
],
|
|
||||||
"permissions": [
|
|
||||||
"core:default",
|
|
||||||
"shell:allow-open",
|
|
||||||
"shell:default"
|
|
||||||
]
|
|
||||||
}
|
|
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
||||||
{"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["core:default","shell:allow-open","shell:default"]}}
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -2,16 +2,13 @@
|
||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
use r621::client::{Authentication, Client};
|
use r621::client::{Authentication, Client};
|
||||||
use r621::prelude::Post;
|
|
||||||
use std::sync::Arc;
|
|
||||||
use tauri::State;
|
use tauri::State;
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
|
use std::sync::Arc;
|
||||||
|
use r621::prelude::Post;
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
async fn get_posts(
|
async fn get_posts(query: Option<String>, arcmut_esix_client: State<'_, Arc<Mutex<Client>>>) -> anyhow::Result<Vec<Post>, String> {
|
||||||
query: Option<String>,
|
|
||||||
arcmut_esix_client: State<'_, Arc<Mutex<Client>>>,
|
|
||||||
) -> anyhow::Result<Vec<Post>, String> {
|
|
||||||
let mut esix_client = arcmut_esix_client.lock().await;
|
let mut esix_client = arcmut_esix_client.lock().await;
|
||||||
match esix_client.list_posts(None, query, None).await {
|
match esix_client.list_posts(None, query, None).await {
|
||||||
Ok(res) => {
|
Ok(res) => {
|
||||||
|
@ -25,10 +22,7 @@ async fn get_posts(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
async fn get_post(
|
async fn get_post(post_id: u64, arcmut_esix_client: State<'_, Arc<Mutex<Client>>>) -> anyhow::Result<Post, String> {
|
||||||
post_id: u64,
|
|
||||||
arcmut_esix_client: State<'_, Arc<Mutex<Client>>>,
|
|
||||||
) -> anyhow::Result<Post, String> {
|
|
||||||
let mut esix_client = arcmut_esix_client.lock().await;
|
let mut esix_client = arcmut_esix_client.lock().await;
|
||||||
match esix_client.get_post(post_id).await {
|
match esix_client.get_post(post_id).await {
|
||||||
Ok(res) => {
|
Ok(res) => {
|
||||||
|
@ -46,16 +40,16 @@ async fn main() {
|
||||||
let user_agent = "eSixClient/1.0 (by pixelhunter on e621)";
|
let user_agent = "eSixClient/1.0 (by pixelhunter on e621)";
|
||||||
let auth = Authentication::Authorized {
|
let auth = Authentication::Authorized {
|
||||||
username: "pixelhunter",
|
username: "pixelhunter",
|
||||||
apikey: "P4pzvnfLSjhQdgCmMfZ8HwUy",
|
apikey: "P4pzvnfLSjhQdgCmMfZ8HwUy"
|
||||||
};
|
};
|
||||||
|
|
||||||
let esix_client = Client::new(auth, user_agent).expect("Could not create esix client");
|
let esix_client = Client::new(auth, user_agent).expect("Could not create esix client");
|
||||||
let arcmut_esix_client = Arc::new(Mutex::new(esix_client));
|
let arcmut_esix_client = Arc::new(Mutex::new(esix_client));
|
||||||
|
|
||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
.plugin(tauri_plugin_shell::init())
|
|
||||||
.invoke_handler(tauri::generate_handler![get_posts, get_post])
|
.invoke_handler(tauri::generate_handler![get_posts, get_post])
|
||||||
.manage(arcmut_esix_client.clone())
|
.manage(arcmut_esix_client.clone())
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
.expect("error while running tauri application");
|
.expect("error while running tauri application");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,26 +2,36 @@
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "pnpm dev",
|
"beforeDevCommand": "pnpm dev",
|
||||||
"beforeBuildCommand": "pnpm build",
|
"beforeBuildCommand": "pnpm build",
|
||||||
"frontendDist": "../dist",
|
"devPath": "http://localhost:1420",
|
||||||
"devUrl": "http://localhost:1420"
|
"distDir": "../dist"
|
||||||
},
|
},
|
||||||
"bundle": {
|
"package": {
|
||||||
"active": true,
|
"productName": "esix-client",
|
||||||
"targets": "all",
|
"version": "0.0.0"
|
||||||
"icon": [
|
|
||||||
"icons/32x32.png",
|
|
||||||
"icons/128x128.png",
|
|
||||||
"icons/128x128@2x.png",
|
|
||||||
"icons/icon.icns",
|
|
||||||
"icons/icon.ico"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"productName": "esix-client",
|
"tauri": {
|
||||||
"mainBinaryName": "esix-client",
|
"allowlist": {
|
||||||
"version": "0.0.0",
|
"all": false,
|
||||||
"identifier": "de.dhalucario.esix-client",
|
"shell": {
|
||||||
"plugins": {},
|
"all": false,
|
||||||
"app": {
|
"open": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bundle": {
|
||||||
|
"active": true,
|
||||||
|
"targets": "all",
|
||||||
|
"identifier": "com.tauri.dev",
|
||||||
|
"icon": [
|
||||||
|
"icons/32x32.png",
|
||||||
|
"icons/128x128.png",
|
||||||
|
"icons/128x128@2x.png",
|
||||||
|
"icons/icon.icns",
|
||||||
|
"icons/icon.ico"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"security": {
|
||||||
|
"csp": null
|
||||||
|
},
|
||||||
"windows": [
|
"windows": [
|
||||||
{
|
{
|
||||||
"fullscreen": false,
|
"fullscreen": false,
|
||||||
|
@ -30,9 +40,6 @@
|
||||||
"width": 800,
|
"width": 800,
|
||||||
"height": 600
|
"height": 600
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"security": {
|
|
||||||
"csp": null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.5 KiB |
Loading…
Reference in a new issue