-
Notifications
You must be signed in to change notification settings - Fork 41
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
Playlists #85
base: master
Are you sure you want to change the base?
Playlists #85
Conversation
can contain (mp3) files or url streams (radio streams)
OK, I think I finally understand what you want. Basically, you want the playlist files to appear in the Filesystem view of the library, right? It's probably a bit redundant with the Playlist tab, and the justification gmpc does it and Sonata doesn't isn't really one. But why not, I'm not against it. I had a look at your code - can you at least squash your 2 commits into one and remove the comments you put? (we don't need I'm not a huge fan of duplicating all the playlist detection code: MPD already tells us which items are playlists and which are files, but we need to make additional comparisons against the icon (really?) and then again with the end of the string (really?). That's a lot of duplicated effort, not really understandable code (why comparing pixbuf to add or not an item?) and fragile code (what if one day we need to support other playlists than I'm going to make some comments on the code, please have look. Also, could you provide a better icon for the playlist items in the Library view? Something which looks like more a playlist than something which looks like "song currently played". |
for item in items: | ||
self.mpd.add(item) | ||
for item in items: ###### | ||
if item.endswith('.pls') or item.endswith('.PLS') or \ |
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 should be extracted into a dedicated function, since I guess we'll have to support something else than .pls
and .m3u
playlists one day.
Also, this could be simplified if you convert your "item" value into lower/upper case.
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.
On 21.06.2015 20:42, Jonathan Ballet wrote:
In sonata/main.py
#85 (comment):@@ -1234,8 +1234,12 @@ def on_add_item(self, _widget, play_after=False):
if self.current_tab == self.TAB_LIBRARY:
items = self.library.get_path_child_filenames(True)
self.mpd.command_list_ok_begin()
for item in items:
self.mpd.add(item)
for item in items: ######
if item.endswith('.pls') or item.endswith('.PLS') or \
This should be extracted into a dedicated function, since I guess
we'll have to support something else than |.pls| and |.m3u| playlists
one day.
Also, this could be simplified if you convert your "item" value into
lower/upper case.—
Reply to this email directly or view it on GitHub
https://github.com/multani/sonata/pull/85/files#r32896050.I can do that but like you said there must be a better way to discern
between mp3's and pls's.
I can not remember that I somewhere found code that looks at the
extension and says: this is not an mp3 and therefore should not be shown
in the fileview window. Do you?
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.
There's no place which looks at the extension of the file to know if the file is a playlist or not, but MPD "knows" and already tells you if it is (and you already used it before)
But, using this information is probably non-trivial, so simply refactor these few lines of could would be enough, I guess.
On 21.06.2015 20:39, Jonathan Ballet wrote:
You are right that "gmpc does it" is not a good argument. I just don't I also find it a better idea to have playlists at the server (in the mpd At several fora I have seen discussions about playlists and mpd clients. I tried a mpd plugin with codi (xbmc) and there too it ignores
I was planning to make in due time an icon but I ran into ploblems with Jonathan, you must understand that to me there are many new things here: Sonata, not a trivial small program So bear with me if I can not handle it all as you would like it. I am
|
On 06/22/2015 05:25 PM, Rocus wrote:
There's no "server side" or "client side" playlists. Sonata, like all (most?) of the other MPD clients are supporting this So, being able to load playlists from the filesystem, I'm still not sure
I meant, can you make one commit from your two commits. That's probably
The place where MPD tells you if an item is a file or a playlist is this This change is not trivial though. Making the function I asked you in
You can find the icon definition in the sonata/ui/icons.glade file, it
I appreciate your effort in improving Sonata and I certainly realise you |
MPD can load playlists (located on the MPD server). Sonata ignores those playlists. This modification shows playlists in the library view. You can add them to the current queue. If the playlist contains mp3's you can find these mp3's in your current queue: they will be played in due time. If the playlist contains one or more URL's (of radio streams), they will also be added to the current queue (and played later).
Most MPD clients ignore playlists, gmpc does not. Sonata changed by the suggested modifications in library.py and main.py will work as gmpc as far as playlists are concerned.
The playlist as implemented sofar in sonata (see playlist tab) are stored in the client (whithout directory structure). This modification stores them at the MPD server and they can be structured in directories.