diff --git a/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs b/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
index 1b5f984..e127ad2 100644
--- a/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
+++ b/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
@@ -814,6 +814,43 @@ namespace Banshee.Collection.Database
             );
         }
 
+        public static int GetBestTrackIdForUri (string absoluteUri, params int [] primary_sources) {
+            int id = GetTrackIdForUri (absoluteUri, primary_sources);
+            if (id <= 0) {
+                /*
+                 * Pre-escape the full absoluteUri, in prep for the LIKE()
+                 */
+                string [] splits = absoluteUri
+                    .Replace ("%", "^%")
+                    .Split ('/');
+
+                string partialUri;
+                int rows;
+
+                /*
+                 * Skip the protocol:// prefix
+                 */
+                for(int i=2; i<splits.Length - 1; ++i) {
+                    partialUri = string.Join ("/", splits, i, splits.Length - i);
+                    rows = ServiceManager.DbConnection.Query<int> (
+                        "SELECT COUNT('x') from CoreTracks WHERE PrimarySourceId IN (?) " +
+                        "AND Uri LIKE ('%' || ?) ESCAPE '^'", 
+                        primary_sources, partialUri 
+                    );
+
+                    if (rows == 1) {
+                        id = ServiceManager.DbConnection.Query<int> (
+                            "SELECT TrackID from CoreTracks WHERE PrimarySourceId IN (?) " +
+                            "AND Uri LIKE ('%' || ?) ESCAPE '^'",
+                            primary_sources, partialUri
+                        );
+                        break;
+                    }
+                }
+            }
+            return id;
+        }
+
         private static IDataReader FindTrackByMetadataHash (string metadata_hash, int [] primary_sources)
         {
             var command = new HyenaSqliteCommand (String.Format (
diff --git a/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MassStorageSource.cs b/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MassStorageSource.cs
index 660e176..c95e266 100644
--- a/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MassStorageSource.cs
+++ b/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MassStorageSource.cs
@@ -168,8 +168,12 @@ namespace Banshee.Dap.MassStorage
                 foreach (string playlist_path in PlaylistFiles) {
                     // playlist_path has a file:// prefix, and GetDirectoryName messes it up,
                     // so we need to convert it to a regular path
-                    string base_folder = System.IO.Path.GetDirectoryName (SafeUri.UriToFilename (playlist_path));
-                    IPlaylistFormat loaded_playlist = PlaylistFileUtil.Load (playlist_path, new Uri (base_folder));
+                    string base_folder = ms_device.RootPath != null ? BaseDirectory :
+                        System.IO.Path.GetDirectoryName (SafeUri.UriToFilename (playlist_path));
+
+                    IPlaylistFormat loaded_playlist = PlaylistFileUtil.Load (playlist_path,
+                                                                             new Uri (base_folder),
+                                                                             null);
                     if (loaded_playlist == null)
                         continue;
 
@@ -179,7 +183,7 @@ namespace Banshee.Dap.MassStorage
                     //Hyena.Data.Sqlite.HyenaSqliteCommand.LogAll = true;
                     foreach (PlaylistElement element in loaded_playlist.Elements) {
                         string track_path = element.Uri.LocalPath;
-                        int track_id = DatabaseTrackInfo.GetTrackIdForUri (new SafeUri (track_path), DbId);
+                        int track_id = DatabaseTrackInfo.GetBestTrackIdForUri (element.Uri.AbsoluteUri, DbId);
                         if (track_id == 0) {
                             Log.DebugFormat ("Failed to find track {0} in DAP library to load it into playlist {1}", track_path, playlist_path);
                         } else {
@@ -366,7 +370,15 @@ namespace Banshee.Dap.MassStorage
                     System.IO.Stream stream = null;
                     try {
                         stream = Banshee.IO.File.OpenWrite (playlist_path, true);
-                        playlist_format.BaseUri = new Uri (PlaylistsWritePath);
+
+
+                        if (ms_device.RootPath == null) {
+                            playlist_format.BaseUri = new Uri (PlaylistsWritePath);
+                        } else {
+                            playlist_format.BaseUri = new Uri (BaseDirectory);
+                            playlist_format.RootPath = ms_device.RootPath;
+                            playlist_format.AbsoluteUriElements = true;
+                        }
 
                         playlist_format.Save (stream, from);
                     } catch (Exception e) {
