New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check metadata title for URI hints before discarding #906
Conversation
"AbsCount": "2147483647" | ||
}, | ||
"result": { | ||
"title": "text=\"Spot Block End\" amgTrackId=\"1234567\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not handled ideally, but it mirrors what is displayed in the native Sonos app. Perhaps should also be discarded?
Radio stations usually provide the station name in a separate call ( |
Just to note that to get radio show names, I fall back to using avTransport events with something like: sub = speaker.avTransport.subscribe()
event = sub.events.get(timeout=0.5)
radio_show = event.variables[
"current_track_meta_data"
].radio_show.rpartition(",")[0] |
Yep, that's the exact same data as what |
|
Ah, yes, I didn't read the attributes closely enough. You're absolutely right and I have not seen that payload in polling calls, either. I was thinking about the radio station, which would require an additional call to the speaker. The radio show is simply not available without separately consuming subscription events. Assuming the user would want to use the radio station/channel as the title may not be a safe assumption and should not be done here. |
6f3922a
to
bab1720
Compare
* Only discard title if it contains URI components * Move string URI component test to utils * Fixes #903
A change in #896 caused certain titles (most obviously from CIFS shares) to be incorrectly discarded as they were contained in the track URI. This was naive as even single-word strings would trigger the discard behavior. This PR adds an additional hurdle which requires the track to contain some URI components before it is discarded, such as path and query arguments or an
.m3u8
extension.I've also added tests to validate expected processing of metadata from a variety of sources. This should help ensure we're going all we can to get correct results and also prevent future regressions.
Note: This includes the commit from #904 in order to pass tests. Once that PR is merged this can be rebased to simplify the changes.
Fixes: #903