Compare commits

...

3 commits

Author SHA1 Message Date
f05e17ee3a
Show track numbers 2023-12-23 06:27:23 +01:00
02f4025de3
Merge pull request #19 from vijfhoek/dependabot/cargo/rustix-0.37.25
Bump rustix from 0.37.23 to 0.37.25
2023-12-23 06:19:14 +01:00
dependabot[bot]
b3525c786f
Bump rustix from 0.37.23 to 0.37.25
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.37.23 to 0.37.25.
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.37.23...v0.37.25)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-18 18:52:12 +00:00
4 changed files with 14 additions and 3 deletions

4
Cargo.lock generated
View file

@ -1264,9 +1264,9 @@ dependencies = [
[[package]]
name = "rustix"
version = "0.37.23"
version = "0.37.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06"
checksum = "d4eb579851244c2c03e7c24f501c3432bed80b8f720af1d6e5b0e0f01555a035"
dependencies = [
"bitflags",
"errno",

View file

@ -25,6 +25,7 @@ pub struct QueueItem {
#[derive(Debug)]
pub enum Entry {
Song {
track: Option<i32>,
name: String,
artist: String,
path: String,
@ -272,6 +273,7 @@ impl Mpd {
.flat_map(|prop| {
if let Some(file) = prop.get("file") {
Some(Entry::Song {
track: prop.get("Track").and_then(|track| track.parse().ok()),
name: prop.get("Title").unwrap_or(&get_filename(file)).clone(),
artist: prop.get("Artist").unwrap_or(&String::new()).clone(),
path: file.to_string(),

View file

@ -225,6 +225,10 @@ ul.dir li .material-symbols-outlined {
object-fit: cover;
}
.track {
margin-right: 0.75rem;
}
.player {
width: 25rem;
padding: 1rem 1rem 0;

View file

@ -48,7 +48,7 @@
<ul class="dir" hx-boost="true" tabindex="-1">
{% for entry in entries %}
{% match entry %}
{% when mpd::Entry::Song with { name, path, artist } %}
{% when mpd::Entry::Song with { track, name, path, artist } %}
<li
hx-post="/queue?path={{ path|urlencode }}"
hx-trigger="click,keyup[key=='Enter']"
@ -64,6 +64,11 @@
alt="Album art"
>
</div>
{% if let Some(track) = track %}
<div class="track">
{{ track }}.
</div>
{% endif %}
<div class="song">
<div class="song__name">{{ name }}</div>
<div class="song__artist">{{ artist }}</div>