Fix build errors and update to latest tauri version

pull/30/head
trivernis 9 months ago
parent 7047dc7903
commit db01332c15
Signed by: Trivernis
GPG Key ID: 7E6D18B61C8D2F4B

@ -0,0 +1,11 @@
[language-server.rust-analyzer]
command = "rust-analyzer"
[language-server.rust-analyzer.config]
inlayHints.bindingModeHints.enable = false
inlayHints.closingBraceHints.minLines = 10
inlayHints.closureReturnTypeHints.enable = "with_block"
inlayHints.discriminantHints.enable = "fieldless"
inlayHints.lifetimeElisionHints.enable = "skip_trivial"
inlayHints.typeHints.hideClosureInitialization = false
cargo.features = "all"

@ -1,6 +1,6 @@
[package]
name = "mediarepo-api"
version = "0.32.1"
version = "0.33.0"
edition = "2018"
license = "gpl-3"
@ -20,7 +20,7 @@ url = { version = "2.2.2", optional = true }
pathsearch = { version = "0.2.0", optional = true }
[dependencies.bromine]
version = "0.20.1"
version = "0.22.1"
optional = true
features = ["serialize_bincode", "encryption_layer"]
@ -33,7 +33,7 @@ version = "0.4.19"
features = ["serde"]
[dependencies.tauri]
version = "1.0.0-rc.4"
version = "1.5.4"
optional = true
default-features = false
features = []

@ -1,22 +1,22 @@
pub mod error;
pub mod file;
pub mod job;
pub mod preset;
pub mod protocol;
pub mod repo;
pub mod tag;
pub mod preset;
use crate::client_api::error::{ApiError, ApiResult};
use crate::client_api::file::FileApi;
use crate::client_api::job::JobApi;
use crate::client_api::preset::PresetApi;
use crate::client_api::repo::RepoApi;
use crate::client_api::tag::TagApi;
use crate::types::misc::{check_apis_compatible, get_api_version, InfoResponse};
use async_trait::async_trait;
use bromine::prelude::*;
use bromine::prelude::emit_metadata::EmitMetadata;
use bromine::prelude::*;
use tokio::time::Duration;
use crate::client_api::preset::PresetApi;
#[async_trait]
pub trait IPCApi {

@ -57,7 +57,10 @@ fn once_scheme<R: Runtime>(app: &AppHandle<R>, request: &Request) -> Result<Resp
#[tracing::instrument(level = "debug", skip_all)]
async fn content_scheme<R: Runtime>(app: &AppHandle<R>, request: &Request) -> Result<Response> {
let buf_state = app.state::<BufferState>();
let hash = request.uri().trim_start_matches("content://");
let hash = request
.uri()
.trim_start_matches("content://")
.trim_end_matches("/");
if let Some(buffer) = buf_state.get_entry(hash) {
tracing::debug!("Fetching content from cache");

@ -5,8 +5,9 @@ use std::time::{SystemTime, UNIX_EPOCH};
pub fn system_time_to_naive_date_time(system_time: SystemTime) -> NaiveDateTime {
let epoch_duration = system_time.duration_since(UNIX_EPOCH).unwrap();
NaiveDateTime::from_timestamp(
NaiveDateTime::from_timestamp_opt(
epoch_duration.as_secs() as i64,
epoch_duration.subsec_nanos(),
)
.unwrap()
}

@ -25,10 +25,11 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "aead"
version = "0.4.3"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877"
checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
dependencies = [
"crypto-common",
"generic-array",
]
@ -38,7 +39,7 @@ version = "0.7.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd"
dependencies = [
"getrandom 0.2.12",
"getrandom",
"once_cell",
"version_check",
]
@ -418,9 +419,9 @@ dependencies = [
[[package]]
name = "bromine"
version = "0.20.2"
version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a16eab2259221f3b27c892f2b3cd7481411acab516fcaacc00993d44eebe6fbf"
checksum = "ef32f4f5be30cb2bad004d6ba32ce3347cbd4724356b169f80f4a72d676fd608"
dependencies = [
"async-trait",
"bincode",
@ -432,7 +433,7 @@ dependencies = [
"lazy_static",
"num_enum",
"rand",
"rand_core 0.6.4",
"rand_core",
"serde",
"sha2",
"thiserror",
@ -518,21 +519,20 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
[[package]]
name = "chacha20"
version = "0.8.2"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6"
checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818"
dependencies = [
"cfg-if 1.0.0",
"cipher",
"cpufeatures",
"zeroize",
]
[[package]]
name = "chacha20poly1305"
version = "0.9.1"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5"
checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35"
dependencies = [
"aead",
"chacha20",
@ -558,11 +558,13 @@ dependencies = [
[[package]]
name = "cipher"
version = "0.3.0"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7"
checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
dependencies = [
"generic-array",
"crypto-common",
"inout",
"zeroize",
]
[[package]]
@ -790,22 +792,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
dependencies = [
"generic-array",
"rand_core",
"typenum",
]
[[package]]
name = "curve25519-dalek"
version = "3.2.1"
version = "4.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0"
checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c"
dependencies = [
"byteorder",
"digest 0.9.0",
"rand_core 0.5.1",
"cfg-if 1.0.0",
"cpufeatures",
"curve25519-dalek-derive",
"fiat-crypto",
"platforms",
"rustc_version 0.4.0",
"subtle",
"zeroize",
]
[[package]]
name = "curve25519-dalek-derive"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
dependencies = [
"proc-macro2 1.0.78",
"quote 1.0.35",
"syn 2.0.48",
]
[[package]]
name = "dashmap"
version = "5.5.3"
@ -854,15 +871,6 @@ dependencies = [
"powerfmt",
]
[[package]]
name = "digest"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
dependencies = [
"generic-array",
]
[[package]]
name = "digest"
version = "0.10.7"
@ -950,6 +958,12 @@ dependencies = [
"simd-adler32",
]
[[package]]
name = "fiat-crypto"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7"
[[package]]
name = "finl_unicode"
version = "1.2.0"
@ -1139,17 +1153,6 @@ dependencies = [
"version_check",
]
[[package]]
name = "getrandom"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
dependencies = [
"cfg-if 1.0.0",
"libc",
"wasi 0.9.0+wasi-snapshot-preview1",
]
[[package]]
name = "getrandom"
version = "0.2.12"
@ -1158,7 +1161,7 @@ checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
dependencies = [
"cfg-if 1.0.0",
"libc",
"wasi 0.11.0+wasi-snapshot-preview1",
"wasi",
]
[[package]]
@ -1459,6 +1462,15 @@ dependencies = [
"hashbrown 0.14.3",
]
[[package]]
name = "inout"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5"
dependencies = [
"generic-array",
]
[[package]]
name = "instant"
version = "0.1.12"
@ -1620,7 +1632,7 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
[[package]]
name = "mediarepo-api"
version = "0.32.1"
version = "0.33.0"
dependencies = [
"bromine",
"chrono",
@ -1659,7 +1671,7 @@ dependencies = [
[[package]]
name = "mediarepo-daemon"
version = "1.0.4"
version = "1.0.5"
dependencies = [
"console-subscriber",
"glob",
@ -1788,7 +1800,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09"
dependencies = [
"libc",
"wasi 0.11.0+wasi-snapshot-preview1",
"wasi",
"windows-sys 0.48.0",
]
@ -1819,7 +1831,7 @@ dependencies = [
"blake2s_simd",
"blake3",
"core2",
"digest 0.10.7",
"digest",
"multihash-derive",
"sha2",
"sha3",
@ -1920,23 +1932,23 @@ dependencies = [
[[package]]
name = "num_enum"
version = "0.5.11"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9"
checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845"
dependencies = [
"num_enum_derive",
]
[[package]]
name = "num_enum_derive"
version = "0.5.11"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799"
checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b"
dependencies = [
"proc-macro-crate 1.1.3",
"proc-macro-crate 3.1.0",
"proc-macro2 1.0.78",
"quote 1.0.35",
"syn 1.0.109",
"syn 2.0.48",
]
[[package]]
@ -2247,6 +2259,12 @@ version = "0.3.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb"
[[package]]
name = "platforms"
version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c"
[[package]]
name = "png"
version = "0.17.11"
@ -2262,9 +2280,9 @@ dependencies = [
[[package]]
name = "poly1305"
version = "0.7.2"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede"
checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf"
dependencies = [
"cpufeatures",
"opaque-debug",
@ -2449,7 +2467,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
dependencies = [
"libc",
"rand_chacha",
"rand_core 0.6.4",
"rand_core",
]
[[package]]
@ -2459,16 +2477,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [
"ppv-lite86",
"rand_core 0.6.4",
]
[[package]]
name = "rand_core"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
dependencies = [
"getrandom 0.1.16",
"rand_core",
]
[[package]]
@ -2477,7 +2486,7 @@ version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
"getrandom 0.2.12",
"getrandom",
]
[[package]]
@ -2658,7 +2667,16 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
dependencies = [
"semver",
"semver 0.9.0",
]
[[package]]
name = "rustc_version"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
dependencies = [
"semver 1.0.21",
]
[[package]]
@ -2827,6 +2845,12 @@ dependencies = [
"semver-parser",
]
[[package]]
name = "semver"
version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0"
[[package]]
name = "semver-parser"
version = "0.7.0"
@ -2918,7 +2942,7 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
dependencies = [
"cfg-if 1.0.0",
"cpufeatures",
"digest 0.10.7",
"digest",
]
[[package]]
@ -2927,7 +2951,7 @@ version = "0.10.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60"
dependencies = [
"digest 0.10.7",
"digest",
"keccak",
]
@ -3113,7 +3137,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5"
dependencies = [
"discard",
"rustc_version",
"rustc_version 0.2.3",
"stdweb-derive",
"stdweb-internal-macros",
"stdweb-internal-runtime",
@ -3198,9 +3222,9 @@ dependencies = [
[[package]]
name = "subtle"
version = "2.4.1"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
[[package]]
name = "syn"
@ -3877,11 +3901,11 @@ checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e"
[[package]]
name = "universal-hash"
version = "0.4.1"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05"
checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea"
dependencies = [
"generic-array",
"crypto-common",
"subtle",
]
@ -3914,7 +3938,7 @@ version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
dependencies = [
"getrandom 0.2.12",
"getrandom",
"serde",
]
@ -3924,7 +3948,7 @@ version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a"
dependencies = [
"getrandom 0.2.12",
"getrandom",
]
[[package]]
@ -3960,12 +3984,6 @@ dependencies = [
"try-lock",
]
[[package]]
name = "wasi"
version = "0.9.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
@ -4225,12 +4243,13 @@ dependencies = [
[[package]]
name = "x25519-dalek"
version = "1.2.0"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2392b6b94a576b4e2bf3c5b2757d63f10ada8020a2e4d08ac849ebcf6ea8e077"
checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96"
dependencies = [
"curve25519-dalek",
"rand_core 0.5.1",
"rand_core",
"serde",
"zeroize",
]
@ -4245,9 +4264,9 @@ dependencies = [
[[package]]
name = "zeroize"
version = "1.3.0"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd"
checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d"
dependencies = [
"zeroize_derive",
]

@ -4,7 +4,7 @@ default-members = ["mediarepo-core", "mediarepo-database", "mediarepo-logic", "m
[package]
name = "mediarepo-daemon"
version = "1.0.4"
version = "1.0.5"
edition = "2018"
license = "gpl-3"
repository = "https://github.com/Trivernis/mediarepo-daemon"

@ -1,66 +1,57 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
],
"quotes": [
"warn",
"double",
{
"avoidEscape": true
}
],
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"no-unused-expressions": "warn",
"semi": "error"
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
"root": true,
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.json"],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
],
"quotes": [
"warn",
"double",
{
"avoidEscape": true
}
],
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"no-unused-expressions": "warn",
"no-extraneous-class": "off",
"semi": "error"
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {}
}
]
}

@ -0,0 +1,15 @@
[language-server.biome]
command = "biome"
args = ["lsp-proxy"]
[[language]]
name = "typescript"
language-servers = ["typescript-language-server"]
auto-format = true
formatter = { command = "biome" , args = ["format", "--stdin-file-path=file.ts"] }
[[language]]
name = "javascript"
language-servers = ["typescript-language-server", "biome"]
auto-format = true
formatter = { command = "biome" , args = ["format", "--stdin-file-path=file.js"] }

@ -3,7 +3,8 @@
"version": 1,
"cli": {
"packageManager": "yarn",
"defaultCollection": "@angular-eslint/schematics"
"defaultCollection": "@angular-eslint/schematics",
"analytics": "dc09bab7-b1ef-4661-8d46-1da5b61c8e44"
},
"newProjectRoot": "projects",
"projects": {

@ -0,0 +1,15 @@
{
"$schema": "https://biomejs.dev/schemas/1.3.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noStaticOnlyClass": "off"
}
}
}
}

@ -1,63 +1,64 @@
{
"name": "mediarepo-ui",
"version": "1.0.4",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"watch-prod": "ng build --watch --configuration production",
"test": "ng test",
"lint": "ng lint",
"tauri": "tauri"
},
"private": true,
"dependencies": {
"@angular/animations": "~13.3.2",
"@angular/cdk": "^13.3.2",
"@angular/common": "~13.3.2",
"@angular/compiler": "~13.3.2",
"@angular/core": "~13.3.2",
"@angular/flex-layout": "^13.0.0-beta.36",
"@angular/forms": "~13.3.2",
"@angular/material": "^13.3.2",
"@angular/platform-browser": "~13.3.2",
"@angular/platform-browser-dynamic": "~13.3.2",
"@angular/router": "~13.3.2",
"@ng-icons/core": "^15.1.0",
"@ng-icons/feather-icons": "^15.1.0",
"@ng-icons/material-icons": "^15.1.0",
"@tauri-apps/api": "^1.0.0-rc.3",
"chart.js": "^3.7.1",
"primeicons": "^5.0.0",
"primeng": "^13.3.2",
"rxjs": "~7.5.5",
"tslib": "^2.3.1",
"w3c-keys": "^1.0.3",
"zone.js": "~0.11.5"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.3.2",
"@angular-eslint/builder": "^13.2.0",
"@angular-eslint/eslint-plugin": "^13.2.0",
"@angular-eslint/eslint-plugin-template": "^13.2.0",
"@angular-eslint/schematics": "^13.2.0",
"@angular-eslint/template-parser": "^13.2.0",
"@angular/cli": "~13.3.2",
"@angular/compiler-cli": "~13.3.2",
"@tauri-apps/cli": "^1.0.0-rc.8",
"@types/file-saver": "^2.0.4",
"@types/jasmine": "~4.0.2",
"@types/node": "^17.0.23",
"@typescript-eslint/eslint-plugin": "5.19.0",
"@typescript-eslint/parser": "^5.19.0",
"eslint": "^8.13.0",
"jasmine-core": "~4.0.0",
"karma": "~6.3.10",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~4.0.2",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.6.3"
}
"name": "mediarepo-ui",
"version": "1.0.5",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"watch-prod": "ng build --watch --configuration production",
"test": "ng test",
"lint": "ng lint",
"tauri": "tauri"
},
"private": true,
"dependencies": {
"@angular/animations": "~13.3.2",
"@angular/cdk": "^13.3.2",
"@angular/common": "~13.3.2",
"@angular/compiler": "~13.3.2",
"@angular/core": "~13.3.2",
"@angular/flex-layout": "^13.0.0-beta.36",
"@angular/forms": "~13.3.2",
"@angular/material": "^13.3.2",
"@angular/platform-browser": "~13.3.2",
"@angular/platform-browser-dynamic": "~13.3.2",
"@angular/router": "~13.3.2",
"@ng-icons/core": "^15.1.0",
"@ng-icons/feather-icons": "^15.1.0",
"@ng-icons/material-icons": "^15.1.0",
"@tauri-apps/api": "^1.5.3",
"chart.js": "^3.7.1",
"primeicons": "^5.0.0",
"primeng": "^13.3.2",
"rxjs": "~7.5.5",
"tslib": "^2.3.1",
"w3c-keys": "^1.0.3",
"zone.js": "~0.11.5"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.3.2",
"@angular-eslint/builder": "^13.2.0",
"@angular-eslint/eslint-plugin": "^13.2.0",
"@angular-eslint/eslint-plugin-template": "^13.2.0",
"@angular-eslint/schematics": "^13.2.0",
"@angular-eslint/template-parser": "^13.2.0",
"@angular/cli": "~13.3.2",
"@angular/compiler-cli": "~13.3.2",
"@angular/language-service": "^17.1.1",
"@tauri-apps/cli": "^1.5.4",
"@types/file-saver": "^2.0.4",
"@types/jasmine": "~4.0.2",
"@types/node": "^17.0.23",
"@typescript-eslint/eslint-plugin": "5.19.0",
"@typescript-eslint/parser": "^5.19.0",
"eslint": "^8.13.0",
"jasmine-core": "~4.0.0",
"karma": "~6.3.10",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~4.0.2",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.6.3"
}
}

File diff suppressed because it is too large Load Diff

@ -1,16 +1,16 @@
[package]
name = "app"
version = "1.0.4"
version = "1.0.5"
description = "The UI for the mediarepo media management tool"
authors = ["you"]
license = ""
repository = ""
default-run = "app"
edition = "2018"
edition = "2021"
build = "src/build.rs"
[build-dependencies]
tauri-build = { version = "1.0.0-rc.5", features = [] }
tauri-build = { version = "1.5.1", features = [] }
[dependencies]
serde_json = "1.0.79"
@ -19,7 +19,7 @@ thiserror = "1.0.30"
typemap_rev = "0.1.5"
[dependencies.tauri]
version = "1.0.0-rc.6"
version = "1.5.4"
features = ["dialog-all", "path-all", "shell-all"]
[dependencies.tracing-subscriber]

@ -1,76 +1,74 @@
{
"package": {
"productName": "mediarepo-ui",
"version": "1.0.4"
},
"build": {
"distDir": "../dist/mediarepo-ui",
"devPath": "http://localhost:4200",
"beforeDevCommand": "yarn start",
"beforeBuildCommand": "yarn build"
},
"tauri": {
"bundle": {
"active": true,
"targets": "all",
"identifier": "net.trivernis.mediarepo",
"icon": [
"icons/32x32.png",
"icons/64x64.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.ico",
"icons/icon.icns"
],
"resources": [],
"externalBin": [],
"copyright": "",
"category": "Productivity",
"shortDescription": "A media management tool",
"longDescription": "",
"deb": {
"depends": [],
"useBootstrapper": false
},
"macOS": {
"frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false,
"exceptionDomain": "",
"signingIdentity": null,
"entitlements": null
},
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
}
},
"updater": {
"active": false
},
"allowlist": {
"dialog": {
"all": true
},
"shell": {
"all": true
},
"path": {
"all": true
}
},
"windows": [
{
"title": "mediarepo",
"width": 1920,
"height": 1080,
"resizable": true,
"fullscreen": false
}
],
"security": {
"csp": null
}
}
"package": {
"productName": "mediarepo-ui",
"version": "1.0.4"
},
"build": {
"distDir": "../dist/mediarepo-ui",
"devPath": "http://localhost:4200",
"beforeDevCommand": "yarn start",
"beforeBuildCommand": "yarn build"
},
"tauri": {
"bundle": {
"active": true,
"targets": ["msi", "app", "dmg", "updater"],
"identifier": "net.trivernis.mediarepo",
"icon": [
"icons/32x32.png",
"icons/64x64.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.ico",
"icons/icon.icns"
],
"resources": [],
"externalBin": [],
"copyright": "",
"category": "Productivity",
"shortDescription": "A media management tool",
"longDescription": "",
"deb": {
"depends": []
},
"macOS": {
"frameworks": [],
"minimumSystemVersion": "",
"exceptionDomain": "",
"signingIdentity": null,
"entitlements": null
},
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
}
},
"updater": {
"active": false
},
"allowlist": {
"dialog": {
"all": true
},
"shell": {
"all": true
},
"path": {
"all": true
}
},
"windows": [
{
"title": "mediarepo",
"width": 1920,
"height": 1080,
"resizable": true,
"fullscreen": false
}
],
"security": {
"csp": null
}
}
}

@ -21,7 +21,7 @@ export class ContextMenuComponent {
event.preventDefault();
this.x = event.clientX + "px";
this.y = event.clientY + "px";
this.menuTrigger.menu.focusFirstItem("mouse");
this.menuTrigger.menu?.focusFirstItem("mouse");
this.menuTrigger.openMenu();
this.changeDetector.markForCheck();
}

@ -23,11 +23,11 @@ export class AddRepositoryDialogComponent {
public async checkLocalRepoExists() {
this.repositoryForm.localRepoExists = await this.repoService.checkLocalRepositoryExists(
this.repositoryForm.formGroup.value.path);
this.repositoryForm.formGroup.value.path as unknown as string);
}
public async initLocalRepository() {
const path = this.repositoryForm.formGroup.value.path;
const path = this.repositoryForm.formGroup.value.path as unknown as string;
try {
await this.repoService.initRepository(path);
} catch (err: any) {
@ -37,7 +37,7 @@ export class AddRepositoryDialogComponent {
}
public async addRepository() {
let { name, repositoryType, path, address } = this.repositoryForm.formGroup.value;
let { name, repositoryType, path, address } = this.repositoryForm.formGroup.value as unknown as any;
path = repositoryType === "local" ? path : undefined;
address = repositoryType === "remote" ? address : undefined;
try {

@ -1,65 +1,71 @@
import {downloadDir} from "@tauri-apps/api/path";
import {dialog} from "@tauri-apps/api";
import {File} from "../../../api/models/File";
import { downloadDir } from "@tauri-apps/api/path";
import { dialog } from "@tauri-apps/api";
import type { File } from "../../../api/models/File";
export class FileHelper {
/**
* Opens a dialog to get a download location for the given file
* @param {File} file
*/
public static async getFileDownloadLocation(
file: File,
): Promise<string | null> {
let extension = FileHelper.getExtensionForMime(file.mimeType);
/**
* Opens a dialog to get a download location for the given file
* @param {File} file
*/
public static async getFileDownloadLocation(file: File): Promise<string | undefined> {
let extension = FileHelper.getExtensionForMime(file.mimeType);
const downloadDirectory = await downloadDir();
const suggestionPath = downloadDirectory + file.cd + "." + extension;
const downloadDirectory = await downloadDir();
const suggestionPath = downloadDirectory + file.cd + "." + extension;
return await dialog.save({
defaultPath: suggestionPath,
filters: [
{
name: file.mimeType,
extensions: [extension ?? "*"],
},
{ name: "All", extensions: ["*"] },
],
});
}
return await dialog.save({
defaultPath: suggestionPath,
filters: [{
name: file.mimeType,
extensions: [extension ?? "*"]
}, { name: "All", extensions: ["*"] }]
});
}
/**
* Parses a mime into its two components
* @param {string | undefined} mimeType
* @returns {[string, string] | undefined}
*/
public static parseMime(
mimeType: string | undefined,
): [string, string] | undefined {
if (!mimeType) {
return undefined;
}
let mimeParts = mimeType.split("/");
if (mimeParts.length < 2) {
return undefined;
}
const type = mimeParts[0];
const subtype = mimeParts[1];
/**
* Parses a mime into its two components
* @param {string | undefined} mimeType
* @returns {[string, string] | undefined}
*/
public static parseMime(mimeType: string | undefined): [string, string] | undefined {
if (!mimeType) {
return undefined;
}
let mimeParts = mimeType.split("/");
if (mimeParts.length < 2) {
return undefined;
}
const type = mimeParts[0];
const subtype = mimeParts[1];
return [type, subtype];
}
return [type, subtype];
}
/**
* Returns the extension for a mime type
* @param {string} mime
* @returns {string | undefined}
* @private
*/
public static getExtensionForMime(mime: string): string | undefined {
let parts = mime.split("/");
/**
* Returns the extension for a mime type
* @param {string} mime
* @returns {string | undefined}
* @private
*/
public static getExtensionForMime(mime: string): string | undefined {
let parts = mime.split("/");
if (parts.length === 2) {
const type = parts[0];
const subtype = parts[1];
return FileHelper.convertMimeSubtypeToExtension(subtype);
}
return undefined;
}
if (parts.length === 2) {
const type = parts[0];
const subtype = parts[1];
return FileHelper.convertMimeSubtypeToExtension(subtype);
}
return undefined;
}
private static convertMimeSubtypeToExtension(subtype: string): string {
return subtype;
}
private static convertMimeSubtypeToExtension(subtype: string): string {
return subtype;
}
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save