Index: src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
===================================================================
--- src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs	(revision 3928)
+++ src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs	(working copy)
@@ -566,9 +566,9 @@
             }
             
             popup.Label = String.Format ("{0} - {1}", current_track.DisplayArtistName, 
-                current_track.DisplayAlbumTitle);
+                current_track.AlbumTitleGuessed);
             popup.Image = pixbuf;
-                
+            
             if (in_thumbnail_region) {
                 popup.Show ();
             }
Index: src/Core/Banshee.Services/Banshee.Metadata.MusicBrainz/MusicBrainzQueryJob.cs
===================================================================
--- src/Core/Banshee.Services/Banshee.Metadata.MusicBrainz/MusicBrainzQueryJob.cs	(revision 3928)
+++ src/Core/Banshee.Services/Banshee.Metadata.MusicBrainz/MusicBrainzQueryJob.cs	(working copy)
@@ -72,8 +72,9 @@
                 return false;
             }
             
+            TryGuessAlbumIfEmpty (track);
             string album_artist_id = track.ArtworkId;
-            
+
             if(album_artist_id == null) {
                 return false;
             } else if(CoverArtSpec.CoverExists(album_artist_id)) {
@@ -104,14 +105,17 @@
             return false;
         }
 
+
         // MusicBrainz has this new XML API, so I'm using that here 
         // instead of using the stuff in the MusicBrainz namespace 
         // which sucks and doesn't even appear to work anymore.
-        
+
+        private string base_url = "http://musicbrainz.org/";
+
         private string FindAsin()
         {
-            Uri uri = new Uri(String.Format("http://musicbrainz.org/ws/1/release/?type=xml&artist={0}&title={1}",
-                track.ArtistName, track.AlbumTitle));
+            Uri uri = new Uri(String.Format("{0}ws/1/release/?type=xml&artist={1}&title={2}",
+                base_url, track.ArtistName, track.AlbumTitleGuessed));
 
             XmlTextReader reader = new XmlTextReader(GetHttpStream(uri));
 
@@ -136,5 +140,52 @@
 
             return null;
         }
+
+
+        private string GuessAlbumTitle (string artist, string song_name)
+        {
+            Uri uri = new Uri (String.Format ("{0}ws/1/track/?type=xml&artist={1}&title={2}",
+                base_url, track.ArtistName, track.TrackTitle));
+            
+            bool haveMatch = false, haveRelease = false;
+
+            XmlTextReader reader = new XmlTextReader(GetHttpStream(uri));
+
+            while(reader.Read()) {
+                if(reader.NodeType == XmlNodeType.Element) {
+                    switch (reader.LocalName) {
+                        case "track":
+                            haveMatch = reader["ext:score"] == "100";
+                            break;
+                        case "release":
+                            if(haveMatch)
+                                    haveRelease = true;
+                            break;
+
+                        //FIXME: maybe it's better to pick up the release id directly? example:
+                        //http://musicbrainz.org/ws/1/release/2225dd4c-ae9a-403b-8ea0-9e05014c778f/?type=xml
+                        case "title":
+                            if(haveRelease)
+                                return reader.ReadString();
+                            break;
+                    default:
+                        break;
+                    }
+                }
+            }
+
+            return null;
+        }
+
+        private void TryGuessAlbumIfEmpty (TrackInfo track)
+        {
+            string album_title = track.AlbumTitle;
+            if(String.IsNullOrEmpty (track.AlbumTitle)) {
+                album_title = GuessAlbumTitle (track.ArtistName, track.TrackTitle);
+                if (!String.IsNullOrEmpty (album_title))
+                    track.AlbumTitleGuessed = album_title;
+            }
+        }
+
     }
 }
Index: src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
===================================================================
--- src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs	(revision 3928)
+++ src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs	(working copy)
@@ -53,6 +52,7 @@
         private string copyright;
         private string license_uri;
         private string musicbrainz_id;
+        private string album_title_guessed = null;
 
         private string comment;
         private int track_number;
@@ -164,6 +164,16 @@
             get { return null; }
         }
         
+        public virtual string AlbumTitleGuessed {
+            get { 
+                if (String.IsNullOrEmpty (album_title_guessed))
+                    return album_title;
+                else
+                    return album_title_guessed;
+            }
+            set { album_title_guessed = value; }
+        }
+
         public virtual DateTime ReleaseDate {
             get { return release_date; }
             set { release_date = value; }
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 3928)
+++ ChangeLog	(working copy)
@@ -1,3 +1,48 @@
+2008-05-18  Andres G. Aragoneses <aaragoneses@novell.com>
+
+	[ Fix for bug#533218 ]
+
+	* src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs: Add new property for
+	storing the guessed album when AlbumTitle is empty.
+	* src/Core/Banshee.Services/Banshee.Metadata.MusicBrainz/MusicBrainzQueryJob.cs:
+	add new logic for querying MusicBrainz for the album title when we don't have it.
+	* src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs:
+	show the guessed album name in case we don't have this info.
+
2008-05-18  Andres G. Aragoneses <aaragoneses@novell.com>

	[ Fix for bug#528493 and part of bgo#499650 ]
