banshee r3832 - in trunk/banshee: . src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3832 - in trunk/banshee: . src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod
- Date: Sat, 26 Apr 2008 05:50:47 +0100 (BST)
Author: abock
Date: Sat Apr 26 04:50:47 2008
New Revision: 3832
URL: http://svn.gnome.org/viewvc/banshee?rev=3832&view=rev
Log:
2008-04-26 Aaron Bockover <abock gnome org>
* src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs: Do not try
to read the name from the iTunesDB until after we have finished loading
that database
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs
Modified: trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs (original)
+++ trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs Sat Apr 26 04:50:47 2008
@@ -42,6 +42,7 @@
public class IpodSource : DapSource
{
private PodSleuthDevice ipod_device;
+ private bool database_loaded;
private string name_path;
internal string NamePath {
@@ -99,8 +100,10 @@
LoadFromDevice (false);
}
- private bool LoadIpod ()
+ private void LoadIpod ()
{
+ database_supported = false;
+
try {
if (File.Exists (ipod_device.TrackDatabasePath)) {
ipod_device.LoadTrackDatabase ();
@@ -115,13 +118,11 @@
} catch (DatabaseReadException e) {
Log.Exception ("Could not read iPod database", e);
ipod_device.LoadTrackDatabase (true);
- database_supported = false;
} catch (Exception e) {
Log.Exception (e);
- return false;
}
- return true;
+ database_loaded = true;
}
private int CountMusicFiles ()
@@ -257,7 +258,7 @@
}
}
- if (String.IsNullOrEmpty (name)) {
+ if (String.IsNullOrEmpty (name) && database_loaded && database_supported) {
name = ipod_device.Name;
}
@@ -271,7 +272,13 @@
name = ((IDevice)ipod_device).Name ?? "iPod";
}
- return name;
+ try {
+ return name;
+ } finally {
+ if (!database_loaded) {
+ name = null;
+ }
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]