cowbell r35 - in trunk: . base



Author: btaylor
Date: Mon Jun  2 01:33:28 2008
New Revision: 35
URL: http://svn.gnome.org/viewvc/cowbell?rev=35&view=rev

Log:
2008-06-01  Brad Taylor  <brad getcoded net>
	
	* base/MusicBrainzMetadataProxy.cs: Fix small bug that was hanging up
	  an album with no releases in MusicBrainz's database (odd, isn't it?).



Modified:
   trunk/ChangeLog
   trunk/base/MusicBrainzMetadataProxy.cs

Modified: trunk/base/MusicBrainzMetadataProxy.cs
==============================================================================
--- trunk/base/MusicBrainzMetadataProxy.cs	(original)
+++ trunk/base/MusicBrainzMetadataProxy.cs	Mon Jun  2 01:33:28 2008
@@ -140,7 +140,11 @@
 					temp.TrackNumber = Convert.ToUInt32 (pos + 1);
 					temp.Title = tracks[pos].GetTitle (); 
 					temp.Album = release.GetTitle ();
-					temp.Year = GetMusicBrainzYearFromDate (release.GetEvents ()[0].Date);
+					
+					ReadOnlyCollection<Event> events = release.GetEvents ();
+					if (events.Count > 0) {
+						temp.Year = GetMusicBrainzYearFromDate (events[0].Date);
+					}
 
 					dispatch_svc.GuiDispatch (new DatabaseUpdateHandler (UpdateDatabase),
 					                          i, temp);



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