1
0
Fork 0

Compare commits

..

No commits in common. "c2dafe4ee1c3de0852ae93dda2581e2f37ba9415" and "007246da68b155b898d195dfde1e2c4698b98725" have entirely different histories.

10 changed files with 722 additions and 5360 deletions

1885
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies]
tauri-build = { version = "2", features = [] }
tauri-build = { version = "1", features = [] }
[dependencies]
anyhow = { version = "1.0", features = [] }
@ -18,8 +18,7 @@ r621 = "0.2"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
simplelog = "0.12"
tauri = { version = "2", features = [] }
tauri-plugin-shell = "2"
tauri = { version = "1", features = ["shell-open"] }
thiserror = "1.0"
tokio = { version = "1.35", features = ["full"] }

View file

@ -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

View file

@ -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

View file

@ -2,16 +2,13 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use r621::client::{Authentication, Client};
use r621::prelude::Post;
use std::sync::Arc;
use tauri::State;
use tokio::sync::Mutex;
use std::sync::Arc;
use r621::prelude::Post;
#[tauri::command]
async fn get_posts(
query: Option<String>,
arcmut_esix_client: State<'_, Arc<Mutex<Client>>>,
) -> anyhow::Result<Vec<Post>, String> {
async fn get_posts(query: Option<String>, arcmut_esix_client: State<'_, Arc<Mutex<Client>>>) -> anyhow::Result<Vec<Post>, String> {
let mut esix_client = arcmut_esix_client.lock().await;
match esix_client.list_posts(None, query, None).await {
Ok(res) => {
@ -25,10 +22,7 @@ async fn get_posts(
}
#[tauri::command]
async fn get_post(
post_id: u64,
arcmut_esix_client: State<'_, Arc<Mutex<Client>>>,
) -> anyhow::Result<Post, String> {
async fn get_post(post_id: u64, arcmut_esix_client: State<'_, Arc<Mutex<Client>>>) -> anyhow::Result<Post, String> {
let mut esix_client = arcmut_esix_client.lock().await;
match esix_client.get_post(post_id).await {
Ok(res) => {
@ -46,16 +40,16 @@ async fn main() {
let user_agent = "eSixClient/1.0 (by pixelhunter on e621)";
let auth = Authentication::Authorized {
username: "pixelhunter",
apikey: "P4pzvnfLSjhQdgCmMfZ8HwUy",
apikey: "P4pzvnfLSjhQdgCmMfZ8HwUy"
};
let esix_client = Client::new(auth, user_agent).expect("Could not create esix client");
let arcmut_esix_client = Arc::new(Mutex::new(esix_client));
tauri::Builder::default()
.plugin(tauri_plugin_shell::init())
.invoke_handler(tauri::generate_handler![get_posts, get_post])
.manage(arcmut_esix_client.clone())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

View file

@ -2,12 +2,25 @@
"build": {
"beforeDevCommand": "pnpm dev",
"beforeBuildCommand": "pnpm build",
"frontendDist": "../dist",
"devUrl": "http://localhost:1420"
"devPath": "http://localhost:1420",
"distDir": "../dist"
},
"package": {
"productName": "esix-client",
"version": "0.0.0"
},
"tauri": {
"allowlist": {
"all": false,
"shell": {
"all": false,
"open": true
}
},
"bundle": {
"active": true,
"targets": "all",
"identifier": "com.tauri.dev",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
@ -16,12 +29,9 @@
"icons/icon.ico"
]
},
"productName": "esix-client",
"mainBinaryName": "esix-client",
"version": "0.0.0",
"identifier": "de.dhalucario.esix-client",
"plugins": {},
"app": {
"security": {
"csp": null
},
"windows": [
{
"fullscreen": false,
@ -30,9 +40,6 @@
"width": 800,
"height": 600
}
],
"security": {
"csp": null
}
]
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB