banshee r5206 - in trunk/banshee: . src/Extensions/Banshee.AudioCd/Banshee.AudioCd



Author: gburt
Date: Wed Apr 15 22:03:16 2009
New Revision: 5206
URL: http://svn.gnome.org/viewvc/banshee?rev=5206&view=rev

Log:
2009-04-15  Gabriel Burt  <gabriel burt gmail com>

	* src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs:
	Handle YYYY release date strings from MusicBrainz (BGO #578073)

Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs

Modified: trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs	Wed Apr 15 22:03:16 2009
@@ -145,7 +145,13 @@
             foreach (Event release_event in release.GetEvents ()) {
                 if (release_event.Date != null) {
                     try {
-                        DateTime date = DateTime.Parse (release_event.Date, ApplicationContext.InternalCultureInfo);
+                        // Handle "YYYY" dates
+                        var date_str = release_event.Date;
+                        DateTime date = DateTime.Parse (
+                            date_str.Length > 4 ? date_str : date_str + "-01",
+                            ApplicationContext.InternalCultureInfo
+                        );
+
                         if (date < release_date) {
                             release_date = date;
                         }



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