diff --git a/.forgejo/workflows/build+release.yml b/.forgejo/workflows/build+release.yml deleted file mode 100644 index 4b71f6c..0000000 --- a/.forgejo/workflows/build+release.yml +++ /dev/null @@ -1,186 +0,0 @@ -name: 'Build and Release Binary File' -author: 'Neshura' - -on: - push: - tags: - - '[0-9]+.[0-9]+.[0-9]+' - - '[0-9]+.[0-9]+.[0-9]+rc[0-9]+' -jobs: - run-tests: - runs-on: docker - container: forgejo.neshweb.net/ci-docker-images/rust-tauri:latest - steps: - - - name: Add Clippy - run: rustup component add clippy - - - name: Checking Out Repository Code - uses: https://code.forgejo.org/actions/checkout@v3 - - - name: Change To Rust Root Dir - run: cd src-tauri/ - - - name: Set Up Cargo Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - name: Run Clippy - run: cargo clippy --manifest-path **/Cargo.toml - - - name: Check if Version in Cargo.toml matches Tag - run: | - VERSION=$(cat src-tauri/Cargo.toml | grep -E "(^|\|)version =" | cut -f2- -d= | tr -d \" | tr -d " ") - if test $VERSION != "${{ github.ref_name }}"; then - echo "Expected Version is: '${{ github.ref_name }}' actual Version is: '$VERSION'"; - exit 1 - else - echo "Version is: '$VERSION'"; - fi - - build-linux: - needs: run-tests - if: success() - runs-on: docker - container: forgejo.neshweb.net/ci-docker-images/rust-tauri:latest - steps: - - - name: Storing Debian Codename for Package Upload Job - run: | - . /etc/os-release - echo Debian Codename is: $VERSION_CODENAME - echo "DEBIAN_CODENAME=$VERSION_CODENAME" >> /build.env - - - name: Checking Out Repository Code - uses: https://code.forgejo.org/actions/checkout@v3 - - - name: Set Up Cargo Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/**/Cargo.lock') }} - - - name: Get Yarn Cache Directory - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - - name: Set Up Yarn Cache - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install Yarn Packages - run: yarn install - - - name: Compiling To Linux Target - run: | - cargo tauri build - - - name: Renaming Binary + Bundles - run: | - echo Moving Build Artifacts to Root - mkdir artifacts - mv -v src-tauri/target/release/comicinfo-editor-v2 artifacts/comicinfo-editor-v2-linux-amd64 - mv -v src-tauri/target/release/bundle/deb/*.deb artifacts/comicinfo-editor-v2-${{ github.ref_name }}-amd64.deb - mv -v src-tauri/target/release/bundle/appimage/*.AppImage artifacts/comicinfo-editor-v2-${{ github.ref_name }}-amd64.AppImage - - - name: Uploading Linux Binary Artifact - uses: actions/upload-artifact@v3 - with: - name: linux-amd64-binary - path: artifacts/comicinfo-editor-v2-linux-amd64 - if-no-files-found: error - - - name: Uploading Linux Debian Artifact - uses: actions/upload-artifact@v3 - with: - name: linux-amd64-debian - path: artifacts/comicinfo-editor-v2-${{ github.ref_name }}-amd64.deb - if-no-files-found: error - - - name: Uploading Linux AppImage Artifact - uses: actions/upload-artifact@v3 - with: - name: linux-amd64-appimage - path: artifacts/comicinfo-editor-v2-${{ github.ref_name }}-amd64.AppImage - if-no-files-found: error - - - name: Upload .env as Artifact - uses: actions/upload-artifact@v3 - with: - name: build-env - path: /build.env - if-no-files-found: error - - upload-release: - needs: [build-linux] - if: success() - runs-on: docker - steps: - - - name: Downloading All Build Artifacts - uses: actions/download-artifact@v3 - with: - path: artifacts - - - name: Load .env from build job - run: | - mv -v artifacts/build-env/build.env build.env - export $(xargs <build.env) - cat build.env - - - name: Rearrange Artifact Paths - run: | - mkdir release - find artifacts/ -type f -print0 | xargs -0 mv -v -t release - - - name: Upload Generic Packages - run: | - echo 'curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ - --upload-file release/comicinfo-editor-v2-linux-amd64 \ - https://forgejo.neshweb.net/api/packages/${{ secrets.FORGEJO_USERNAME }}/generic/${{ github.event.repository.name }}/${{ github.ref_name }}/comicinfo-editor-v2-linux-amd64' - curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ - --upload-file release/comicinfo-editor-v2-linux-amd64 \ - https://forgejo.neshweb.net/api/packages/${{ secrets.FORGEJO_USERNAME }}/generic/${{ github.event.repository.name }}/${{ github.ref_name }}/comicinfo-editor-v2-linux-amd64 - - echo 'curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ - --upload-file release/comicinfo-editor-v2-${{ github.ref_name }}-amd64.AppImage \ - https://forgejo.neshweb.net/api/packages/${{ secrets.FORGEJO_USERNAME }}/generic/${{ github.event.repository.name }}/${{ github.ref_name }}/comicinfo-editor-v2-${{ github.ref_name }}-amd64.AppImage' - curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ - --upload-file release/comicinfo-editor-v2-${{ github.ref_name }}-amd64.AppImage \ - https://forgejo.neshweb.net/api/packages/${{ secrets.FORGEJO_USERNAME }}/generic/${{ github.event.repository.name }}/${{ github.ref_name }}/comicinfo-editor-v2-${{ github.ref_name }}-amd64.AppImage - - - name: Upload Debian Package - run: | - export $(xargs <build.env) - echo "curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ - --upload-file release/comicinfo-editor-v2-${{ github.ref_name }}-amd64.deb \ - https://forgejo.neshweb.net/api/packages/${{ secrets.FORGEJO_USERNAME }}/debian/pool/$DEBIAN_CODENAME/main/upload" - curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ - --upload-file release/comicinfo-editor-v2-${{ github.ref_name }}-amd64.deb \ - https://forgejo.neshweb.net/api/packages/${{ secrets.FORGEJO_USERNAME }}/debian/pool/$DEBIAN_CODENAME/main/upload - - - name: Release New Version - uses: actions/forgejo-release@v1 - with: - direction: upload - url: https://forgejo.neshweb.net - release-dir: release - token: ${{ secrets.FORGEJO_TOKEN }} - tag: ${{ github.ref_name }} diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml deleted file mode 100644 index c18ba73..0000000 --- a/.forgejo/workflows/test.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: 'Run Tests on Code' -author: 'Neshura' - -on: - push: - tags-ignore: - - '**' - branches: - - '**' -jobs: - run-tests: - runs-on: docker - container: forgejo.neshweb.net/ci-docker-images/rust-tauri:latest - steps: - - - name: Add Clippy - run: rustup component add clippy - - - name: Checking Out Repository Code - uses: https://code.forgejo.org/actions/checkout@v3 - - - name: Change To Rust Root Dir - run: cd src-tauri/ - - - name: Set Up Cargo Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - name: Run Clippy - run: cargo clippy --manifest-path **/Cargo.toml \ No newline at end of file diff --git a/package.json b/package.json index 3a5397d..2f1b588 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "comicinfo-editor-v2", "private": true, - "version": "0.1.8", + "version": "0.0.0", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 0624fa5..ff33e0b 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -17,17 +17,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aes" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - [[package]] name = "aho-corasick" version = "1.1.2" @@ -130,12 +119,6 @@ version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - [[package]] name = "bitflags" version = "1.3.2" @@ -218,27 +201,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - [[package]] name = "cairo-rs" version = "0.15.12" @@ -279,7 +241,6 @@ version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ - "jobserver", "libc", ] @@ -335,17 +296,7 @@ dependencies = [ "iana-time-zone", "num-traits", "serde", - "windows-targets 0.48.5", -] - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", + "windows-targets", ] [[package]] @@ -396,7 +347,7 @@ dependencies = [ [[package]] name = "comicinfo-editor-v2" -version = "0.1.12" +version = "0.1.0" dependencies = [ "quick-xml", "serde", @@ -406,15 +357,8 @@ dependencies = [ "strum_macros", "tauri", "tauri-build", - "zip", ] -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "convert_case" version = "0.4.0" @@ -610,7 +554,6 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", - "subtle", ] [[package]] @@ -1200,15 +1143,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - [[package]] name = "html5ever" version = "0.25.2" @@ -1364,15 +1298,6 @@ dependencies = [ "cfb", ] -[[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" @@ -1437,15 +1362,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" -[[package]] -name = "jobserver" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" version = "0.3.64" @@ -1754,17 +1670,6 @@ dependencies = [ "objc_exception", ] -[[package]] -name = "objc-foundation" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" -dependencies = [ - "block", - "objc", - "objc_id", -] - [[package]] name = "objc_exception" version = "0.1.2" @@ -1808,17 +1713,6 @@ dependencies = [ "windows-sys 0.42.0", ] -[[package]] -name = "os_info" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006e42d5b888366f1880eda20371fedde764ed2213dc8496f49622fa0c99cd5e" -dependencies = [ - "log", - "serde", - "winapi", -] - [[package]] name = "overload" version = "0.1.1" @@ -1870,18 +1764,7 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets 0.48.5", -] - -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core 0.6.4", - "subtle", + "windows-targets", ] [[package]] @@ -1890,18 +1773,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest", - "hmac", - "password-hash", - "sha2", -] - [[package]] name = "percent-encoding" version = "2.3.0" @@ -2301,30 +2172,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3cbb081b9784b07cceb8824c8583f86db4814d172ab043f3c23f7dc600bf83d" -[[package]] -name = "rfd" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0149778bd99b6959285b0933288206090c50e2327f47a9c463bfdbf45c8823ea" -dependencies = [ - "block", - "dispatch", - "glib-sys", - "gobject-sys", - "gtk-sys", - "js-sys", - "lazy_static", - "log", - "objc", - "objc-foundation", - "objc_id", - "raw-window-handle", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "windows 0.37.0", -] - [[package]] name = "rustc-demangle" version = "0.1.23" @@ -2545,17 +2392,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sha2" version = "0.10.8" @@ -2697,12 +2533,6 @@ dependencies = [ "syn 2.0.38", ] -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - [[package]] name = "syn" version = "1.0.109" @@ -2725,19 +2555,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sys-locale" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8a11bd9c338fdba09f7881ab41551932ad42e405f61d01e8406baea71c07aee" -dependencies = [ - "js-sys", - "libc", - "wasm-bindgen", - "web-sys", - "windows-sys 0.45.0", -] - [[package]] name = "system-deps" version = "5.0.0" @@ -2861,19 +2678,16 @@ dependencies = [ "objc", "once_cell", "open", - "os_info", "percent-encoding", "rand 0.8.5", "raw-window-handle", "regex", - "rfd", "semver", "serde", "serde_json", "serde_repr", "serialize-to-javascript", "state", - "sys-locale", "tar", "tauri-macros", "tauri-runtime", @@ -3434,18 +3248,6 @@ dependencies = [ "wasm-bindgen-shared", ] -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "wasm-bindgen-macro" version = "0.2.87" @@ -3475,16 +3277,6 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" -[[package]] -name = "web-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "webkit2gtk" version = "0.18.2" @@ -3601,19 +3393,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b543186b344cc61c85b5aab0d2e3adf4e0f99bc076eff9aa5927bcc0b8a647" -dependencies = [ - "windows_aarch64_msvc 0.37.0", - "windows_i686_gnu 0.37.0", - "windows_i686_msvc 0.37.0", - "windows_x86_64_gnu 0.37.0", - "windows_x86_64_msvc 0.37.0", -] - [[package]] name = "windows" version = "0.39.0" @@ -3634,7 +3413,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.5", + "windows-targets", ] [[package]] @@ -3678,37 +3457,13 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets", ] [[package]] @@ -3744,12 +3499,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" -[[package]] -name = "windows_aarch64_msvc" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2623277cb2d1c216ba3b578c0f3cf9cdebeddb6e66b1b218bb33596ea7769c3a" - [[package]] name = "windows_aarch64_msvc" version = "0.39.0" @@ -3768,12 +3517,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" -[[package]] -name = "windows_i686_gnu" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3925fd0b0b804730d44d4b6278c50f9699703ec49bcd628020f46f4ba07d9e1" - [[package]] name = "windows_i686_gnu" version = "0.39.0" @@ -3792,12 +3535,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" -[[package]] -name = "windows_i686_msvc" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce907ac74fe331b524c1298683efbf598bb031bc84d5e274db2083696d07c57c" - [[package]] name = "windows_i686_msvc" version = "0.39.0" @@ -3816,12 +3553,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" -[[package]] -name = "windows_x86_64_gnu" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2babfba0828f2e6b32457d5341427dcbb577ceef556273229959ac23a10af33d" - [[package]] name = "windows_x86_64_gnu" version = "0.39.0" @@ -3852,12 +3583,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" -[[package]] -name = "windows_x86_64_msvc" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4dd6dc7df2d84cf7b33822ed5b86318fb1781948e9663bacd047fc9dd52259d" - [[package]] name = "windows_x86_64_msvc" version = "0.39.0" @@ -3968,52 +3693,3 @@ name = "xml-rs" version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" - -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "aes", - "byteorder", - "bzip2", - "constant_time_eq", - "crc32fast", - "crossbeam-utils", - "flate2", - "hmac", - "pbkdf2", - "sha1", - "time", - "zstd", -] - -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 6c0c66a..584ec19 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "comicinfo-editor-v2" -version = "0.1.12" +version = "0.1.0" description = "App for creating Comicinfo.xml files" authors = ["Neshura"] license = "" -repository = "https://forgejo.neshweb.net/Neshura/comicinfo-editor-v2" +repository = "" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -13,14 +13,13 @@ edition = "2021" tauri-build = { version = "1.4", features = [] } [dependencies] -tauri = { version = "1.4", features = [ "os-all", "path-all", "dialog-open", "shell-open"] } +tauri = { version = "1.4", features = ["shell-open"] } quick-xml = { version = "0.29.0", features = ["serde", "serialize"] } serde = { version = "1.0", features = ["derive"] } serde-xml-rs = "0.6.0" serde_json = "1.0" strum = "0.25.0" strum_macros = "0.25.0" -zip = { version = "0.6.6", features = [] } [features] # this feature is used for production builds or when `devPath` points to the filesystem diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 0b1aae3..602d3c8 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -1,10 +1,7 @@ // Prevents additional console window on Windows in release, DO NOT REMOVE!! #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] -use std::fs; -use std::fs::{File}; -use std::io::{Read, Write}; -use std::path::MAIN_SEPARATOR_STR; +use serde::{Deserialize, Serialize}; use crate::metadata::{*}; mod metadata; @@ -17,49 +14,13 @@ fn greet(name: &str) -> String { fn main() { tauri::Builder::default() - .invoke_handler(tauri::generate_handler![greet, save, save_bundle]) + .invoke_handler(tauri::generate_handler![greet, test]) .run(tauri::generate_context!()) .expect("error while running tauri application"); } #[tauri::command] -fn save(metadata: Metadata, path: String) -> String { - let file_path: String; - if path.ends_with(MAIN_SEPARATOR_STR) { - file_path = path + "ComicInfo.xml"; - } - else { - file_path = path + MAIN_SEPARATOR_STR + "ComicInfo.xml"; - } - metadata.save_to_xml(&file_path); - file_path -} - -#[tauri::command] -fn save_bundle(bundle_dir: String, metadata_file_path: String, save_path: String) -> String { - let comic_book_zip = File::create(&save_path).unwrap(); - let mut zip_writer = zip::ZipWriter::new(comic_book_zip); - - let options = zip::write::FileOptions::default().compression_method(zip::CompressionMethod::Stored); - - let mut file_list: Vec<String> = Vec::new(); - - file_list.push(metadata_file_path); - - let directory_contents = fs::read_dir(bundle_dir.clone()).unwrap(); - - directory_contents.for_each(|entry| file_list.push(entry.unwrap().path().to_str().unwrap().to_string())); - - for file in file_list { - zip_writer.start_file(file.clone().split(MAIN_SEPARATOR_STR).last().unwrap(), options).unwrap(); - let mut file = File::open(file).unwrap(); - let mut buffer = Vec::new(); - - file.read_to_end(&mut buffer).unwrap(); - - zip_writer.write_all(&*buffer).unwrap(); - } - - zip_writer.finish().unwrap(); - return bundle_dir +fn test(message: metadata::Metadata) -> String { + message.save_to_xml("/home/neshura/Repositories/comicinfo-editor-v2/ComicInfo.xml"); + format!("Series: '{}' | Title: '{}'", message.series_title, message.title) } diff --git a/src-tauri/src/metadata/mod.rs b/src-tauri/src/metadata/mod.rs index 63203bd..b3d87e0 100644 --- a/src-tauri/src/metadata/mod.rs +++ b/src-tauri/src/metadata/mod.rs @@ -1,8 +1,10 @@ -use std::{fs::File, io::{Write}}; -use quick_xml::{se::Serializer}; +use std::{fs::File, io::{Write, Cursor}}; +use quick_xml::{se::Serializer, events::BytesStart}; use serde::{Serialize, Deserialize}; use serde::ser::{SerializeSeq, SerializeStruct}; +use serde_xml_rs::{to_string, to_writer}; + #[derive(Debug, Deserialize, PartialEq, Clone)] pub(crate) struct Metadata { pub(crate) title: String, @@ -137,7 +139,7 @@ impl Metadata { ser.indent(' ', 4); self.serialize(ser).unwrap(); - file.write_all(buffer.as_bytes()).unwrap(); + file.write(buffer.as_bytes()).unwrap(); } } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 16f9f15..686dc01 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -3,12 +3,12 @@ "beforeDevCommand": "yarn dev", "beforeBuildCommand": "yarn build", "devPath": "http://localhost:1420", - "distDir": "../dist", + "distDir": "../build", "withGlobalTauri": false }, "package": { "productName": "comicinfo-editor-v2", - "version": "0.1.8" + "version": "0.1.0" }, "tauri": { "allowlist": { @@ -16,15 +16,6 @@ "shell": { "all": false, "open": true - }, - "dialog": { - "open": true - }, - "path": { - "all": true - }, - "os": { - "all": true } }, "bundle": { @@ -47,8 +38,8 @@ "fullscreen": false, "resizable": true, "title": "comicinfo-editor-v2", - "width": 1280, - "height": 720 + "width": 800, + "height": 600 } ] } diff --git a/src/App.svelte b/src/App.svelte index a79addc..d97f7cd 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -21,14 +21,6 @@ <p> Settings go here </p> - - <p> - Default ComicInfo.xml save location - </p> - - <p> - Default Metadata Settings (genre, age rating) - </p> {/if} </div> diff --git a/src/lib/ListTextInput/ListTextInputElement.svelte b/src/lib/ListTextInput/ListTextInputElement.svelte index c4ff428..42f22e1 100644 --- a/src/lib/ListTextInput/ListTextInputElement.svelte +++ b/src/lib/ListTextInput/ListTextInputElement.svelte @@ -15,7 +15,7 @@ } </script> -<input id="tag-{id}" type="text" class="letterInput" style="--valuelen: {width}ch" bind:value={value} autofocus> +<input id="tag-{id}" type="text" class="letterInput" style="--valuelen: {width}ch" bind:value={value}> <button on:click|preventDefault={handleClick}>X</button> <style> diff --git a/src/lib/MetadataInput.svelte b/src/lib/MetadataInput.svelte index d876940..08c75b9 100644 --- a/src/lib/MetadataInput.svelte +++ b/src/lib/MetadataInput.svelte @@ -6,13 +6,6 @@ import {invoke} from "@tauri-apps/api/tauri"; import {AgeRating, LanguageISO, type Metadata} from "./metadata"; import Dropdown from "./Dropdown/Dropdown.svelte"; - import PathInput from "./PathInput.svelte"; - import {tempdir} from "@tauri-apps/api/os"; - import {downloadDir} from "@tauri-apps/api/path"; - let tauriInitDone = false; - - let downloadDirPath: string; - let tempDirPath: string; let returnMessage = ""; @@ -54,11 +47,6 @@ age_rating: AgeRating.Unknown }; - let saveDirectory = ""; - - let bundleDirectory = ""; - let doBundle = false; - $: { if (metadata.release_date.year < 0) { metadata.release_date.month = -1; @@ -68,54 +56,15 @@ } } - $: { - if (tauriInitDone) { - if (saveDirectory == "") { - saveDirectory = downloadDirPath; - } - - if (bundleDirectory == "" && doBundle) { - bundleDirectory = downloadDirPath; - } - } - } - - async function init() { - downloadDirPath = await downloadDir(); - tempDirPath = await tempdir(); - tauriInitDone = true; - } - function deleteTag(event: any) { metadata.tags.splice(event.detail.tagId, 1); metadata.tags = metadata.tags; } async function saveMetadata() { - while (!tauriInitDone) { - await new Promise( resolve => setTimeout(resolve, 100) ); - } console.log(metadata); - if (bundleDirectory != "") { - let savePath = saveDirectory; - if (saveDirectory.endsWith("/")) { - savePath += "test.cbz"; - } - else { - savePath += "/test.cbz"; - } - - let comicInfoPath = await invoke("save", { metadata: metadata, path: tempDirPath}); - let bundlePath = await invoke("save_bundle", { bundleDir: bundleDirectory, metadataFilePath: comicInfoPath, savePath: savePath }) - returnMessage = "Saved '" + metadata.title + "' bundled to '" + bundlePath + "'"; - } - else { - let comicInfoPath = await invoke("save", { message: metadata, path: saveDirectory }) - returnMessage = "Saved '" + metadata.title + "' to '" + comicInfoPath + "'"; - } + returnMessage = await invoke("test", { message: metadata }) } - - init(); </script> <div class="metadataInputContainer"> @@ -182,24 +131,14 @@ <TextInput id="genre" bind:value={metadata.genre} placeholder="Genre" /> <label for="language-select">Language:</label> - <Dropdown id="language-select" bind:activeElement={metadata.language} list={Object.values(LanguageISO)} /> + <Dropdown id="language-select" bind:activeElement={metadata.language} list={Object.values(LanguageISO)}></Dropdown> </div> <div class="row-left"> <label for="age-rating">Age Rating:</label> - <Dropdown id="" bind:activeElement={metadata.age_rating} list={Object.values(AgeRating)} /> + <Dropdown id="" bind:activeElement={metadata.age_rating} list={Object.values(AgeRating)}></Dropdown> </div> - <hr> - - <PathInput bind:path={saveDirectory}/> - <div class="row-left"> - <label for="bundle-check">Bundle:</label> - <input id="bundle-check" type="checkbox" bind:checked={doBundle}> - </div> - {#if doBundle} - <PathInput bind:path={bundleDirectory}/> - {/if} <input type="submit" value="Save"/> <p>{returnMessage}</p> </form> diff --git a/src/lib/PathInput.svelte b/src/lib/PathInput.svelte deleted file mode 100644 index ed38668..0000000 --- a/src/lib/PathInput.svelte +++ /dev/null @@ -1,35 +0,0 @@ -<script lang="ts"> - import { open } from '@tauri-apps/api/dialog'; - - export let path: string; - - let buttonPrompt = "Select"; - - async function handleClick() { - const dirHandle = await open({ - multiple: false, - directory: true, - defaultPath: path - }); - if (Array.isArray(dirHandle)) { - path = dirHandle[0]; - } - else if (dirHandle !== null) { - path = dirHandle; - } - } - -</script> - -<div> - <button on:click|preventDefault={handleClick}>{buttonPrompt}</button> - {#if path != ""} - <p>{path}</p> - {:else} - <p>Select Save Location...</p> - {/if} -</div> - -<style> - -</style> \ No newline at end of file