Skip to content

Commit

Permalink
Add local libmpv-rs
Browse files Browse the repository at this point in the history
  • Loading branch information
sudipghimire533 committed Nov 9, 2024
1 parent 62410fd commit 549ce21
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 52 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ jobs:

- name: Install dependencies
run: |
git submodule init
sudo apt update &&
sudo apt install libmpv-dev
- name: Build
run: |
cargo build --all --release &&
cargo build --all --release --features=libmpv_build &&
strip target/release/ytui_music &&
mv target/release/ytui_music target/release/ytui_music-linux-amd64
Expand Down
133 changes: 106 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ git clone git@github.com:sudipghimire533/ytui-music

3) `cd` into source root and do:
```
cargo build --all --release
git submodule init
MPV_BUILD=mpv-build/ cargo build --all --release --features libmpv_build
```

4) The compiled binary is located in `target/release/` directory. Copy the `ytui_music` binary and place it somewhere where it is easy to run. Preferrably under `$PATH`.
Expand Down
7 changes: 5 additions & 2 deletions front-end/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ authors = ["Sudip Ghimire <sudipghimire533@gmail.com>"]
[dependencies]
tokio = { version = "1", features = ["full"] }
crossterm = { version = "0.20", features = ["event-stream"] }
tui = { version = "0.16", features = ["crossterm"], default-features = false }
tui = { package = "ratatui", version = "0.22.0", features = ["crossterm", "all-widgets"], default-features = false }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
libmpv = { version = "2.0.1" }
libmpv = { git = "https://github.com/sudipghimire533/libmpv-rs", rev = "master" }
fetcher = { path = "../fetcher" }
lazy_static = "1.4.0"
config = { path = "../config" }
reqwest = { version = "0.11", features = ["json", "gzip"] }

[features]
build_libmpv = ["libmpv/build_libmpv"]
2 changes: 1 addition & 1 deletion front-end/src/ui/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ pub async fn event_sender(
let increase_by = match direction {
HeadTo::Next => CONFIG.constants.volume_step,
HeadTo::Prev => CONFIG.constants.volume_step * -1,
HeadTo::Initial => 0
HeadTo::Initial => 0,
};

let res = state.player.change_volume(increase_by);
Expand Down
Loading

0 comments on commit 549ce21

Please sign in to comment.