From 72bf38a7ff759d2c3824f41d7692ebb46df53bf9 Mon Sep 17 00:00:00 2001 From: servius Date: Fri, 30 Jan 2026 02:09:10 +0530 Subject: [PATCH] refactor(workspace): move crates under crates/ --- Cargo.lock | 6 -- Cargo.toml | 11 ++-- {api => crates/api}/.gitignore | 0 {api => crates/api}/Cargo.toml | 0 {api => crates/api}/examples/items.rs | 0 {api => crates/api}/src/jellyfin.rs | 0 {api => crates/api}/src/lib.rs | 0 {gst => crates/gst}/.gitignore | 0 {gst => crates/gst}/Cargo.lock | 0 {gst => crates/gst}/Cargo.toml | 0 {gst => crates/gst}/src/bin.rs | 0 {gst => crates/gst}/src/bus.rs | 0 {gst => crates/gst}/src/caps.rs | 0 {gst => crates/gst}/src/element.rs | 0 {gst => crates/gst}/src/errors.rs | 0 {gst => crates/gst}/src/lib.rs | 0 {gst => crates/gst}/src/pad.rs | 0 {gst => crates/gst}/src/pipeline.rs | 0 {gst => crates/gst}/src/plugins.rs | 0 {gst => crates/gst}/src/plugins/app.rs | 0 .../gst}/src/plugins/app/appsink.rs | 0 {gst => crates/gst}/src/plugins/autodetect.rs | 0 .../src/plugins/autodetect/autovideosink.rs | 0 {gst => crates/gst}/src/plugins/playback.rs | 0 .../gst}/src/plugins/playback/playbin.rs | 0 .../gst}/src/plugins/playback/playbin3.rs | 0 .../gst}/src/plugins/videoconvertscale.rs | 0 .../plugins/videoconvertscale/videoconvert.rs | 0 {gst => crates/gst}/src/sample.rs | 0 {gst => crates/gst}/src/wgpu.rs | 0 {gst => crates/gst}/src/wrapper.rs | 0 crates/iced-video/Cargo.toml | 8 --- crates/iced-video/src/source.rs | 3 +- {store => crates/store}/Cargo.toml | 0 {store => crates/store}/src/lib.rs | 0 {store => crates/store}/src/sqlite.rs | 0 {store => crates/store}/src/toml.rs | 0 examples/hdr-gstreamer-wgpu/Cargo.toml | 3 - gst/.github/workflows/build.yaml | 62 ------------------- gst/.github/workflows/docs.yaml | 38 ------------ src/errors.rs | 2 +- src/main.rs | 1 - ui-iced/Cargo.toml | 2 +- ui-iced/src/lib.rs | 1 - 44 files changed, 9 insertions(+), 128 deletions(-) rename {api => crates/api}/.gitignore (100%) rename {api => crates/api}/Cargo.toml (100%) rename {api => crates/api}/examples/items.rs (100%) rename {api => crates/api}/src/jellyfin.rs (100%) rename {api => crates/api}/src/lib.rs (100%) rename {gst => crates/gst}/.gitignore (100%) rename {gst => crates/gst}/Cargo.lock (100%) rename {gst => crates/gst}/Cargo.toml (100%) rename {gst => crates/gst}/src/bin.rs (100%) rename {gst => crates/gst}/src/bus.rs (100%) rename {gst => crates/gst}/src/caps.rs (100%) rename {gst => crates/gst}/src/element.rs (100%) rename {gst => crates/gst}/src/errors.rs (100%) rename {gst => crates/gst}/src/lib.rs (100%) rename {gst => crates/gst}/src/pad.rs (100%) rename {gst => crates/gst}/src/pipeline.rs (100%) rename {gst => crates/gst}/src/plugins.rs (100%) rename {gst => crates/gst}/src/plugins/app.rs (100%) rename {gst => crates/gst}/src/plugins/app/appsink.rs (100%) rename {gst => crates/gst}/src/plugins/autodetect.rs (100%) rename {gst => crates/gst}/src/plugins/autodetect/autovideosink.rs (100%) rename {gst => crates/gst}/src/plugins/playback.rs (100%) rename {gst => crates/gst}/src/plugins/playback/playbin.rs (100%) rename {gst => crates/gst}/src/plugins/playback/playbin3.rs (100%) rename {gst => crates/gst}/src/plugins/videoconvertscale.rs (100%) rename {gst => crates/gst}/src/plugins/videoconvertscale/videoconvert.rs (100%) rename {gst => crates/gst}/src/sample.rs (100%) rename {gst => crates/gst}/src/wgpu.rs (100%) rename {gst => crates/gst}/src/wrapper.rs (100%) rename {store => crates/store}/Cargo.toml (100%) rename {store => crates/store}/src/lib.rs (100%) rename {store => crates/store}/src/sqlite.rs (100%) rename {store => crates/store}/src/toml.rs (100%) delete mode 100644 gst/.github/workflows/build.yaml delete mode 100644 gst/.github/workflows/docs.yaml diff --git a/Cargo.lock b/Cargo.lock index dab6cf7..647345f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2348,12 +2348,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - [[package]] name = "futf" version = "0.1.5" diff --git a/Cargo.toml b/Cargo.toml index 724b547..00024cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,20 +1,21 @@ [workspace] members = [ ".", - "api", "typegen", "ui-gpui", "ui-iced", - "store", - "gst", + "crates/api", + "crates/gst", "crates/iced-video", + "crates/store", "examples/hdr-gstreamer-wgpu", ] [workspace.dependencies] iced = { version = "0.14.0" } -gst = { version = "0.1.0", path = "gst" } +gst = { version = "0.1.0", path = "crates/gst" } iced_wgpu = { version = "0.14.0" } iced-video = { version = "0.1.0", path = "crates/iced-video" } +api = { version = "0.1.0", path = "crates/api" } [patch.crates-io] iced_wgpu = { git = "https://github.com/uttarayan21/iced", branch = "0.14" } @@ -30,7 +31,7 @@ edition = "2024" license = "MIT" [dependencies] -api = { version = "0.1.0", path = "api" } +api = { version = "0.1.0", path = "crates/api" } bytemuck = { version = "1.24.0", features = ["derive"] } clap = { version = "4.5", features = ["derive"] } clap-verbosity-flag = { version = "3.0.4", features = ["tracing"] } diff --git a/api/.gitignore b/crates/api/.gitignore similarity index 100% rename from api/.gitignore rename to crates/api/.gitignore diff --git a/api/Cargo.toml b/crates/api/Cargo.toml similarity index 100% rename from api/Cargo.toml rename to crates/api/Cargo.toml diff --git a/api/examples/items.rs b/crates/api/examples/items.rs similarity index 100% rename from api/examples/items.rs rename to crates/api/examples/items.rs diff --git a/api/src/jellyfin.rs b/crates/api/src/jellyfin.rs similarity index 100% rename from api/src/jellyfin.rs rename to crates/api/src/jellyfin.rs diff --git a/api/src/lib.rs b/crates/api/src/lib.rs similarity index 100% rename from api/src/lib.rs rename to crates/api/src/lib.rs diff --git a/gst/.gitignore b/crates/gst/.gitignore similarity index 100% rename from gst/.gitignore rename to crates/gst/.gitignore diff --git a/gst/Cargo.lock b/crates/gst/Cargo.lock similarity index 100% rename from gst/Cargo.lock rename to crates/gst/Cargo.lock diff --git a/gst/Cargo.toml b/crates/gst/Cargo.toml similarity index 100% rename from gst/Cargo.toml rename to crates/gst/Cargo.toml diff --git a/gst/src/bin.rs b/crates/gst/src/bin.rs similarity index 100% rename from gst/src/bin.rs rename to crates/gst/src/bin.rs diff --git a/gst/src/bus.rs b/crates/gst/src/bus.rs similarity index 100% rename from gst/src/bus.rs rename to crates/gst/src/bus.rs diff --git a/gst/src/caps.rs b/crates/gst/src/caps.rs similarity index 100% rename from gst/src/caps.rs rename to crates/gst/src/caps.rs diff --git a/gst/src/element.rs b/crates/gst/src/element.rs similarity index 100% rename from gst/src/element.rs rename to crates/gst/src/element.rs diff --git a/gst/src/errors.rs b/crates/gst/src/errors.rs similarity index 100% rename from gst/src/errors.rs rename to crates/gst/src/errors.rs diff --git a/gst/src/lib.rs b/crates/gst/src/lib.rs similarity index 100% rename from gst/src/lib.rs rename to crates/gst/src/lib.rs diff --git a/gst/src/pad.rs b/crates/gst/src/pad.rs similarity index 100% rename from gst/src/pad.rs rename to crates/gst/src/pad.rs diff --git a/gst/src/pipeline.rs b/crates/gst/src/pipeline.rs similarity index 100% rename from gst/src/pipeline.rs rename to crates/gst/src/pipeline.rs diff --git a/gst/src/plugins.rs b/crates/gst/src/plugins.rs similarity index 100% rename from gst/src/plugins.rs rename to crates/gst/src/plugins.rs diff --git a/gst/src/plugins/app.rs b/crates/gst/src/plugins/app.rs similarity index 100% rename from gst/src/plugins/app.rs rename to crates/gst/src/plugins/app.rs diff --git a/gst/src/plugins/app/appsink.rs b/crates/gst/src/plugins/app/appsink.rs similarity index 100% rename from gst/src/plugins/app/appsink.rs rename to crates/gst/src/plugins/app/appsink.rs diff --git a/gst/src/plugins/autodetect.rs b/crates/gst/src/plugins/autodetect.rs similarity index 100% rename from gst/src/plugins/autodetect.rs rename to crates/gst/src/plugins/autodetect.rs diff --git a/gst/src/plugins/autodetect/autovideosink.rs b/crates/gst/src/plugins/autodetect/autovideosink.rs similarity index 100% rename from gst/src/plugins/autodetect/autovideosink.rs rename to crates/gst/src/plugins/autodetect/autovideosink.rs diff --git a/gst/src/plugins/playback.rs b/crates/gst/src/plugins/playback.rs similarity index 100% rename from gst/src/plugins/playback.rs rename to crates/gst/src/plugins/playback.rs diff --git a/gst/src/plugins/playback/playbin.rs b/crates/gst/src/plugins/playback/playbin.rs similarity index 100% rename from gst/src/plugins/playback/playbin.rs rename to crates/gst/src/plugins/playback/playbin.rs diff --git a/gst/src/plugins/playback/playbin3.rs b/crates/gst/src/plugins/playback/playbin3.rs similarity index 100% rename from gst/src/plugins/playback/playbin3.rs rename to crates/gst/src/plugins/playback/playbin3.rs diff --git a/gst/src/plugins/videoconvertscale.rs b/crates/gst/src/plugins/videoconvertscale.rs similarity index 100% rename from gst/src/plugins/videoconvertscale.rs rename to crates/gst/src/plugins/videoconvertscale.rs diff --git a/gst/src/plugins/videoconvertscale/videoconvert.rs b/crates/gst/src/plugins/videoconvertscale/videoconvert.rs similarity index 100% rename from gst/src/plugins/videoconvertscale/videoconvert.rs rename to crates/gst/src/plugins/videoconvertscale/videoconvert.rs diff --git a/gst/src/sample.rs b/crates/gst/src/sample.rs similarity index 100% rename from gst/src/sample.rs rename to crates/gst/src/sample.rs diff --git a/gst/src/wgpu.rs b/crates/gst/src/wgpu.rs similarity index 100% rename from gst/src/wgpu.rs rename to crates/gst/src/wgpu.rs diff --git a/gst/src/wrapper.rs b/crates/gst/src/wrapper.rs similarity index 100% rename from gst/src/wrapper.rs rename to crates/gst/src/wrapper.rs diff --git a/crates/iced-video/Cargo.toml b/crates/iced-video/Cargo.toml index a98099f..394f8d2 100644 --- a/crates/iced-video/Cargo.toml +++ b/crates/iced-video/Cargo.toml @@ -19,11 +19,3 @@ wgpu = { version = "27.0.1", features = ["vulkan"] } [dev-dependencies] iced.workspace = true tracing-subscriber = { version = "0.3.22", features = ["env-filter"] } - -[profile.dev] -debug = true -[profile.release] -debug = true - -# [patch.crates-io] -# iced_wgpu = { git = "https://github.com/uttarayan21/iced", branch = "0.14" } diff --git a/crates/iced-video/src/source.rs b/crates/iced-video/src/source.rs index 3884326..5428885 100644 --- a/crates/iced-video/src/source.rs +++ b/crates/iced-video/src/source.rs @@ -1,12 +1,11 @@ use crate::{Error, Result, ResultExt}; use gst::{ - Bus, Gst, MessageType, MessageView, Sink, Source, + Bus, Gst, Sink, app::AppSink, caps::{Caps, CapsType}, element::ElementExt, pipeline::PipelineExt, playback::{PlayFlags, Playbin3}, - videoconvertscale::VideoConvert, }; use std::sync::{Arc, Mutex, atomic::AtomicBool}; diff --git a/store/Cargo.toml b/crates/store/Cargo.toml similarity index 100% rename from store/Cargo.toml rename to crates/store/Cargo.toml diff --git a/store/src/lib.rs b/crates/store/src/lib.rs similarity index 100% rename from store/src/lib.rs rename to crates/store/src/lib.rs diff --git a/store/src/sqlite.rs b/crates/store/src/sqlite.rs similarity index 100% rename from store/src/sqlite.rs rename to crates/store/src/sqlite.rs diff --git a/store/src/toml.rs b/crates/store/src/toml.rs similarity index 100% rename from store/src/toml.rs rename to crates/store/src/toml.rs diff --git a/examples/hdr-gstreamer-wgpu/Cargo.toml b/examples/hdr-gstreamer-wgpu/Cargo.toml index a317703..5650d7b 100644 --- a/examples/hdr-gstreamer-wgpu/Cargo.toml +++ b/examples/hdr-gstreamer-wgpu/Cargo.toml @@ -15,6 +15,3 @@ anyhow = "*" pollster = "0.4.0" tracing = { version = "0.1.43", features = ["log"] } tracing-subscriber = "0.3.22" - -[profile.release] -debug = true diff --git a/gst/.github/workflows/build.yaml b/gst/.github/workflows/build.yaml deleted file mode 100644 index d8894ee..0000000 --- a/gst/.github/workflows/build.yaml +++ /dev/null @@ -1,62 +0,0 @@ -name: build - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - CARGO_TERM_COLOR: always - -jobs: - checks-matrix: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - - id: set-matrix - name: Generate Nix Matrix - run: | - set -Eeu - matrix="$(nix eval --json '.#githubActions.matrix')" - echo "matrix=$matrix" >> "$GITHUB_OUTPUT" - - checks-build: - needs: checks-matrix - runs-on: ${{ matrix.os }} - strategy: - matrix: ${{fromJSON(needs.checks-matrix.outputs.matrix)}} - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - - run: nix build -L '.#${{ matrix.attr }}' - - codecov: - runs-on: ubuntu-latest - permissions: - id-token: "write" - contents: "read" - - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - - - name: Run codecov - run: nix build .#checks.x86_64-linux.hello-llvm-cov - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.0.1 - with: - flags: unittests - name: codecov-hello - fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} - files: ./result - verbose: true - diff --git a/gst/.github/workflows/docs.yaml b/gst/.github/workflows/docs.yaml deleted file mode 100644 index c7048c4..0000000 --- a/gst/.github/workflows/docs.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: docs - -on: - push: - branches: [ master ] - -env: - CARGO_TERM_COLOR: always - -jobs: - docs: - runs-on: ubuntu-latest - permissions: - id-token: "write" - contents: "read" - pages: "write" - - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - - uses: DeterminateSystems/flake-checker-action@main - - - name: Generate docs - run: nix build .#checks.x86_64-linux.hello-docs - - - name: Setup Pages - uses: actions/configure-pages@v5 - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: result/share/doc - - - name: Deploy to gh-pages - id: deployment - uses: actions/deploy-pages@v4 - diff --git a/src/errors.rs b/src/errors.rs index 149f933..3f7fda9 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,4 +1,4 @@ -pub use error_stack::{Report, ResultExt}; +pub use error_stack::ResultExt; #[derive(Debug, thiserror::Error)] #[error("An error occurred")] pub struct Error; diff --git a/src/main.rs b/src/main.rs index 018e132..f957377 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,5 @@ mod cli; mod errors; -use api::JellyfinConfig; use errors::*; fn main() -> Result<()> { diff --git a/ui-iced/Cargo.toml b/ui-iced/Cargo.toml index f4db350..71c489f 100644 --- a/ui-iced/Cargo.toml +++ b/ui-iced/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" license = "MIT" [dependencies] -api = { version = "0.1.0", path = "../api" } +api = { workspace = true } blurhash = "0.2.3" bytes = "1.11.0" gpui_util = "0.2.2" diff --git a/ui-iced/src/lib.rs b/ui-iced/src/lib.rs index 88b0619..00df60e 100644 --- a/ui-iced/src/lib.rs +++ b/ui-iced/src/lib.rs @@ -270,7 +270,6 @@ fn update(state: &mut State, message: Message) -> Task { } } Message::Video(msg) => video::update(state, msg), - _ => todo!(), } }