[banshee] DatabaseAlbumArtistListModel: Fix type-ahead find with album artists



commit 0a9ac195049e4b6b923cb79264aeb4bef2b8c6b0
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Mon Nov 28 12:31:08 2011 +0100

    DatabaseAlbumArtistListModel: Fix type-ahead find with album artists
    
    DatabaseAlbumArtistInfo uses the CoreArtists table, but
    DatabaseAlbumArtistListModel was using a query field based on the
    CoreAlbums table, which broke the query used for type-ahead find.
    
    Use the ArtistField query field instead, which is based on the
    CoreArtists table, and adapt the reload sql fragment to start from
    CoreArtists. Fixes bgo#664933.

 .../DatabaseAlbumArtistListModel.cs                |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumArtistListModel.cs b/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumArtistListModel.cs
index cce5e61..dee9c81 100644
--- a/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumArtistListModel.cs
+++ b/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumArtistListModel.cs
@@ -42,15 +42,15 @@ namespace Banshee.Collection.Database
             : base (Banshee.Query.BansheeQuery.AlbumArtistField.Name, Banshee.Query.BansheeQuery.AlbumArtistField.Label,
                     source, trackModel, connection, DatabaseAlbumArtistInfo.Provider, new ArtistInfo (null, null), uuid)
         {
-            QueryFields = new QueryFieldSet (Banshee.Query.BansheeQuery.AlbumArtistField);
+            QueryFields = new QueryFieldSet (Banshee.Query.BansheeQuery.ArtistField);
             ReloadFragmentFormat = @"
-                FROM (SELECT DISTINCT ArtistID, ArtistNameSortKey FROM CoreAlbums) CoreArtists WHERE CoreArtists.ArtistID IN
+                FROM CoreArtists WHERE CoreArtists.ArtistID IN
                     (SELECT CoreAlbums.ArtistID FROM CoreAlbums, CoreTracks, CoreCache{0}
                         WHERE CoreCache.ModelID = {1} AND
                               CoreTracks.AlbumID = CoreAlbums.AlbumID AND
                               EXISTS (SELECT 1 FROM CoreArtists WHERE ArtistID = CoreAlbums.ArtistID) AND
                               CoreCache.ItemID = {2} {3})
-                        ORDER BY ArtistNameSortKey";
+                        ORDER BY NameSortKey";
         }
 
         public override string FilterColumn {



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