Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 586c0b88eb | |||
| 8e2989731e | |||
| bda76ba5a0 | |||
| c4adb30d7b |
@@ -93,19 +93,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.version.outputs.VERSION }}"
|
VERSION="${{ steps.version.outputs.VERSION }}"
|
||||||
|
|
||||||
|
# Get hash from the local tarball (already built)
|
||||||
|
NEW_HASH=$(sha256sum release/cm-player-linux-x86_64.tar.gz | cut -d' ' -f1)
|
||||||
|
NIX_HASH="sha256-$(python3 -c "import base64, binascii; print(base64.b64encode(binascii.unhexlify('$NEW_HASH')).decode())")"
|
||||||
|
|
||||||
# Clone nixosbox repository
|
# Clone nixosbox repository
|
||||||
git clone https://$GITEA_TOKEN@gitea.cmtec.se/cm/nixosbox.git nixosbox-update
|
git clone https://$GITEA_TOKEN@gitea.cmtec.se/cm/nixosbox.git nixosbox-update
|
||||||
cd nixosbox-update
|
cd nixosbox-update
|
||||||
|
|
||||||
# Get hash for the new release tarball
|
|
||||||
TARBALL_URL="https://gitea.cmtec.se/cm/cm-player/releases/download/$VERSION/cm-player-linux-x86_64.tar.gz"
|
|
||||||
|
|
||||||
# Download tarball to get correct hash
|
|
||||||
curl -L -o cm-player.tar.gz "$TARBALL_URL"
|
|
||||||
# Convert sha256 hex to base64 for Nix hash format using Python
|
|
||||||
NEW_HASH=$(sha256sum cm-player.tar.gz | cut -d' ' -f1)
|
|
||||||
NIX_HASH="sha256-$(python3 -c "import base64, binascii; print(base64.b64encode(binascii.unhexlify('$NEW_HASH')).decode())")"
|
|
||||||
|
|
||||||
# Update the NixOS configuration
|
# Update the NixOS configuration
|
||||||
sed -i "s|version = \"v[^\"]*\"|version = \"$VERSION\"|" hosts/common/cm-player.nix
|
sed -i "s|version = \"v[^\"]*\"|version = \"$VERSION\"|" hosts/common/cm-player.nix
|
||||||
sed -i "s|sha256 = \"sha256-[^\"]*\"|sha256 = \"$NIX_HASH\"|" hosts/common/cm-player.nix
|
sed -i "s|sha256 = \"sha256-[^\"]*\"|sha256 = \"$NIX_HASH\"|" hosts/common/cm-player.nix
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-player"
|
name = "cm-player"
|
||||||
version = "0.1.3"
|
version = "0.1.5"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -227,6 +227,13 @@ async fn handle_key_event<B: ratatui::backend::Backend>(terminal: &mut Terminal<
|
|||||||
tracing::info!("Playing: {:?} (playlist: {} tracks)", path, state.playlist.len());
|
tracing::info!("Playing: {:?} (playlist: {} tracks)", path, state.playlist.len());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
(KeyCode::Char('s'), _) => {
|
||||||
|
// s: Stop playback
|
||||||
|
state.player_state = PlayerState::Stopped;
|
||||||
|
state.current_position = 0.0;
|
||||||
|
state.current_duration = 0.0;
|
||||||
|
tracing::info!("Stopped");
|
||||||
|
}
|
||||||
(KeyCode::Char(' '), _) => {
|
(KeyCode::Char(' '), _) => {
|
||||||
match state.player_state {
|
match state.player_state {
|
||||||
PlayerState::Playing => {
|
PlayerState::Playing => {
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ fn render_status_bar(frame: &mut Frame, state: &AppState, area: Rect) {
|
|||||||
frame.render_widget(status_bar, area);
|
frame.render_widget(status_bar, area);
|
||||||
} else {
|
} else {
|
||||||
// Normal mode shortcuts (always shown when not in search mode)
|
// Normal mode shortcuts (always shown when not in search mode)
|
||||||
let shortcuts = "/: Search • v: Mark • a: Add to Playlist • c: Clear Playlist • Enter: Play • Space: Pause • ←→: Seek • +/-: Volume • n/p: Next/Prev • r: Rescan • q: Quit";
|
let shortcuts = "/: Search • v: Mark • a: Add • c: Clear • Enter: Play • Space: Pause • s: Stop • ←→: Seek • +/-: Vol • n/p: Next/Prev • r: Rescan • q: Quit";
|
||||||
let status_bar = Paragraph::new(shortcuts)
|
let status_bar = Paragraph::new(shortcuts)
|
||||||
.style(Style::default().fg(Theme::muted_text()).bg(Theme::background()))
|
.style(Style::default().fg(Theme::muted_text()).bg(Theme::background()))
|
||||||
.alignment(Alignment::Center);
|
.alignment(Alignment::Center);
|
||||||
|
|||||||
Reference in New Issue
Block a user