[PR #1432] [MERGED] metadata: handle empty trailer_uri for shows #1389

Closed
opened 2026-02-27 20:02:15 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/1432
Author: @eladyn
Created: 12/29/2024
Status: Merged
Merged: 12/30/2024
Merged by: @photovoltex

Base: devHead: episode_metadata_fix


📝 Commits (2)

  • d2e4ac0 metadata: handle empty trailer_uri for shows
  • 3bf830f chore: update changelog

📊 Changes

2 files changed (+8 additions, -2 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 metadata/src/show.rs (+7 -2)

📄 Description

I stumbled across a show, which has an empty trailer_uri. In particular, the trailer_uri field on the librespot_protocol::metadata::Show struct was Some(""), which led to the SpotifyId::from_uri parsing to fail.

This patch accounts for this possibility. Another option would of course be to just use String for that field, to avoid any parsing problems.

Example:

previously, doing Show::get(&session, &id).await yielded for spotify:show:28sR8OiOq0MMnGEzMJTXSt:

Error { kind: InvalidArgument, error: InvalidFormat }

With this, it returns:

Show {
    id: SpotifyId(
        "spotify:show:28sR8OiOq0MMnGEzMJTXSt",
    ),
    name: "1,5 Grad – der Klima-Podcast mit Luisa Neubauer",
    description: "Die Klimakrise ist hier. Wir haben alle Fakten, die wir brauchen, um gegen sie anzukämpfen. In Deutschland haben wir dafür sogar politische Mehrheiten. Wie kommen wir als Gesellschaft endlich ins Handeln? Im Spotify-Original Podcast “1,5 Grad” gibt Luisa Neubauer Antworten auf diese Frage. Sie gewährt Einblicke hinter die Kulissen ihres Aktivistinnen-Lebens und beleuchtet die Klimadiskussion mit ihren Gästen aus neuen Blickwinkeln. Für sie ist klar: Veränderung findet bereits statt, Quellen für Hoffnung gibt es überall. Jetzt liegt es an uns allen, den Wandel mit anzuschieben. \"1,5 Grad\" - der Klima-Podcast mit Luisa Neubauer, nur auf Spotify.",
    publisher: "Spotify & Luisa Neubauer",
    language: "de",
    is_explicit: false,
    covers: Images(
        [
            Image {
                id: FileId(
                    Ok(
                        "ab6765630000f68da378a43d00eddbb41f2f4c70",
                    ),
                ),
                size: SMALL,
                width: 64,
                height: 64,
            },
            Image {
                id: FileId(
                    Ok(
                        "ab67656300005f1fa378a43d00eddbb41f2f4c70",
                    ),
                ),
                size: DEFAULT,
                width: 300,
                height: 300,
            },
            Image {
                id: FileId(
                    Ok(
                        "ab6765630000ba8aa378a43d00eddbb41f2f4c70",
                    ),
                ),
                size: LARGE,
                width: 640,
                height: 640,
            },
        ],
    ),
    episodes: Episodes(
        [
            SpotifyId(
                "spotify:episode:2yJRySMdJa0IJyhiQt2KYe",
            ),
            SpotifyId(
                "spotify:episode:5keKoTZNooaeKboKsfuZNk",
            ),
            SpotifyId(
                "spotify:episode:09rvishjEfUJ3MxEZj6tO9",
            ),
            SpotifyId(
                "spotify:episode:2SgffAMDaqFuPmpc9QihBP",
            ),
            SpotifyId(
                "spotify:episode:4COEXOhmcH83gW2mVwxQOl",
            ),
            SpotifyId(
                "spotify:episode:1Uk9wVHzBJ1O8R1ale0zaV",
            ),
            SpotifyId(
                "spotify:episode:1LmstLMvSj9EuvziJc0cov",
            ),
            SpotifyId(
                "spotify:episode:5zzZdUXuMsnctu9Pz5G05u",
            ),
            SpotifyId(
                "spotify:episode:7FMbTNlH5XNzUcXvTnYh16",
            ),
            SpotifyId(
                "spotify:episode:6xHOj0wQFtGUK2SGSXjzKB",
            ),
            SpotifyId(
                "spotify:episode:2A1evUit45oQb65OWT6P8b",
            ),
            SpotifyId(
                "spotify:episode:5nXD7kVMvfwh0M2piTc0WJ",
            ),
            SpotifyId(
                "spotify:episode:0PsAw06YY8FuUspnCZS7nD",
            ),
            SpotifyId(
                "spotify:episode:1y7uYvJ9TPJVKxLnYN6Ror",
            ),
            SpotifyId(
                "spotify:episode:3vCNeuiYXmz2nWZYnbPND7",
            ),
            SpotifyId(
                "spotify:episode:2onaNST6VMOR3Tqyh40X8j",
            ),
            SpotifyId(
                "spotify:episode:1x6ripc5R6YgQFU9ViUzJI",
            ),
            SpotifyId(
                "spotify:episode:3KMAxjwnQ4zx2Z8dQjl70t",
            ),
            SpotifyId(
                "spotify:episode:6asAmilWvDl8PXjr3IIOnX",
            ),
            SpotifyId(
                "spotify:episode:1ymuViiEonDfMAWRjaaN1T",
            ),
            SpotifyId(
                "spotify:episode:39KFKqoDk4TuXlX9rKoWLS",
            ),
            SpotifyId(
                "spotify:episode:1qSu2efACZAxWuXDoeQaXh",
            ),
            SpotifyId(
                "spotify:episode:5vWMPof2Jb2iFNTlyigIcz",
            ),
            SpotifyId(
                "spotify:episode:7fzqrKo2HeIRfQQ9gtXbeX",
            ),
            SpotifyId(
                "spotify:episode:2EAt05dQh3p8GqeRdqWuxZ",
            ),
            SpotifyId(
                "spotify:episode:2OL68dHC8PtnSENJZuhUYT",
            ),
            SpotifyId(
                "spotify:episode:4hOrkGiMX87T2PWQ82KyTz",
            ),
            SpotifyId(
                "spotify:episode:3Ocm2w0et8jTk8zIrtKT2V",
            ),
            SpotifyId(
                "spotify:episode:34G1AB7LhH2CDj53TbgKlq",
            ),
            SpotifyId(
                "spotify:episode:4jtZGkwKDTgGm0omX3RImR",
            ),
            SpotifyId(
                "spotify:episode:1nJTLeXwgHCKH4Md82AlfX",
            ),
            SpotifyId(
                "spotify:episode:6u8PhdmS8mjxH6Ki67y8n4",
            ),
            SpotifyId(
                "spotify:episode:7dRCQTIDrTLLKMeiPNFTOm",
            ),
            SpotifyId(
                "spotify:episode:6544sUNuxTD0vaJ67qgop7",
            ),
            SpotifyId(
                "spotify:episode:220LAEscnWZ8PpY3CxwX8A",
            ),
            SpotifyId(
                "spotify:episode:7kPNMpbzl5m63DDEqChGmq",
            ),
            SpotifyId(
                "spotify:episode:4zO0xIqBlvG9BSO5ZFBNvL",
            ),
            SpotifyId(
                "spotify:episode:6rOdBsMjRc6jz46inwx7Hp",
            ),
            SpotifyId(
                "spotify:episode:274Faf5SUiQRe9wIefAmxJ",
            ),
            SpotifyId(
                "spotify:episode:7baOTUE0lzsxtTAqWCwrh3",
            ),
            SpotifyId(
                "spotify:episode:2f4Q1eGIlOiUs0GAy6uioj",
            ),
        ],
    ),
    copyrights: Copyrights(
        [],
    ),
    restrictions: Restrictions(
        [
            Restriction {
                catalogues: RestrictionCatalogues(
                    [],
                ),
                restriction_type: STREAMING,
                catalogue_strs: [
                    "all",
                    "free",
                    "premium",
                    "shuffle",
                    "commercial",
                ],
                countries_allowed: None,
                countries_forbidden: Some(
                    [],
                ),
            },
        ],
    ),
    keywords: [],
    media_type: AUDIO,
    consumption_order: EPISODIC,
    availability: Availabilities(
        [],
    ),
    trailer_uri: None,
    has_music_and_talk: false,
    is_audiobook: false,
}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/librespot-org/librespot/pull/1432 **Author:** [@eladyn](https://github.com/eladyn) **Created:** 12/29/2024 **Status:** ✅ Merged **Merged:** 12/30/2024 **Merged by:** [@photovoltex](https://github.com/photovoltex) **Base:** `dev` ← **Head:** `episode_metadata_fix` --- ### 📝 Commits (2) - [`d2e4ac0`](https://github.com/librespot-org/librespot/commit/d2e4ac04566920c502649a546d9566ec8263785d) metadata: handle empty trailer_uri for shows - [`3bf830f`](https://github.com/librespot-org/librespot/commit/3bf830fe277b275eab1610c235fc8f904a1d9fb5) chore: update changelog ### 📊 Changes **2 files changed** (+8 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `metadata/src/show.rs` (+7 -2) </details> ### 📄 Description I stumbled across a show, which has an empty `trailer_uri`. In particular, the `trailer_uri` field on the `librespot_protocol::metadata::Show` struct was `Some("")`, which led to the `SpotifyId::from_uri` parsing to fail. This patch accounts for this possibility. Another option would of course be to just use `String` for that field, to avoid any parsing problems. <details><summary>Example:</summary> previously, doing `Show::get(&session, &id).await` yielded for `spotify:show:28sR8OiOq0MMnGEzMJTXSt`: ``` Error { kind: InvalidArgument, error: InvalidFormat } ``` With this, it returns: ``` Show { id: SpotifyId( "spotify:show:28sR8OiOq0MMnGEzMJTXSt", ), name: "1,5 Grad – der Klima-Podcast mit Luisa Neubauer", description: "Die Klimakrise ist hier. Wir haben alle Fakten, die wir brauchen, um gegen sie anzukämpfen. In Deutschland haben wir dafür sogar politische Mehrheiten. Wie kommen wir als Gesellschaft endlich ins Handeln? Im Spotify-Original Podcast “1,5 Grad” gibt Luisa Neubauer Antworten auf diese Frage. Sie gewährt Einblicke hinter die Kulissen ihres Aktivistinnen-Lebens und beleuchtet die Klimadiskussion mit ihren Gästen aus neuen Blickwinkeln. Für sie ist klar: Veränderung findet bereits statt, Quellen für Hoffnung gibt es überall. Jetzt liegt es an uns allen, den Wandel mit anzuschieben. \"1,5 Grad\" - der Klima-Podcast mit Luisa Neubauer, nur auf Spotify.", publisher: "Spotify & Luisa Neubauer", language: "de", is_explicit: false, covers: Images( [ Image { id: FileId( Ok( "ab6765630000f68da378a43d00eddbb41f2f4c70", ), ), size: SMALL, width: 64, height: 64, }, Image { id: FileId( Ok( "ab67656300005f1fa378a43d00eddbb41f2f4c70", ), ), size: DEFAULT, width: 300, height: 300, }, Image { id: FileId( Ok( "ab6765630000ba8aa378a43d00eddbb41f2f4c70", ), ), size: LARGE, width: 640, height: 640, }, ], ), episodes: Episodes( [ SpotifyId( "spotify:episode:2yJRySMdJa0IJyhiQt2KYe", ), SpotifyId( "spotify:episode:5keKoTZNooaeKboKsfuZNk", ), SpotifyId( "spotify:episode:09rvishjEfUJ3MxEZj6tO9", ), SpotifyId( "spotify:episode:2SgffAMDaqFuPmpc9QihBP", ), SpotifyId( "spotify:episode:4COEXOhmcH83gW2mVwxQOl", ), SpotifyId( "spotify:episode:1Uk9wVHzBJ1O8R1ale0zaV", ), SpotifyId( "spotify:episode:1LmstLMvSj9EuvziJc0cov", ), SpotifyId( "spotify:episode:5zzZdUXuMsnctu9Pz5G05u", ), SpotifyId( "spotify:episode:7FMbTNlH5XNzUcXvTnYh16", ), SpotifyId( "spotify:episode:6xHOj0wQFtGUK2SGSXjzKB", ), SpotifyId( "spotify:episode:2A1evUit45oQb65OWT6P8b", ), SpotifyId( "spotify:episode:5nXD7kVMvfwh0M2piTc0WJ", ), SpotifyId( "spotify:episode:0PsAw06YY8FuUspnCZS7nD", ), SpotifyId( "spotify:episode:1y7uYvJ9TPJVKxLnYN6Ror", ), SpotifyId( "spotify:episode:3vCNeuiYXmz2nWZYnbPND7", ), SpotifyId( "spotify:episode:2onaNST6VMOR3Tqyh40X8j", ), SpotifyId( "spotify:episode:1x6ripc5R6YgQFU9ViUzJI", ), SpotifyId( "spotify:episode:3KMAxjwnQ4zx2Z8dQjl70t", ), SpotifyId( "spotify:episode:6asAmilWvDl8PXjr3IIOnX", ), SpotifyId( "spotify:episode:1ymuViiEonDfMAWRjaaN1T", ), SpotifyId( "spotify:episode:39KFKqoDk4TuXlX9rKoWLS", ), SpotifyId( "spotify:episode:1qSu2efACZAxWuXDoeQaXh", ), SpotifyId( "spotify:episode:5vWMPof2Jb2iFNTlyigIcz", ), SpotifyId( "spotify:episode:7fzqrKo2HeIRfQQ9gtXbeX", ), SpotifyId( "spotify:episode:2EAt05dQh3p8GqeRdqWuxZ", ), SpotifyId( "spotify:episode:2OL68dHC8PtnSENJZuhUYT", ), SpotifyId( "spotify:episode:4hOrkGiMX87T2PWQ82KyTz", ), SpotifyId( "spotify:episode:3Ocm2w0et8jTk8zIrtKT2V", ), SpotifyId( "spotify:episode:34G1AB7LhH2CDj53TbgKlq", ), SpotifyId( "spotify:episode:4jtZGkwKDTgGm0omX3RImR", ), SpotifyId( "spotify:episode:1nJTLeXwgHCKH4Md82AlfX", ), SpotifyId( "spotify:episode:6u8PhdmS8mjxH6Ki67y8n4", ), SpotifyId( "spotify:episode:7dRCQTIDrTLLKMeiPNFTOm", ), SpotifyId( "spotify:episode:6544sUNuxTD0vaJ67qgop7", ), SpotifyId( "spotify:episode:220LAEscnWZ8PpY3CxwX8A", ), SpotifyId( "spotify:episode:7kPNMpbzl5m63DDEqChGmq", ), SpotifyId( "spotify:episode:4zO0xIqBlvG9BSO5ZFBNvL", ), SpotifyId( "spotify:episode:6rOdBsMjRc6jz46inwx7Hp", ), SpotifyId( "spotify:episode:274Faf5SUiQRe9wIefAmxJ", ), SpotifyId( "spotify:episode:7baOTUE0lzsxtTAqWCwrh3", ), SpotifyId( "spotify:episode:2f4Q1eGIlOiUs0GAy6uioj", ), ], ), copyrights: Copyrights( [], ), restrictions: Restrictions( [ Restriction { catalogues: RestrictionCatalogues( [], ), restriction_type: STREAMING, catalogue_strs: [ "all", "free", "premium", "shuffle", "commercial", ], countries_allowed: None, countries_forbidden: Some( [], ), }, ], ), keywords: [], media_type: AUDIO, consumption_order: EPISODIC, availability: Availabilities( [], ), trailer_uri: None, has_music_and_talk: false, is_audiobook: false, } ``` </details> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:02:15 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#1389
No description provided.