banshee r4329 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Playlists.Formats src/Libraries/Hyena/Hyena.Data.Sqlite



Author: gburt
Date: Tue Aug  5 21:23:46 2008
New Revision: 4329
URL: http://svn.gnome.org/viewvc/banshee?rev=4329&view=rev

Log:
2008-08-05  Gabriel Burt  <gabriel burt gmail com>

	* src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistParser.cs:
	Instead of throwing an exception when the uri scheme isn't one we support,
	simply return false to indicate the parsing failed.  Fixes bug where
	mms:// URIs wouldn't load (BGO #546392).

	* src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs: Call
	typeof (T) once instead of N times.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistParser.cs
   trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistParser.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistParser.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistParser.cs	Tue Aug  5 21:23:46 2008
@@ -91,7 +91,8 @@
                         response.Close();
                     }
                 } else {
-                    throw new InvalidOperationException("Only HTTP and local playlist access is supported");
+                    Hyena.Log.DebugFormat ("Not able to parse playlist at {0}", uri);
+                    return false;
                 }
                                   
                 PlaylistFormatDescription matching_format = null;

Modified: trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs	Tue Aug  5 21:23:46 2008
@@ -117,9 +117,10 @@
         // SELECT single column, multiple rows queries
         public IEnumerable<T> QueryEnumerable<T> (HyenaSqliteCommand command)
         {
+            Type type = typeof (T);
             using (IDataReader reader = Query (command)) {
                 while (reader.Read ()) {
-                    yield return (T)SqliteUtils.FromDbFormat (typeof (T), reader[0]);
+                    yield return (T)SqliteUtils.FromDbFormat (type, reader[0]);
                 }
             }
         }



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