Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8255e39047 | ||
|
|
8f8004c205 |
@@ -2,6 +2,13 @@
|
||||
|
||||
One section per version, newest first.
|
||||
|
||||
## v0.2.1 (2026-11-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- Starting a track from another album at the same position as the one playing, such as track 1 after track 1, now shows the new track and its cover. Pause works straight away instead of saying nothing is playing.
|
||||
- Replaying the track that is playing counts as a new play: its position resets and the server is told it is playing.
|
||||
|
||||
## v0.2.0 (2026-11-04)
|
||||
|
||||
### Features
|
||||
|
||||
Generated
+1
-1
@@ -4385,7 +4385,7 @@ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
|
||||
|
||||
[[package]]
|
||||
name = "remus"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"directories",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "remus"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
|
||||
|
||||
@@ -113,6 +113,8 @@ branding: ## Regenerate the logo SVGs and render the PNGs (needs inkscape)
|
||||
PACKAGE = $(shell awk -F'"' '/^\[package\]/{p=1;next} /^\[/{p=0} p && /^name *= *"/{print $$2; exit}' Cargo.toml)
|
||||
CURRENT = $(shell awk -F'"' '/^\[package\]/{p=1;next} /^\[/{p=0} p && /^version *= *"/{print $$2; exit}' Cargo.toml)
|
||||
METAINFO = flatpak/$(FLATPAK_ID).metainfo.xml
|
||||
# Versions are only made here, so a tag never lands on a commit that is not on it.
|
||||
BUMP_BRANCH = master
|
||||
|
||||
.PHONY: version
|
||||
version: ## Print the current version
|
||||
@@ -128,13 +130,18 @@ minor: bump ## Bump for a feature: amend into the last commit and tag it
|
||||
major: bump ## Bump for a breaking change, decided by hand
|
||||
|
||||
# Folds the bump into the last commit and tags it, as one action, so there is
|
||||
# never a bump without a tag or a tag without a bump. Refuses anything that
|
||||
# would make rewriting that commit lose work, orphan a tag or need a force push,
|
||||
# and a version CHANGELOG.md does not describe yet.
|
||||
# never a bump without a tag or a tag without a bump. Refuses any branch but
|
||||
# BUMP_BRANCH, anything that would make rewriting that commit lose work, orphan
|
||||
# a tag or need a force push, and a version CHANGELOG.md does not describe yet.
|
||||
.PHONY: bump
|
||||
bump:
|
||||
@set -e; \
|
||||
if [ -z "$(BUMP)" ]; then echo "error: run make patch, make minor or make major" >&2; exit 1; fi; \
|
||||
branch=$$(git symbolic-ref --quiet --short HEAD || true); \
|
||||
if [ "$$branch" != "$(BUMP_BRANCH)" ]; then \
|
||||
echo "error: versions are only bumped on local $(BUMP_BRANCH), and this is $${branch:-a detached HEAD}. Fast-forward $(BUMP_BRANCH) to this work, switch to it, then bump." >&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
if ! git rev-parse -q --verify HEAD >/dev/null 2>&1; then \
|
||||
echo "error: no commits yet, so there is no commit to fold a version bump into. Commit first." >&2; \
|
||||
exit 1; \
|
||||
|
||||
@@ -90,4 +90,5 @@ Every finished ticket bumps the version, so a build on the Deck can be matched t
|
||||
|
||||
- `make patch` for a bug fix, `make minor` for a feature, `make major` only when a breaking change has been decided.
|
||||
- Before bumping, add a `## v<new> (<date>)` entry at the top of `CHANGELOG.md`, with `### Features` and `### Bug fixes` subsections (leave out an empty one), and commit it with the change. `make version` prints the current version.
|
||||
- Bump on local `master` only: fast-forward `master` to the finished work, switch to it, then bump. The targets refuse any other branch.
|
||||
- The bump writes the new version to `Cargo.toml`, `Cargo.lock` and the Flatpak metainfo, amends that into the last commit and tags it `v<new>`. It refuses a dirty tree, a commit that is already tagged or pushed, and a version the changelog has no entry for.
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
</supports>
|
||||
<content_rating type="oars-1.1"/>
|
||||
<releases>
|
||||
<release version="0.2.1" date="2026-11-04"/>
|
||||
<release version="0.2.0" date="2026-11-04"/>
|
||||
<release version="0.1.0" date="2026-11-04"/>
|
||||
</releases>
|
||||
|
||||
+2
-3
@@ -1519,10 +1519,9 @@ impl App {
|
||||
self.ui.set_np_paused(p);
|
||||
}
|
||||
PlayerEvent::Track(t) => {
|
||||
// Reported once per track started, so the same index again is a
|
||||
// new play: another queue started there, or the track replayed.
|
||||
let t = t.filter(|&i| i < self.queue.len());
|
||||
if t == self.current {
|
||||
return;
|
||||
}
|
||||
self.current = t;
|
||||
self.position = 0.0;
|
||||
self.scrobbled = false;
|
||||
|
||||
+49
-11
@@ -182,10 +182,12 @@ fn watch_bus(playbin: &gst::Element, queue: &Mutex<Queue>, stop: &AtomicBool, em
|
||||
let Some(bus) = playbin.bus() else { return };
|
||||
let mut last_tick = Instant::now();
|
||||
let mut duration = 0.0;
|
||||
// playbin can post stream-start more than once for one track.
|
||||
// playbin can post stream-start more than once for one track, so a repeat
|
||||
// of the last report is dropped. A track that was just started is always
|
||||
// reported, even at the same index: a new queue, or the same track again.
|
||||
let mut last_track: Option<Option<usize>> = None;
|
||||
let mut report_track = |t: Option<usize>| {
|
||||
if last_track != Some(t) {
|
||||
let mut report_track = |t: Option<usize>, started: bool| {
|
||||
if started || last_track != Some(t) {
|
||||
last_track = Some(t);
|
||||
emit(PlayerEvent::Track(t));
|
||||
emit(PlayerEvent::Position(0.0));
|
||||
@@ -196,15 +198,19 @@ fn watch_bus(playbin: &gst::Element, queue: &Mutex<Queue>, stop: &AtomicBool, em
|
||||
use gst::MessageView;
|
||||
match msg.view() {
|
||||
MessageView::StreamStart(_) => {
|
||||
let current = {
|
||||
let (current, started) = {
|
||||
let mut q = lock(queue);
|
||||
if let Some(p) = q.pending.take() {
|
||||
q.current = Some(p);
|
||||
}
|
||||
q.current
|
||||
let started = match q.pending.take() {
|
||||
Some(p) => {
|
||||
q.current = Some(p);
|
||||
true
|
||||
}
|
||||
None => false,
|
||||
};
|
||||
(q.current, started)
|
||||
};
|
||||
duration = 0.0;
|
||||
report_track(current);
|
||||
report_track(current, started);
|
||||
}
|
||||
MessageView::StateChanged(s) if s.src() == Some(playbin.upcast_ref()) => match s.current() {
|
||||
gst::State::Playing => emit(PlayerEvent::Paused(false)),
|
||||
@@ -218,7 +224,7 @@ fn watch_bus(playbin: &gst::Element, queue: &Mutex<Queue>, stop: &AtomicBool, em
|
||||
q.pending = None;
|
||||
}
|
||||
let _ = playbin.set_state(gst::State::Ready);
|
||||
report_track(None);
|
||||
report_track(None, false);
|
||||
}
|
||||
MessageView::Error(err) => {
|
||||
let detail = err.debug().map(|d| d.to_string()).unwrap_or_default();
|
||||
@@ -239,7 +245,7 @@ fn watch_bus(playbin: &gst::Element, queue: &Mutex<Queue>, stop: &AtomicBool, em
|
||||
start(playbin, &url);
|
||||
} else {
|
||||
let _ = playbin.set_state(gst::State::Ready);
|
||||
report_track(None);
|
||||
report_track(None, false);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
@@ -357,4 +363,36 @@ mod tests {
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
assert_eq!(tracks, vec![Some(0), Some(1), None]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn starting_at_the_playing_index_reports_the_track_again() {
|
||||
// SAFETY: set before any thread reads the environment in this test.
|
||||
unsafe { std::env::set_var("REMUS_AUDIO_SINK", "fakesink") };
|
||||
let dir = std::env::temp_dir().join(format!("remus-player-restart-{}", std::process::id()));
|
||||
std::fs::create_dir_all(&dir).unwrap();
|
||||
// Long enough that nothing finishes while the test runs.
|
||||
let album_a = vec![silent_wav(&dir, "a1.wav", 10.0), silent_wav(&dir, "a2.wav", 10.0)];
|
||||
let album_b = vec![silent_wav(&dir, "b1.wav", 10.0), silent_wav(&dir, "b2.wav", 10.0)];
|
||||
|
||||
let (tx, rx) = mpsc::channel();
|
||||
let player = Player::spawn(move |ev| {
|
||||
if let PlayerEvent::Track(t) = ev {
|
||||
let _ = tx.send(t);
|
||||
}
|
||||
})
|
||||
.unwrap();
|
||||
let next = || rx.recv_timeout(Duration::from_secs(3)).ok();
|
||||
|
||||
player.play_list(&album_a, 0);
|
||||
assert_eq!(next(), Some(Some(0)), "first album started");
|
||||
// Another album, started at the same index as the track playing.
|
||||
player.play_list(&album_b, 0);
|
||||
assert_eq!(next(), Some(Some(0)), "second album started at the same index");
|
||||
// The playing track started again from the queue.
|
||||
player.play_index(0);
|
||||
assert_eq!(next(), Some(Some(0)), "the same track restarted");
|
||||
|
||||
drop(player);
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user