fix: Playlist retrieval if list has podcasts (#1691)

* fix: Playlist retrieval if list has podcasts

Fixes #1689

* fix: Gracefully handle unknown playable types
This commit is contained in:
Henrik Friedrichsen
2025-08-28 06:16:17 +02:00
committed by GitHub
parent fdd05d4f3f
commit 2d4507dfc9
4 changed files with 33 additions and 16 deletions

View File

@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Fixed
- Playlist retrieval crashing when list contains podcast episodes
## [1.3.1] ## [1.3.1]
### Fixed ### Fixed

32
Cargo.lock generated
View File

@@ -58,9 +58,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
[[package]] [[package]]
name = "alsa" name = "alsa"
version = "0.9.1" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed7572b7ba83a31e20d1b48970ee402d2e3e0537dcfe0a3ff4d6eb7508617d43" checksum = "bdc00893e7a970727e9304671b2c88577b4cfe53dc64019fdfdf9683573a09c4"
dependencies = [ dependencies = [
"alsa-sys", "alsa-sys",
"bitflags 2.9.3", "bitflags 2.9.3",
@@ -202,9 +202,9 @@ dependencies = [
[[package]] [[package]]
name = "async-executor" name = "async-executor"
version = "1.13.2" version = "1.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb812ffb58524bdd10860d7d974e2f01cc0950c2438a74ee5ec2e2280c6c4ffa" checksum = "497c00e0fd83a72a79a39fcbd8e3e2f055d6f6c7e025f3b3d91f4f8e76527fb8"
dependencies = [ dependencies = [
"async-task", "async-task",
"concurrent-queue", "concurrent-queue",
@@ -482,18 +482,18 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.45" version = "4.5.46"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fc0e74a703892159f5ae7d3aac52c8e6c392f5ae5f359c70b5881d60aaac318" checksum = "2c5e4fcf9c21d2e544ca1ee9d8552de13019a42aa7dbf32747fa7aaf1df76e57"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
] ]
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.44" version = "4.5.46"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3e7f4214277f3c7aa526a59dd3fbe306a370daee1f8b7b8c987069cd8e888a8" checksum = "fecb53a0e6fcfb055f686001bc2e2592fa527efaf38dbe81a6a9563562e57d41"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@@ -3444,9 +3444,9 @@ dependencies = [
[[package]] [[package]]
name = "rspotify" name = "rspotify"
version = "0.15.0" version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77beedc33ecff4c39e8ef0e6f7ebc8d849f3ffebbeb786f9997d96f0d9cf4017" checksum = "c39d180900892f9b6327d087b239ea82b8ed911fe9aa18d4942ffdbf8055a5fc"
dependencies = [ dependencies = [
"base64", "base64",
"chrono", "chrono",
@@ -3465,9 +3465,9 @@ dependencies = [
[[package]] [[package]]
name = "rspotify-http" name = "rspotify-http"
version = "0.15.0" version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fde1ea9e2a49698cffbc994a83f5f909b37736c31cccb202f9577e8a32df3a63" checksum = "945a4224bc10689210e3a174d11a0fe739cc3cd274a5b20e189fa6dcd075c3ee"
dependencies = [ dependencies = [
"log", "log",
"maybe-async", "maybe-async",
@@ -3479,15 +3479,15 @@ dependencies = [
[[package]] [[package]]
name = "rspotify-macros" name = "rspotify-macros"
version = "0.15.0" version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee3dfb51ee54bd754ad76e96ad60a3b64bc70ae33a89261d9dbabc4c148a496f" checksum = "beb553ecf4dc5bb227ff9ad722aada0c000fe02cb95d5d94bed15580d488f63d"
[[package]] [[package]]
name = "rspotify-model" name = "rspotify-model"
version = "0.15.0" version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "018f29a6a8c47cfe7923c48140ed546a395f660c7af05b73e6001d4505f89c8d" checksum = "9d78e4c1c1f0363c8d5950337eca16f17483e8da86548c34fa4fdc94f5c7746e"
dependencies = [ dependencies = [
"chrono", "chrono",
"enum_dispatch", "enum_dispatch",

View File

@@ -144,6 +144,7 @@ impl From<&PlayableItem> for Playable {
match item { match item {
PlayableItem::Episode(episode) => Self::Episode(episode.into()), PlayableItem::Episode(episode) => Self::Episode(episode.into()),
PlayableItem::Track(track) => Self::Track(track.into()), PlayableItem::Track(track) => Self::Track(track.into()),
PlayableItem::Unknown(value) => panic!("Unknown playable item {value:?}"),
} }
} }
} }

View File

@@ -431,6 +431,16 @@ impl WebApi {
items: page items: page
.items .items
.iter() .iter()
.filter(|pt| {
if let Some(t) = pt.track.as_ref()
&& !t.is_unknown()
{
true
} else {
error!("Could not process item {pt:?}, ignoring");
false
}
})
.enumerate() .enumerate()
.flat_map(|(index, pt)| { .flat_map(|(index, pt)| {
pt.track.as_ref().map(|t| { pt.track.as_ref().map(|t| {