Beispiel #1
0
        protected virtual IEnumerable <IFilterListModel> CreateFiltersFor(DatabaseSource src)
        {
            if (!HasArtistAlbum)
            {
                yield break;
            }

            DatabaseAlbumArtistListModel      albumartist_model = new DatabaseAlbumArtistListModel(src, src.DatabaseTrackModel, ServiceManager.DbConnection, src.UniqueId);
            DatabaseArtistListModel           artist_model      = new DatabaseArtistListModel(src, src.DatabaseTrackModel, ServiceManager.DbConnection, src.UniqueId);
            DatabaseAlbumListModel            album_model       = new DatabaseAlbumListModel(src, src.DatabaseTrackModel, ServiceManager.DbConnection, src.UniqueId);
            DatabaseQueryFilterModel <string> genre_model       = new DatabaseQueryFilterModel <string> (src, src.DatabaseTrackModel, ServiceManager.DbConnection,
                                                                                                         Catalog.GetString("All Genres ({0})"), src.UniqueId, BansheeQuery.GenreField, "Genre");
            DatabaseYearListModel year_model = new DatabaseYearListModel(src, src.DatabaseTrackModel, ServiceManager.DbConnection, src.UniqueId);

            if (this == src)
            {
                this.artist_model = artist_model;
                this.album_model  = album_model;
                this.genre_model  = genre_model;
            }

            yield return(genre_model);

            yield return(albumartist_model);

            yield return(artist_model);

            yield return(year_model);

            yield return(album_model);
        }
Beispiel #2
0
        /*
         * TODO:
         *      Filter by Artist instead of by Genre. How do I do this?
         */
        protected override IEnumerable <IFilterListModel> CreateFiltersFor(DatabaseSource src)
        {
            DatabaseArtistListModel artist_model = new DatabaseArtistListModel(src, src.DatabaseTrackModel, ServiceManager.DbConnection, src.UniqueId);

            //DatabaseQueryFilterModel<string> genre_model = new DatabaseQueryFilterModel<string>(src, src.DatabaseTrackModel, ServiceManager.DbConnection,
            //             Catalog.GetString("All Genre({0})"), src.UniqueId, Banshee.Query.BansheeQuery.GenreField , "Genre");

            if (this == src)
            {
                //this.genre_model = genre_model;
                this.artist_model = artist_model;
            }
            yield return(artist_model);
            //yield return genre_model;
        }
        protected virtual IEnumerable<IFilterListModel> CreateFiltersFor (DatabaseSource src)
        {
            if (!HasArtistAlbum) {
                yield break;
            }

            DatabaseArtistListModel artist_model = new DatabaseArtistListModel (src, src.DatabaseTrackModel, ServiceManager.DbConnection, src.UniqueId);
            DatabaseAlbumListModel album_model = new DatabaseAlbumListModel (src, src.DatabaseTrackModel, ServiceManager.DbConnection, src.UniqueId);
            DatabaseQueryFilterModel<string> genre_model = new DatabaseQueryFilterModel<string> (src, src.DatabaseTrackModel, ServiceManager.DbConnection,
                        Catalog.GetString ("All Genres ({0})"), src.UniqueId, BansheeQuery.GenreField, "Genre");

            if (this == src) {
                this.artist_model = artist_model;
                this.album_model = album_model;
                this.genre_model = genre_model;
            }

            yield return artist_model;
            yield return album_model;
            yield return genre_model;
        }
        /*
         * TODO:
         * 		Filter by Artist instead of by Genre. How do I do this?
         */
        protected override IEnumerable<IFilterListModel> CreateFiltersFor(DatabaseSource src)
        {
            DatabaseArtistListModel artist_model = new DatabaseArtistListModel(src, src.DatabaseTrackModel, ServiceManager.DbConnection, src.UniqueId);
            //DatabaseQueryFilterModel<string> genre_model = new DatabaseQueryFilterModel<string>(src, src.DatabaseTrackModel, ServiceManager.DbConnection,
               //             Catalog.GetString("All Genre({0})"), src.UniqueId, Banshee.Query.BansheeQuery.GenreField , "Genre");

            if(this == src) {
                //this.genre_model = genre_model;
                this.artist_model = artist_model;
            }
            yield return artist_model;
            //yield return genre_model;
        }