GNOME Bugzilla – Bug 504423
Strip known playlist suffixes
Last modified: 2018-05-24 13:03:47 UTC
From bug #427975: > * The playlist is shown with the .m3u extension in the rb side pane; Ok. We should strip the extension if there is one.
Created attachment 118786 [details] [review] Strips .m3u and .pls off names if one is not provided This is a first attempt at stripping the extension of .m3u and .pls playlists. Ideally it would iterate over the known playlist extensions, but this works for now. I do not know if there are any better ways to strip off the extension than the g_strsplit I used.
Created attachment 118794 [details] [review] Had to fix that, here's a take two. This strips any recognized playlist extension off the name if a name is not provided for the playlist. One minor artifact I have just noticed: When importing a .pls playlist, it instantly highlights the name, as if it wants me to rename the playlist, and the name is shown in a strange "overlayed" way: http://img137.imageshack.us/my.php?image=rbplaylistoverlayrh1.png
Is there a reason you moved the entire function like that? It makes it hard to see what you've actually changed. "name[strlen (name) - strlen (suffix)] = '\0'" is a much simpler way of removing the suffix.
I had to move the function, or the static variable that has all of the mimetypes, as it is only defined after that function. So I opted to move the function, as all other uses of that static var occured later on, so I grouped them by moving this function down as well. @suffix: Oh, I thought about that, but was afraid I might leak something. If you want me to move either the static define or change the way of handling the suffix, I'll cook up another patch for you.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/rhythmbox/issues/485.