--- /home/dolfin/Desktop/CoverArtSpec.cs	2009-04-24 22:41:01.000000000 +0300
+++ /home/dolfin/Desktop/banshee-1-1.5.0/src/Core/Banshee.Core/Banshee.Base/CoverArtSpec.cs	2009-06-17 08:12:30.000000000 +0300
@@ -40,6 +40,8 @@ namespace Banshee.Base
         private static string unknown_artist = "Unknown Artist";
         private static string unknown_album_tr = Catalog.GetString ("Unknown Album");
         private static string unknown_album = "Unknown Album";
+		
+		private static string ilegal_characters = " -.,:/\"'`!@#$%^&*()=+*;<>?[]{}()|~";
 
         public static bool CoverExists (string artist, string album)
         {
@@ -98,9 +100,19 @@ namespace Banshee.Base
                 part = part.Substring (0, lp_index);
             }
             
-            // TODO compile regex
-            return Regex.Replace (part, @"[^A-Za-z0-9]*", "").ToLower ();
+			part = RemoveCharacters(part, Path.GetInvalidFileNameChars());
+			part = RemoveCharacters(part, ilegal_characters.ToCharArray());
+
+			return part.ToLower();
         }
+		
+		private static string RemoveCharacters (string text, char[] chars_to_remove)
+		{
+			foreach (char c in chars_to_remove) {
+				text = text.Replace(c.ToString(), string.Empty);
+			}
+			return text;
+		}
         
         private static string root_path = Path.Combine (XdgBaseDirectorySpec.GetUserDirectory (
             "XDG_CACHE_HOME", ".cache"),  "album-art");
