[banshee] [AppleDevice] Fix consistency of URIs (BGO#620826)



commit c6a6aea30e56616a96872fc593ac17862ccbba79
Author: Alan McGovern <alan mcgovern gmail com>
Date:   Sat Sep 18 13:53:34 2010 +0100

    [AppleDevice] Fix consistency of URIs (BGO#620826)
    
    After the track has been committed to the AppleDevice, the URI
    on Banshee should be updated so:
    - The user can click on "Open containing folder" and get the correct
    result.
    - The SaveTrackMetadataJob can act on the device if the user needs
    to update the metadata (this will be enabled when patches for
    BGO#589196) land.
    Patch by Andrés G. Aragoneses

 .../Banshee.Dap.AppleDevice/AppleDeviceSource.cs   |    6 +++++-
 .../AppleDeviceTrackInfo.cs                        |    1 +
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceSource.cs b/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceSource.cs
index da3d3ef..7b4a0ad 100644
--- a/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceSource.cs
+++ b/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceSource.cs
@@ -396,7 +396,6 @@ namespace Banshee.Dap.AppleDevice
                 AppleDeviceTrackInfo ipod_track = new AppleDeviceTrackInfo (track);
                 ipod_track.Uri = fromUri;
                 ipod_track.PrimarySource = this;
-                ipod_track.Save (false);
 
                 tracks_to_add.Enqueue (ipod_track);
             }
@@ -509,11 +508,16 @@ namespace Banshee.Dap.AppleDevice
                 try {
                     UpdateProgress (progressUpdater, message, total - tracks_to_add.Count, total);
                     track.CommitToIpod (MediaDatabase);
+                    track.Save (false);
                     tracks_map[track.TrackId] = track;
                 } catch (Exception e) {
                     Log.Exception ("Cannot save track to iPod", e);
                 }
             }
+            if (total > 0) {
+                OnTracksAdded ();
+                OnUserNotifyUpdated ();
+            }
 
             // TODO sync updated metadata to changed tracks
             message = Catalog.GetString ("Removing track {0} of {1}");
diff --git a/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceTrackInfo.cs b/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceTrackInfo.cs
index eeaba72..d4c6836 100644
--- a/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceTrackInfo.cs
+++ b/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceTrackInfo.cs
@@ -260,6 +260,7 @@ namespace Banshee.Dap.AppleDevice
                 database.Tracks.Add (IpodTrack);
                 database.MasterPlaylist.Tracks.Add (IpodTrack);
                 database.CopyTrackToIPod (track, Uri.LocalPath);
+                Uri = new SafeUri (GPod.ITDB.GetLocalPath (database.Device, track));
                 ExternalId = (long) IpodTrack.DBID;
             }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]