banshee r5082 - in trunk/banshee: . src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Recommendations



Author: gburt
Date: Fri Feb 27 18:33:06 2009
New Revision: 5082
URL: http://svn.gnome.org/viewvc/banshee?rev=5082&view=rev

Log:
2009-02-27  Gabriel Burt  <gabriel burt gmail com>

	* src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Recommendations/RecommendationPane.cs:
	Patch from Alexander Kojevnikov to ignore/not fetch recommendations for
	Unknown etc artists (BGO #560722)

Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Recommendations/RecommendationPane.cs

Modified: trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Recommendations/RecommendationPane.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Recommendations/RecommendationPane.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Recommendations/RecommendationPane.cs	Fri Feb 27 18:33:06 2009
@@ -78,6 +78,17 @@
 
         private static string album_title_format = Catalog.GetString ("Top Albums by {0}");
         private static string track_title_format = Catalog.GetString ("Top Tracks by {0}");
+
+        private static string[] special_artists = new string[] {
+            "Unknown",
+            "Unknown Artists",
+            "Unknown Artist",
+            "Various Artists",
+            "[unknown]",
+            "[no artist]",
+            Catalog.GetString ("Unknown Artist"),
+            Catalog.GetString ("Various Artists")
+        };
         
         private bool ready = false;
         private bool refreshing = false;
@@ -113,14 +124,21 @@
                 }
                 
                 ready = false;
-                if (String.IsNullOrEmpty (value)) {
-                    Hide ();
-                    return;
+                artist = value;
+
+                foreach (string special_artist in special_artists) {
+                    if (String.Compare (artist, special_artist, true) == 0) {
+                        artist = null;
+                        break;
+                    }
                 }
                 
-                artist = value;
-                HideWithTimeout ();
-                RefreshRecommendations ();
+                if (String.IsNullOrEmpty (artist)) {
+                    Hide ();
+                } else {
+                    HideWithTimeout ();
+                    RefreshRecommendations ();
+                }
             }
         }
         



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