Index: ChangeLog
===================================================================
--- ChangeLog	(revision 3920)
+++ ChangeLog	(working copy)
@@ -1,3 +1,24 @@
+2008-05-15  Andres G. Aragoneses <aaragoneses@novell.com>
+
+	[ Fix for bug#528493 ]
+
+	* src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs:
+	rather bind to the Display* properties in order to get the meta information.
+	* src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumListModel.cs:
+	don't include Unknown Albums in the Albums view.
+	* src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs,
+	src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs:
+	The 'Unknown' fallback is no longer needed here (this way we also don't fake the
+	data, because meta info is not real info).
+	* src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs: Use DisplayHelper
+	in order to reuse this behaviour.
+	* src/Core/Banshee.Core/Banshee.Collection/DisplayHelper.cs: New file that
+	has the constant string for null values. This also adds a "[{0}]" prefix and
+	suffix in order for the tracklist not to sort null values in the 'U' position
+	(from 'Unknown'), and because this is meta-information (not real information).
+	* src/Core/Banshee.Core/Makefile.am,
+	src/Core/Banshee.Core/Banshee.Core.mdp: Added DisplayHelper.cs.
+
 2008-05-14  Aaron Bockover  <abock@gnome.org>
 
 	* src/Core/Banshee.Core/Banshee.Base/FileNamePattern.cs: Added %year% 
Index: src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs
===================================================================
--- src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs	(revision 3920)
+++ src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs	(working copy)
@@ -93,19 +93,19 @@
         }
         
         private SortableColumn title_column = new SortableColumn (Catalog.GetString ("Title"), 
-            new ColumnCellText ("TrackTitle", true), 0.25, "Title", true);
+            new ColumnCellText ("DisplayTrackTitle", true), 0.25, "Title", true);
         public SortableColumn TitleColumn {
             get { return title_column; }
         }
         
         private SortableColumn artist_column = new SortableColumn (Catalog.GetString ("Artist"), 
-            new ColumnCellText ("ArtistName", true), 0.225, "Artist", true);
+            new ColumnCellText ("DisplayArtistName", true), 0.225, "Artist", true);
         public SortableColumn ArtistColumn {
             get { return artist_column; }
         }
         
         private SortableColumn album_column = new SortableColumn (Catalog.GetString ("Album"), 
-            new ColumnCellText ("AlbumTitle", true), 0.225, "Album", true);
+            new ColumnCellText ("DisplayAlbumTitle", true), 0.225, "Album", true);
         public SortableColumn AlbumColumn {
             get { return album_column; }
         }
Index: src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs
===================================================================
--- src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs	(revision 3920)
+++ src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs	(working copy)
@@ -77,10 +77,6 @@
                 return last_album;
             }
 
-            if (String.IsNullOrEmpty (album.Title) || album.Title.Trim () == String.Empty) {
-                album.Title = Catalog.GetString ("Unknown Album");
-            }
-
             using (IDataReader reader = ServiceManager.DbConnection.Query (select_command, artist.DbId, album.Title)) {
                 if (reader.Read ()) {
                     last_album = provider.Load (reader);
Index: src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumListModel.cs
===================================================================
--- src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumListModel.cs	(revision 3920)
+++ src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumListModel.cs	(working copy)
@@ -90,6 +90,7 @@
                 either ? "WHERE" : null,
                 track_model == null ? null :
                     String.Format (@"
+                        CoreAlbums.Title NOT LIKE '' AND
                         CoreAlbums.AlbumID IN
                             (SELECT CoreTracks.AlbumID FROM CoreTracks, CoreCache{1}
                                 WHERE CoreCache.ModelID = {0} AND
Index: src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs
===================================================================
--- src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs	(revision 3920)
+++ src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs	(working copy)
@@ -75,10 +75,6 @@
                 return last_artist;
             }
 
-            if (String.IsNullOrEmpty (artist.Name) || artist.Name.Trim () == String.Empty) {
-                artist.Name = Catalog.GetString ("Unknown Artist");
-            }
-
             using (IDataReader reader = ServiceManager.DbConnection.Query (select_command, artist.Name)) {
                 if (reader.Read ()) {
                     last_artist = provider.Load (reader);
Index: src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
===================================================================
--- src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs	(revision 3920)
+++ src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs	(working copy)
@@ -29,7 +29,6 @@
 using System;
 using System.IO;
 using System.Collections.Generic;
-using Mono.Unix;
 
 using Hyena;
 using Hyena.Data;
@@ -171,28 +170,19 @@
         
         public string DisplayArtistName { 
             get {
-                string name = ArtistName == null ? null : ArtistName.Trim ();
-                return String.IsNullOrEmpty (name)
-                    ? Catalog.GetString ("Unknown Artist") 
-                    : name; 
+                return DisplayHelper.Artist (ArtistName);
             } 
         }
 
         public string DisplayAlbumTitle { 
             get { 
-                string title = AlbumTitle == null ? null : AlbumTitle.Trim ();
-                return String.IsNullOrEmpty (title) 
-                    ? Catalog.GetString ("Unknown Album") 
-                    : title; 
+                return DisplayHelper.Album (AlbumTitle);
             } 
         }
 
         public string DisplayTrackTitle { 
             get { 
-                string title = TrackTitle == null ? null : TrackTitle.Trim ();
-                return String.IsNullOrEmpty (title) 
-                    ? Catalog.GetString ("Unknown Title") 
-                    : title; 
+                return DisplayHelper.Title (TrackTitle);
             } 
         }     
         
@@ -308,7 +298,7 @@
             get { return media_attributes; }
             set { media_attributes = value; }
         }
-        
+
         // Generates a{sv} of self according to http://wiki.xmms2.xmms.se/index.php/Media_Player_Interfaces#.22Metadata.22
         public IDictionary<string, object> GenerateExportable ()
         {
Index: src/Core/Banshee.Core/Banshee.Collection/DisplayHelper.cs
===================================================================
--- src/Core/Banshee.Core/Banshee.Collection/DisplayHelper.cs	(revision 0)
+++ src/Core/Banshee.Core/Banshee.Collection/DisplayHelper.cs	(revision 0)
@@ -0,0 +1,82 @@
+//
+// DisplayHelper.cs
+//
+// Author:
+//   Andres G. Aragoneses <aaragoneses@novell.com>
+//
+// Copyright (C) 2006-2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+using Mono.Unix;
+
+namespace Banshee.Collection
+{
+    public static class DisplayHelper
+    {   
+        public static string Artist (string orig_name)
+        {
+            return Name (orig_name, DisplayType.Artist);
+        }
+        
+        public static string Album (string orig_name)
+        {
+            return Name (orig_name, DisplayType.Album);
+        }
+        
+        public static string Title (string orig_name)
+        {
+            return Name (orig_name, DisplayType.Title);
+        }
+        
+        private enum DisplayType {
+            Artist, 
+            Album,
+            Title
+        }
+        
+        private static string Name (string orig_name, DisplayType type)
+        {
+            string name = orig_name == null ? null : orig_name.Trim ();
+            return String.IsNullOrEmpty (name)
+                ? MetaString (name, type) 
+                : name; 
+        }
+        
+        private static string MetaString (string str, DisplayType type)
+        {
+            switch(type){
+            case DisplayType.Album:
+                str = Catalog.GetString ("Unknown Album");
+                break;
+            case DisplayType.Artist:
+                str = Catalog.GetString ("Unknown Artist");
+                break;
+            case DisplayType.Title:
+                str = Catalog.GetString ("Unknown Title");
+                break;
+            }
+            return String.Format ("[ {0} ]", str);
+        }
+    }
+}
Index: src/Core/Banshee.Core/Makefile.am
===================================================================
--- src/Core/Banshee.Core/Makefile.am	(revision 3920)
+++ src/Core/Banshee.Core/Makefile.am	(working copy)
@@ -16,6 +16,7 @@
 	Banshee.Base/XdgBaseDirectorySpec.cs \
 	Banshee.Collection/AlbumInfo.cs \
 	Banshee.Collection/ArtistInfo.cs \
+	Banshee.Collection/DisplayHelper.cs \
 	Banshee.Collection/FileTrackInfo.cs \
 	Banshee.Collection/IBasicTrackInfo.cs \
 	Banshee.Collection/ITrackInfo.cs \
Index: src/Core/Banshee.Core/Banshee.Core.mdp
===================================================================
--- src/Core/Banshee.Core/Banshee.Core.mdp	(revision 3920)
+++ src/Core/Banshee.Core/Banshee.Core.mdp	(working copy)
@@ -67,6 +67,7 @@
     <File name="Banshee.Core.addin.xml" subtype="Code" buildaction="EmbedAsResource" />
     <File name="Banshee.Collection/TrackMediaAttributes.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Base/XdgBaseDirectorySpec.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.Collection/DisplayHelper.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Project" localcopy="False" refto="Hyena" />
