mirror of
https://github.com/aome510/spotify-player.git
synced 2026-04-26 09:25:49 +03:00
[GH-ISSUE #359] Empty UI when playing a podcast episode #190
Labels
No labels
bug
documentation
enhancement
good first issue
help wanted
pull-request
question
third-party
third-party
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-player#190
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Schnouki on GitHub (Feb 6, 2024).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/359
Is your feature request related to a problem? Please describe.
If I listen to a podcast on my phone, then switch to spotify_player on my laptop, then spotify_player doesn't show anything about the active episode. I can play it or pause it alright (never tried more), but there's nothing displayed about it. This is pretty confusing.
Describe the solution you'd like
Basic information about the current episode should be displayed.
Describe alternatives you've considered
None.
Additional context
There's actually no need for full support for podcasts here (although that could be nice). Just, you know, show what's currently playing :)
Screenshot
Quick example: a podcast is playing (as shown in the Spotify Web UI), the current player is
spotify_playeron my laptop (device name "Magni"), but nothing is visible in the "Playback" section of the TUI:@BinaryFly commented on GitHub (Apr 1, 2024):
I tried working on this but I'm afraid I don't have enough knowledge of rust or this project to add this change.
But this is a nice pointer for someone that might want to continue working on this later.
So first off this seemed like a nice first issue because my thought was that I should just change the formatted strings in the playback area to the right info for a podcast. This was relatively easy, although I did expect some polymorphism between
FullEpisodetypes (the type for a podcast episode) and theFullTracktypes, which there wasn't really.I want to document my changes here for future reference (there's probably an easier way to do this using git, but I haven't really pushed anything so I figured I'd just show the diffs here)
First off I created a new struct in model.rs, this was not really necessary but it kept a clear overview for me as to what the changes were between episodes and tracks.
I also implemented a new function to get the right image url for any vector of images in utils.rs:
Then I changed some things for the function render_playback_window and the private functions it called in the same file, here I use most of the previously seen methods implemented via the new struct
PlayableItemWrapper:Now after these changes I figured it would work and the Playback UI section would no longer be empty if I reran cargo.
Unfortunately it didn't work.
I looked in the logs and saw the following (I added the upper warning with every event change for more clarity):
It seems the program doesn't recognize the
PlayerEvent, why this is is easily seen by taking a look at streaming.rs, we only support the typeTrackIdwhenever an event changes, in the case of a podcast the id is of the typeEpisodeIdorShowId(sorry I didn't check). I didn't dare to change this because I don't really know how to do this cleanly while preserving the code structure, therefore I think this is better left to someone who has more experience with the project or rust. If there is an easy fix for this (i.e. casting anEpisodeIdinto aTrackIdsomewhere if that's possible in rust) then by all means suggest it and I'll see if I can still implement it.