[banshee: 48/57] UPnPClient: Improve code formatting to match our style conventions



commit 8663a697e1f8a314691e2874b3790b55359976c1
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Sat Jan 14 18:52:36 2012 +0100

    UPnPClient: Improve code formatting to match our style conventions
    
    No real code change, just cosmetics.

 .../Banshee.UPnPClient/UPnPContainerSource.cs      |    2 +-
 .../Banshee.UPnPClient/UPnPMusicSource.cs          |   15 +-
 .../Banshee.UPnPClient/UPnPServerSource.cs         |  212 ++++++++++---------
 .../Banshee.UPnPClient/UPnPService.cs              |   27 ++--
 .../Banshee.UPnPClient/UPnPTrackInfo.cs            |   38 ++--
 .../Banshee.UPnPClient/UPnPVideoSource.cs          |   15 +-
 src/Extensions/Banshee.UPnPClient/Makefile.am      |    8 +-
 7 files changed, 167 insertions(+), 150 deletions(-)
---
diff --git a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPContainerSource.cs b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPContainerSource.cs
index ac7573c..aa2325d 100644
--- a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPContainerSource.cs
+++ b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPContainerSource.cs
@@ -63,7 +63,7 @@ namespace Banshee.UPnPClient
         }
 
         public static readonly SchemaEntry<bool> ExpandedSchema = new SchemaEntry<bool> (
-            "plugins.upnp", "expanded", true, "Shared Music expanded", "Shared Music expanded"
+            "plugins.upnp", "expanded", true, "Shared Media expanded", "Shared Media expanded"
         );
     }
 }
diff --git a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPMusicSource.cs b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPMusicSource.cs
index 974bef4..c712b8a 100644
--- a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPMusicSource.cs
+++ b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPMusicSource.cs
@@ -59,10 +59,11 @@ namespace Banshee.UPnPClient
             Properties.SetStringList ("Icon.Name", "audio-x-generic", "source-library");
             Properties.Set<string> ("SearchEntryDescription", Catalog.GetString ("Search your music"));
 
-            music_tracks = new Dictionary<string, UPnPTrackInfo>();
+            music_tracks = new Dictionary<string, UPnPTrackInfo> ();
 
-            // Remove tracks previously associated with this source, we do this to be sure they are non-existant before we refresh.
-            PurgeTracks();
+            // Remove tracks previously associated with this source
+            // we do this to be sure they are non-existant before we refresh.
+            PurgeTracks ();
             AfterInitialized ();
             OnTracksRemoved ();
         }
@@ -91,19 +92,19 @@ namespace Banshee.UPnPClient
             } catch {}
 
             // Remove tracks associated with this source, we will refetch them on next connect
-            PurgeTracks();
+            PurgeTracks ();
         }
 
-        public override bool CanDeleteTracks
-        {
+        public override bool CanDeleteTracks {
             get { return false; }
         }
 
         public void AddTracks (List<MusicTrack> tracks)
         {
             foreach (var track in tracks) {
-                if (music_tracks.ContainsKey(track.Id))
+                if (music_tracks.ContainsKey(track.Id)) {
                     continue;
+                }
 
                 UPnPTrackInfo track_info = new UPnPTrackInfo (track, this);
                 track_info.Save (false);
diff --git a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPServerSource.cs b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPServerSource.cs
index 8b3dec3..fb804d9 100644
--- a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPServerSource.cs
+++ b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPServerSource.cs
@@ -56,22 +56,25 @@ namespace Banshee.UPnPClient
         {
             Properties.SetStringList ("Icon.Name", "computer", "network-server");
             TypeUniqueId = "upnp-container";
-            expanded_schema = new SchemaEntry<bool> ("plugins.upnp." + device.Udn, "expanded", true, "UPnP Share expanded", "UPnP Share expanded" );
+            expanded_schema = new SchemaEntry<bool> ("plugins.upnp." + device.Udn, "expanded", true,
+                                                     "UPnP Share expanded", "UPnP Share expanded" );
             udn = device.Udn;
 
-            ContentDirectoryController contentDirectory = null;
+            ContentDirectoryController content_directory = null;
 
             foreach (Service service in device.Services) {
-                Hyena.Log.Debug ("UPnPService \"" + device.FriendlyName + "\" Implements " + service.Type);
-                if (service.Type.Type == "ContentDirectory")
-                    contentDirectory = new ContentDirectoryController (service.GetController());
+                Log.Debug ("UPnPService \"" + device.FriendlyName + "\" Implements " + service.Type);
+                if (service.Type.Type == "ContentDirectory") {
+                    content_directory = new ContentDirectoryController (service.GetController());
+                }
             }
 
-            if (contentDirectory == null)
-                throw new ArgumentNullException("contentDirectory");
+            if (content_directory == null) {
+                throw new ArgumentNullException("content_directory");
+            }
 
             ThreadAssist.Spawn (delegate {
-                Parse (device, contentDirectory);
+                Parse (device, content_directory);
             });
             
         }
@@ -90,16 +93,18 @@ namespace Banshee.UPnPClient
         }
 
         delegate void ChunkHandler<T> (Results<T> results);
-        void HandleResults<T> (Results<T> results, RemoteContentDirectory remoteContentDirectory, ChunkHandler<T> chunkHandler)
+
+        void HandleResults<T> (Results<T> results, RemoteContentDirectory remote_dir, ChunkHandler<T> chunkHandler)
         {
-            bool hasresults = results.Count > 0;
+            bool has_results = results.Count > 0;
 
-            while (hasresults) {
-                chunkHandler(results);
+            while (has_results) {
+                chunkHandler (results);
 
-                hasresults = results.HasMoreResults;
-                if (hasresults)
-                    results = results.GetMoreResults(remoteContentDirectory);
+                has_results = results.HasMoreResults;
+                if (has_results) {
+                    results = results.GetMoreResults (remote_dir);
+                }
             }
         }
 
@@ -107,145 +112,152 @@ namespace Banshee.UPnPClient
         {
             List<string[]> core = new List<string[]>();
             if (device.ModelName == "MediaTomb" && device.ModelNumber == "0.12.1") {
-                core.Add(new string[2] { "Audio", "Albums" });
-                core.Add(new string[2] { "Video", "All Video" });
+                core.Add (new string[2] { "Audio", "Albums" });
+                core.Add (new string[2] { "Video", "All Video" });
             } else if (device.ModelName == "Coherence UPnP A/V MediaServer" && device.ModelNumber == "0.6.6.2") {
-                core.Add(new string[1] { "Albums" });
+                core.Add (new string[1] { "Albums" });
             } else {
-              core.Add(new string[0]);
+              core.Add (new string[0]);
             }
 
             return core;
         }
 
-        void Parse (Device device, ContentDirectoryController contentDirectory)
+        void Parse (Device device, ContentDirectoryController content_directory)
         {
-            RemoteContentDirectory remoteContentDirectory = new RemoteContentDirectory (contentDirectory);
+            RemoteContentDirectory remote_dir = new RemoteContentDirectory (content_directory);
             DateTime begin = DateTime.Now;
-            Container root = remoteContentDirectory.GetRootObject();
-            bool recursiveBrowse = !contentDirectory.CanSearch;
+            Container root = remote_dir.GetRootObject ();
+            bool recursive_browse = !content_directory.CanSearch;
 
             try {
-                if (!recursiveBrowse) {
+                if (!recursive_browse) {
                     try {
-                        Hyena.Log.Debug ("Searchable, lets search");
+                        Log.Debug ("Content directory is searchable, let's search");
 
-                        HandleResults<MusicTrack> (remoteContentDirectory.Search<MusicTrack>(root, visitor => visitor.VisitDerivedFrom("upnp:class", "object.item.audioItem.musicTrack"), new ResultsSettings()),
-                                                   remoteContentDirectory,
+                        HandleResults<MusicTrack> (remote_dir.Search<MusicTrack>(root, visitor => visitor.VisitDerivedFrom("upnp:class", "object.item.audioItem.musicTrack"), new ResultsSettings()),
+                                                   remote_dir,
                                                    chunk => {
-                                                                List<MusicTrack> musicTracks = new List<MusicTrack>();
-                                                                foreach (var item in chunk)
-                                                                    musicTracks.Add(item as MusicTrack);
+                                                                List<MusicTrack> music_tracks = new List<MusicTrack>();
+                                                                foreach (var item in chunk) {
+                                                                    music_tracks.Add (item as MusicTrack);
+                                                                }
 
-                                                                AddMusic (musicTracks);
+                                                                AddMusic (music_tracks);
                                                             });
 
-                        HandleResults<VideoItem>  (remoteContentDirectory.Search<VideoItem>(root, visitor => visitor.VisitDerivedFrom("upnp:class", "object.item.videoItem"), new ResultsSettings()),
-                                                   remoteContentDirectory,
+                        HandleResults<VideoItem>  (remote_dir.Search<VideoItem>(root, visitor => visitor.VisitDerivedFrom("upnp:class", "object.item.videoItem"), new ResultsSettings()),
+                                                   remote_dir,
                                                    chunk => {
-                                                                List<VideoItem> videoTracks = new List<VideoItem>();
-                                                                foreach (var item in chunk)
-                                                                    videoTracks.Add(item as VideoItem);
+                                                                List<VideoItem> video_tracks = new List<VideoItem>();
+                                                                foreach (var item in chunk) {
+                                                                    video_tracks.Add (item as VideoItem);
+                                                                }
 
-                                                                AddVideo (videoTracks);
+                                                                AddVideo (video_tracks);
                                                             });
                     } catch (System.InvalidCastException exception) {
-                        Hyena.Log.Exception (exception);
-                        recursiveBrowse = true;
+                        Log.Exception (exception);
+                        recursive_browse = true;
                     }
                 }
 
-                if (recursiveBrowse) {
-                    Hyena.Log.Debug ("Not searchable, lets recursive browse");
-                    List<MusicTrack> musicTracks = new List<MusicTrack>();
-                    List<VideoItem> videoTracks = new List<VideoItem>();
+                if (recursive_browse) {
+                    Log.Debug ("Content directory is not searchable, let's browse recursively");
+                    List<MusicTrack> music_tracks = new List<MusicTrack> ();
+                    List<VideoItem> video_tracks = new List<VideoItem> ();
 
-                    foreach (var hierarchy in FindBrowseQuirks(device)) {
-                        TraverseContainer(remoteContentDirectory, root, hierarchy, 0, musicTracks, videoTracks);
+                    foreach (var hierarchy in FindBrowseQuirks (device)) {
+                        TraverseContainer (remote_dir, root, hierarchy, 0, music_tracks, video_tracks);
                     }
 
-                    if (musicTracks.Count > 0)
-                        music_source.AddTracks (musicTracks);
-                    if (videoTracks.Count > 0)
-                        video_source.AddTracks (videoTracks);
+                    if (music_tracks.Count > 0) {
+                        AddMusic (music_tracks);
+                    }
+                    if (video_tracks.Count > 0) {
+                        AddVideo (video_tracks);
+                    }
                 }
             } catch (Exception exception) {
-                Hyena.Log.Exception (exception);
+                Log.Exception (exception);
             }
 
-            Hyena.Log.Debug ("Found all items on the service, took " + (DateTime.Now - begin).ToString());
+            Log.Debug ("Found all items on the service, took " + (DateTime.Now - begin).ToString());
         }
 
-        void TraverseContainer (RemoteContentDirectory remoteContentDirectory, Container container, string[] hierarchy, int position, List<MusicTrack> musicTracks, List<VideoItem> videoTracks)
+        void TraverseContainer (RemoteContentDirectory remote_dir, Container container, string[] hierarchy, int position, List<MusicTrack> music_tracks, List<VideoItem> video_tracks)
         {
             if (hierarchy != null && hierarchy.Length > position) {
                 HandleResults<Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object> (
-                                           remoteContentDirectory.GetChildren<Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object>(container),
-                                           remoteContentDirectory,
-                                           chunk => {
-                                                        foreach (var upnp_object in chunk) {
-                                                            if (upnp_object is Container && upnp_object.Title == hierarchy[position]) {
-                                                                TraverseContainer (remoteContentDirectory, upnp_object as Container, hierarchy, position + 1, musicTracks, videoTracks);
-                                                            }
-                                                        }
-                                                    });
+                    remote_dir.GetChildren<Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object> (container),
+                    remote_dir,
+                    chunk => {
+                        foreach (var upnp_object in chunk) {
+                            if (upnp_object is Container && upnp_object.Title == hierarchy[position]) {
+                                TraverseContainer (remote_dir, upnp_object as Container, hierarchy, position + 1, music_tracks, video_tracks);
+                            }
+                        }
+                    });
             } else {
-                ParseContainer (remoteContentDirectory, container, 0, musicTracks, videoTracks);
+                ParseContainer (remote_dir, container, 0, music_tracks, video_tracks);
             }
         }
 
-        void ParseContainer (RemoteContentDirectory remoteContentDirectory, Container container, int depth, List<MusicTrack> musicTracks, List<VideoItem> videoTracks)
+        void ParseContainer (RemoteContentDirectory remote_dir, Container container, int depth, List<MusicTrack> music_tracks, List<VideoItem> video_tracks)
         {
-            if (depth > 10 || (container.ChildCount != null && container.ChildCount == 0))
+            if (depth > 10 || (container.ChildCount != null && container.ChildCount == 0)) {
                 return;
+            }
 
             HandleResults<Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object> (
-                                       remoteContentDirectory.GetChildren<Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object>(container),
-                                       remoteContentDirectory,
-                                       chunk => {
-                                                    foreach (var upnp_object in chunk) {
-                                                        if (upnp_object is Item) {
-                                                            Item item = upnp_object as Item;
-
-                                                            if (item.IsReference || item.Resources.Count == 0)
-                                                                continue;
-
-                                                            if (item is MusicTrack) {
-                                                                musicTracks.Add(item as MusicTrack);
-                                                            } else if (item is VideoItem) {
-                                                                videoTracks.Add(item as VideoItem);
-                                                            }
-                                                        }
-                                                        else if (upnp_object is Container) {
-                                                            ParseContainer (remoteContentDirectory, upnp_object as Container, depth + 1, musicTracks, videoTracks);
-                                                        }
-
-                                                        if (musicTracks.Count > 500) {
-                                                            AddMusic (musicTracks);
-                                                            musicTracks.Clear();
-                                                        }
-                                                        if (videoTracks.Count > 100) {
-                                                            AddVideo (videoTracks);
-                                                            videoTracks.Clear();
-                                                        }
-                                                    }
-                                                });
+                remote_dir.GetChildren<Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object> (container),
+                remote_dir,
+                chunk => {
+                    foreach (var upnp_object in chunk) {
+                        if (upnp_object is Item) {
+                            Item item = upnp_object as Item;
+
+                            if (item.IsReference || item.Resources.Count == 0) {
+                                continue;
+                            }
+
+                            if (item is MusicTrack) {
+                                music_tracks.Add (item as MusicTrack);
+                            } else if (item is VideoItem) {
+                                video_tracks.Add (item as VideoItem);
+                            }
+                        } else if (upnp_object is Container) {
+                            ParseContainer (remote_dir, upnp_object as Container, depth + 1, music_tracks, video_tracks);
+                        }
+
+                        if (music_tracks.Count > 500) {
+                            AddMusic (music_tracks);
+                            music_tracks.Clear ();
+                        }
+                        if (video_tracks.Count > 100) {
+                            AddVideo (video_tracks);
+                            video_tracks.Clear ();
+                        }
+                    }
+                });
         }
 
         public void Disconnect ()
         {
-            if (music_source != null)
+            if (music_source != null) {
                 music_source.Disconnect ();
+            }
 
-            if (video_source != null)
+            if (video_source != null) {
                 video_source.Disconnect ();
+            }
         }
 
         private void AddMusic (List<MusicTrack> tracks)
         {
             if (music_source == null) {
-              music_source = new UPnPMusicSource(udn);
-              AddChildSource (music_source);
+                music_source = new UPnPMusicSource (udn);
+                AddChildSource (music_source);
             }
 
             music_source.AddTracks (tracks);
@@ -254,8 +266,8 @@ namespace Banshee.UPnPClient
         private void AddVideo (List<VideoItem> tracks)
         {
             if (video_source == null) {
-              video_source = new UPnPVideoSource(udn);
-              AddChildSource (video_source);
+                video_source = new UPnPVideoSource (udn);
+                AddChildSource (video_source);
             }
 
             video_source.AddTracks (tracks);
diff --git a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPService.cs b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPService.cs
index 8710631..6866811 100644
--- a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPService.cs
+++ b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPService.cs
@@ -32,8 +32,8 @@ using System.Collections.Generic;
 using Mono.Addins;
 
 using Mono.Upnp;
-using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1;
-using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV;
+
+using Hyena;
 
 using Banshee.Base;
 using Banshee.Sources.Gui;
@@ -51,35 +51,36 @@ namespace Banshee.UPnPClient
 
         void IExtensionService.Initialize ()
         {
-            container = new UPnPContainerSource();
-            ServiceManager.SourceManager.AddSource(container);
+            container = new UPnPContainerSource ();
+            ServiceManager.SourceManager.AddSource (container);
 
             client = new Mono.Upnp.Client ();
             client.DeviceAdded += DeviceAdded;
 
-            client.BrowseAll();
+            client.BrowseAll ();
         }
     
         public void Dispose ()
         {
             if (container != null)
             {
-                foreach (UPnPServerSource source in container.Children)
-                    source.Disconnect();
+                foreach (UPnPServerSource source in container.Children) {
+                    source.Disconnect ();
+                }
 
-                ServiceManager.SourceManager.RemoveSource(container);
+                ServiceManager.SourceManager.RemoveSource (container);
                 container = null;
             }
         }
 
         void DeviceAdded (object sender, DeviceEventArgs e)
         {
-            Hyena.Log.Debug ("UPnPService.DeviceFound (" + e.Device.ToString() + ") (" + e.Device.Type + ")");
-            Device device = e.Device.GetDevice();
+            Log.DebugFormat ("UPnPService.DeviceFound {0} ({1})",e.Device.ToString (), e.Device.Type);
+            Device device = e.Device.GetDevice ();
 
             if (device.Type.Type == "MediaServer") {
-                Hyena.Log.Debug ("UPnPService MediaServer Found");
-                UPnPServerSource source = new UPnPServerSource(device);
+                Log.DebugFormat ("UPnPService MediaServer Found: {0} {1}", device.ModelName, device.ModelNumber);
+                UPnPServerSource source = new UPnPServerSource (device);
                 container.AddChildSource (source);
             }
         }
@@ -87,5 +88,5 @@ namespace Banshee.UPnPClient
         string IService.ServiceName {
             get { return "uPnP Client service"; }
         }
-  }
+    }
 }
diff --git a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPTrackInfo.cs b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPTrackInfo.cs
index d91c398..c8ac5c9 100644
--- a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPTrackInfo.cs
+++ b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPTrackInfo.cs
@@ -50,7 +50,7 @@ namespace Banshee.UPnPClient
             ArtistName = track.Artists.Count > 0 ? track.Artists[0].Name : "";
             AlbumTitle = track.Albums.Count > 0 ? track.Albums[0] : "";
             
-            TrackNumber = track.OriginalTrackNumber.GetValueOrDefault();
+            TrackNumber = track.OriginalTrackNumber.GetValueOrDefault ();
 
             Genre = track.Genres.Count > 0 ? track.Genres[0] : "";
         }
@@ -62,30 +62,31 @@ namespace Banshee.UPnPClient
             Genre = track.Genres.Count > 0 ? track.Genres[0] : "";
         }
 
-        public UPnPTrackInfo (Item track, PrimarySource source) : base()
+        public UPnPTrackInfo (Item track, PrimarySource source) : base ()
         {
-            if (track == null)
-              throw new ArgumentNullException("track");
+            if (track == null) {
+              throw new ArgumentNullException ("track");
+            }
 
-            if (source == null)
-              throw new ArgumentNullException("source");
+            if (source == null) {
+              throw new ArgumentNullException ("source");
+            }
 
             TrackTitle = track.Title;
 
-            Resource resource = FindSuitableResource(track.Resources);
+            Resource resource = FindSuitableResource (track.Resources);
 
-            if (resource != null)
-            {
-                BitRate = (int)resource.BitRate.GetValueOrDefault();
-                BitsPerSample = (int)resource.BitsPerSample.GetValueOrDefault();
-                Duration = resource.Duration.GetValueOrDefault();
-                SampleRate = (int)resource.SampleFrequency.GetValueOrDefault();
-                FileSize = (int)resource.Size.GetValueOrDefault();
+            if (resource != null) {
+                BitRate = (int)resource.BitRate.GetValueOrDefault ();
+                BitsPerSample = (int)resource.BitsPerSample.GetValueOrDefault ();
+                Duration = resource.Duration.GetValueOrDefault ();
+                SampleRate = (int)resource.SampleFrequency.GetValueOrDefault ();
+                FileSize = (int)resource.Size.GetValueOrDefault ();
 
-                Uri = new SafeUri(resource.Uri);
-            }
-            else
+                Uri = new SafeUri (resource.Uri);
+            } else {
                 CanPlay = false;
+            }
 
             ExternalId = ++id;
 
@@ -95,8 +96,9 @@ namespace Banshee.UPnPClient
         private Resource FindSuitableResource (IList<Resource> resources)
         {
             foreach (Resource resource in resources) {
-                if (resource.Uri != null && resource.Uri.Scheme == System.Uri.UriSchemeHttp)
+                if (resource.Uri != null && resource.Uri.Scheme == System.Uri.UriSchemeHttp) {
                     return resource;
+                }
             }
 
             return null;
diff --git a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPVideoSource.cs b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPVideoSource.cs
index 9c22f83..bd145f7 100644
--- a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPVideoSource.cs
+++ b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPVideoSource.cs
@@ -76,10 +76,11 @@ namespace Banshee.UPnPClient
                 </column-controller>
             ", Catalog.GetString ("Produced By")));
 
-            video_tracks = new Dictionary<string, UPnPTrackInfo>();
+            video_tracks = new Dictionary<string, UPnPTrackInfo> ();
 
-            // Remove tracks previously associated with this source, we do this to be sure they are non-existant before we refresh.
-            PurgeTracks();
+            // Remove tracks previously associated with this source
+            // we do this to be sure they are non-existant before we refresh.
+            PurgeTracks ();
             AfterInitialized ();
             OnTracksRemoved ();
         }
@@ -108,7 +109,7 @@ namespace Banshee.UPnPClient
             } catch {}
 
             // Remove tracks associated with this source, we will refetch them on next connect
-            PurgeTracks();
+            PurgeTracks ();
         }
 
         public override bool ShowBrowser {
@@ -119,16 +120,16 @@ namespace Banshee.UPnPClient
             get { return false; }
         }
 
-        public override bool CanDeleteTracks
-        {
+        public override bool CanDeleteTracks {
             get { return false; }
         }
 
         public void AddTracks (List<VideoItem> tracks)
         {
             foreach (var track in tracks) {
-                if (video_tracks.ContainsKey(track.Id))
+                if (video_tracks.ContainsKey(track.Id)) {
                     continue;
+                }
 
                 UPnPTrackInfo track_info = new UPnPTrackInfo (track, this);
                 track_info.Save (false);
diff --git a/src/Extensions/Banshee.UPnPClient/Makefile.am b/src/Extensions/Banshee.UPnPClient/Makefile.am
index 2f529cf..6abc5f2 100644
--- a/src/Extensions/Banshee.UPnPClient/Makefile.am
+++ b/src/Extensions/Banshee.UPnPClient/Makefile.am
@@ -5,11 +5,11 @@ INSTALL_DIR = $(EXTENSIONS_INSTALL_DIR)
 
 SOURCES =  \
 	Banshee.UPnPClient/UPnPContainerSource.cs \
-	Banshee.UPnPClient/UPnPService.cs \
-    Banshee.UPnPClient/UPnPServerSource.cs \
 	Banshee.UPnPClient/UPnPMusicSource.cs \
-	Banshee.UPnPClient/UPnPVideoSource.cs \
-	Banshee.UPnPClient/UPnPTrackInfo.cs
+	Banshee.UPnPClient/UPnPServerSource.cs \
+	Banshee.UPnPClient/UPnPService.cs \
+	Banshee.UPnPClient/UPnPTrackInfo.cs \
+	Banshee.UPnPClient/UPnPVideoSource.cs
 
 RESOURCES = Banshee.UPnPClient.addin.xml
 



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