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
Fixed adding stream to playlist #41
Conversation
Hi Anders, thanks for the fix! Actually, there's already a pull request opened to fix this, have a look at #34. It seems you went for the same kind of solution, and I already raised some concerns there, can you have a look? I believe @Mic92 is not working on this at the moment, if you can get something to work, that would be awesome! |
I began to write a playlist parser, but have never actually finish it. Maybe it helps a little. You might want write unittests for the various playlist formats... https://gist.github.com/Mic92/5902534 Good luck! |
Oops! :) The fix proposed in PR #34 does not work as intended because @multani: regarding your concerns: I'm a bit skeptical about the MIME type detection approach. Even with MIME type detection we would not be sure to get it right because the servers might return incorrect types. E.g. one of my URL points to a .pls playlist which is detected as @Mic92: Thanks for gist! When I first thought I had fixed the problem I did not imagine it being so complex! In fact I was pretty delighted by the |
Yes, this can be a bit tricky.
@Mic92: how do you think your approache in your Gist is going to be? (On a side note, the current code is currently broken with playlists longer than 4000 bytes I believe... -_- ) On Mon, Jul 01, 2013 at 11:09:34AM -0700, Anders Boesen Lindbo Larsen wrote:
|
I think the current solution is good enough; it is short and has worked fine for me so far. However, if this is not the case for everyone it should definitely be fixed! I have looked into the MIME type detection problem I mentioned earlier: The problem is caused by the HTTP server that reports a wrong MIME type in the header. If I use |
Hum, fair enough. Let's do something about this fix then. Would you considerate doing something slightly different, as I udnerstood you mentionned above: I think we can probably get rid of Also, I need some information on how to reproduce this issue in the first place. Can you describe me which steps you are doing to face this bug? I tried several things and I'm hitting other bugs in the meanwhile -_- So I can test your fix after. Thanks! |
Ok, I will revise the PR over the weekend! Regarding the bug: I add a new stream in Sonata and enter "http://kcrw.ic.llnwd.net/stream/kcrw_music" as Stream URL. |
Maybe the solution the original authors chosen, wasn't that bad. This mimetype things just seems to breaks to often on the internet. The only thing I have to note, that you shouldn't add all songs, you find in a radio playlist. Radio stations often put multiple formats of the same stream into 1 playlist. Instead you should add the first playable stream to mpd. This behaviour different from what a user expect, if he/she add local playlist. |
Hi Anders, any progress on this? If not and you think it's acceptable, I'll probably just implement what I said in #41 (comment) and propose it as a fix. |
@andersbll @Mic92 I implemented in 60cd4c3 a fix, inspired by what as been done by @andersbll in this pull request, and what we discussed here. I tested it with a few use cases, and it seems to work. (On a side note, I also did after some cleanups of this portion of the code, hopefully it's a bit better now. See branch refactor/stream-parsing) |
1.7b1 (2016-01-31) ------------------ New features '''''''''''' * redirect to the localized Wikipedia according to the user's local, instead of redirecting to the English one. multani/sonata#61 * add "Shuffle by album" multani/sonata#59 * repeat single song (Corentin Néau) multani/sonata#95 Bug fixes ''''''''' * fix crashs on Gtk.TextView when updating the lyrics of a song * Fix streams parsing: multani/sonata#41 multani/sonata#38 * fix withdrawn mode by fixing incorrect usage of threads and Gtk eco-system * choosing a local artwork wasn't working anymore * fix artwork caching * keep the selected tab when hiding/showing Sonata using the tray icon * correctly handle tracks without a definitely reasonable track or disc value (Peter Helbing) multani/sonata#74 * fix translation of of Glade dialogs (Peter Helbing) multani/sonata#75 * fix opening the About dialog (based on Rocus van Oosten report). * fix refreshing profiles upon connections add/delete (Corentin Néau) multani/sonata#92 * fix update of cover and text in fullscreen mode (Corentin Néau) multani/sonata#93 Internal changes '''''''''''''''' * slightly better performance when updating the library * threading improvements: - use GIO instead of a thread to download drag-and-droped covers - remove the MPD from a dedicated thread. It works as good (if not better) as before since the threaded code was poorly written anyway and rendered the additionnal basically useless. This move is not definitive but something better will probably come up some day. * Looking for covers isn't as filesystem expensive as before, but it doesn't check for multiple possible cases in the cover name anymore. 1.7a2 (2013-11-26) ------------------ New features '''''''''''' * Download bigger covers from Last.fm * Centering the current song using Ctrl+i now also selects the current song * Use Transifex as a translation plateform. See https://www.transifex.com/projects/p/sonata/ * Update translations: - Russian (thanks Stas!) - Ukrainian (thanks Stas!) - French (thanks Jon!) Bug fixes ''''''''' * Fix search in library (using a specific filter or the 'everything' filter) * Fix scrobbling to Last.fm * Scrolling with the mouse wheel on the tray icon correctly changes the volume * Some lyrics from LyricsWiki redirects to another page. The plugin now follows those redirect to find the actual lyrics. * Fix multiple issues related to drag-and-drop of songs in the current playlist * Fix error while using Sonata's command line interface * Fix filtering songs in the current playlist * Fix DND of custom artwork images in the main window * Fix breadcrumb icon in the library while browsing an album while in Artist view * Fix saving the visibility flag of tabs: multani/sonata#45 * Fix hiding/showing the main window even if it's not the active widget: multani/sonata#43 * Deleting a track doesn't toggle the filter bar anymore in the current playlist. * Better support for MPD 0.18 Internal changes '''''''''''''''' * Simplified the `current` module. It should also now use less memory than before. * Provide a new GObject signal to notify on artwork change and artwork reset. 1.7a1 (2013-02-08) ------------------ New features '''''''''''' * Fetch covers from Last.fm instead of Rhapsody.com * Custom plugins are now stored along the configuration file in ~/.config/sonata/plugins/ * Switch to Python 3 and Gtk 3 (Jörg Thalheim & Adam Dane) * More items in the tray menu (Kirill Lashuk) * Better fullscreen support (Kirill Lashuk) * Toggle fullscreen from the command line (Daniel) * Support MPD's "consume" mode (Anton Lashkov) * Use more default icons in the context menus (Anton Lashkov) * Load only the most recent of plugins with the same names Bug fixes ''''''''' * Fix population of the "Save to playlist" menu (Zhihao Yuan) * Prevent multiple entries and improve art search with multi-CD albums (Kirill Lashuk) * Fixes weird show up if Sonata is not on the current workspace (Kirill Lashuk) * Scrobble after seeking to the beginning (Kirill Lashuk) * The lyricswiki plugin should now work again (Jonathan Ballet) * Fix UI status after reconnection to MPD (Jonathan Ballet) * Fix crash when searching the library (Kirill Lashuk) Internal changes '''''''''''''''' * Simpler API for cover fetching plugins * Lot of code cleanup and internal changes * Removed Sugar UI support * Use Glade files to describe the interface and GtkBuilder to build the interface * More systematic configuration file management * High-level access to MPD's command results
1.7b1 (2016-01-31) ------------------ New features '''''''''''' * redirect to the localized Wikipedia according to the user's local, instead of redirecting to the English one. multani/sonata#61 * add "Shuffle by album" multani/sonata#59 * repeat single song (Corentin Néau) multani/sonata#95 Bug fixes ''''''''' * fix crashs on Gtk.TextView when updating the lyrics of a song * Fix streams parsing: multani/sonata#41 multani/sonata#38 * fix withdrawn mode by fixing incorrect usage of threads and Gtk eco-system * choosing a local artwork wasn't working anymore * fix artwork caching * keep the selected tab when hiding/showing Sonata using the tray icon * correctly handle tracks without a definitely reasonable track or disc value (Peter Helbing) multani/sonata#74 * fix translation of of Glade dialogs (Peter Helbing) multani/sonata#75 * fix opening the About dialog (based on Rocus van Oosten report). * fix refreshing profiles upon connections add/delete (Corentin Néau) multani/sonata#92 * fix update of cover and text in fullscreen mode (Corentin Néau) multani/sonata#93 Internal changes '''''''''''''''' * slightly better performance when updating the library * threading improvements: - use GIO instead of a thread to download drag-and-droped covers - remove the MPD from a dedicated thread. It works as good (if not better) as before since the threaded code was poorly written anyway and rendered the additionnal basically useless. This move is not definitive but something better will probably come up some day. * Looking for covers isn't as filesystem expensive as before, but it doesn't check for multiple possible cases in the cover name anymore. 1.7a2 (2013-11-26) ------------------ New features '''''''''''' * Download bigger covers from Last.fm * Centering the current song using Ctrl+i now also selects the current song * Use Transifex as a translation plateform. See https://www.transifex.com/projects/p/sonata/ * Update translations: - Russian (thanks Stas!) - Ukrainian (thanks Stas!) - French (thanks Jon!) Bug fixes ''''''''' * Fix search in library (using a specific filter or the 'everything' filter) * Fix scrobbling to Last.fm * Scrolling with the mouse wheel on the tray icon correctly changes the volume * Some lyrics from LyricsWiki redirects to another page. The plugin now follows those redirect to find the actual lyrics. * Fix multiple issues related to drag-and-drop of songs in the current playlist * Fix error while using Sonata's command line interface * Fix filtering songs in the current playlist * Fix DND of custom artwork images in the main window * Fix breadcrumb icon in the library while browsing an album while in Artist view * Fix saving the visibility flag of tabs: multani/sonata#45 * Fix hiding/showing the main window even if it's not the active widget: multani/sonata#43 * Deleting a track doesn't toggle the filter bar anymore in the current playlist. * Better support for MPD 0.18 Internal changes '''''''''''''''' * Simplified the `current` module. It should also now use less memory than before. * Provide a new GObject signal to notify on artwork change and artwork reset. 1.7a1 (2013-02-08) ------------------ New features '''''''''''' * Fetch covers from Last.fm instead of Rhapsody.com * Custom plugins are now stored along the configuration file in ~/.config/sonata/plugins/ * Switch to Python 3 and Gtk 3 (Jörg Thalheim & Adam Dane) * More items in the tray menu (Kirill Lashuk) * Better fullscreen support (Kirill Lashuk) * Toggle fullscreen from the command line (Daniel) * Support MPD's "consume" mode (Anton Lashkov) * Use more default icons in the context menus (Anton Lashkov) * Load only the most recent of plugins with the same names Bug fixes ''''''''' * Fix population of the "Save to playlist" menu (Zhihao Yuan) * Prevent multiple entries and improve art search with multi-CD albums (Kirill Lashuk) * Fixes weird show up if Sonata is not on the current workspace (Kirill Lashuk) * Scrobble after seeking to the beginning (Kirill Lashuk) * The lyricswiki plugin should now work again (Jonathan Ballet) * Fix UI status after reconnection to MPD (Jonathan Ballet) * Fix crash when searching the library (Kirill Lashuk) Internal changes '''''''''''''''' * Simpler API for cover fetching plugins * Lot of code cleanup and internal changes * Removed Sugar UI support * Use Glade files to describe the interface and GtkBuilder to build the interface * More systematic configuration file management * High-level access to MPD's command results
Hi there, great work porting Sonata to Python 3. It seems to be pretty solid by now!
I recently noticed that I was unable to add music streams to the playlist. The problem is caused by urllib returning
bytes
instead of a string. Here is a quick fix that seems to work for links to binary streams as well as playlist files.