[rhythmbox] generic-player: handle playlist paths with %File better
- From: Jonathan Matthew <jmatthew src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rhythmbox] generic-player: handle playlist paths with %File better
- Date: Sat, 30 Jan 2010 10:24:13 +0000 (UTC)
commit e62f190a2c7cbd2d0d57389ea05911ee89d2399d
Author: Jonathan Matthew <jonathan d14n org>
Date: Sat Jan 30 20:17:38 2010 +1000
generic-player: handle playlist paths with %File better
Move the check for %File to rb_generic_player_source_get_playlist_path,
and use that (rather than the playlist path from the device info) when
building the path to search for playlists. Fixes creation of new
playlists when the playlist path includes %File.
plugins/generic-player/rb-generic-player-source.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/plugins/generic-player/rb-generic-player-source.c b/plugins/generic-player/rb-generic-player-source.c
index 3fec9eb..e829a3e 100644
--- a/plugins/generic-player/rb-generic-player-source.c
+++ b/plugins/generic-player/rb-generic-player-source.c
@@ -732,7 +732,7 @@ default_load_playlists (RBGenericPlayerSource *source)
mount_path = rb_generic_player_source_get_mount_path (source);
- g_object_get (priv->device_info, "playlist-path", &playlist_path, NULL);
+ playlist_path = rb_generic_player_source_get_playlist_path (RB_GENERIC_PLAYER_SOURCE (source));
if (playlist_path) {
/* If the device only supports a single playlist, just load that */
@@ -749,9 +749,6 @@ default_load_playlists (RBGenericPlayerSource *source)
}
/* Otherwise, limit the search to the device's playlist folder */
- if (g_str_has_suffix (playlist_path, "/%File")) {
- playlist_path[strlen (playlist_path) - strlen("/%File")] = '\0';
- }
full_playlist_path = rb_uri_append_path (mount_path, playlist_path);
rb_debug ("constructed playlist search path %s", full_playlist_path);
} else {
@@ -1100,6 +1097,9 @@ rb_generic_player_source_get_playlist_path (RBGenericPlayerSource *source)
char *path;
g_object_get (priv->device_info, "playlist-path", &path, NULL);
+ if (g_str_has_suffix (path, "%File")) {
+ path[strlen (path) - strlen("%File")] = '\0';
+ }
return path;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]