Back to index

unity-lens-music  6.0.0
rhythmbox-collection.c
Go to the documentation of this file.
00001 /* rhythmbox-collection.c generated by valac 0.14.2, the Vala compiler
00002  * generated from rhythmbox-collection.vala, do not modify */
00003 
00004 /*
00005  * Copyright (C) 2012 Canonical Ltd
00006  *
00007  * This program is free software: you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License version 3 as
00009  * published by the Free Software Foundation.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018  *
00019  * Authored by David Calle <davidc@framli.eu>
00020  *             Michal Hruby <michal.hruby@canonical.com>
00021  *
00022  */
00023 
00024 #include <glib.h>
00025 #include <glib-object.h>
00026 #include <dee.h>
00027 #include <stdlib.h>
00028 #include <string.h>
00029 #include <tdb.h>
00030 #include <gio/gio.h>
00031 #include <dee-icu.h>
00032 #include <glib/gi18n-lib.h>
00033 #include <glib/gstdio.h>
00034 #include <fcntl.h>
00035 #include <sys/types.h>
00036 #include <unity.h>
00037 #include <gee.h>
00038 
00039 
00040 #define UNITY_MUSIC_LENS_TYPE_COLUMNS (unity_music_lens_columns_get_type ())
00041 
00042 #define UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION (unity_music_lens_rhythmbox_collection_get_type ())
00043 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION, UnityMusicLensRhythmboxCollection))
00044 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION, UnityMusicLensRhythmboxCollectionClass))
00045 #define UNITY_MUSIC_LENS_IS_RHYTHMBOX_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION))
00046 #define UNITY_MUSIC_LENS_IS_RHYTHMBOX_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION))
00047 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION, UnityMusicLensRhythmboxCollectionClass))
00048 
00049 typedef struct _UnityMusicLensRhythmboxCollection UnityMusicLensRhythmboxCollection;
00050 typedef struct _UnityMusicLensRhythmboxCollectionClass UnityMusicLensRhythmboxCollectionClass;
00051 typedef struct _UnityMusicLensRhythmboxCollectionPrivate UnityMusicLensRhythmboxCollectionPrivate;
00052 
00053 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_RESULT_TYPE (unity_music_lens_rhythmbox_collection_result_type_get_type ())
00054 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00055 #define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
00056 #define _tdb_close0(var) ((var == NULL) ? NULL : (var = (tdb_close (var), NULL)))
00057 #define _dee_icu_term_filter_destroy0(var) ((var == NULL) ? NULL : (var = (dee_icu_term_filter_destroy (var), NULL)))
00058 #define _g_free0(var) (var = (g_free (var), NULL))
00059 #define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
00060 #define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
00061 #define _g_byte_array_unref0(var) ((var == NULL) ? NULL : (var = (g_byte_array_unref (var), NULL)))
00062 
00063 #define UNITY_MUSIC_LENS_TYPE_TRACK (unity_music_lens_track_get_type ())
00064 #define UNITY_MUSIC_LENS_TRACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_TRACK, UnityMusicLensTrack))
00065 #define UNITY_MUSIC_LENS_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_TRACK, UnityMusicLensTrackClass))
00066 #define UNITY_MUSIC_LENS_IS_TRACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_TRACK))
00067 #define UNITY_MUSIC_LENS_IS_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_TRACK))
00068 #define UNITY_MUSIC_LENS_TRACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_TRACK, UnityMusicLensTrackClass))
00069 
00070 typedef struct _UnityMusicLensTrack UnityMusicLensTrack;
00071 typedef struct _UnityMusicLensTrackClass UnityMusicLensTrackClass;
00072 #define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
00073 #define _g_slist_free0(var) ((var == NULL) ? NULL : (var = (g_slist_free (var), NULL)))
00074 
00075 #define UNITY_MUSIC_LENS_TYPE_TRACK_TYPE (unity_music_lens_track_type_get_type ())
00076 typedef struct _Block2Data Block2Data;
00077 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
00078 
00079 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER (unity_music_lens_rhythmbox_collection_xml_parser_get_type ())
00080 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER, UnityMusicLensRhythmboxCollectionXmlParser))
00081 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER, UnityMusicLensRhythmboxCollectionXmlParserClass))
00082 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_IS_XML_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER))
00083 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_IS_XML_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER))
00084 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER, UnityMusicLensRhythmboxCollectionXmlParserClass))
00085 
00086 typedef struct _UnityMusicLensRhythmboxCollectionXmlParser UnityMusicLensRhythmboxCollectionXmlParser;
00087 typedef struct _UnityMusicLensRhythmboxCollectionXmlParserClass UnityMusicLensRhythmboxCollectionXmlParserClass;
00088 #define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
00089 #define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
00090 
00091 #define UNITY_MUSIC_LENS_TYPE_FILTER_PARSER (unity_music_lens_filter_parser_get_type ())
00092 #define UNITY_MUSIC_LENS_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParser))
00093 #define UNITY_MUSIC_LENS_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserClass))
00094 #define UNITY_MUSIC_LENS_IS_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER))
00095 #define UNITY_MUSIC_LENS_IS_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER))
00096 #define UNITY_MUSIC_LENS_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserClass))
00097 
00098 typedef struct _UnityMusicLensFilterParser UnityMusicLensFilterParser;
00099 typedef struct _UnityMusicLensFilterParserClass UnityMusicLensFilterParserClass;
00100 
00101 #define UNITY_MUSIC_LENS_TYPE_CATEGORY (unity_music_lens_category_get_type ())
00102 #define _g_sequence_free0(var) ((var == NULL) ? NULL : (var = (g_sequence_free (var), NULL)))
00103 
00104 #define UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER (unity_music_lens_decade_filter_parser_get_type ())
00105 #define UNITY_MUSIC_LENS_DECADE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER, UnityMusicLensDecadeFilterParser))
00106 #define UNITY_MUSIC_LENS_DECADE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER, UnityMusicLensDecadeFilterParserClass))
00107 #define UNITY_MUSIC_LENS_IS_DECADE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER))
00108 #define UNITY_MUSIC_LENS_IS_DECADE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER))
00109 #define UNITY_MUSIC_LENS_DECADE_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER, UnityMusicLensDecadeFilterParserClass))
00110 
00111 typedef struct _UnityMusicLensDecadeFilterParser UnityMusicLensDecadeFilterParser;
00112 typedef struct _UnityMusicLensDecadeFilterParserClass UnityMusicLensDecadeFilterParserClass;
00113 
00114 #define UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER (unity_music_lens_genre_filter_parser_get_type ())
00115 #define UNITY_MUSIC_LENS_GENRE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER, UnityMusicLensGenreFilterParser))
00116 #define UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER, UnityMusicLensGenreFilterParserClass))
00117 #define UNITY_MUSIC_LENS_IS_GENRE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER))
00118 #define UNITY_MUSIC_LENS_IS_GENRE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER))
00119 #define UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER, UnityMusicLensGenreFilterParserClass))
00120 
00121 typedef struct _UnityMusicLensGenreFilterParser UnityMusicLensGenreFilterParser;
00122 typedef struct _UnityMusicLensGenreFilterParserClass UnityMusicLensGenreFilterParserClass;
00123 typedef struct _UnityMusicLensRhythmboxCollectionXmlParserPrivate UnityMusicLensRhythmboxCollectionXmlParserPrivate;
00124 
00125 #define UNITY_MUSIC_LENS_TYPE_GENRE (unity_music_lens_genre_get_type ())
00126 #define UNITY_MUSIC_LENS_GENRE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_GENRE, UnityMusicLensGenre))
00127 #define UNITY_MUSIC_LENS_GENRE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_GENRE, UnityMusicLensGenreClass))
00128 #define UNITY_MUSIC_LENS_IS_GENRE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_GENRE))
00129 #define UNITY_MUSIC_LENS_IS_GENRE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_GENRE))
00130 #define UNITY_MUSIC_LENS_GENRE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_GENRE, UnityMusicLensGenreClass))
00131 
00132 typedef struct _UnityMusicLensGenre UnityMusicLensGenre;
00133 typedef struct _UnityMusicLensGenreClass UnityMusicLensGenreClass;
00134 #define _g_markup_parse_context_free0(var) ((var == NULL) ? NULL : (var = (g_markup_parse_context_free (var), NULL)))
00135 
00136 typedef enum  {
00137        UNITY_MUSIC_LENS_COLUMNS_TYPE,
00138        UNITY_MUSIC_LENS_COLUMNS_URI,
00139        UNITY_MUSIC_LENS_COLUMNS_TITLE,
00140        UNITY_MUSIC_LENS_COLUMNS_ARTIST,
00141        UNITY_MUSIC_LENS_COLUMNS_ALBUM,
00142        UNITY_MUSIC_LENS_COLUMNS_ARTWORK,
00143        UNITY_MUSIC_LENS_COLUMNS_MIMETYPE,
00144        UNITY_MUSIC_LENS_COLUMNS_GENRE,
00145        UNITY_MUSIC_LENS_COLUMNS_ALBUM_ARTIST,
00146        UNITY_MUSIC_LENS_COLUMNS_TRACK_NUMBER,
00147        UNITY_MUSIC_LENS_COLUMNS_YEAR,
00148        UNITY_MUSIC_LENS_COLUMNS_PLAY_COUNT,
00149        UNITY_MUSIC_LENS_COLUMNS_N_COLUMNS
00150 } UnityMusicLensColumns;
00151 
00152 struct _UnityMusicLensRhythmboxCollection {
00153        GObject parent_instance;
00154        UnityMusicLensRhythmboxCollectionPrivate * priv;
00155 };
00156 
00157 struct _UnityMusicLensRhythmboxCollectionClass {
00158        GObjectClass parent_class;
00159 };
00160 
00161 struct _UnityMusicLensRhythmboxCollectionPrivate {
00162        DeeSequenceModel* all_tracks;
00163        DeeModelTag* album_art_tag;
00164        DeeFilterModel* tracks_by_play_count;
00165        GHashTable* album_to_tracks_map;
00166        TDB_CONTEXT* album_art_tdb;
00167        GFileMonitor* tdb_monitor;
00168        gint current_album_art_tag;
00169        GHashTable* variant_store;
00170        GHashTable* int_variant_store;
00171        GVariant* row_buffer[12];
00172        DeeAnalyzer* analyzer;
00173        DeeIndex* index;
00174        DeeICUTermFilter* ascii_filter;
00175        gchar* media_art_dir;
00176 };
00177 
00178 typedef enum  {
00179        UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_ALBUM,
00180        UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_SONG,
00181        UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_RADIO
00182 } UnityMusicLensRhythmboxCollectionResultType;
00183 
00184 typedef enum  {
00185        UNITY_MUSIC_LENS_TRACK_TYPE_SONG,
00186        UNITY_MUSIC_LENS_TRACK_TYPE_RADIO
00187 } UnityMusicLensTrackType;
00188 
00189 struct _Block2Data {
00190        int _ref_count_;
00191        UnityMusicLensRhythmboxCollection * self;
00192        gchar* path;
00193 };
00194 
00195 typedef enum  {
00196        UNITY_MUSIC_LENS_CATEGORY_SONGS,
00197        UNITY_MUSIC_LENS_CATEGORY_ALBUMS,
00198        UNITY_MUSIC_LENS_CATEGORY_PURCHASE,
00199        UNITY_MUSIC_LENS_CATEGORY_MUSIC,
00200        UNITY_MUSIC_LENS_CATEGORY_RADIOS
00201 } UnityMusicLensCategory;
00202 
00203 struct _UnityMusicLensRhythmboxCollectionXmlParser {
00204        GObject parent_instance;
00205        UnityMusicLensRhythmboxCollectionXmlParserPrivate * priv;
00206 };
00207 
00208 struct _UnityMusicLensRhythmboxCollectionXmlParserClass {
00209        GObjectClass parent_class;
00210 };
00211 
00212 struct _UnityMusicLensRhythmboxCollectionXmlParserPrivate {
00213        UnityMusicLensGenre* genre;
00214        GMarkupParseContext* context;
00215        gboolean is_rhythmdb_xml;
00216        gboolean processing_track;
00217        UnityMusicLensTrack* current_track;
00218        gint current_data;
00219 };
00220 
00221 
00222 static gpointer unity_music_lens_rhythmbox_collection_parent_class = NULL;
00223 static gpointer unity_music_lens_rhythmbox_collection_xml_parser_parent_class = NULL;
00224 
00225 GType unity_music_lens_columns_get_type (void) G_GNUC_CONST;
00226 GType unity_music_lens_rhythmbox_collection_get_type (void) G_GNUC_CONST;
00227 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION, UnityMusicLensRhythmboxCollectionPrivate))
00228 enum  {
00229        UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_DUMMY_PROPERTY
00230 };
00231 static GType unity_music_lens_rhythmbox_collection_result_type_get_type (void) G_GNUC_UNUSED;
00232 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_UNKNOWN_ALBUM _ ("Unknown")
00233 static void unity_music_lens_rhythmbox_collection_initialize_index (UnityMusicLensRhythmboxCollection* self);
00234 static gchar* __lambda4_ (UnityMusicLensRhythmboxCollection* self, DeeModel* model, DeeModelIter* iter);
00235 static gchar* ___lambda4__dee_model_reader_func (DeeModel* model, DeeModelIter* iter, gpointer self);
00236 static gchar* unity_music_lens_rhythmbox_collection_check_album_art_tdb (UnityMusicLensRhythmboxCollection* self, const gchar* artist, const gchar* album);
00237 GType unity_music_lens_track_get_type (void) G_GNUC_CONST;
00238 static gchar* unity_music_lens_rhythmbox_collection_get_albumart (UnityMusicLensRhythmboxCollection* self, UnityMusicLensTrack* track);
00239 const gchar* unity_music_lens_track_get_album_artist (UnityMusicLensTrack* self);
00240 const gchar* unity_music_lens_track_get_artist (UnityMusicLensTrack* self);
00241 const gchar* unity_music_lens_track_get_album (UnityMusicLensTrack* self);
00242 const gchar* unity_music_lens_track_get_uri (UnityMusicLensTrack* self);
00243 GSList* unity_music_lens_rhythmbox_collection_get_album_tracks (UnityMusicLensRhythmboxCollection* self, const gchar* album_key);
00244 static GVariant* unity_music_lens_rhythmbox_collection_cached_variant_for_string (UnityMusicLensRhythmboxCollection* self, const gchar* input);
00245 static GVariant* unity_music_lens_rhythmbox_collection_cached_variant_for_int (UnityMusicLensRhythmboxCollection* self, gint input);
00246 static void unity_music_lens_rhythmbox_collection_prepare_row_buffer (UnityMusicLensRhythmboxCollection* self, UnityMusicLensTrack* track);
00247 GType unity_music_lens_track_type_get_type (void) G_GNUC_CONST;
00248 UnityMusicLensTrackType unity_music_lens_track_get_type_track (UnityMusicLensTrack* self);
00249 const gchar* unity_music_lens_track_get_title (UnityMusicLensTrack* self);
00250 const gchar* unity_music_lens_track_get_mime_type (UnityMusicLensTrack* self);
00251 const gchar* unity_music_lens_track_get_artwork_path (UnityMusicLensTrack* self);
00252 const gchar* unity_music_lens_track_get_genre (UnityMusicLensTrack* self);
00253 gint unity_music_lens_track_get_track_number (UnityMusicLensTrack* self);
00254 gint unity_music_lens_track_get_year (UnityMusicLensTrack* self);
00255 gint unity_music_lens_track_get_play_count (UnityMusicLensTrack* self);
00256 void unity_music_lens_rhythmbox_collection_parse_metadata_file (UnityMusicLensRhythmboxCollection* self, const gchar* path);
00257 static Block2Data* block2_data_ref (Block2Data* _data2_);
00258 static void block2_data_unref (Block2Data* _data2_);
00259 static void ____lambda5_ (Block2Data* _data2_);
00260 static void _____lambda5__g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self);
00261 void unity_music_lens_rhythmbox_collection_parse_file (UnityMusicLensRhythmboxCollection* self, const gchar* path);
00262 UnityMusicLensRhythmboxCollectionXmlParser* unity_music_lens_rhythmbox_collection_xml_parser_new (void);
00263 UnityMusicLensRhythmboxCollectionXmlParser* unity_music_lens_rhythmbox_collection_xml_parser_construct (GType object_type);
00264 GType unity_music_lens_rhythmbox_collection_xml_parser_get_type (void) G_GNUC_CONST;
00265 static void __lambda6_ (UnityMusicLensRhythmboxCollection* self, UnityMusicLensTrack* track);
00266 void unity_music_lens_track_set_artwork_path (UnityMusicLensTrack* self, const gchar* value);
00267 static void ___lambda6__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready (UnityMusicLensRhythmboxCollectionXmlParser* _sender, UnityMusicLensTrack* track, gpointer self);
00268 gboolean unity_music_lens_rhythmbox_collection_xml_parser_parse (UnityMusicLensRhythmboxCollectionXmlParser* self, const gchar* content, gsize len, GError** error);
00269 static gint ____lambda7_ (UnityMusicLensRhythmboxCollection* self, DeeModelIter** a, DeeModelIter** b);
00270 static gint _____lambda7__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
00271 static void unity_music_lens_rhythmbox_collection_add_result (UnityMusicLensRhythmboxCollection* self, DeeModel* results_model, DeeModel* model, DeeModelIter* iter, UnityMusicLensRhythmboxCollectionResultType result_type, guint category_id);
00272 GType unity_music_lens_filter_parser_get_type (void) G_GNUC_CONST;
00273 void unity_music_lens_rhythmbox_collection_search (UnityMusicLensRhythmboxCollection* self, UnityLensSearch* search, UnitySearchType search_type, GList* filters, gint max_results, gint category_override);
00274 static void unity_music_lens_rhythmbox_collection_get_decade_filter (UnityMusicLensRhythmboxCollection* self, GList* filters, gint* min_year, gint* max_year);
00275 static GeeSet* unity_music_lens_rhythmbox_collection_get_genre_filter (UnityMusicLensRhythmboxCollection* self, GList* filters);
00276 GType unity_music_lens_category_get_type (void) G_GNUC_CONST;
00277 static gint ____lambda8_ (UnityMusicLensRhythmboxCollection* self, DeeModelIter* a, DeeModelIter* b);
00278 static gint _____lambda8__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
00279 GType unity_music_lens_decade_filter_parser_get_type (void) G_GNUC_CONST;
00280 UnityFilter* unity_music_lens_filter_parser_get_filter (UnityMusicLensFilterParser* self);
00281 GType unity_music_lens_genre_filter_parser_get_type (void) G_GNUC_CONST;
00282 UnityMusicLensRhythmboxCollection* unity_music_lens_rhythmbox_collection_new (void);
00283 UnityMusicLensRhythmboxCollection* unity_music_lens_rhythmbox_collection_construct (GType object_type);
00284 static GObject * unity_music_lens_rhythmbox_collection_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
00285 static void _g_variant_unref0_ (gpointer var);
00286 static void _g_free0_ (gpointer var);
00287 static void _g_ptr_array_unref0_ (gpointer var);
00288 static gint _unity_music_lens_rhythmbox_collection___lambda9_ (UnityMusicLensRhythmboxCollection* self, GVariant** row1, int row1_length1, GVariant** row2, int row2_length1);
00289 static gint __unity_music_lens_rhythmbox_collection___lambda9__dee_compare_row_func (GVariant** row1, GVariant** row2, gpointer self);
00290 static void _unity_music_lens_rhythmbox_collection___lambda10_ (UnityMusicLensRhythmboxCollection* self, DeeTermList* terms_in, DeeTermList* terms_out);
00291 static void __unity_music_lens_rhythmbox_collection___lambda10__dee_term_filter_func (DeeTermList* terms_in, DeeTermList* terms_out, gpointer self);
00292 GType unity_music_lens_genre_get_type (void) G_GNUC_CONST;
00293 #define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER, UnityMusicLensRhythmboxCollectionXmlParserPrivate))
00294 enum  {
00295        UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER_DUMMY_PROPERTY
00296 };
00297 UnityMusicLensGenre* unity_music_lens_genre_new (void);
00298 UnityMusicLensGenre* unity_music_lens_genre_construct (GType object_type);
00299 static void unity_music_lens_rhythmbox_collection_xml_parser_start_tag (UnityMusicLensRhythmboxCollectionXmlParser* self, GMarkupParseContext* context, const gchar* name, gchar** attr_names, gchar** attr_values, GError** error);
00300 static void _unity_music_lens_rhythmbox_collection_xml_parser_start_tag_gmarkup_parser_start_element_func (GMarkupParseContext* context, const gchar* element_name, gchar** attribute_names, gchar** attribute_values, gpointer self, GError** error);
00301 static void unity_music_lens_rhythmbox_collection_xml_parser_end_tag (UnityMusicLensRhythmboxCollectionXmlParser* self, GMarkupParseContext* content, const gchar* name, GError** error);
00302 static void _unity_music_lens_rhythmbox_collection_xml_parser_end_tag_gmarkup_parser_end_element_func (GMarkupParseContext* context, const gchar* element_name, gpointer self, GError** error);
00303 static void unity_music_lens_rhythmbox_collection_xml_parser_process_text (UnityMusicLensRhythmboxCollectionXmlParser* self, GMarkupParseContext* context, const gchar* text, gsize text_len, GError** error);
00304 static void _unity_music_lens_rhythmbox_collection_xml_parser_process_text_gmarkup_parser_text_func (GMarkupParseContext* context, const gchar* text, gsize text_len, gpointer self, GError** error);
00305 UnityMusicLensTrack* unity_music_lens_track_new (void);
00306 UnityMusicLensTrack* unity_music_lens_track_construct (GType object_type);
00307 void unity_music_lens_track_set_type_track (UnityMusicLensTrack* self, UnityMusicLensTrackType value);
00308 void unity_music_lens_track_set_uri (UnityMusicLensTrack* self, const gchar* value);
00309 void unity_music_lens_track_set_title (UnityMusicLensTrack* self, const gchar* value);
00310 void unity_music_lens_track_set_artist (UnityMusicLensTrack* self, const gchar* value);
00311 void unity_music_lens_track_set_album (UnityMusicLensTrack* self, const gchar* value);
00312 void unity_music_lens_track_set_album_artist (UnityMusicLensTrack* self, const gchar* value);
00313 gchar* unity_music_lens_genre_get_id_for_genre (UnityMusicLensGenre* self, const gchar* genre);
00314 void unity_music_lens_track_set_genre (UnityMusicLensTrack* self, const gchar* value);
00315 void unity_music_lens_track_set_mime_type (UnityMusicLensTrack* self, const gchar* value);
00316 void unity_music_lens_track_set_year (UnityMusicLensTrack* self, gint value);
00317 void unity_music_lens_track_set_play_count (UnityMusicLensTrack* self, gint value);
00318 void unity_music_lens_track_set_track_number (UnityMusicLensTrack* self, gint value);
00319 static GObject * unity_music_lens_rhythmbox_collection_xml_parser_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
00320 static void unity_music_lens_rhythmbox_collection_xml_parser_finalize (GObject* obj);
00321 static void unity_music_lens_rhythmbox_collection_finalize (GObject* obj);
00322 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
00323 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
00324 static gint _vala_array_length (gpointer array);
00325 
00326 static const GMarkupParser UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER_parser = {_unity_music_lens_rhythmbox_collection_xml_parser_start_tag_gmarkup_parser_start_element_func, _unity_music_lens_rhythmbox_collection_xml_parser_end_tag_gmarkup_parser_end_element_func, _unity_music_lens_rhythmbox_collection_xml_parser_process_text_gmarkup_parser_text_func, NULL, NULL};
00327 
00328 GType unity_music_lens_columns_get_type (void) {
00329        static volatile gsize unity_music_lens_columns_type_id__volatile = 0;
00330        if (g_once_init_enter (&unity_music_lens_columns_type_id__volatile)) {
00331               static const GEnumValue values[] = {{UNITY_MUSIC_LENS_COLUMNS_TYPE, "UNITY_MUSIC_LENS_COLUMNS_TYPE", "type"}, {UNITY_MUSIC_LENS_COLUMNS_URI, "UNITY_MUSIC_LENS_COLUMNS_URI", "uri"}, {UNITY_MUSIC_LENS_COLUMNS_TITLE, "UNITY_MUSIC_LENS_COLUMNS_TITLE", "title"}, {UNITY_MUSIC_LENS_COLUMNS_ARTIST, "UNITY_MUSIC_LENS_COLUMNS_ARTIST", "artist"}, {UNITY_MUSIC_LENS_COLUMNS_ALBUM, "UNITY_MUSIC_LENS_COLUMNS_ALBUM", "album"}, {UNITY_MUSIC_LENS_COLUMNS_ARTWORK, "UNITY_MUSIC_LENS_COLUMNS_ARTWORK", "artwork"}, {UNITY_MUSIC_LENS_COLUMNS_MIMETYPE, "UNITY_MUSIC_LENS_COLUMNS_MIMETYPE", "mimetype"}, {UNITY_MUSIC_LENS_COLUMNS_GENRE, "UNITY_MUSIC_LENS_COLUMNS_GENRE", "genre"}, {UNITY_MUSIC_LENS_COLUMNS_ALBUM_ARTIST, "UNITY_MUSIC_LENS_COLUMNS_ALBUM_ARTIST", "album-artist"}, {UNITY_MUSIC_LENS_COLUMNS_TRACK_NUMBER, "UNITY_MUSIC_LENS_COLUMNS_TRACK_NUMBER", "track-number"}, {UNITY_MUSIC_LENS_COLUMNS_YEAR, "UNITY_MUSIC_LENS_COLUMNS_YEAR", "year"}, {UNITY_MUSIC_LENS_COLUMNS_PLAY_COUNT, "UNITY_MUSIC_LENS_COLUMNS_PLAY_COUNT", "play-count"}, {UNITY_MUSIC_LENS_COLUMNS_N_COLUMNS, "UNITY_MUSIC_LENS_COLUMNS_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
00332               GType unity_music_lens_columns_type_id;
00333               unity_music_lens_columns_type_id = g_enum_register_static ("UnityMusicLensColumns", values);
00334               g_once_init_leave (&unity_music_lens_columns_type_id__volatile, unity_music_lens_columns_type_id);
00335        }
00336        return unity_music_lens_columns_type_id__volatile;
00337 }
00338 
00339 
00340 static GType unity_music_lens_rhythmbox_collection_result_type_get_type (void) {
00341        static volatile gsize unity_music_lens_rhythmbox_collection_result_type_type_id__volatile = 0;
00342        if (g_once_init_enter (&unity_music_lens_rhythmbox_collection_result_type_type_id__volatile)) {
00343               static const GEnumValue values[] = {{UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_ALBUM, "UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_ALBUM", "album"}, {UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_SONG, "UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_SONG", "song"}, {UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_RADIO, "UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_RADIO", "radio"}, {0, NULL, NULL}};
00344               GType unity_music_lens_rhythmbox_collection_result_type_type_id;
00345               unity_music_lens_rhythmbox_collection_result_type_type_id = g_enum_register_static ("UnityMusicLensRhythmboxCollectionResultType", values);
00346               g_once_init_leave (&unity_music_lens_rhythmbox_collection_result_type_type_id__volatile, unity_music_lens_rhythmbox_collection_result_type_type_id);
00347        }
00348        return unity_music_lens_rhythmbox_collection_result_type_type_id__volatile;
00349 }
00350 
00351 
00352 static gchar* __lambda4_ (UnityMusicLensRhythmboxCollection* self, DeeModel* model, DeeModelIter* iter) {
00353        gchar* result = NULL;
00354        DeeModel* _tmp0_;
00355        DeeModelIter* _tmp1_;
00356        const gchar* _tmp2_ = NULL;
00357        DeeModel* _tmp3_;
00358        DeeModelIter* _tmp4_;
00359        const gchar* _tmp5_ = NULL;
00360        DeeModel* _tmp6_;
00361        DeeModelIter* _tmp7_;
00362        const gchar* _tmp8_ = NULL;
00363        gchar* _tmp9_ = NULL;
00364        gchar* s;
00365        g_return_val_if_fail (model != NULL, NULL);
00366        g_return_val_if_fail (iter != NULL, NULL);
00367        _tmp0_ = model;
00368        _tmp1_ = iter;
00369        _tmp2_ = dee_model_get_string (_tmp0_, _tmp1_, (guint) UNITY_MUSIC_LENS_COLUMNS_TITLE);
00370        _tmp3_ = model;
00371        _tmp4_ = iter;
00372        _tmp5_ = dee_model_get_string (_tmp3_, _tmp4_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTIST);
00373        _tmp6_ = model;
00374        _tmp7_ = iter;
00375        _tmp8_ = dee_model_get_string (_tmp6_, _tmp7_, (guint) UNITY_MUSIC_LENS_COLUMNS_ALBUM);
00376        _tmp9_ = g_strdup_printf ("%s\n%s\n%s", _tmp2_, _tmp5_, _tmp8_);
00377        s = _tmp9_;
00378        result = s;
00379        return result;
00380 }
00381 
00382 
00383 static gchar* ___lambda4__dee_model_reader_func (DeeModel* model, DeeModelIter* iter, gpointer self) {
00384        gchar* result;
00385        result = __lambda4_ (self, model, iter);
00386        return result;
00387 }
00388 
00389 
00390 static void unity_music_lens_rhythmbox_collection_initialize_index (UnityMusicLensRhythmboxCollection* self) {
00391        DeeModelReader _tmp0_ = {0};
00392        DeeModelReader reader;
00393        DeeSequenceModel* _tmp1_;
00394        DeeAnalyzer* _tmp2_;
00395        DeeModelReader _tmp3_;
00396        DeeTreeIndex* _tmp4_;
00397        g_return_if_fail (self != NULL);
00398        dee_model_reader_new (___lambda4__dee_model_reader_func, g_object_ref (self), g_object_unref, &_tmp0_);
00399        reader = _tmp0_;
00400        _tmp1_ = self->priv->all_tracks;
00401        _tmp2_ = self->priv->analyzer;
00402        _tmp3_ = reader;
00403        _tmp4_ = dee_tree_index_new ((DeeModel*) _tmp1_, _tmp2_, &_tmp3_);
00404        _g_object_unref0 (self->priv->index);
00405        self->priv->index = (DeeIndex*) _tmp4_;
00406 }
00407 
00408 
00409 static guint8* string_get_data (const gchar* self, int* result_length1) {
00410        guint8* result;
00411        guint8* res;
00412        gint res_length1;
00413        gint _res_size_;
00414        gint _tmp0_;
00415        gint _tmp1_;
00416        gint _tmp2_;
00417        guint8* _tmp3_;
00418        gint _tmp3__length1;
00419        guint8* _tmp4_;
00420        gint _tmp4__length1;
00421        g_return_val_if_fail (self != NULL, NULL);
00422        res = (guint8*) self;
00423        res_length1 = -1;
00424        _res_size_ = res_length1;
00425        _tmp0_ = strlen (self);
00426        _tmp1_ = _tmp0_;
00427        res_length1 = (gint) _tmp1_;
00428        _tmp2_ = res_length1;
00429        _tmp3_ = res;
00430        _tmp3__length1 = res_length1;
00431        _tmp4_ = _tmp3_;
00432        _tmp4__length1 = _tmp3__length1;
00433        if (result_length1) {
00434               *result_length1 = _tmp4__length1;
00435        }
00436        result = _tmp4_;
00437        return result;
00438 }
00439 
00440 
00441 static gchar* unity_music_lens_rhythmbox_collection_check_album_art_tdb (UnityMusicLensRhythmboxCollection* self, const gchar* artist, const gchar* album) {
00442        gchar* result = NULL;
00443        TDB_CONTEXT* _tmp0_;
00444        guint8 _tmp1_[1] = {0};
00445        guint8 null_helper[1];
00446        GByteArray* _tmp2_;
00447        GByteArray* byte_arr;
00448        GByteArray* _tmp3_;
00449        guint8* _tmp4_;
00450        gint _tmp4__length1;
00451        guint8* _tmp5_;
00452        gint _tmp5__length1;
00453        GByteArray* _tmp6_;
00454        GByteArray* _tmp7_;
00455        const gchar* _tmp8_;
00456        guint8* _tmp9_;
00457        gint _tmp9__length1;
00458        guint8* _tmp10_;
00459        gint _tmp10__length1;
00460        GByteArray* _tmp11_;
00461        GByteArray* _tmp12_;
00462        guint8* _tmp13_;
00463        gint _tmp13__length1;
00464        guint8* _tmp14_;
00465        gint _tmp14__length1;
00466        GByteArray* _tmp15_;
00467        GByteArray* _tmp16_;
00468        const gchar* _tmp17_;
00469        guint8* _tmp18_;
00470        gint _tmp18__length1;
00471        guint8* _tmp19_;
00472        gint _tmp19__length1;
00473        GByteArray* _tmp20_;
00474        TDB_DATA key;
00475        GByteArray* _tmp21_;
00476        guint8* _tmp22_;
00477        gint _tmp22__length1;
00478        TDB_CONTEXT* _tmp23_;
00479        TDB_DATA _tmp24_;
00480        TDB_DATA _tmp25_ = {0};
00481        TDB_DATA val;
00482        TDB_DATA _tmp26_;
00483        guint8* _tmp27_;
00484        gint _tmp27__length1;
00485        g_return_val_if_fail (self != NULL, NULL);
00486        g_return_val_if_fail (artist != NULL, NULL);
00487        g_return_val_if_fail (album != NULL, NULL);
00488        _tmp0_ = self->priv->album_art_tdb;
00489        if (_tmp0_ == NULL) {
00490               result = NULL;
00491               return result;
00492        }
00493        _tmp1_[0] = (guint8) 0;
00494        memcpy (null_helper, _tmp1_, 1 * sizeof (guint8));
00495        _tmp2_ = g_byte_array_new ();
00496        byte_arr = _tmp2_;
00497        _tmp3_ = byte_arr;
00498        _tmp4_ = string_get_data ("album", &_tmp4__length1);
00499        _tmp5_ = _tmp4_;
00500        _tmp5__length1 = _tmp4__length1;
00501        g_byte_array_append (_tmp3_, _tmp5_, _tmp5__length1);
00502        _tmp6_ = byte_arr;
00503        g_byte_array_append (_tmp6_, null_helper, 1);
00504        _tmp7_ = byte_arr;
00505        _tmp8_ = album;
00506        _tmp9_ = string_get_data (_tmp8_, &_tmp9__length1);
00507        _tmp10_ = _tmp9_;
00508        _tmp10__length1 = _tmp9__length1;
00509        g_byte_array_append (_tmp7_, _tmp10_, _tmp10__length1);
00510        _tmp11_ = byte_arr;
00511        g_byte_array_append (_tmp11_, null_helper, 1);
00512        _tmp12_ = byte_arr;
00513        _tmp13_ = string_get_data ("artist", &_tmp13__length1);
00514        _tmp14_ = _tmp13_;
00515        _tmp14__length1 = _tmp13__length1;
00516        g_byte_array_append (_tmp12_, _tmp14_, _tmp14__length1);
00517        _tmp15_ = byte_arr;
00518        g_byte_array_append (_tmp15_, null_helper, 1);
00519        _tmp16_ = byte_arr;
00520        _tmp17_ = artist;
00521        _tmp18_ = string_get_data (_tmp17_, &_tmp18__length1);
00522        _tmp19_ = _tmp18_;
00523        _tmp19__length1 = _tmp18__length1;
00524        g_byte_array_append (_tmp16_, _tmp19_, _tmp19__length1);
00525        _tmp20_ = byte_arr;
00526        g_byte_array_append (_tmp20_, null_helper, 1);
00527        key = tdb_null;
00528        _tmp21_ = byte_arr;
00529        _tmp22_ = _tmp21_->data;
00530        _tmp22__length1 = (gint) _tmp21_->len;
00531        key.dptr = _tmp22_;
00532        key.dsize = _tmp22__length1;
00533        _tmp23_ = self->priv->album_art_tdb;
00534        _tmp24_ = key;
00535        _tmp25_ = tdb_fetch (_tmp23_, _tmp24_);
00536        val = _tmp25_;
00537        _tmp26_ = val;
00538        _tmp27_ = _tmp26_.dptr;
00539        _tmp27__length1 = (gint) _tmp26_.dsize;
00540        if (_tmp27_ != NULL) {
00541               GVariantType* _tmp28_;
00542               GVariantType* _tmp29_;
00543               TDB_DATA _tmp30_;
00544               guint8* _tmp31_;
00545               gint _tmp31__length1;
00546               GVariant* _tmp32_ = NULL;
00547               GVariant* _tmp33_;
00548               GVariant* _tmp34_;
00549               GVariant* v;
00550               GVariant* _tmp35_;
00551               const GVariantType* _tmp36_;
00552               GVariant* _tmp37_ = NULL;
00553               GVariant* file_variant;
00554               GVariant* _tmp38_;
00555               _tmp28_ = g_variant_type_new ("a{sv}");
00556               _tmp29_ = _tmp28_;
00557               _tmp30_ = val;
00558               _tmp31_ = _tmp30_.dptr;
00559               _tmp31__length1 = (gint) _tmp30_.dsize;
00560               _tmp32_ = g_variant_new_from_data (_tmp29_, _tmp31_, _tmp31__length1, FALSE, NULL, NULL);
00561               _tmp33_ = g_variant_ref_sink (_tmp32_);
00562               _tmp34_ = _tmp33_;
00563               _g_variant_type_free0 (_tmp29_);
00564               v = _tmp34_;
00565               _tmp35_ = v;
00566               _tmp36_ = G_VARIANT_TYPE_STRING;
00567               _tmp37_ = g_variant_lookup_value (_tmp35_, "file", _tmp36_);
00568               file_variant = _tmp37_;
00569               _tmp38_ = file_variant;
00570               if (_tmp38_ != NULL) {
00571                      GVariant* _tmp39_;
00572                      const gchar* _tmp40_ = NULL;
00573                      gchar* _tmp41_;
00574                      _tmp39_ = file_variant;
00575                      _tmp40_ = g_variant_get_string (_tmp39_, NULL);
00576                      _tmp41_ = g_strdup (_tmp40_);
00577                      result = _tmp41_;
00578                      _g_variant_unref0 (file_variant);
00579                      _g_variant_unref0 (v);
00580                      _g_byte_array_unref0 (byte_arr);
00581                      return result;
00582               }
00583               _g_variant_unref0 (file_variant);
00584               _g_variant_unref0 (v);
00585        }
00586        result = NULL;
00587        _g_byte_array_unref0 (byte_arr);
00588        return result;
00589 }
00590 
00591 
00592 static gchar* unity_music_lens_rhythmbox_collection_get_albumart (UnityMusicLensRhythmboxCollection* self, UnityMusicLensTrack* track) {
00593        gchar* result = NULL;
00594        gchar* filename = NULL;
00595        UnityMusicLensTrack* _tmp0_;
00596        const gchar* _tmp1_;
00597        const gchar* _tmp2_;
00598        gchar* _tmp3_;
00599        gchar* _tmp4_;
00600        const gchar* _tmp5_;
00601        const gchar* _tmp10_;
00602        gchar* _tmp11_;
00603        gchar* artist;
00604        UnityMusicLensTrack* _tmp12_;
00605        const gchar* _tmp13_;
00606        const gchar* _tmp14_;
00607        gchar* _tmp15_;
00608        gchar* album;
00609        const gchar* _tmp16_;
00610        gchar* _tmp17_ = NULL;
00611        gchar* artist_norm;
00612        const gchar* _tmp18_;
00613        gchar* _tmp19_ = NULL;
00614        gchar* album_norm;
00615        const gchar* _tmp20_;
00616        const gchar* _tmp21_;
00617        gchar* _tmp22_ = NULL;
00618        const gchar* _tmp23_;
00619        const gchar* _tmp29_;
00620        gchar* _tmp30_ = NULL;
00621        gchar* artist_md5;
00622        const gchar* _tmp31_;
00623        gchar* _tmp32_ = NULL;
00624        gchar* album_md5;
00625        const gchar* _tmp33_;
00626        const gchar* _tmp34_;
00627        const gchar* _tmp35_;
00628        gchar* _tmp36_ = NULL;
00629        gchar* _tmp37_;
00630        gchar* _tmp38_ = NULL;
00631        const gchar* _tmp39_;
00632        gboolean _tmp40_ = FALSE;
00633        const gchar* _tmp41_;
00634        const gchar* _tmp42_;
00635        gchar* _tmp43_ = NULL;
00636        gchar* _tmp44_;
00637        gchar* _tmp45_ = NULL;
00638        gchar* _tmp46_;
00639        gchar* combined;
00640        const gchar* _tmp47_;
00641        const gchar* _tmp48_;
00642        gchar* _tmp49_ = NULL;
00643        gchar* _tmp50_;
00644        gchar* _tmp51_ = NULL;
00645        gchar* _tmp52_;
00646        gchar* _tmp53_ = NULL;
00647        const gchar* _tmp54_;
00648        gboolean _tmp55_ = FALSE;
00649        const gchar* _tmp66_ = NULL;
00650        UnityMusicLensTrack* _tmp67_;
00651        const gchar* _tmp68_;
00652        const gchar* _tmp69_;
00653        UnityMusicLensTrack* _tmp70_;
00654        const gchar* _tmp71_;
00655        const gchar* _tmp72_;
00656        gchar* _tmp73_ = NULL;
00657        gchar* _tmp74_;
00658        gchar* _tmp75_ = NULL;
00659        gchar* _tmp76_;
00660        gchar* artwork;
00661        const gchar* _tmp77_;
00662        gboolean _tmp78_ = FALSE;
00663        GError * _inner_error_ = NULL;
00664        g_return_val_if_fail (self != NULL, NULL);
00665        g_return_val_if_fail (track != NULL, NULL);
00666        _tmp0_ = track;
00667        _tmp1_ = unity_music_lens_track_get_album_artist (_tmp0_);
00668        _tmp2_ = _tmp1_;
00669        _tmp3_ = g_strdup (_tmp2_);
00670        _tmp4_ = _tmp3_;
00671        _tmp5_ = _tmp4_;
00672        if (_tmp5_ == NULL) {
00673               UnityMusicLensTrack* _tmp6_;
00674               const gchar* _tmp7_;
00675               const gchar* _tmp8_;
00676               gchar* _tmp9_;
00677               _tmp6_ = track;
00678               _tmp7_ = unity_music_lens_track_get_artist (_tmp6_);
00679               _tmp8_ = _tmp7_;
00680               _tmp9_ = g_strdup (_tmp8_);
00681               _g_free0 (_tmp4_);
00682               _tmp4_ = _tmp9_;
00683        }
00684        _tmp10_ = _tmp4_;
00685        _tmp11_ = g_strdup (_tmp10_);
00686        artist = _tmp11_;
00687        _tmp12_ = track;
00688        _tmp13_ = unity_music_lens_track_get_album (_tmp12_);
00689        _tmp14_ = _tmp13_;
00690        _tmp15_ = g_strdup (_tmp14_);
00691        album = _tmp15_;
00692        _tmp16_ = artist;
00693        _tmp17_ = g_utf8_normalize (_tmp16_, (gssize) (-1), G_NORMALIZE_NFKD);
00694        artist_norm = _tmp17_;
00695        _tmp18_ = album;
00696        _tmp19_ = g_utf8_normalize (_tmp18_, (gssize) (-1), G_NORMALIZE_NFKD);
00697        album_norm = _tmp19_;
00698        _tmp20_ = artist;
00699        _tmp21_ = album;
00700        _tmp22_ = unity_music_lens_rhythmbox_collection_check_album_art_tdb (self, _tmp20_, _tmp21_);
00701        _g_free0 (filename);
00702        filename = _tmp22_;
00703        _tmp23_ = filename;
00704        if (_tmp23_ != NULL) {
00705               const gchar* _tmp24_ = NULL;
00706               const gchar* _tmp25_;
00707               gchar* _tmp26_ = NULL;
00708               const gchar* _tmp27_;
00709               gboolean _tmp28_ = FALSE;
00710               _tmp24_ = g_get_user_cache_dir ();
00711               _tmp25_ = filename;
00712               _tmp26_ = g_build_filename (_tmp24_, "rhythmbox", "album-art", _tmp25_, NULL);
00713               _g_free0 (filename);
00714               filename = _tmp26_;
00715               _tmp27_ = filename;
00716               _tmp28_ = g_file_test (_tmp27_, G_FILE_TEST_EXISTS);
00717               if (_tmp28_) {
00718                      result = filename;
00719                      _g_free0 (album_norm);
00720                      _g_free0 (artist_norm);
00721                      _g_free0 (album);
00722                      _g_free0 (artist);
00723                      _g_free0 (_tmp4_);
00724                      return result;
00725               }
00726        }
00727        _tmp29_ = artist_norm;
00728        _tmp30_ = g_compute_checksum_for_string (G_CHECKSUM_MD5, _tmp29_, (gsize) (-1));
00729        artist_md5 = _tmp30_;
00730        _tmp31_ = album_norm;
00731        _tmp32_ = g_compute_checksum_for_string (G_CHECKSUM_MD5, _tmp31_, (gsize) (-1));
00732        album_md5 = _tmp32_;
00733        _tmp33_ = self->priv->media_art_dir;
00734        _tmp34_ = artist_md5;
00735        _tmp35_ = album_md5;
00736        _tmp36_ = g_strdup_printf ("album-%s-%s", _tmp34_, _tmp35_);
00737        _tmp37_ = _tmp36_;
00738        _tmp38_ = g_build_filename (_tmp33_, _tmp37_, NULL);
00739        _g_free0 (filename);
00740        filename = _tmp38_;
00741        _g_free0 (_tmp37_);
00742        _tmp39_ = filename;
00743        _tmp40_ = g_file_test (_tmp39_, G_FILE_TEST_EXISTS);
00744        if (_tmp40_) {
00745               result = filename;
00746               _g_free0 (album_md5);
00747               _g_free0 (artist_md5);
00748               _g_free0 (album_norm);
00749               _g_free0 (artist_norm);
00750               _g_free0 (album);
00751               _g_free0 (artist);
00752               _g_free0 (_tmp4_);
00753               return result;
00754        }
00755        _tmp41_ = artist;
00756        _tmp42_ = album;
00757        _tmp43_ = g_strdup_printf ("%s\t%s", _tmp41_, _tmp42_);
00758        _tmp44_ = _tmp43_;
00759        _tmp45_ = g_utf8_normalize (_tmp44_, (gssize) (-1), G_NORMALIZE_NFKD);
00760        _tmp46_ = _tmp45_;
00761        _g_free0 (_tmp44_);
00762        combined = _tmp46_;
00763        _tmp47_ = self->priv->media_art_dir;
00764        _tmp48_ = combined;
00765        _tmp49_ = g_compute_checksum_for_string (G_CHECKSUM_MD5, _tmp48_, (gsize) (-1));
00766        _tmp50_ = _tmp49_;
00767        _tmp51_ = g_strdup_printf ("album-%s.jpg", _tmp50_);
00768        _tmp52_ = _tmp51_;
00769        _tmp53_ = g_build_filename (_tmp47_, _tmp52_, NULL);
00770        _g_free0 (filename);
00771        filename = _tmp53_;
00772        _g_free0 (_tmp52_);
00773        _g_free0 (_tmp50_);
00774        _tmp54_ = filename;
00775        _tmp55_ = g_file_test (_tmp54_, G_FILE_TEST_EXISTS);
00776        if (_tmp55_) {
00777               result = filename;
00778               _g_free0 (combined);
00779               _g_free0 (album_md5);
00780               _g_free0 (artist_md5);
00781               _g_free0 (album_norm);
00782               _g_free0 (artist_norm);
00783               _g_free0 (album);
00784               _g_free0 (artist);
00785               _g_free0 (_tmp4_);
00786               return result;
00787        }
00788        {
00789               UnityMusicLensTrack* _tmp56_;
00790               const gchar* _tmp57_;
00791               const gchar* _tmp58_;
00792               GFile* _tmp59_ = NULL;
00793               GFile* artwork_file;
00794               GFile* _tmp60_;
00795               GFileInfo* _tmp61_ = NULL;
00796               GFileInfo* info;
00797               GFileInfo* _tmp62_;
00798               const gchar* _tmp63_ = NULL;
00799               gchar* _tmp64_;
00800               gchar* thumbnail_path;
00801               const gchar* _tmp65_;
00802               _tmp56_ = track;
00803               _tmp57_ = unity_music_lens_track_get_uri (_tmp56_);
00804               _tmp58_ = _tmp57_;
00805               _tmp59_ = g_file_new_for_uri (_tmp58_);
00806               artwork_file = _tmp59_;
00807               _tmp60_ = artwork_file;
00808               _tmp61_ = g_file_query_info (_tmp60_, G_FILE_ATTRIBUTE_THUMBNAIL_PATH, 0, NULL, &_inner_error_);
00809               info = _tmp61_;
00810               if (_inner_error_ != NULL) {
00811                      _g_object_unref0 (artwork_file);
00812                      goto __catch8_g_error;
00813               }
00814               _tmp62_ = info;
00815               _tmp63_ = g_file_info_get_attribute_string (_tmp62_, G_FILE_ATTRIBUTE_THUMBNAIL_PATH);
00816               _tmp64_ = g_strdup (_tmp63_);
00817               thumbnail_path = _tmp64_;
00818               _tmp65_ = thumbnail_path;
00819               if (_tmp65_ != NULL) {
00820                      result = thumbnail_path;
00821                      _g_object_unref0 (info);
00822                      _g_object_unref0 (artwork_file);
00823                      _g_free0 (combined);
00824                      _g_free0 (album_md5);
00825                      _g_free0 (artist_md5);
00826                      _g_free0 (album_norm);
00827                      _g_free0 (artist_norm);
00828                      _g_free0 (album);
00829                      _g_free0 (artist);
00830                      _g_free0 (_tmp4_);
00831                      _g_free0 (filename);
00832                      return result;
00833               }
00834               _g_free0 (thumbnail_path);
00835               _g_object_unref0 (info);
00836               _g_object_unref0 (artwork_file);
00837        }
00838        goto __finally8;
00839        __catch8_g_error:
00840        {
00841               g_clear_error (&_inner_error_);
00842               _inner_error_ = NULL;
00843        }
00844        __finally8:
00845        if (_inner_error_ != NULL) {
00846               _g_free0 (combined);
00847               _g_free0 (album_md5);
00848               _g_free0 (artist_md5);
00849               _g_free0 (album_norm);
00850               _g_free0 (artist_norm);
00851               _g_free0 (album);
00852               _g_free0 (artist);
00853               _g_free0 (_tmp4_);
00854               _g_free0 (filename);
00855               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
00856               g_clear_error (&_inner_error_);
00857               return NULL;
00858        }
00859        _tmp66_ = g_get_user_cache_dir ();
00860        _tmp67_ = track;
00861        _tmp68_ = unity_music_lens_track_get_artist (_tmp67_);
00862        _tmp69_ = _tmp68_;
00863        _tmp70_ = track;
00864        _tmp71_ = unity_music_lens_track_get_album (_tmp70_);
00865        _tmp72_ = _tmp71_;
00866        _tmp73_ = g_strdup_printf ("%s - %s.jpg", _tmp69_, _tmp72_);
00867        _tmp74_ = _tmp73_;
00868        _tmp75_ = g_build_filename (_tmp66_, "rhythmbox", "covers", _tmp74_, NULL);
00869        _tmp76_ = _tmp75_;
00870        _g_free0 (_tmp74_);
00871        artwork = _tmp76_;
00872        _tmp77_ = artwork;
00873        _tmp78_ = g_file_test (_tmp77_, G_FILE_TEST_EXISTS);
00874        if (_tmp78_) {
00875               result = artwork;
00876               _g_free0 (combined);
00877               _g_free0 (album_md5);
00878               _g_free0 (artist_md5);
00879               _g_free0 (album_norm);
00880               _g_free0 (artist_norm);
00881               _g_free0 (album);
00882               _g_free0 (artist);
00883               _g_free0 (_tmp4_);
00884               _g_free0 (filename);
00885               return result;
00886        }
00887        result = NULL;
00888        _g_free0 (artwork);
00889        _g_free0 (combined);
00890        _g_free0 (album_md5);
00891        _g_free0 (artist_md5);
00892        _g_free0 (album_norm);
00893        _g_free0 (artist_norm);
00894        _g_free0 (album);
00895        _g_free0 (artist);
00896        _g_free0 (_tmp4_);
00897        _g_free0 (filename);
00898        return result;
00899 }
00900 
00901 
00902 static gpointer _g_ptr_array_ref0 (gpointer self) {
00903        return self ? g_ptr_array_ref (self) : NULL;
00904 }
00905 
00906 
00907 static gint g_ptr_array_get_length (GPtrArray* self) {
00908        gint result;
00909        guint _tmp0_;
00910        g_return_val_if_fail (self != NULL, 0);
00911        _tmp0_ = self->len;
00912        result = (gint) _tmp0_;
00913        return result;
00914 }
00915 
00916 
00917 static void g_ptr_array_set_length (GPtrArray* self, gint value) {
00918        gint _tmp0_;
00919        g_return_if_fail (self != NULL);
00920        _tmp0_ = value;
00921        g_ptr_array_set_size (self, _tmp0_);
00922 }
00923 
00924 
00925 GSList* unity_music_lens_rhythmbox_collection_get_album_tracks (UnityMusicLensRhythmboxCollection* self, const gchar* album_key) {
00926        GSList* result = NULL;
00927        GSList* results;
00928        GHashTable* _tmp0_;
00929        const gchar* _tmp1_;
00930        gconstpointer _tmp2_ = NULL;
00931        GPtrArray* _tmp3_;
00932        GPtrArray* iter_arr;
00933        GPtrArray* _tmp4_;
00934        g_return_val_if_fail (self != NULL, NULL);
00935        g_return_val_if_fail (album_key != NULL, NULL);
00936        results = NULL;
00937        _tmp0_ = self->priv->album_to_tracks_map;
00938        _tmp1_ = album_key;
00939        _tmp2_ = g_hash_table_lookup (_tmp0_, _tmp1_);
00940        _tmp3_ = _g_ptr_array_ref0 ((GPtrArray*) _tmp2_);
00941        iter_arr = _tmp3_;
00942        _tmp4_ = iter_arr;
00943        if (_tmp4_ != NULL) {
00944               {
00945                      GPtrArray* _tmp5_;
00946                      gint _tmp6_;
00947                      gint _tmp7_;
00948                      gint i;
00949                      _tmp5_ = iter_arr;
00950                      _tmp6_ = g_ptr_array_get_length (_tmp5_);
00951                      _tmp7_ = _tmp6_;
00952                      i = _tmp7_ - 1;
00953                      {
00954                             gboolean _tmp8_;
00955                             _tmp8_ = TRUE;
00956                             while (TRUE) {
00957                                    gboolean _tmp9_;
00958                                    gint _tmp11_;
00959                                    DeeSequenceModel* _tmp12_;
00960                                    GPtrArray* _tmp13_;
00961                                    gint _tmp14_;
00962                                    gconstpointer _tmp15_ = NULL;
00963                                    const gchar* _tmp16_ = NULL;
00964                                    _tmp9_ = _tmp8_;
00965                                    if (!_tmp9_) {
00966                                           gint _tmp10_;
00967                                           _tmp10_ = i;
00968                                           i = _tmp10_ - 1;
00969                                    }
00970                                    _tmp8_ = FALSE;
00971                                    _tmp11_ = i;
00972                                    if (!(_tmp11_ >= 0)) {
00973                                           break;
00974                                    }
00975                                    _tmp12_ = self->priv->all_tracks;
00976                                    _tmp13_ = iter_arr;
00977                                    _tmp14_ = i;
00978                                    _tmp15_ = g_ptr_array_index (_tmp13_, (guint) _tmp14_);
00979                                    _tmp16_ = dee_model_get_string ((DeeModel*) _tmp12_, (DeeModelIter*) _tmp15_, (guint) UNITY_MUSIC_LENS_COLUMNS_URI);
00980                                    results = g_slist_prepend (results, _tmp16_);
00981                             }
00982                      }
00983               }
00984        }
00985        result = results;
00986        _g_ptr_array_unref0 (iter_arr);
00987        return result;
00988 }
00989 
00990 
00991 static gpointer _g_variant_ref0 (gpointer self) {
00992        return self ? g_variant_ref (self) : NULL;
00993 }
00994 
00995 
00996 static GVariant* unity_music_lens_rhythmbox_collection_cached_variant_for_string (UnityMusicLensRhythmboxCollection* self, const gchar* input) {
00997        GVariant* result = NULL;
00998        const gchar* _tmp0_ = NULL;
00999        const gchar* _tmp1_;
01000        const gchar* _tmp3_;
01001        const gchar* text;
01002        GHashTable* _tmp4_;
01003        const gchar* _tmp5_;
01004        gconstpointer _tmp6_ = NULL;
01005        GVariant* _tmp7_;
01006        GVariant* v;
01007        GVariant* _tmp8_;
01008        const gchar* _tmp9_;
01009        GVariant* _tmp10_;
01010        GVariant* _tmp11_;
01011        GHashTable* _tmp12_;
01012        GVariant* _tmp13_;
01013        const gchar* _tmp14_ = NULL;
01014        GVariant* _tmp15_;
01015        GVariant* _tmp16_;
01016        g_return_val_if_fail (self != NULL, NULL);
01017        _tmp1_ = input;
01018        if (_tmp1_ != NULL) {
01019               const gchar* _tmp2_;
01020               _tmp2_ = input;
01021               _tmp0_ = _tmp2_;
01022        } else {
01023               _tmp0_ = "";
01024        }
01025        _tmp3_ = _tmp0_;
01026        text = _tmp3_;
01027        _tmp4_ = self->priv->variant_store;
01028        _tmp5_ = text;
01029        _tmp6_ = g_hash_table_lookup (_tmp4_, _tmp5_);
01030        _tmp7_ = _g_variant_ref0 ((GVariant*) _tmp6_);
01031        v = _tmp7_;
01032        _tmp8_ = v;
01033        if (_tmp8_ != NULL) {
01034               result = v;
01035               return result;
01036        }
01037        _tmp9_ = text;
01038        _tmp10_ = g_variant_new_string (_tmp9_);
01039        _tmp11_ = g_variant_ref_sink (_tmp10_);
01040        _g_variant_unref0 (v);
01041        v = _tmp11_;
01042        _tmp12_ = self->priv->variant_store;
01043        _tmp13_ = v;
01044        _tmp14_ = g_variant_get_string (_tmp13_, NULL);
01045        _tmp15_ = v;
01046        _tmp16_ = _g_variant_ref0 (_tmp15_);
01047        g_hash_table_insert (_tmp12_, _tmp14_, _tmp16_);
01048        result = v;
01049        return result;
01050 }
01051 
01052 
01053 static GVariant* unity_music_lens_rhythmbox_collection_cached_variant_for_int (UnityMusicLensRhythmboxCollection* self, gint input) {
01054        GVariant* result = NULL;
01055        GHashTable* _tmp0_;
01056        gint _tmp1_;
01057        gconstpointer _tmp2_ = NULL;
01058        GVariant* _tmp3_;
01059        GVariant* v;
01060        GVariant* _tmp4_;
01061        gint _tmp5_;
01062        GVariant* _tmp6_;
01063        GVariant* _tmp7_;
01064        gint _tmp8_;
01065        g_return_val_if_fail (self != NULL, NULL);
01066        _tmp0_ = self->priv->int_variant_store;
01067        _tmp1_ = input;
01068        _tmp2_ = g_hash_table_lookup (_tmp0_, GINT_TO_POINTER (_tmp1_));
01069        _tmp3_ = _g_variant_ref0 ((GVariant*) _tmp2_);
01070        v = _tmp3_;
01071        _tmp4_ = v;
01072        if (_tmp4_ != NULL) {
01073               result = v;
01074               return result;
01075        }
01076        _tmp5_ = input;
01077        _tmp6_ = g_variant_new_int32 ((gint32) _tmp5_);
01078        _tmp7_ = g_variant_ref_sink (_tmp6_);
01079        _g_variant_unref0 (v);
01080        v = _tmp7_;
01081        _tmp8_ = input;
01082        if (_tmp8_ < 128) {
01083               GHashTable* _tmp9_;
01084               gint _tmp10_;
01085               GVariant* _tmp11_;
01086               GVariant* _tmp12_;
01087               _tmp9_ = self->priv->int_variant_store;
01088               _tmp10_ = input;
01089               _tmp11_ = v;
01090               _tmp12_ = _g_variant_ref0 (_tmp11_);
01091               g_hash_table_insert (_tmp9_, GINT_TO_POINTER (_tmp10_), _tmp12_);
01092        }
01093        result = v;
01094        return result;
01095 }
01096 
01097 
01098 static void unity_music_lens_rhythmbox_collection_prepare_row_buffer (UnityMusicLensRhythmboxCollection* self, UnityMusicLensTrack* track) {
01099        UnityMusicLensTrack* _tmp0_;
01100        UnityMusicLensTrackType _tmp1_;
01101        UnityMusicLensTrackType _tmp2_;
01102        GVariant* _tmp3_ = NULL;
01103        GVariant* type;
01104        UnityMusicLensTrack* _tmp4_;
01105        const gchar* _tmp5_;
01106        const gchar* _tmp6_;
01107        GVariant* _tmp7_;
01108        GVariant* _tmp8_;
01109        GVariant* uri;
01110        UnityMusicLensTrack* _tmp9_;
01111        const gchar* _tmp10_;
01112        const gchar* _tmp11_;
01113        GVariant* _tmp12_;
01114        GVariant* _tmp13_;
01115        GVariant* title;
01116        UnityMusicLensTrack* _tmp14_;
01117        const gchar* _tmp15_;
01118        const gchar* _tmp16_;
01119        GVariant* _tmp17_ = NULL;
01120        GVariant* artist;
01121        UnityMusicLensTrack* _tmp18_;
01122        const gchar* _tmp19_;
01123        const gchar* _tmp20_;
01124        GVariant* _tmp21_ = NULL;
01125        GVariant* album_artist;
01126        UnityMusicLensTrack* _tmp22_;
01127        const gchar* _tmp23_;
01128        const gchar* _tmp24_;
01129        GVariant* _tmp25_ = NULL;
01130        GVariant* album;
01131        UnityMusicLensTrack* _tmp26_;
01132        const gchar* _tmp27_;
01133        const gchar* _tmp28_;
01134        GVariant* _tmp29_ = NULL;
01135        GVariant* mime_type;
01136        UnityMusicLensTrack* _tmp30_;
01137        const gchar* _tmp31_;
01138        const gchar* _tmp32_;
01139        GVariant* _tmp33_ = NULL;
01140        GVariant* artwork;
01141        UnityMusicLensTrack* _tmp34_;
01142        const gchar* _tmp35_;
01143        const gchar* _tmp36_;
01144        GVariant* _tmp37_ = NULL;
01145        GVariant* genre;
01146        UnityMusicLensTrack* _tmp38_;
01147        gint _tmp39_;
01148        gint _tmp40_;
01149        GVariant* _tmp41_ = NULL;
01150        GVariant* track_number;
01151        UnityMusicLensTrack* _tmp42_;
01152        gint _tmp43_;
01153        gint _tmp44_;
01154        GVariant* _tmp45_ = NULL;
01155        GVariant* year;
01156        UnityMusicLensTrack* _tmp46_;
01157        gint _tmp47_;
01158        gint _tmp48_;
01159        GVariant* _tmp49_ = NULL;
01160        GVariant* play_count;
01161        GVariant* _tmp50_;
01162        GVariant* _tmp51_;
01163        GVariant* _tmp52_;
01164        GVariant* _tmp53_;
01165        GVariant* _tmp54_;
01166        GVariant* _tmp55_;
01167        GVariant* _tmp56_;
01168        GVariant* _tmp57_;
01169        GVariant* _tmp58_;
01170        GVariant* _tmp59_;
01171        GVariant* _tmp60_;
01172        GVariant* _tmp61_;
01173        GVariant* _tmp62_;
01174        GVariant* _tmp63_;
01175        GVariant* _tmp64_;
01176        GVariant* _tmp65_;
01177        GVariant* _tmp66_;
01178        GVariant* _tmp67_;
01179        GVariant* _tmp68_;
01180        GVariant* _tmp69_;
01181        GVariant* _tmp70_;
01182        GVariant* _tmp71_;
01183        GVariant* _tmp72_;
01184        GVariant* _tmp73_;
01185        g_return_if_fail (self != NULL);
01186        g_return_if_fail (track != NULL);
01187        _tmp0_ = track;
01188        _tmp1_ = unity_music_lens_track_get_type_track (_tmp0_);
01189        _tmp2_ = _tmp1_;
01190        _tmp3_ = unity_music_lens_rhythmbox_collection_cached_variant_for_int (self, (gint) _tmp2_);
01191        type = _tmp3_;
01192        _tmp4_ = track;
01193        _tmp5_ = unity_music_lens_track_get_uri (_tmp4_);
01194        _tmp6_ = _tmp5_;
01195        _tmp7_ = g_variant_new_string (_tmp6_);
01196        _tmp8_ = g_variant_ref_sink (_tmp7_);
01197        uri = _tmp8_;
01198        _tmp9_ = track;
01199        _tmp10_ = unity_music_lens_track_get_title (_tmp9_);
01200        _tmp11_ = _tmp10_;
01201        _tmp12_ = g_variant_new_string (_tmp11_);
01202        _tmp13_ = g_variant_ref_sink (_tmp12_);
01203        title = _tmp13_;
01204        _tmp14_ = track;
01205        _tmp15_ = unity_music_lens_track_get_artist (_tmp14_);
01206        _tmp16_ = _tmp15_;
01207        _tmp17_ = unity_music_lens_rhythmbox_collection_cached_variant_for_string (self, _tmp16_);
01208        artist = _tmp17_;
01209        _tmp18_ = track;
01210        _tmp19_ = unity_music_lens_track_get_album_artist (_tmp18_);
01211        _tmp20_ = _tmp19_;
01212        _tmp21_ = unity_music_lens_rhythmbox_collection_cached_variant_for_string (self, _tmp20_);
01213        album_artist = _tmp21_;
01214        _tmp22_ = track;
01215        _tmp23_ = unity_music_lens_track_get_album (_tmp22_);
01216        _tmp24_ = _tmp23_;
01217        _tmp25_ = unity_music_lens_rhythmbox_collection_cached_variant_for_string (self, _tmp24_);
01218        album = _tmp25_;
01219        _tmp26_ = track;
01220        _tmp27_ = unity_music_lens_track_get_mime_type (_tmp26_);
01221        _tmp28_ = _tmp27_;
01222        _tmp29_ = unity_music_lens_rhythmbox_collection_cached_variant_for_string (self, _tmp28_);
01223        mime_type = _tmp29_;
01224        _tmp30_ = track;
01225        _tmp31_ = unity_music_lens_track_get_artwork_path (_tmp30_);
01226        _tmp32_ = _tmp31_;
01227        _tmp33_ = unity_music_lens_rhythmbox_collection_cached_variant_for_string (self, _tmp32_);
01228        artwork = _tmp33_;
01229        _tmp34_ = track;
01230        _tmp35_ = unity_music_lens_track_get_genre (_tmp34_);
01231        _tmp36_ = _tmp35_;
01232        _tmp37_ = unity_music_lens_rhythmbox_collection_cached_variant_for_string (self, _tmp36_);
01233        genre = _tmp37_;
01234        _tmp38_ = track;
01235        _tmp39_ = unity_music_lens_track_get_track_number (_tmp38_);
01236        _tmp40_ = _tmp39_;
01237        _tmp41_ = unity_music_lens_rhythmbox_collection_cached_variant_for_int (self, _tmp40_);
01238        track_number = _tmp41_;
01239        _tmp42_ = track;
01240        _tmp43_ = unity_music_lens_track_get_year (_tmp42_);
01241        _tmp44_ = _tmp43_;
01242        _tmp45_ = unity_music_lens_rhythmbox_collection_cached_variant_for_int (self, _tmp44_);
01243        year = _tmp45_;
01244        _tmp46_ = track;
01245        _tmp47_ = unity_music_lens_track_get_play_count (_tmp46_);
01246        _tmp48_ = _tmp47_;
01247        _tmp49_ = unity_music_lens_rhythmbox_collection_cached_variant_for_int (self, _tmp48_);
01248        play_count = _tmp49_;
01249        _tmp50_ = _g_variant_ref0 (type);
01250        _g_variant_unref0 (self->priv->row_buffer[0]);
01251        self->priv->row_buffer[0] = _tmp50_;
01252        _tmp51_ = self->priv->row_buffer[0];
01253        _tmp52_ = _g_variant_ref0 (uri);
01254        _g_variant_unref0 (self->priv->row_buffer[1]);
01255        self->priv->row_buffer[1] = _tmp52_;
01256        _tmp53_ = self->priv->row_buffer[1];
01257        _tmp54_ = _g_variant_ref0 (title);
01258        _g_variant_unref0 (self->priv->row_buffer[2]);
01259        self->priv->row_buffer[2] = _tmp54_;
01260        _tmp55_ = self->priv->row_buffer[2];
01261        _tmp56_ = _g_variant_ref0 (artist);
01262        _g_variant_unref0 (self->priv->row_buffer[3]);
01263        self->priv->row_buffer[3] = _tmp56_;
01264        _tmp57_ = self->priv->row_buffer[3];
01265        _tmp58_ = _g_variant_ref0 (album);
01266        _g_variant_unref0 (self->priv->row_buffer[4]);
01267        self->priv->row_buffer[4] = _tmp58_;
01268        _tmp59_ = self->priv->row_buffer[4];
01269        _tmp60_ = _g_variant_ref0 (artwork);
01270        _g_variant_unref0 (self->priv->row_buffer[5]);
01271        self->priv->row_buffer[5] = _tmp60_;
01272        _tmp61_ = self->priv->row_buffer[5];
01273        _tmp62_ = _g_variant_ref0 (mime_type);
01274        _g_variant_unref0 (self->priv->row_buffer[6]);
01275        self->priv->row_buffer[6] = _tmp62_;
01276        _tmp63_ = self->priv->row_buffer[6];
01277        _tmp64_ = _g_variant_ref0 (genre);
01278        _g_variant_unref0 (self->priv->row_buffer[7]);
01279        self->priv->row_buffer[7] = _tmp64_;
01280        _tmp65_ = self->priv->row_buffer[7];
01281        _tmp66_ = _g_variant_ref0 (album_artist);
01282        _g_variant_unref0 (self->priv->row_buffer[8]);
01283        self->priv->row_buffer[8] = _tmp66_;
01284        _tmp67_ = self->priv->row_buffer[8];
01285        _tmp68_ = _g_variant_ref0 (track_number);
01286        _g_variant_unref0 (self->priv->row_buffer[9]);
01287        self->priv->row_buffer[9] = _tmp68_;
01288        _tmp69_ = self->priv->row_buffer[9];
01289        _tmp70_ = _g_variant_ref0 (year);
01290        _g_variant_unref0 (self->priv->row_buffer[10]);
01291        self->priv->row_buffer[10] = _tmp70_;
01292        _tmp71_ = self->priv->row_buffer[10];
01293        _tmp72_ = _g_variant_ref0 (play_count);
01294        _g_variant_unref0 (self->priv->row_buffer[11]);
01295        self->priv->row_buffer[11] = _tmp72_;
01296        _tmp73_ = self->priv->row_buffer[11];
01297        _g_variant_unref0 (play_count);
01298        _g_variant_unref0 (year);
01299        _g_variant_unref0 (track_number);
01300        _g_variant_unref0 (genre);
01301        _g_variant_unref0 (artwork);
01302        _g_variant_unref0 (mime_type);
01303        _g_variant_unref0 (album);
01304        _g_variant_unref0 (album_artist);
01305        _g_variant_unref0 (artist);
01306        _g_variant_unref0 (title);
01307        _g_variant_unref0 (uri);
01308        _g_variant_unref0 (type);
01309 }
01310 
01311 
01312 static Block2Data* block2_data_ref (Block2Data* _data2_) {
01313        g_atomic_int_inc (&_data2_->_ref_count_);
01314        return _data2_;
01315 }
01316 
01317 
01318 static void block2_data_unref (Block2Data* _data2_) {
01319        if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
01320               _g_object_unref0 (_data2_->self);
01321               _g_free0 (_data2_->path);
01322               g_slice_free (Block2Data, _data2_);
01323        }
01324 }
01325 
01326 
01327 static gpointer _g_object_ref0 (gpointer self) {
01328        return self ? g_object_ref (self) : NULL;
01329 }
01330 
01331 
01332 static void ____lambda5_ (Block2Data* _data2_) {
01333        UnityMusicLensRhythmboxCollection * self;
01334        TDB_CONTEXT* _tmp0_;
01335        self = _data2_->self;
01336        _tmp0_ = self->priv->album_art_tdb;
01337        if (_tmp0_ == NULL) {
01338               const gchar* _tmp1_;
01339               _tmp1_ = _data2_->path;
01340               unity_music_lens_rhythmbox_collection_parse_metadata_file (self, _tmp1_);
01341        } else {
01342               gint _tmp2_;
01343               _tmp2_ = self->priv->current_album_art_tag;
01344               self->priv->current_album_art_tag = _tmp2_ + 1;
01345        }
01346 }
01347 
01348 
01349 static void _____lambda5__g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self) {
01350        ____lambda5_ (self);
01351 }
01352 
01353 
01354 void unity_music_lens_rhythmbox_collection_parse_metadata_file (UnityMusicLensRhythmboxCollection* self, const gchar* path) {
01355        Block2Data* _data2_;
01356        const gchar* _tmp0_;
01357        gchar* _tmp1_;
01358        TDB_CONTEXT* _tmp2_;
01359        GFileMonitor* _tmp3_;
01360        int flags;
01361        const gchar* _tmp13_;
01362        int _tmp14_;
01363        TDB_CONTEXT* _tmp15_;
01364        TDB_CONTEXT* _tmp16_;
01365        GError * _inner_error_ = NULL;
01366        g_return_if_fail (self != NULL);
01367        g_return_if_fail (path != NULL);
01368        _data2_ = g_slice_new0 (Block2Data);
01369        _data2_->_ref_count_ = 1;
01370        _data2_->self = g_object_ref (self);
01371        _tmp0_ = path;
01372        _tmp1_ = g_strdup (_tmp0_);
01373        _data2_->path = _tmp1_;
01374        _tmp2_ = self->priv->album_art_tdb;
01375        if (_tmp2_ != NULL) {
01376               block2_data_unref (_data2_);
01377               _data2_ = NULL;
01378               return;
01379        }
01380        _tmp3_ = self->priv->tdb_monitor;
01381        if (_tmp3_ == NULL) {
01382               const gchar* _tmp4_;
01383               GFile* _tmp5_ = NULL;
01384               GFile* tdb_file;
01385               _tmp4_ = _data2_->path;
01386               _tmp5_ = g_file_new_for_path (_tmp4_);
01387               tdb_file = _tmp5_;
01388               {
01389                      GFile* _tmp6_;
01390                      GFileMonitor* _tmp7_ = NULL;
01391                      GFileMonitor* _tmp8_;
01392                      GFileMonitor* _tmp9_;
01393                      GFileMonitor* _tmp10_;
01394                      _tmp6_ = tdb_file;
01395                      _tmp7_ = g_file_monitor (_tmp6_, G_FILE_MONITOR_NONE, NULL, &_inner_error_);
01396                      _tmp8_ = _tmp7_;
01397                      if (_inner_error_ != NULL) {
01398                             goto __catch9_g_error;
01399                      }
01400                      _tmp9_ = _g_object_ref0 (_tmp8_);
01401                      _g_object_unref0 (self->priv->tdb_monitor);
01402                      self->priv->tdb_monitor = _tmp9_;
01403                      _tmp10_ = self->priv->tdb_monitor;
01404                      g_signal_connect_data (_tmp10_, "changed", (GCallback) _____lambda5__g_file_monitor_changed, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
01405               }
01406               goto __finally9;
01407               __catch9_g_error:
01408               {
01409                      GError* err = NULL;
01410                      GError* _tmp11_;
01411                      const gchar* _tmp12_;
01412                      err = _inner_error_;
01413                      _inner_error_ = NULL;
01414                      _tmp11_ = err;
01415                      _tmp12_ = _tmp11_->message;
01416                      g_warning ("rhythmbox-collection.vala:435: %s", _tmp12_);
01417                      _g_error_free0 (err);
01418               }
01419               __finally9:
01420               if (_inner_error_ != NULL) {
01421                      _g_object_unref0 (tdb_file);
01422                      block2_data_unref (_data2_);
01423                      _data2_ = NULL;
01424                      g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
01425                      g_clear_error (&_inner_error_);
01426                      return;
01427               }
01428               _g_object_unref0 (tdb_file);
01429        }
01430        flags = (TDB_INCOMPATIBLE_HASH | TDB_SEQNUM) | TDB_NOLOCK;
01431        _tmp13_ = _data2_->path;
01432        _tmp14_ = flags;
01433        _tmp15_ = tdb_open (_tmp13_, 999, _tmp14_, O_RDONLY, (mode_t) 0600);
01434        _tdb_close0 (self->priv->album_art_tdb);
01435        self->priv->album_art_tdb = _tmp15_;
01436        _tmp16_ = self->priv->album_art_tdb;
01437        if (_tmp16_ == NULL) {
01438               g_warning ("rhythmbox-collection.vala:444: Unable to open album-art DB!");
01439               block2_data_unref (_data2_);
01440               _data2_ = NULL;
01441               return;
01442        }
01443        block2_data_unref (_data2_);
01444        _data2_ = NULL;
01445 }
01446 
01447 
01448 static void __lambda6_ (UnityMusicLensRhythmboxCollection* self, UnityMusicLensTrack* track) {
01449        UnityMusicLensTrack* _tmp0_;
01450        gchar* _tmp1_ = NULL;
01451        gchar* albumart;
01452        const gchar* _tmp2_;
01453        UnityMusicLensTrack* _tmp6_;
01454        DeeSequenceModel* _tmp7_;
01455        DeeModelIter* _tmp8_ = NULL;
01456        DeeModelIter* iter;
01457        gboolean _tmp9_ = FALSE;
01458        UnityMusicLensTrack* _tmp10_;
01459        const gchar* _tmp11_;
01460        const gchar* _tmp12_;
01461        gboolean _tmp16_;
01462        const gchar* _tmp17_ = NULL;
01463        UnityMusicLensTrack* _tmp18_;
01464        const gchar* _tmp19_;
01465        const gchar* _tmp20_;
01466        UnityMusicLensTrack* _tmp27_;
01467        const gchar* _tmp28_;
01468        const gchar* _tmp29_;
01469        const gchar* _tmp30_;
01470        gchar* _tmp31_ = NULL;
01471        gchar* album_key;
01472        GHashTable* _tmp32_;
01473        const gchar* _tmp33_;
01474        gconstpointer _tmp34_ = NULL;
01475        GPtrArray* _tmp35_;
01476        GPtrArray* arr;
01477        GPtrArray* _tmp36_;
01478        GPtrArray* _tmp43_;
01479        DeeModelIter* _tmp44_;
01480        g_return_if_fail (track != NULL);
01481        _tmp0_ = track;
01482        _tmp1_ = unity_music_lens_rhythmbox_collection_get_albumart (self, _tmp0_);
01483        albumart = _tmp1_;
01484        _tmp2_ = albumart;
01485        if (_tmp2_ != NULL) {
01486               UnityMusicLensTrack* _tmp3_;
01487               const gchar* _tmp4_;
01488               _tmp3_ = track;
01489               _tmp4_ = albumart;
01490               unity_music_lens_track_set_artwork_path (_tmp3_, _tmp4_);
01491        } else {
01492               UnityMusicLensTrack* _tmp5_;
01493               _tmp5_ = track;
01494               unity_music_lens_track_set_artwork_path (_tmp5_, "audio-x-generic");
01495        }
01496        _tmp6_ = track;
01497        unity_music_lens_rhythmbox_collection_prepare_row_buffer (self, _tmp6_);
01498        _tmp7_ = self->priv->all_tracks;
01499        _tmp8_ = dee_model_append_row ((DeeModel*) _tmp7_, self->priv->row_buffer);
01500        iter = _tmp8_;
01501        _tmp10_ = track;
01502        _tmp11_ = unity_music_lens_track_get_album (_tmp10_);
01503        _tmp12_ = _tmp11_;
01504        if (g_strcmp0 (_tmp12_, "") == 0) {
01505               _tmp9_ = TRUE;
01506        } else {
01507               UnityMusicLensTrack* _tmp13_;
01508               const gchar* _tmp14_;
01509               const gchar* _tmp15_;
01510               _tmp13_ = track;
01511               _tmp14_ = unity_music_lens_track_get_album (_tmp13_);
01512               _tmp15_ = _tmp14_;
01513               _tmp9_ = g_strcmp0 (_tmp15_, UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_UNKNOWN_ALBUM) == 0;
01514        }
01515        _tmp16_ = _tmp9_;
01516        if (_tmp16_) {
01517               _g_free0 (albumart);
01518               return;
01519        }
01520        _tmp18_ = track;
01521        _tmp19_ = unity_music_lens_track_get_album_artist (_tmp18_);
01522        _tmp20_ = _tmp19_;
01523        if (_tmp20_ != NULL) {
01524               UnityMusicLensTrack* _tmp21_;
01525               const gchar* _tmp22_;
01526               const gchar* _tmp23_;
01527               _tmp21_ = track;
01528               _tmp22_ = unity_music_lens_track_get_album_artist (_tmp21_);
01529               _tmp23_ = _tmp22_;
01530               _tmp17_ = _tmp23_;
01531        } else {
01532               UnityMusicLensTrack* _tmp24_;
01533               const gchar* _tmp25_;
01534               const gchar* _tmp26_;
01535               _tmp24_ = track;
01536               _tmp25_ = unity_music_lens_track_get_artist (_tmp24_);
01537               _tmp26_ = _tmp25_;
01538               _tmp17_ = _tmp26_;
01539        }
01540        _tmp27_ = track;
01541        _tmp28_ = unity_music_lens_track_get_album (_tmp27_);
01542        _tmp29_ = _tmp28_;
01543        _tmp30_ = _tmp17_;
01544        _tmp31_ = g_strdup_printf ("%s - %s", _tmp29_, _tmp30_);
01545        album_key = _tmp31_;
01546        _tmp32_ = self->priv->album_to_tracks_map;
01547        _tmp33_ = album_key;
01548        _tmp34_ = g_hash_table_lookup (_tmp32_, _tmp33_);
01549        _tmp35_ = _g_ptr_array_ref0 ((GPtrArray*) _tmp34_);
01550        arr = _tmp35_;
01551        _tmp36_ = arr;
01552        if (_tmp36_ == NULL) {
01553               GPtrArray* _tmp37_;
01554               GHashTable* _tmp38_;
01555               const gchar* _tmp39_;
01556               gchar* _tmp40_;
01557               GPtrArray* _tmp41_;
01558               GPtrArray* _tmp42_;
01559               _tmp37_ = g_ptr_array_new_with_free_func (NULL);
01560               _g_ptr_array_unref0 (arr);
01561               arr = _tmp37_;
01562               _tmp38_ = self->priv->album_to_tracks_map;
01563               _tmp39_ = album_key;
01564               _tmp40_ = g_strdup (_tmp39_);
01565               _tmp41_ = arr;
01566               _tmp42_ = _g_ptr_array_ref0 (_tmp41_);
01567               g_hash_table_insert (_tmp38_, _tmp40_, _tmp42_);
01568        }
01569        _tmp43_ = arr;
01570        _tmp44_ = iter;
01571        g_ptr_array_add (_tmp43_, _tmp44_);
01572        _g_ptr_array_unref0 (arr);
01573        _g_free0 (album_key);
01574        _g_free0 (albumart);
01575 }
01576 
01577 
01578 static void ___lambda6__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready (UnityMusicLensRhythmboxCollectionXmlParser* _sender, UnityMusicLensTrack* track, gpointer self) {
01579        __lambda6_ (self, track);
01580 }
01581 
01582 
01583 static gint ____lambda7_ (UnityMusicLensRhythmboxCollection* self, DeeModelIter** a, DeeModelIter** b) {
01584        gint result = 0;
01585        DeeSequenceModel* _tmp0_;
01586        DeeModelIter* _tmp1_;
01587        gint32 _tmp2_ = 0;
01588        gint32 trackno1;
01589        DeeSequenceModel* _tmp3_;
01590        DeeModelIter* _tmp4_;
01591        gint32 _tmp5_ = 0;
01592        gint32 trackno2;
01593        g_return_val_if_fail (a != NULL, 0);
01594        g_return_val_if_fail (b != NULL, 0);
01595        _tmp0_ = self->priv->all_tracks;
01596        _tmp1_ = *a;
01597        _tmp2_ = dee_model_get_int32 ((DeeModel*) _tmp0_, _tmp1_, (guint) UNITY_MUSIC_LENS_COLUMNS_TRACK_NUMBER);
01598        trackno1 = _tmp2_;
01599        _tmp3_ = self->priv->all_tracks;
01600        _tmp4_ = *b;
01601        _tmp5_ = dee_model_get_int32 ((DeeModel*) _tmp3_, _tmp4_, (guint) UNITY_MUSIC_LENS_COLUMNS_TRACK_NUMBER);
01602        trackno2 = _tmp5_;
01603        result = (gint) (trackno1 - trackno2);
01604        return result;
01605 }
01606 
01607 
01608 static gint _____lambda7__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
01609        gint result;
01610        result = ____lambda7_ (self, a, b);
01611        return result;
01612 }
01613 
01614 
01615 void unity_music_lens_rhythmbox_collection_parse_file (UnityMusicLensRhythmboxCollection* self, const gchar* path) {
01616        DeeSequenceModel* _tmp0_;
01617        GHashTable* _tmp1_;
01618        UnityMusicLensRhythmboxCollectionXmlParser* _tmp2_;
01619        UnityMusicLensRhythmboxCollectionXmlParser* parser;
01620        UnityMusicLensRhythmboxCollectionXmlParser* _tmp3_;
01621        const gchar* _tmp4_;
01622        GFile* _tmp5_ = NULL;
01623        GFile* file;
01624        GHashTable* _tmp16_;
01625        GList* _tmp17_ = NULL;
01626        GList* all_albums;
01627        GList* _tmp18_;
01628        GError * _inner_error_ = NULL;
01629        g_return_if_fail (self != NULL);
01630        g_return_if_fail (path != NULL);
01631        _g_object_unref0 (self->priv->index);
01632        self->priv->index = NULL;
01633        _tmp0_ = self->priv->all_tracks;
01634        dee_model_clear ((DeeModel*) _tmp0_);
01635        unity_music_lens_rhythmbox_collection_initialize_index (self);
01636        self->priv->current_album_art_tag = 0;
01637        _tmp1_ = self->priv->album_to_tracks_map;
01638        g_hash_table_remove_all (_tmp1_);
01639        _tmp2_ = unity_music_lens_rhythmbox_collection_xml_parser_new ();
01640        parser = _tmp2_;
01641        _tmp3_ = parser;
01642        g_signal_connect_object (_tmp3_, "track-info-ready", (GCallback) ___lambda6__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready, self, 0);
01643        _tmp4_ = path;
01644        _tmp5_ = g_file_new_for_path (_tmp4_);
01645        file = _tmp5_;
01646        {
01647               GFile* _tmp6_;
01648               GFileInputStream* _tmp7_ = NULL;
01649               GFileInputStream* stream;
01650               guint8 buffer[65536] = {0};
01651               gsize bytes_read = 0UL;
01652               _tmp6_ = file;
01653               _tmp7_ = g_file_read (_tmp6_, NULL, &_inner_error_);
01654               stream = _tmp7_;
01655               if (_inner_error_ != NULL) {
01656                      goto __catch10_g_error;
01657               }
01658               while (TRUE) {
01659                      GFileInputStream* _tmp8_;
01660                      gssize _tmp9_ = 0L;
01661                      gssize _tmp10_;
01662                      gsize _tmp11_;
01663                      UnityMusicLensRhythmboxCollectionXmlParser* _tmp12_;
01664                      gsize _tmp13_;
01665                      _tmp8_ = stream;
01666                      _tmp9_ = g_input_stream_read ((GInputStream*) _tmp8_, buffer, (gsize) 65536, NULL, &_inner_error_);
01667                      _tmp10_ = _tmp9_;
01668                      if (_inner_error_ != NULL) {
01669                             _g_object_unref0 (stream);
01670                             goto __catch10_g_error;
01671                      }
01672                      bytes_read = (gsize) _tmp10_;
01673                      _tmp11_ = bytes_read;
01674                      if (!(_tmp11_ > ((gsize) 0))) {
01675                             break;
01676                      }
01677                      _tmp12_ = parser;
01678                      _tmp13_ = bytes_read;
01679                      unity_music_lens_rhythmbox_collection_xml_parser_parse (_tmp12_, (const gchar*) buffer, _tmp13_, &_inner_error_);
01680                      if (_inner_error_ != NULL) {
01681                             _g_object_unref0 (stream);
01682                             goto __catch10_g_error;
01683                      }
01684               }
01685               _g_object_unref0 (stream);
01686        }
01687        goto __finally10;
01688        __catch10_g_error:
01689        {
01690               GError* err = NULL;
01691               GError* _tmp14_;
01692               const gchar* _tmp15_;
01693               err = _inner_error_;
01694               _inner_error_ = NULL;
01695               _tmp14_ = err;
01696               _tmp15_ = _tmp14_->message;
01697               g_warning ("rhythmbox-collection.vala:510: Error while parsing rhythmbox DB: %s", _tmp15_);
01698               _g_error_free0 (err);
01699        }
01700        __finally10:
01701        if (_inner_error_ != NULL) {
01702               _g_object_unref0 (file);
01703               _g_object_unref0 (parser);
01704               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
01705               g_clear_error (&_inner_error_);
01706               return;
01707        }
01708        _tmp16_ = self->priv->album_to_tracks_map;
01709        _tmp17_ = g_hash_table_get_keys (_tmp16_);
01710        all_albums = _tmp17_;
01711        _tmp18_ = all_albums;
01712        {
01713               GList* s_collection = NULL;
01714               GList* s_it = NULL;
01715               s_collection = _tmp18_;
01716               for (s_it = s_collection; s_it != NULL; s_it = s_it->next) {
01717                      const gchar* s = NULL;
01718                      s = (const gchar*) s_it->data;
01719                      {
01720                             GHashTable* _tmp19_;
01721                             const gchar* _tmp20_;
01722                             gconstpointer _tmp21_ = NULL;
01723                             _tmp19_ = self->priv->album_to_tracks_map;
01724                             _tmp20_ = s;
01725                             _tmp21_ = g_hash_table_lookup (_tmp19_, _tmp20_);
01726                             g_ptr_array_sort_with_data ((GPtrArray*) _tmp21_, _____lambda7__gcompare_data_func, self);
01727                      }
01728               }
01729        }
01730        _g_list_free0 (all_albums);
01731        _g_object_unref0 (file);
01732        _g_object_unref0 (parser);
01733 }
01734 
01735 
01736 static void unity_music_lens_rhythmbox_collection_add_result (UnityMusicLensRhythmboxCollection* self, DeeModel* results_model, DeeModel* model, DeeModelIter* iter, UnityMusicLensRhythmboxCollectionResultType result_type, guint category_id) {
01737        DeeModelTag* _tmp0_;
01738        DeeModel* _tmp1_;
01739        DeeModelIter* _tmp2_;
01740        gconstpointer _tmp3_ = NULL;
01741        gint tag;
01742        gint _tmp4_;
01743        gint _tmp5_;
01744        UnityMusicLensColumns _tmp42_ = 0;
01745        gboolean _tmp43_ = FALSE;
01746        UnityMusicLensRhythmboxCollectionResultType _tmp44_;
01747        gboolean _tmp46_;
01748        UnityMusicLensColumns _tmp47_;
01749        UnityMusicLensColumns title_col;
01750        DeeModel* _tmp48_;
01751        DeeModelIter* _tmp49_;
01752        UnityMusicLensColumns _tmp50_;
01753        const gchar* _tmp51_ = NULL;
01754        const gchar* title;
01755        DeeModel* _tmp52_;
01756        DeeModelIter* _tmp53_;
01757        const gchar* _tmp54_ = NULL;
01758        gchar* _tmp55_;
01759        gchar* uri;
01760        DeeModel* _tmp56_;
01761        DeeModelIter* _tmp57_;
01762        const gchar* _tmp58_ = NULL;
01763        gchar* _tmp59_;
01764        gchar* dnd_uri;
01765        UnityMusicLensRhythmboxCollectionResultType _tmp60_;
01766        DeeModel* _tmp84_;
01767        const gchar* _tmp85_;
01768        DeeModel* _tmp86_;
01769        DeeModelIter* _tmp87_;
01770        const gchar* _tmp88_ = NULL;
01771        guint _tmp89_;
01772        DeeModel* _tmp90_;
01773        DeeModelIter* _tmp91_;
01774        const gchar* _tmp92_ = NULL;
01775        const gchar* _tmp93_;
01776        DeeModel* _tmp94_;
01777        DeeModelIter* _tmp95_;
01778        const gchar* _tmp96_ = NULL;
01779        const gchar* _tmp97_;
01780        g_return_if_fail (self != NULL);
01781        g_return_if_fail (results_model != NULL);
01782        g_return_if_fail (model != NULL);
01783        g_return_if_fail (iter != NULL);
01784        _tmp0_ = self->priv->album_art_tag;
01785        _tmp1_ = model;
01786        _tmp2_ = iter;
01787        _tmp3_ = dee_model_get_tag (_tmp1_, _tmp2_, _tmp0_);
01788        tag = GPOINTER_TO_INT (_tmp3_);
01789        _tmp4_ = tag;
01790        _tmp5_ = self->priv->current_album_art_tag;
01791        if (_tmp4_ < _tmp5_) {
01792               DeeModel* _tmp6_;
01793               DeeModelIter* _tmp7_;
01794               const gchar* _tmp8_ = NULL;
01795               const gchar* album;
01796               DeeModel* _tmp9_;
01797               DeeModelIter* _tmp10_;
01798               const gchar* _tmp11_ = NULL;
01799               const gchar* artist;
01800               const gchar* _tmp12_;
01801               const gchar* _tmp16_;
01802               const gchar* _tmp17_;
01803               gchar* _tmp18_ = NULL;
01804               gchar* album_art_string;
01805               const gchar* _tmp19_;
01806               DeeModelTag* _tmp38_;
01807               DeeModel* _tmp39_;
01808               DeeModelIter* _tmp40_;
01809               gint _tmp41_;
01810               _tmp6_ = model;
01811               _tmp7_ = iter;
01812               _tmp8_ = dee_model_get_string (_tmp6_, _tmp7_, (guint) UNITY_MUSIC_LENS_COLUMNS_ALBUM);
01813               album = _tmp8_;
01814               _tmp9_ = model;
01815               _tmp10_ = iter;
01816               _tmp11_ = dee_model_get_string (_tmp9_, _tmp10_, (guint) UNITY_MUSIC_LENS_COLUMNS_ALBUM_ARTIST);
01817               artist = _tmp11_;
01818               _tmp12_ = artist;
01819               if (g_strcmp0 (_tmp12_, "") == 0) {
01820                      DeeModel* _tmp13_;
01821                      DeeModelIter* _tmp14_;
01822                      const gchar* _tmp15_ = NULL;
01823                      _tmp13_ = model;
01824                      _tmp14_ = iter;
01825                      _tmp15_ = dee_model_get_string (_tmp13_, _tmp14_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTIST);
01826                      artist = _tmp15_;
01827               }
01828               _tmp16_ = artist;
01829               _tmp17_ = album;
01830               _tmp18_ = unity_music_lens_rhythmbox_collection_check_album_art_tdb (self, _tmp16_, _tmp17_);
01831               album_art_string = _tmp18_;
01832               _tmp19_ = album_art_string;
01833               if (_tmp19_ != NULL) {
01834                      gchar* filename = NULL;
01835                      const gchar* _tmp20_ = NULL;
01836                      const gchar* _tmp21_;
01837                      gchar* _tmp22_ = NULL;
01838                      const gchar* _tmp23_ = NULL;
01839                      const gchar* _tmp24_;
01840                      gboolean _tmp25_ = FALSE;
01841                      const gchar* _tmp27_;
01842                      gchar* _tmp28_;
01843                      const gchar* _tmp29_;
01844                      DeeModel* _tmp30_;
01845                      DeeModelIter* _tmp31_;
01846                      const gchar* _tmp32_ = NULL;
01847                      _tmp20_ = g_get_user_cache_dir ();
01848                      _tmp21_ = album_art_string;
01849                      _tmp22_ = g_build_filename (_tmp20_, "rhythmbox", "album-art", _tmp21_, NULL);
01850                      _g_free0 (filename);
01851                      filename = _tmp22_;
01852                      _tmp24_ = filename;
01853                      _tmp25_ = g_file_test (_tmp24_, G_FILE_TEST_EXISTS);
01854                      if (_tmp25_) {
01855                             const gchar* _tmp26_;
01856                             _tmp26_ = filename;
01857                             _tmp23_ = _tmp26_;
01858                      } else {
01859                             _tmp23_ = "audio-x-generic";
01860                      }
01861                      _tmp27_ = _tmp23_;
01862                      _tmp28_ = g_strdup (_tmp27_);
01863                      _g_free0 (album_art_string);
01864                      album_art_string = _tmp28_;
01865                      _tmp29_ = album_art_string;
01866                      _tmp30_ = model;
01867                      _tmp31_ = iter;
01868                      _tmp32_ = dee_model_get_string (_tmp30_, _tmp31_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTWORK);
01869                      if (g_strcmp0 (_tmp29_, _tmp32_) != 0) {
01870                             DeeModel* _tmp33_;
01871                             DeeModelIter* _tmp34_;
01872                             const gchar* _tmp35_;
01873                             GVariant* _tmp36_ = NULL;
01874                             GVariant* _tmp37_;
01875                             _tmp33_ = model;
01876                             _tmp34_ = iter;
01877                             _tmp35_ = album_art_string;
01878                             _tmp36_ = unity_music_lens_rhythmbox_collection_cached_variant_for_string (self, _tmp35_);
01879                             _tmp37_ = _tmp36_;
01880                             dee_model_set_value (_tmp33_, _tmp34_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTWORK, _tmp37_);
01881                             _g_variant_unref0 (_tmp37_);
01882                      }
01883                      _g_free0 (filename);
01884               }
01885               _tmp38_ = self->priv->album_art_tag;
01886               _tmp39_ = model;
01887               _tmp40_ = iter;
01888               _tmp41_ = self->priv->current_album_art_tag;
01889               dee_model_set_tag (_tmp39_, _tmp40_, _tmp38_, GINT_TO_POINTER (_tmp41_));
01890               _g_free0 (album_art_string);
01891        }
01892        _tmp44_ = result_type;
01893        if (_tmp44_ == UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_SONG) {
01894               _tmp43_ = TRUE;
01895        } else {
01896               UnityMusicLensRhythmboxCollectionResultType _tmp45_;
01897               _tmp45_ = result_type;
01898               _tmp43_ = _tmp45_ == UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_RADIO;
01899        }
01900        _tmp46_ = _tmp43_;
01901        if (_tmp46_) {
01902               _tmp42_ = UNITY_MUSIC_LENS_COLUMNS_TITLE;
01903        } else {
01904               _tmp42_ = UNITY_MUSIC_LENS_COLUMNS_ALBUM;
01905        }
01906        _tmp47_ = _tmp42_;
01907        title_col = _tmp47_;
01908        _tmp48_ = model;
01909        _tmp49_ = iter;
01910        _tmp50_ = title_col;
01911        _tmp51_ = dee_model_get_string (_tmp48_, _tmp49_, (guint) _tmp50_);
01912        title = _tmp51_;
01913        _tmp52_ = model;
01914        _tmp53_ = iter;
01915        _tmp54_ = dee_model_get_string (_tmp52_, _tmp53_, (guint) UNITY_MUSIC_LENS_COLUMNS_URI);
01916        _tmp55_ = g_strdup (_tmp54_);
01917        uri = _tmp55_;
01918        _tmp56_ = model;
01919        _tmp57_ = iter;
01920        _tmp58_ = dee_model_get_string (_tmp56_, _tmp57_, (guint) UNITY_MUSIC_LENS_COLUMNS_URI);
01921        _tmp59_ = g_strdup (_tmp58_);
01922        dnd_uri = _tmp59_;
01923        _tmp60_ = result_type;
01924        if (_tmp60_ == UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_ALBUM) {
01925               gboolean _tmp61_ = FALSE;
01926               const gchar* _tmp62_;
01927               gboolean _tmp64_;
01928               DeeModel* _tmp65_;
01929               DeeModelIter* _tmp66_;
01930               const gchar* _tmp67_ = NULL;
01931               const gchar* artist;
01932               const gchar* _tmp68_;
01933               const gchar* _tmp72_;
01934               const gchar* _tmp73_;
01935               gchar* _tmp74_ = NULL;
01936               gchar* album_key;
01937               GString* _tmp75_;
01938               GString* sb;
01939               const gchar* _tmp76_;
01940               GSList* _tmp77_ = NULL;
01941               GString* _tmp80_;
01942               gchar* _tmp81_;
01943               const gchar* _tmp82_;
01944               gchar* _tmp83_ = NULL;
01945               _tmp62_ = title;
01946               if (g_strcmp0 (_tmp62_, "") == 0) {
01947                      _tmp61_ = TRUE;
01948               } else {
01949                      const gchar* _tmp63_;
01950                      _tmp63_ = title;
01951                      _tmp61_ = g_strcmp0 (_tmp63_, UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_UNKNOWN_ALBUM) == 0;
01952               }
01953               _tmp64_ = _tmp61_;
01954               if (_tmp64_) {
01955                      _g_free0 (dnd_uri);
01956                      _g_free0 (uri);
01957                      return;
01958               }
01959               _tmp65_ = model;
01960               _tmp66_ = iter;
01961               _tmp67_ = dee_model_get_string (_tmp65_, _tmp66_, (guint) UNITY_MUSIC_LENS_COLUMNS_ALBUM_ARTIST);
01962               artist = _tmp67_;
01963               _tmp68_ = artist;
01964               if (g_strcmp0 (_tmp68_, "") == 0) {
01965                      DeeModel* _tmp69_;
01966                      DeeModelIter* _tmp70_;
01967                      const gchar* _tmp71_ = NULL;
01968                      _tmp69_ = model;
01969                      _tmp70_ = iter;
01970                      _tmp71_ = dee_model_get_string (_tmp69_, _tmp70_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTIST);
01971                      artist = _tmp71_;
01972               }
01973               _tmp72_ = title;
01974               _tmp73_ = artist;
01975               _tmp74_ = g_strdup_printf ("%s - %s", _tmp72_, _tmp73_);
01976               album_key = _tmp74_;
01977               _tmp75_ = g_string_new ("");
01978               sb = _tmp75_;
01979               _tmp76_ = album_key;
01980               _tmp77_ = unity_music_lens_rhythmbox_collection_get_album_tracks (self, _tmp76_);
01981               {
01982                      GSList* track_uri_collection = NULL;
01983                      GSList* track_uri_it = NULL;
01984                      track_uri_collection = _tmp77_;
01985                      for (track_uri_it = track_uri_collection; track_uri_it != NULL; track_uri_it = track_uri_it->next) {
01986                             const gchar* track_uri = NULL;
01987                             track_uri = (const gchar*) track_uri_it->data;
01988                             {
01989                                    GString* _tmp78_;
01990                                    const gchar* _tmp79_;
01991                                    _tmp78_ = sb;
01992                                    _tmp79_ = track_uri;
01993                                    g_string_append_printf (_tmp78_, "%s\r\n", _tmp79_);
01994                             }
01995                      }
01996                      _g_slist_free0 (track_uri_collection);
01997               }
01998               _tmp80_ = sb;
01999               _tmp81_ = _tmp80_->str;
02000               _tmp80_->str = NULL;
02001               _g_free0 (dnd_uri);
02002               dnd_uri = _tmp81_;
02003               _tmp82_ = album_key;
02004               _tmp83_ = g_strdup_printf ("album://%s", _tmp82_);
02005               _g_free0 (uri);
02006               uri = _tmp83_;
02007               _g_string_free0 (sb);
02008               _g_free0 (album_key);
02009        }
02010        _tmp84_ = results_model;
02011        _tmp85_ = uri;
02012        _tmp86_ = model;
02013        _tmp87_ = iter;
02014        _tmp88_ = dee_model_get_string (_tmp86_, _tmp87_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTWORK);
02015        _tmp89_ = category_id;
02016        _tmp90_ = model;
02017        _tmp91_ = iter;
02018        _tmp92_ = dee_model_get_string (_tmp90_, _tmp91_, (guint) UNITY_MUSIC_LENS_COLUMNS_MIMETYPE);
02019        _tmp93_ = title;
02020        _tmp94_ = model;
02021        _tmp95_ = iter;
02022        _tmp96_ = dee_model_get_string (_tmp94_, _tmp95_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTIST);
02023        _tmp97_ = dnd_uri;
02024        dee_model_append (_tmp84_, _tmp85_, _tmp88_, _tmp89_, _tmp92_, _tmp93_, _tmp96_, _tmp97_, NULL);
02025        _g_free0 (dnd_uri);
02026        _g_free0 (uri);
02027 }
02028 
02029 
02030 static gchar* string_strip (const gchar* self) {
02031        gchar* result = NULL;
02032        gchar* _tmp0_ = NULL;
02033        gchar* _result_;
02034        const gchar* _tmp1_;
02035        g_return_val_if_fail (self != NULL, NULL);
02036        _tmp0_ = g_strdup (self);
02037        _result_ = _tmp0_;
02038        _tmp1_ = _result_;
02039        g_strstrip (_tmp1_);
02040        result = _result_;
02041        return result;
02042 }
02043 
02044 
02045 static gint ____lambda8_ (UnityMusicLensRhythmboxCollection* self, DeeModelIter* a, DeeModelIter* b) {
02046        gint result = 0;
02047        gint _tmp0_ = 0;
02048        DeeModelIter* _tmp1_;
02049        DeeModelIter* _tmp2_;
02050        gint _tmp7_;
02051        g_return_val_if_fail (a != NULL, 0);
02052        g_return_val_if_fail (b != NULL, 0);
02053        _tmp1_ = a;
02054        _tmp2_ = b;
02055        if (_tmp1_ == _tmp2_) {
02056               _tmp0_ = 0;
02057        } else {
02058               gint _tmp3_ = 0;
02059               DeeModelIter* _tmp4_;
02060               DeeModelIter* _tmp5_;
02061               gint _tmp6_;
02062               _tmp4_ = a;
02063               _tmp5_ = b;
02064               if (((void*) _tmp4_) > ((void*) _tmp5_)) {
02065                      _tmp3_ = 1;
02066               } else {
02067                      _tmp3_ = -1;
02068               }
02069               _tmp6_ = _tmp3_;
02070               _tmp0_ = _tmp6_;
02071        }
02072        _tmp7_ = _tmp0_;
02073        result = _tmp7_;
02074        return result;
02075 }
02076 
02077 
02078 static gint _____lambda8__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
02079        gint result;
02080        result = ____lambda8_ (self, a, b);
02081        return result;
02082 }
02083 
02084 
02085 void unity_music_lens_rhythmbox_collection_search (UnityMusicLensRhythmboxCollection* self, UnityLensSearch* search, UnitySearchType search_type, GList* filters, gint max_results, gint category_override) {
02086        gint num_results;
02087        UnityLensSearch* _tmp0_;
02088        const gchar* _tmp1_;
02089        const gchar* _tmp2_;
02090        gchar* _tmp3_ = NULL;
02091        gchar* _tmp4_;
02092        gboolean _tmp5_;
02093        gboolean empty_search;
02094        gint min_year = 0;
02095        gint max_year = 0;
02096        gint category_id = 0;
02097        UnityMusicLensRhythmboxCollectionResultType result_type = 0;
02098        DeeSequenceModel* _tmp6_;
02099        DeeModel* _tmp7_;
02100        DeeModel* model;
02101        GList* _tmp8_;
02102        gint _tmp9_ = 0;
02103        gint _tmp10_ = 0;
02104        GList* _tmp11_;
02105        GeeSet* _tmp12_ = NULL;
02106        GeeSet* active_genres;
02107        UnityLensSearch* _tmp13_;
02108        DeeSerializableModel* _tmp14_;
02109        DeeSerializableModel* _tmp15_;
02110        DeeSerializableModel* _tmp16_;
02111        DeeSerializableModel* helper_model;
02112        gint _tmp17_;
02113        gboolean _tmp25_;
02114        GObject* _tmp95_ = NULL;
02115        GObject* _tmp96_;
02116        DeeTermList* term_list;
02117        DeeAnalyzer* _tmp97_;
02118        DeeICUTermFilter* _tmp98_;
02119        UnityLensSearch* _tmp99_;
02120        const gchar* _tmp100_;
02121        const gchar* _tmp101_;
02122        gchar* _tmp102_ = NULL;
02123        gchar* _tmp103_;
02124        DeeTermList* _tmp104_;
02125        GSequence* _tmp105_;
02126        GSequence* matches;
02127        gboolean first_pass;
02128        GSequence* _tmp145_;
02129        GSequenceIter* _tmp146_ = NULL;
02130        GSequenceIter* seq_iter;
02131        GSequence* _tmp147_;
02132        GSequenceIter* _tmp148_ = NULL;
02133        GSequenceIter* seq_end_iter;
02134        GeeHashSet* _tmp149_;
02135        GeeHashSet* albums_list;
02136        DeeSerializableModel* _tmp213_;
02137        UnityLensSearch* _tmp214_;
02138        DeeSerializableModel* _tmp215_;
02139        DeeSerializableModel* _tmp216_;
02140        DeeSerializableModel* _tmp217_;
02141        DeeModelIter* _tmp218_ = NULL;
02142        DeeModelIter* iter;
02143        DeeSerializableModel* _tmp219_;
02144        DeeModelIter* _tmp220_ = NULL;
02145        DeeModelIter* last;
02146        g_return_if_fail (self != NULL);
02147        g_return_if_fail (search != NULL);
02148        num_results = 0;
02149        _tmp0_ = search;
02150        _tmp1_ = unity_lens_search_get_search_string (_tmp0_);
02151        _tmp2_ = _tmp1_;
02152        _tmp3_ = string_strip (_tmp2_);
02153        _tmp4_ = _tmp3_;
02154        _tmp5_ = g_strcmp0 (_tmp4_, "") == 0;
02155        _g_free0 (_tmp4_);
02156        empty_search = _tmp5_;
02157        _tmp6_ = self->priv->all_tracks;
02158        _tmp7_ = _g_object_ref0 ((DeeModel*) _tmp6_);
02159        model = _tmp7_;
02160        _tmp8_ = filters;
02161        unity_music_lens_rhythmbox_collection_get_decade_filter (self, _tmp8_, &_tmp9_, &_tmp10_);
02162        min_year = _tmp9_;
02163        max_year = _tmp10_;
02164        _tmp11_ = filters;
02165        _tmp12_ = unity_music_lens_rhythmbox_collection_get_genre_filter (self, _tmp11_);
02166        active_genres = _tmp12_;
02167        _tmp13_ = search;
02168        _tmp14_ = unity_lens_search_get_results_model (_tmp13_);
02169        _tmp15_ = _tmp14_;
02170        _tmp16_ = _g_object_ref0 (_tmp15_);
02171        helper_model = _tmp16_;
02172        _tmp17_ = category_override;
02173        if (_tmp17_ >= 0) {
02174               DeeSequenceModel* _tmp18_;
02175               DeeSerializableModel* _tmp19_;
02176               UnityLensSearch* _tmp20_;
02177               DeeSerializableModel* _tmp21_;
02178               DeeSerializableModel* _tmp22_;
02179               guint _tmp23_;
02180               gchar** _tmp24_ = NULL;
02181               _tmp18_ = (DeeSequenceModel*) dee_sequence_model_new ();
02182               _g_object_unref0 (helper_model);
02183               helper_model = (DeeSerializableModel*) _tmp18_;
02184               _tmp19_ = helper_model;
02185               _tmp20_ = search;
02186               _tmp21_ = unity_lens_search_get_results_model (_tmp20_);
02187               _tmp22_ = _tmp21_;
02188               _tmp24_ = dee_model_get_schema ((DeeModel*) _tmp22_, &_tmp23_);
02189               dee_model_set_schema_full ((DeeModel*) _tmp19_, _tmp24_, (guint) _tmp23_);
02190        }
02191        _tmp25_ = empty_search;
02192        if (_tmp25_) {
02193               DeeFilterModel* _tmp26_;
02194               DeeModel* _tmp27_;
02195               DeeModel* _tmp28_;
02196               DeeModelIter* _tmp29_ = NULL;
02197               DeeModelIter* iter;
02198               DeeModel* _tmp30_;
02199               DeeModelIter* _tmp31_ = NULL;
02200               DeeModelIter* end_iter;
02201               GeeHashSet* _tmp32_;
02202               GeeHashSet* albums_list_nosearch;
02203               _tmp26_ = self->priv->tracks_by_play_count;
02204               _tmp27_ = _g_object_ref0 ((DeeModel*) _tmp26_);
02205               _g_object_unref0 (model);
02206               model = _tmp27_;
02207               _tmp28_ = model;
02208               _tmp29_ = dee_model_get_first_iter (_tmp28_);
02209               iter = _tmp29_;
02210               _tmp30_ = model;
02211               _tmp31_ = dee_model_get_last_iter (_tmp30_);
02212               end_iter = _tmp31_;
02213               _tmp32_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
02214               albums_list_nosearch = _tmp32_;
02215               while (TRUE) {
02216                      DeeModelIter* _tmp33_;
02217                      DeeModelIter* _tmp34_;
02218                      DeeModel* _tmp35_;
02219                      DeeModelIter* _tmp36_;
02220                      gint32 _tmp37_ = 0;
02221                      gint year;
02222                      DeeModel* _tmp38_;
02223                      DeeModelIter* _tmp39_;
02224                      const gchar* _tmp40_ = NULL;
02225                      const gchar* genre;
02226                      gboolean _tmp41_ = FALSE;
02227                      gint _tmp42_;
02228                      gint _tmp43_;
02229                      gboolean _tmp46_;
02230                      GeeSet* _tmp50_;
02231                      DeeModel* _tmp57_;
02232                      DeeModelIter* _tmp58_;
02233                      gint32 _tmp59_ = 0;
02234                      gint _tmp79_;
02235                      DeeSerializableModel* _tmp81_;
02236                      DeeModel* _tmp82_;
02237                      DeeModelIter* _tmp83_;
02238                      UnityMusicLensRhythmboxCollectionResultType _tmp84_;
02239                      gint _tmp85_;
02240                      gint _tmp86_;
02241                      gboolean _tmp87_ = FALSE;
02242                      gint _tmp88_;
02243                      gboolean _tmp91_;
02244                      DeeModel* _tmp92_;
02245                      DeeModelIter* _tmp93_;
02246                      DeeModelIter* _tmp94_ = NULL;
02247                      _tmp33_ = iter;
02248                      _tmp34_ = end_iter;
02249                      if (!(_tmp33_ != _tmp34_)) {
02250                             break;
02251                      }
02252                      _tmp35_ = model;
02253                      _tmp36_ = iter;
02254                      _tmp37_ = dee_model_get_int32 (_tmp35_, _tmp36_, (guint) UNITY_MUSIC_LENS_COLUMNS_YEAR);
02255                      year = (gint) _tmp37_;
02256                      _tmp38_ = model;
02257                      _tmp39_ = iter;
02258                      _tmp40_ = dee_model_get_string (_tmp38_, _tmp39_, (guint) UNITY_MUSIC_LENS_COLUMNS_GENRE);
02259                      genre = _tmp40_;
02260                      _tmp42_ = year;
02261                      _tmp43_ = min_year;
02262                      if (_tmp42_ < _tmp43_) {
02263                             _tmp41_ = TRUE;
02264                      } else {
02265                             gint _tmp44_;
02266                             gint _tmp45_;
02267                             _tmp44_ = year;
02268                             _tmp45_ = max_year;
02269                             _tmp41_ = _tmp44_ > _tmp45_;
02270                      }
02271                      _tmp46_ = _tmp41_;
02272                      if (_tmp46_) {
02273                             DeeModel* _tmp47_;
02274                             DeeModelIter* _tmp48_;
02275                             DeeModelIter* _tmp49_ = NULL;
02276                             _tmp47_ = model;
02277                             _tmp48_ = iter;
02278                             _tmp49_ = dee_model_next (_tmp47_, _tmp48_);
02279                             iter = _tmp49_;
02280                             continue;
02281                      }
02282                      _tmp50_ = active_genres;
02283                      if (_tmp50_ != NULL) {
02284                             GeeSet* _tmp51_;
02285                             const gchar* _tmp52_;
02286                             gboolean _tmp53_ = FALSE;
02287                             _tmp51_ = active_genres;
02288                             _tmp52_ = genre;
02289                             _tmp53_ = gee_collection_contains ((GeeCollection*) _tmp51_, _tmp52_);
02290                             if (!_tmp53_) {
02291                                    DeeModel* _tmp54_;
02292                                    DeeModelIter* _tmp55_;
02293                                    DeeModelIter* _tmp56_ = NULL;
02294                                    _tmp54_ = model;
02295                                    _tmp55_ = iter;
02296                                    _tmp56_ = dee_model_next (_tmp54_, _tmp55_);
02297                                    iter = _tmp56_;
02298                                    continue;
02299                             }
02300                      }
02301                      _tmp57_ = model;
02302                      _tmp58_ = iter;
02303                      _tmp59_ = dee_model_get_int32 (_tmp57_, _tmp58_, (guint) UNITY_MUSIC_LENS_COLUMNS_TYPE);
02304                      if (_tmp59_ == ((gint32) UNITY_MUSIC_LENS_TRACK_TYPE_SONG)) {
02305                             DeeModel* _tmp60_;
02306                             DeeModelIter* _tmp61_;
02307                             const gchar* _tmp62_ = NULL;
02308                             const gchar* album;
02309                             GeeHashSet* _tmp63_;
02310                             const gchar* _tmp64_;
02311                             gboolean _tmp65_ = FALSE;
02312                             gboolean first_track_from_album;
02313                             GeeHashSet* _tmp66_;
02314                             const gchar* _tmp67_;
02315                             gboolean _tmp68_;
02316                             category_id = (gint) UNITY_MUSIC_LENS_CATEGORY_SONGS;
02317                             result_type = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_SONG;
02318                             _tmp60_ = model;
02319                             _tmp61_ = iter;
02320                             _tmp62_ = dee_model_get_string (_tmp60_, _tmp61_, (guint) UNITY_MUSIC_LENS_COLUMNS_ALBUM);
02321                             album = _tmp62_;
02322                             _tmp63_ = albums_list_nosearch;
02323                             _tmp64_ = album;
02324                             _tmp65_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp63_, _tmp64_);
02325                             first_track_from_album = !_tmp65_;
02326                             _tmp66_ = albums_list_nosearch;
02327                             _tmp67_ = album;
02328                             gee_abstract_collection_add ((GeeAbstractCollection*) _tmp66_, _tmp67_);
02329                             _tmp68_ = first_track_from_album;
02330                             if (_tmp68_) {
02331                                    gint _tmp69_ = 0;
02332                                    gint _tmp70_;
02333                                    gint _tmp72_;
02334                                    UnityLensSearch* _tmp73_;
02335                                    DeeSerializableModel* _tmp74_;
02336                                    DeeSerializableModel* _tmp75_;
02337                                    DeeModel* _tmp76_;
02338                                    DeeModelIter* _tmp77_;
02339                                    gint _tmp78_;
02340                                    _tmp70_ = category_override;
02341                                    if (_tmp70_ >= 0) {
02342                                           gint _tmp71_;
02343                                           _tmp71_ = category_override;
02344                                           _tmp69_ = _tmp71_;
02345                                    } else {
02346                                           _tmp69_ = (gint) UNITY_MUSIC_LENS_CATEGORY_ALBUMS;
02347                                    }
02348                                    _tmp72_ = _tmp69_;
02349                                    category_id = _tmp72_;
02350                                    _tmp73_ = search;
02351                                    _tmp74_ = unity_lens_search_get_results_model (_tmp73_);
02352                                    _tmp75_ = _tmp74_;
02353                                    _tmp76_ = model;
02354                                    _tmp77_ = iter;
02355                                    _tmp78_ = category_id;
02356                                    unity_music_lens_rhythmbox_collection_add_result (self, (DeeModel*) _tmp75_, _tmp76_, _tmp77_, UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_ALBUM, (guint) _tmp78_);
02357                             }
02358                      } else {
02359                             category_id = (gint) UNITY_MUSIC_LENS_CATEGORY_RADIOS;
02360                             result_type = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_RADIO;
02361                      }
02362                      _tmp79_ = category_override;
02363                      if (_tmp79_ >= 0) {
02364                             gint _tmp80_;
02365                             _tmp80_ = category_override;
02366                             category_id = _tmp80_;
02367                      }
02368                      _tmp81_ = helper_model;
02369                      _tmp82_ = model;
02370                      _tmp83_ = iter;
02371                      _tmp84_ = result_type;
02372                      _tmp85_ = category_id;
02373                      unity_music_lens_rhythmbox_collection_add_result (self, (DeeModel*) _tmp81_, _tmp82_, _tmp83_, _tmp84_, (guint) _tmp85_);
02374                      _tmp86_ = num_results;
02375                      num_results = _tmp86_ + 1;
02376                      _tmp88_ = max_results;
02377                      if (_tmp88_ >= 0) {
02378                             gint _tmp89_;
02379                             gint _tmp90_;
02380                             _tmp89_ = num_results;
02381                             _tmp90_ = max_results;
02382                             _tmp87_ = _tmp89_ >= _tmp90_;
02383                      } else {
02384                             _tmp87_ = FALSE;
02385                      }
02386                      _tmp91_ = _tmp87_;
02387                      if (_tmp91_) {
02388                             break;
02389                      }
02390                      _tmp92_ = model;
02391                      _tmp93_ = iter;
02392                      _tmp94_ = dee_model_next (_tmp92_, _tmp93_);
02393                      iter = _tmp94_;
02394               }
02395               _g_object_unref0 (albums_list_nosearch);
02396               _g_object_unref0 (helper_model);
02397               _g_object_unref0 (active_genres);
02398               _g_object_unref0 (model);
02399               return;
02400        }
02401        _tmp95_ = g_object_new (dee_term_list_get_type (), NULL);
02402        _tmp96_ = G_IS_INITIALLY_UNOWNED (_tmp95_) ? g_object_ref_sink (_tmp95_) : _tmp95_;
02403        term_list = DEE_IS_TERM_LIST (_tmp96_) ? ((DeeTermList*) _tmp96_) : NULL;
02404        _tmp97_ = self->priv->analyzer;
02405        _tmp98_ = self->priv->ascii_filter;
02406        _tmp99_ = search;
02407        _tmp100_ = unity_lens_search_get_search_string (_tmp99_);
02408        _tmp101_ = _tmp100_;
02409        _tmp102_ = dee_icu_term_filter_apply (_tmp98_, _tmp101_);
02410        _tmp103_ = _tmp102_;
02411        _tmp104_ = term_list;
02412        dee_analyzer_tokenize (_tmp97_, _tmp103_, _tmp104_);
02413        _g_free0 (_tmp103_);
02414        _tmp105_ = g_sequence_new (NULL);
02415        matches = _tmp105_;
02416        first_pass = TRUE;
02417        {
02418               DeeTermList* _tmp106_;
02419               DeeTermList* _tmp107_;
02420               DeeTermList* _term_list;
02421               DeeTermList* _tmp108_;
02422               guint _tmp109_;
02423               guint _tmp110_;
02424               guint _term_size;
02425               gint _term_index;
02426               _tmp106_ = term_list;
02427               _tmp107_ = _g_object_ref0 (_tmp106_);
02428               _term_list = _tmp107_;
02429               _tmp108_ = _term_list;
02430               _tmp109_ = dee_term_list_num_terms (_tmp108_);
02431               _tmp110_ = _tmp109_;
02432               _term_size = _tmp110_;
02433               _term_index = -1;
02434               while (TRUE) {
02435                      gint _tmp111_;
02436                      gint _tmp112_;
02437                      guint _tmp113_;
02438                      DeeTermList* _tmp114_;
02439                      gint _tmp115_;
02440                      const gchar* _tmp116_ = NULL;
02441                      const gchar* term;
02442                      DeeIndex* _tmp117_;
02443                      const gchar* _tmp118_;
02444                      DeeResultSet* _tmp119_ = NULL;
02445                      DeeResultSet* result_set;
02446                      GCompareDataFunc cmp_func;
02447                      void* cmp_func_target;
02448                      GDestroyNotify cmp_func_target_destroy_notify;
02449                      GSequence* _tmp120_;
02450                      GSequence* remaining;
02451                      gboolean _tmp139_;
02452                      GSequence* _tmp141_;
02453                      GSequenceIter* _tmp142_ = NULL;
02454                      GSequence* _tmp143_;
02455                      GSequenceIter* _tmp144_ = NULL;
02456                      _tmp111_ = _term_index;
02457                      _term_index = _tmp111_ + 1;
02458                      _tmp112_ = _term_index;
02459                      _tmp113_ = _term_size;
02460                      if (!(((guint) _tmp112_) < _tmp113_)) {
02461                             break;
02462                      }
02463                      _tmp114_ = _term_list;
02464                      _tmp115_ = _term_index;
02465                      _tmp116_ = dee_term_list_get_term (_tmp114_, (guint) _tmp115_);
02466                      term = _tmp116_;
02467                      _tmp117_ = self->priv->index;
02468                      _tmp118_ = term;
02469                      _tmp119_ = dee_index_lookup (_tmp117_, _tmp118_, DEE_TERM_MATCH_PREFIX);
02470                      result_set = _tmp119_;
02471                      cmp_func = _____lambda8__gcompare_data_func;
02472                      cmp_func_target = g_object_ref (self);
02473                      cmp_func_target_destroy_notify = g_object_unref;
02474                      _tmp120_ = g_sequence_new (NULL);
02475                      remaining = _tmp120_;
02476                      {
02477                             DeeResultSet* _tmp121_;
02478                             DeeResultSet* _tmp122_ = NULL;
02479                             DeeResultSet* _item_it;
02480                             DeeModelIter* item = NULL;
02481                             _tmp121_ = result_set;
02482                             _tmp122_ = _vala_dee_result_set_iterator (_tmp121_);
02483                             _item_it = _tmp122_;
02484                             while (TRUE) {
02485                                    DeeResultSet* _tmp123_;
02486                                    DeeModelIter* _tmp124_ = NULL;
02487                                    DeeModelIter* _tmp125_;
02488                                    gboolean _tmp126_;
02489                                    _tmp123_ = _item_it;
02490                                    _tmp124_ = _vala_dee_result_set_next_value (_tmp123_);
02491                                    item = _tmp124_;
02492                                    _tmp125_ = item;
02493                                    if (!(_tmp125_ != NULL)) {
02494                                           break;
02495                                    }
02496                                    _tmp126_ = first_pass;
02497                                    if (_tmp126_) {
02498                                           GSequence* _tmp127_;
02499                                           DeeModelIter* _tmp128_;
02500                                           GCompareDataFunc _tmp129_;
02501                                           void* _tmp129__target;
02502                                           GSequenceIter* _tmp130_ = NULL;
02503                                           _tmp127_ = matches;
02504                                           _tmp128_ = item;
02505                                           _tmp129_ = cmp_func;
02506                                           _tmp129__target = cmp_func_target;
02507                                           _tmp130_ = g_sequence_insert_sorted (_tmp127_, _tmp128_, _tmp129_, _tmp129__target);
02508                                    } else {
02509                                           GSequence* _tmp131_;
02510                                           DeeModelIter* _tmp132_;
02511                                           GCompareDataFunc _tmp133_;
02512                                           void* _tmp133__target;
02513                                           GSequenceIter* _tmp134_ = NULL;
02514                                           _tmp131_ = matches;
02515                                           _tmp132_ = item;
02516                                           _tmp133_ = cmp_func;
02517                                           _tmp133__target = cmp_func_target;
02518                                           _tmp134_ = g_sequence_lookup (_tmp131_, _tmp132_, _tmp133_, _tmp133__target);
02519                                           if (_tmp134_ != NULL) {
02520                                                  GSequence* _tmp135_;
02521                                                  DeeModelIter* _tmp136_;
02522                                                  GCompareDataFunc _tmp137_;
02523                                                  void* _tmp137__target;
02524                                                  GSequenceIter* _tmp138_ = NULL;
02525                                                  _tmp135_ = remaining;
02526                                                  _tmp136_ = item;
02527                                                  _tmp137_ = cmp_func;
02528                                                  _tmp137__target = cmp_func_target;
02529                                                  _tmp138_ = g_sequence_insert_sorted (_tmp135_, _tmp136_, _tmp137_, _tmp137__target);
02530                                           }
02531                                    }
02532                             }
02533                             _g_object_unref0 (_item_it);
02534                      }
02535                      _tmp139_ = first_pass;
02536                      if (!_tmp139_) {
02537                             GSequence* _tmp140_;
02538                             _tmp140_ = remaining;
02539                             remaining = NULL;
02540                             _g_sequence_free0 (matches);
02541                             matches = _tmp140_;
02542                      }
02543                      _tmp141_ = matches;
02544                      _tmp142_ = g_sequence_get_begin_iter (_tmp141_);
02545                      _tmp143_ = matches;
02546                      _tmp144_ = g_sequence_get_end_iter (_tmp143_);
02547                      if (_tmp142_ == _tmp144_) {
02548                             _g_sequence_free0 (remaining);
02549                             (cmp_func_target_destroy_notify == NULL) ? NULL : (cmp_func_target_destroy_notify (cmp_func_target), NULL);
02550                             cmp_func = NULL;
02551                             cmp_func_target = NULL;
02552                             cmp_func_target_destroy_notify = NULL;
02553                             _g_object_unref0 (result_set);
02554                             break;
02555                      }
02556                      first_pass = FALSE;
02557                      _g_sequence_free0 (remaining);
02558                      (cmp_func_target_destroy_notify == NULL) ? NULL : (cmp_func_target_destroy_notify (cmp_func_target), NULL);
02559                      cmp_func = NULL;
02560                      cmp_func_target = NULL;
02561                      cmp_func_target_destroy_notify = NULL;
02562                      _g_object_unref0 (result_set);
02563               }
02564               _g_object_unref0 (_term_list);
02565        }
02566        _tmp145_ = matches;
02567        _tmp146_ = g_sequence_get_begin_iter (_tmp145_);
02568        seq_iter = _tmp146_;
02569        _tmp147_ = matches;
02570        _tmp148_ = g_sequence_get_end_iter (_tmp147_);
02571        seq_end_iter = _tmp148_;
02572        _tmp149_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
02573        albums_list = _tmp149_;
02574        while (TRUE) {
02575               GSequenceIter* _tmp150_;
02576               GSequenceIter* _tmp151_;
02577               GSequenceIter* _tmp152_;
02578               gconstpointer _tmp153_ = NULL;
02579               DeeModelIter* model_iter;
02580               DeeModel* _tmp154_;
02581               DeeModelIter* _tmp155_;
02582               gint32 _tmp156_ = 0;
02583               gint year;
02584               DeeModel* _tmp157_;
02585               DeeModelIter* _tmp158_;
02586               const gchar* _tmp159_ = NULL;
02587               gchar* _tmp160_;
02588               gchar* genre;
02589               gboolean _tmp161_ = FALSE;
02590               gint _tmp162_;
02591               gint _tmp163_;
02592               gboolean _tmp166_;
02593               GeeSet* _tmp169_;
02594               DeeModel* _tmp176_;
02595               DeeModelIter* _tmp177_;
02596               gint32 _tmp178_ = 0;
02597               gint _tmp198_;
02598               DeeSerializableModel* _tmp200_;
02599               DeeModel* _tmp201_;
02600               DeeModelIter* _tmp202_;
02601               UnityMusicLensRhythmboxCollectionResultType _tmp203_;
02602               gint _tmp204_;
02603               gint _tmp205_;
02604               gboolean _tmp206_ = FALSE;
02605               gint _tmp207_;
02606               gboolean _tmp210_;
02607               GSequenceIter* _tmp211_;
02608               GSequenceIter* _tmp212_ = NULL;
02609               _tmp150_ = seq_iter;
02610               _tmp151_ = seq_end_iter;
02611               if (!(_tmp150_ != _tmp151_)) {
02612                      break;
02613               }
02614               _tmp152_ = seq_iter;
02615               _tmp153_ = g_sequence_get (_tmp152_);
02616               model_iter = (DeeModelIter*) _tmp153_;
02617               _tmp154_ = model;
02618               _tmp155_ = model_iter;
02619               _tmp156_ = dee_model_get_int32 (_tmp154_, _tmp155_, (guint) UNITY_MUSIC_LENS_COLUMNS_YEAR);
02620               year = (gint) _tmp156_;
02621               _tmp157_ = model;
02622               _tmp158_ = model_iter;
02623               _tmp159_ = dee_model_get_string (_tmp157_, _tmp158_, (guint) UNITY_MUSIC_LENS_COLUMNS_GENRE);
02624               _tmp160_ = g_strdup (_tmp159_);
02625               genre = _tmp160_;
02626               _tmp162_ = year;
02627               _tmp163_ = min_year;
02628               if (_tmp162_ < _tmp163_) {
02629                      _tmp161_ = TRUE;
02630               } else {
02631                      gint _tmp164_;
02632                      gint _tmp165_;
02633                      _tmp164_ = year;
02634                      _tmp165_ = max_year;
02635                      _tmp161_ = _tmp164_ > _tmp165_;
02636               }
02637               _tmp166_ = _tmp161_;
02638               if (_tmp166_) {
02639                      GSequenceIter* _tmp167_;
02640                      GSequenceIter* _tmp168_ = NULL;
02641                      _tmp167_ = seq_iter;
02642                      _tmp168_ = g_sequence_iter_next (_tmp167_);
02643                      seq_iter = _tmp168_;
02644                      _g_free0 (genre);
02645                      continue;
02646               }
02647               _tmp169_ = active_genres;
02648               if (_tmp169_ != NULL) {
02649                      GeeSet* _tmp170_;
02650                      const gchar* _tmp171_;
02651                      gboolean _tmp172_ = FALSE;
02652                      gboolean genre_match;
02653                      gboolean _tmp173_;
02654                      _tmp170_ = active_genres;
02655                      _tmp171_ = genre;
02656                      _tmp172_ = gee_collection_contains ((GeeCollection*) _tmp170_, _tmp171_);
02657                      genre_match = _tmp172_;
02658                      _tmp173_ = genre_match;
02659                      if (!_tmp173_) {
02660                             GSequenceIter* _tmp174_;
02661                             GSequenceIter* _tmp175_ = NULL;
02662                             _tmp174_ = seq_iter;
02663                             _tmp175_ = g_sequence_iter_next (_tmp174_);
02664                             seq_iter = _tmp175_;
02665                             _g_free0 (genre);
02666                             continue;
02667                      }
02668               }
02669               _tmp176_ = model;
02670               _tmp177_ = model_iter;
02671               _tmp178_ = dee_model_get_int32 (_tmp176_, _tmp177_, (guint) UNITY_MUSIC_LENS_COLUMNS_TYPE);
02672               if (_tmp178_ == ((gint32) UNITY_MUSIC_LENS_TRACK_TYPE_SONG)) {
02673                      DeeModel* _tmp179_;
02674                      DeeModelIter* _tmp180_;
02675                      const gchar* _tmp181_ = NULL;
02676                      const gchar* album;
02677                      GeeHashSet* _tmp182_;
02678                      const gchar* _tmp183_;
02679                      gboolean _tmp184_ = FALSE;
02680                      gboolean first_track_from_album;
02681                      GeeHashSet* _tmp185_;
02682                      const gchar* _tmp186_;
02683                      gboolean _tmp187_;
02684                      category_id = (gint) UNITY_MUSIC_LENS_CATEGORY_SONGS;
02685                      result_type = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_SONG;
02686                      _tmp179_ = model;
02687                      _tmp180_ = model_iter;
02688                      _tmp181_ = dee_model_get_string (_tmp179_, _tmp180_, (guint) UNITY_MUSIC_LENS_COLUMNS_ALBUM);
02689                      album = _tmp181_;
02690                      _tmp182_ = albums_list;
02691                      _tmp183_ = album;
02692                      _tmp184_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp182_, _tmp183_);
02693                      first_track_from_album = !_tmp184_;
02694                      _tmp185_ = albums_list;
02695                      _tmp186_ = album;
02696                      gee_abstract_collection_add ((GeeAbstractCollection*) _tmp185_, _tmp186_);
02697                      _tmp187_ = first_track_from_album;
02698                      if (_tmp187_) {
02699                             gint _tmp188_ = 0;
02700                             gint _tmp189_;
02701                             gint _tmp191_;
02702                             UnityLensSearch* _tmp192_;
02703                             DeeSerializableModel* _tmp193_;
02704                             DeeSerializableModel* _tmp194_;
02705                             DeeModel* _tmp195_;
02706                             DeeModelIter* _tmp196_;
02707                             gint _tmp197_;
02708                             _tmp189_ = category_override;
02709                             if (_tmp189_ >= 0) {
02710                                    gint _tmp190_;
02711                                    _tmp190_ = category_override;
02712                                    _tmp188_ = _tmp190_;
02713                             } else {
02714                                    _tmp188_ = (gint) UNITY_MUSIC_LENS_CATEGORY_ALBUMS;
02715                             }
02716                             _tmp191_ = _tmp188_;
02717                             category_id = _tmp191_;
02718                             _tmp192_ = search;
02719                             _tmp193_ = unity_lens_search_get_results_model (_tmp192_);
02720                             _tmp194_ = _tmp193_;
02721                             _tmp195_ = model;
02722                             _tmp196_ = model_iter;
02723                             _tmp197_ = category_id;
02724                             unity_music_lens_rhythmbox_collection_add_result (self, (DeeModel*) _tmp194_, _tmp195_, _tmp196_, UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_ALBUM, (guint) _tmp197_);
02725                      }
02726               } else {
02727                      category_id = (gint) UNITY_MUSIC_LENS_CATEGORY_RADIOS;
02728                      result_type = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_RADIO;
02729               }
02730               _tmp198_ = category_override;
02731               if (_tmp198_ >= 0) {
02732                      gint _tmp199_;
02733                      _tmp199_ = category_override;
02734                      category_id = _tmp199_;
02735               }
02736               _tmp200_ = helper_model;
02737               _tmp201_ = model;
02738               _tmp202_ = model_iter;
02739               _tmp203_ = result_type;
02740               _tmp204_ = category_id;
02741               unity_music_lens_rhythmbox_collection_add_result (self, (DeeModel*) _tmp200_, _tmp201_, _tmp202_, _tmp203_, (guint) _tmp204_);
02742               _tmp205_ = num_results;
02743               num_results = _tmp205_ + 1;
02744               _tmp207_ = max_results;
02745               if (_tmp207_ >= 0) {
02746                      gint _tmp208_;
02747                      gint _tmp209_;
02748                      _tmp208_ = num_results;
02749                      _tmp209_ = max_results;
02750                      _tmp206_ = _tmp208_ >= _tmp209_;
02751               } else {
02752                      _tmp206_ = FALSE;
02753               }
02754               _tmp210_ = _tmp206_;
02755               if (_tmp210_) {
02756                      _g_free0 (genre);
02757                      break;
02758               }
02759               _tmp211_ = seq_iter;
02760               _tmp212_ = g_sequence_iter_next (_tmp211_);
02761               seq_iter = _tmp212_;
02762               _g_free0 (genre);
02763        }
02764        _tmp213_ = helper_model;
02765        _tmp214_ = search;
02766        _tmp215_ = unity_lens_search_get_results_model (_tmp214_);
02767        _tmp216_ = _tmp215_;
02768        if (_tmp213_ == _tmp216_) {
02769               _g_object_unref0 (albums_list);
02770               _g_sequence_free0 (matches);
02771               _g_object_unref0 (term_list);
02772               _g_object_unref0 (helper_model);
02773               _g_object_unref0 (active_genres);
02774               _g_object_unref0 (model);
02775               return;
02776        }
02777        _tmp217_ = helper_model;
02778        _tmp218_ = dee_model_get_first_iter ((DeeModel*) _tmp217_);
02779        iter = _tmp218_;
02780        _tmp219_ = helper_model;
02781        _tmp220_ = dee_model_get_last_iter ((DeeModel*) _tmp219_);
02782        last = _tmp220_;
02783        while (TRUE) {
02784               DeeModelIter* _tmp221_;
02785               DeeModelIter* _tmp222_;
02786               DeeSerializableModel* _tmp223_;
02787               DeeModelIter* _tmp224_;
02788               GVariant** _tmp225_;
02789               GVariant** _tmp226_ = NULL;
02790               GVariant** row;
02791               gint row_length1;
02792               gint _row_size_;
02793               UnityLensSearch* _tmp227_;
02794               DeeSerializableModel* _tmp228_;
02795               DeeSerializableModel* _tmp229_;
02796               GVariant** _tmp230_;
02797               gint _tmp230__length1;
02798               DeeSerializableModel* _tmp231_;
02799               DeeModelIter* _tmp232_;
02800               DeeModelIter* _tmp233_ = NULL;
02801               _tmp221_ = iter;
02802               _tmp222_ = last;
02803               if (!(_tmp221_ != _tmp222_)) {
02804                      break;
02805               }
02806               _tmp223_ = helper_model;
02807               _tmp224_ = iter;
02808               _tmp226_ = _tmp225_ = dee_model_get_row ((DeeModel*) _tmp223_, _tmp224_, NULL);
02809               row = _tmp226_;
02810               row_length1 = _vala_array_length (_tmp225_);
02811               _row_size_ = row_length1;
02812               _tmp227_ = search;
02813               _tmp228_ = unity_lens_search_get_results_model (_tmp227_);
02814               _tmp229_ = _tmp228_;
02815               _tmp230_ = row;
02816               _tmp230__length1 = row_length1;
02817               dee_model_append_row ((DeeModel*) _tmp229_, _tmp230_);
02818               _tmp231_ = helper_model;
02819               _tmp232_ = iter;
02820               _tmp233_ = dee_model_next ((DeeModel*) _tmp231_, _tmp232_);
02821               iter = _tmp233_;
02822               row = (_vala_array_free (row, row_length1, (GDestroyNotify) g_variant_unref), NULL);
02823        }
02824        _g_object_unref0 (albums_list);
02825        _g_sequence_free0 (matches);
02826        _g_object_unref0 (term_list);
02827        _g_object_unref0 (helper_model);
02828        _g_object_unref0 (active_genres);
02829        _g_object_unref0 (model);
02830 }
02831 
02832 
02833 static void unity_music_lens_rhythmbox_collection_get_decade_filter (UnityMusicLensRhythmboxCollection* self, GList* filters, gint* min_year, gint* max_year) {
02834        gint _vala_min_year = 0;
02835        gint _vala_max_year = 0;
02836        UnityFilter* filter;
02837        GList* _tmp0_;
02838        gboolean _tmp7_ = FALSE;
02839        UnityFilter* _tmp8_;
02840        gboolean _tmp12_;
02841        UnityFilter* _tmp14_;
02842        UnityMultiRangeFilter* _tmp15_;
02843        UnityMultiRangeFilter* mrf;
02844        UnityMultiRangeFilter* _tmp16_;
02845        UnityFilterOption* _tmp17_ = NULL;
02846        UnityFilterOption* _tmp18_;
02847        const gchar* _tmp19_;
02848        const gchar* _tmp20_;
02849        gint _tmp21_ = 0;
02850        UnityMultiRangeFilter* _tmp22_;
02851        UnityFilterOption* _tmp23_ = NULL;
02852        UnityFilterOption* _tmp24_;
02853        const gchar* _tmp25_;
02854        const gchar* _tmp26_;
02855        gint _tmp27_ = 0;
02856        g_return_if_fail (self != NULL);
02857        filter = NULL;
02858        _tmp0_ = filters;
02859        {
02860               GList* parser_collection = NULL;
02861               GList* parser_it = NULL;
02862               parser_collection = _tmp0_;
02863               for (parser_it = parser_collection; parser_it != NULL; parser_it = parser_it->next) {
02864                      UnityMusicLensFilterParser* _tmp1_;
02865                      UnityMusicLensFilterParser* parser = NULL;
02866                      _tmp1_ = _g_object_ref0 ((UnityMusicLensFilterParser*) parser_it->data);
02867                      parser = _tmp1_;
02868                      {
02869                             UnityMusicLensFilterParser* _tmp2_;
02870                             _tmp2_ = parser;
02871                             if (UNITY_MUSIC_LENS_IS_DECADE_FILTER_PARSER (_tmp2_)) {
02872                                    UnityMusicLensFilterParser* _tmp3_;
02873                                    UnityFilter* _tmp4_;
02874                                    UnityFilter* _tmp5_;
02875                                    UnityFilter* _tmp6_;
02876                                    _tmp3_ = parser;
02877                                    _tmp4_ = unity_music_lens_filter_parser_get_filter (_tmp3_);
02878                                    _tmp5_ = _tmp4_;
02879                                    _tmp6_ = _g_object_ref0 (_tmp5_);
02880                                    _g_object_unref0 (filter);
02881                                    filter = _tmp6_;
02882                             }
02883                             _g_object_unref0 (parser);
02884                      }
02885               }
02886        }
02887        _tmp8_ = filter;
02888        if (_tmp8_ == NULL) {
02889               _tmp7_ = TRUE;
02890        } else {
02891               UnityFilter* _tmp9_;
02892               gboolean _tmp10_;
02893               gboolean _tmp11_;
02894               _tmp9_ = filter;
02895               _tmp10_ = unity_filter_get_filtering (_tmp9_);
02896               _tmp11_ = _tmp10_;
02897               _tmp7_ = !_tmp11_;
02898        }
02899        _tmp12_ = _tmp7_;
02900        if (_tmp12_) {
02901               gint _tmp13_;
02902               _vala_min_year = 0;
02903               _tmp13_ = G_MAXINT;
02904               _vala_max_year = _tmp13_;
02905               _g_object_unref0 (filter);
02906               if (min_year) {
02907                      *min_year = _vala_min_year;
02908               }
02909               if (max_year) {
02910                      *max_year = _vala_max_year;
02911               }
02912               return;
02913        }
02914        _tmp14_ = filter;
02915        _tmp15_ = _g_object_ref0 (UNITY_IS_MULTI_RANGE_FILTER (_tmp14_) ? ((UnityMultiRangeFilter*) _tmp14_) : NULL);
02916        mrf = _tmp15_;
02917        _tmp16_ = mrf;
02918        _tmp17_ = unity_multi_range_filter_get_first_active (_tmp16_);
02919        _tmp18_ = _tmp17_;
02920        _tmp19_ = unity_filter_option_get_id (_tmp18_);
02921        _tmp20_ = _tmp19_;
02922        _tmp21_ = atoi (_tmp20_);
02923        _vala_min_year = _tmp21_;
02924        _g_object_unref0 (_tmp18_);
02925        _tmp22_ = mrf;
02926        _tmp23_ = unity_multi_range_filter_get_last_active (_tmp22_);
02927        _tmp24_ = _tmp23_;
02928        _tmp25_ = unity_filter_option_get_id (_tmp24_);
02929        _tmp26_ = _tmp25_;
02930        _tmp27_ = atoi (_tmp26_);
02931        _vala_max_year = _tmp27_ + 9;
02932        _g_object_unref0 (_tmp24_);
02933        _g_object_unref0 (mrf);
02934        _g_object_unref0 (filter);
02935        if (min_year) {
02936               *min_year = _vala_min_year;
02937        }
02938        if (max_year) {
02939               *max_year = _vala_max_year;
02940        }
02941 }
02942 
02943 
02944 static GeeSet* unity_music_lens_rhythmbox_collection_get_genre_filter (UnityMusicLensRhythmboxCollection* self, GList* filters) {
02945        GeeSet* result = NULL;
02946        UnityFilter* filter;
02947        GList* _tmp0_;
02948        gboolean _tmp7_ = FALSE;
02949        UnityFilter* _tmp8_;
02950        gboolean _tmp12_;
02951        GeeHashSet* _tmp13_;
02952        GeeHashSet* active_genres;
02953        UnityFilter* _tmp14_;
02954        UnityCheckOptionFilterCompact* _tmp15_;
02955        UnityCheckOptionFilterCompact* all_genres;
02956        UnityCheckOptionFilterCompact* _tmp16_;
02957        GList* _tmp17_;
02958        g_return_val_if_fail (self != NULL, NULL);
02959        filter = NULL;
02960        _tmp0_ = filters;
02961        {
02962               GList* parser_collection = NULL;
02963               GList* parser_it = NULL;
02964               parser_collection = _tmp0_;
02965               for (parser_it = parser_collection; parser_it != NULL; parser_it = parser_it->next) {
02966                      UnityMusicLensFilterParser* _tmp1_;
02967                      UnityMusicLensFilterParser* parser = NULL;
02968                      _tmp1_ = _g_object_ref0 ((UnityMusicLensFilterParser*) parser_it->data);
02969                      parser = _tmp1_;
02970                      {
02971                             UnityMusicLensFilterParser* _tmp2_;
02972                             _tmp2_ = parser;
02973                             if (UNITY_MUSIC_LENS_IS_GENRE_FILTER_PARSER (_tmp2_)) {
02974                                    UnityMusicLensFilterParser* _tmp3_;
02975                                    UnityFilter* _tmp4_;
02976                                    UnityFilter* _tmp5_;
02977                                    UnityFilter* _tmp6_;
02978                                    _tmp3_ = parser;
02979                                    _tmp4_ = unity_music_lens_filter_parser_get_filter (_tmp3_);
02980                                    _tmp5_ = _tmp4_;
02981                                    _tmp6_ = _g_object_ref0 (_tmp5_);
02982                                    _g_object_unref0 (filter);
02983                                    filter = _tmp6_;
02984                             }
02985                             _g_object_unref0 (parser);
02986                      }
02987               }
02988        }
02989        _tmp8_ = filter;
02990        if (_tmp8_ == NULL) {
02991               _tmp7_ = TRUE;
02992        } else {
02993               UnityFilter* _tmp9_;
02994               gboolean _tmp10_;
02995               gboolean _tmp11_;
02996               _tmp9_ = filter;
02997               _tmp10_ = unity_filter_get_filtering (_tmp9_);
02998               _tmp11_ = _tmp10_;
02999               _tmp7_ = !_tmp11_;
03000        }
03001        _tmp12_ = _tmp7_;
03002        if (_tmp12_) {
03003               result = NULL;
03004               _g_object_unref0 (filter);
03005               return result;
03006        }
03007        _tmp13_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
03008        active_genres = _tmp13_;
03009        _tmp14_ = filter;
03010        _tmp15_ = _g_object_ref0 (UNITY_IS_CHECK_OPTION_FILTER_COMPACT (_tmp14_) ? ((UnityCheckOptionFilterCompact*) _tmp14_) : NULL);
03011        all_genres = _tmp15_;
03012        _tmp16_ = all_genres;
03013        _tmp17_ = ((UnityOptionsFilter*) _tmp16_)->options;
03014        {
03015               GList* option_collection = NULL;
03016               GList* option_it = NULL;
03017               option_collection = _tmp17_;
03018               for (option_it = option_collection; option_it != NULL; option_it = option_it->next) {
03019                      UnityFilterOption* _tmp18_;
03020                      UnityFilterOption* option = NULL;
03021                      _tmp18_ = _g_object_ref0 ((UnityFilterOption*) option_it->data);
03022                      option = _tmp18_;
03023                      {
03024                             gboolean _tmp19_ = FALSE;
03025                             UnityFilterOption* _tmp20_;
03026                             const gchar* _tmp21_;
03027                             const gchar* _tmp22_;
03028                             gboolean _tmp26_;
03029                             GeeHashSet* _tmp27_;
03030                             UnityFilterOption* _tmp28_;
03031                             const gchar* _tmp29_;
03032                             const gchar* _tmp30_;
03033                             _tmp20_ = option;
03034                             _tmp21_ = unity_filter_option_get_id (_tmp20_);
03035                             _tmp22_ = _tmp21_;
03036                             if (_tmp22_ == NULL) {
03037                                    _tmp19_ = TRUE;
03038                             } else {
03039                                    UnityFilterOption* _tmp23_;
03040                                    gboolean _tmp24_;
03041                                    gboolean _tmp25_;
03042                                    _tmp23_ = option;
03043                                    _tmp24_ = unity_filter_option_get_active (_tmp23_);
03044                                    _tmp25_ = _tmp24_;
03045                                    _tmp19_ = !_tmp25_;
03046                             }
03047                             _tmp26_ = _tmp19_;
03048                             if (_tmp26_) {
03049                                    _g_object_unref0 (option);
03050                                    continue;
03051                             }
03052                             _tmp27_ = active_genres;
03053                             _tmp28_ = option;
03054                             _tmp29_ = unity_filter_option_get_id (_tmp28_);
03055                             _tmp30_ = _tmp29_;
03056                             gee_abstract_collection_add ((GeeAbstractCollection*) _tmp27_, _tmp30_);
03057                             _g_object_unref0 (option);
03058                      }
03059               }
03060        }
03061        result = (GeeSet*) active_genres;
03062        _g_object_unref0 (all_genres);
03063        _g_object_unref0 (filter);
03064        return result;
03065 }
03066 
03067 
03068 UnityMusicLensRhythmboxCollection* unity_music_lens_rhythmbox_collection_construct (GType object_type) {
03069        UnityMusicLensRhythmboxCollection * self = NULL;
03070        self = (UnityMusicLensRhythmboxCollection*) g_object_new (object_type, NULL);
03071        return self;
03072 }
03073 
03074 
03075 UnityMusicLensRhythmboxCollection* unity_music_lens_rhythmbox_collection_new (void) {
03076        return unity_music_lens_rhythmbox_collection_construct (UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION);
03077 }
03078 
03079 
03080 static void _g_variant_unref0_ (gpointer var) {
03081        (var == NULL) ? NULL : (var = (g_variant_unref (var), NULL));
03082 }
03083 
03084 
03085 static void _g_free0_ (gpointer var) {
03086        var = (g_free (var), NULL);
03087 }
03088 
03089 
03090 static void _g_ptr_array_unref0_ (gpointer var) {
03091        (var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL));
03092 }
03093 
03094 
03095 static gint _unity_music_lens_rhythmbox_collection___lambda9_ (UnityMusicLensRhythmboxCollection* self, GVariant** row1, int row1_length1, GVariant** row2, int row2_length1) {
03096        gint result = 0;
03097        GVariant** _tmp0_;
03098        gint _tmp0__length1;
03099        GVariant* _tmp1_;
03100        gint32 _tmp2_ = 0;
03101        gint a;
03102        GVariant** _tmp3_;
03103        gint _tmp3__length1;
03104        GVariant* _tmp4_;
03105        gint32 _tmp5_ = 0;
03106        gint b;
03107        gint _tmp6_;
03108        gint _tmp7_;
03109        _tmp0_ = row1;
03110        _tmp0__length1 = row1_length1;
03111        _tmp1_ = _tmp0_[UNITY_MUSIC_LENS_COLUMNS_PLAY_COUNT];
03112        _tmp2_ = g_variant_get_int32 (_tmp1_);
03113        a = (gint) _tmp2_;
03114        _tmp3_ = row2;
03115        _tmp3__length1 = row2_length1;
03116        _tmp4_ = _tmp3_[UNITY_MUSIC_LENS_COLUMNS_PLAY_COUNT];
03117        _tmp5_ = g_variant_get_int32 (_tmp4_);
03118        b = (gint) _tmp5_;
03119        _tmp6_ = b;
03120        _tmp7_ = a;
03121        result = _tmp6_ - _tmp7_;
03122        return result;
03123 }
03124 
03125 
03126 static gint __unity_music_lens_rhythmbox_collection___lambda9__dee_compare_row_func (GVariant** row1, GVariant** row2, gpointer self) {
03127        gint result;
03128        result = _unity_music_lens_rhythmbox_collection___lambda9_ (self, row1, -1, row2, -1);
03129        return result;
03130 }
03131 
03132 
03133 static void _unity_music_lens_rhythmbox_collection___lambda10_ (UnityMusicLensRhythmboxCollection* self, DeeTermList* terms_in, DeeTermList* terms_out) {
03134        g_return_if_fail (terms_in != NULL);
03135        g_return_if_fail (terms_out != NULL);
03136        {
03137               DeeTermList* _tmp0_;
03138               DeeTermList* _tmp1_;
03139               DeeTermList* _term_list;
03140               DeeTermList* _tmp2_;
03141               guint _tmp3_;
03142               guint _tmp4_;
03143               guint _term_size;
03144               gint _term_index;
03145               _tmp0_ = terms_in;
03146               _tmp1_ = _g_object_ref0 (_tmp0_);
03147               _term_list = _tmp1_;
03148               _tmp2_ = _term_list;
03149               _tmp3_ = dee_term_list_num_terms (_tmp2_);
03150               _tmp4_ = _tmp3_;
03151               _term_size = _tmp4_;
03152               _term_index = -1;
03153               while (TRUE) {
03154                      gint _tmp5_;
03155                      gint _tmp6_;
03156                      guint _tmp7_;
03157                      DeeTermList* _tmp8_;
03158                      gint _tmp9_;
03159                      const gchar* _tmp10_ = NULL;
03160                      const gchar* term;
03161                      DeeICUTermFilter* _tmp11_;
03162                      const gchar* _tmp12_;
03163                      gchar* _tmp13_ = NULL;
03164                      gchar* folded;
03165                      DeeTermList* _tmp14_;
03166                      const gchar* _tmp15_;
03167                      const gchar* _tmp16_;
03168                      const gchar* _tmp17_;
03169                      _tmp5_ = _term_index;
03170                      _term_index = _tmp5_ + 1;
03171                      _tmp6_ = _term_index;
03172                      _tmp7_ = _term_size;
03173                      if (!(((guint) _tmp6_) < _tmp7_)) {
03174                             break;
03175                      }
03176                      _tmp8_ = _term_list;
03177                      _tmp9_ = _term_index;
03178                      _tmp10_ = dee_term_list_get_term (_tmp8_, (guint) _tmp9_);
03179                      term = _tmp10_;
03180                      _tmp11_ = self->priv->ascii_filter;
03181                      _tmp12_ = term;
03182                      _tmp13_ = dee_icu_term_filter_apply (_tmp11_, _tmp12_);
03183                      folded = _tmp13_;
03184                      _tmp14_ = terms_out;
03185                      _tmp15_ = term;
03186                      dee_term_list_add_term (_tmp14_, _tmp15_);
03187                      _tmp16_ = folded;
03188                      _tmp17_ = term;
03189                      if (g_strcmp0 (_tmp16_, _tmp17_) != 0) {
03190                             DeeTermList* _tmp18_;
03191                             const gchar* _tmp19_;
03192                             _tmp18_ = terms_out;
03193                             _tmp19_ = folded;
03194                             dee_term_list_add_term (_tmp18_, _tmp19_);
03195                      }
03196                      _g_free0 (folded);
03197               }
03198               _g_object_unref0 (_term_list);
03199        }
03200 }
03201 
03202 
03203 static void __unity_music_lens_rhythmbox_collection___lambda10__dee_term_filter_func (DeeTermList* terms_in, DeeTermList* terms_out, gpointer self) {
03204        _unity_music_lens_rhythmbox_collection___lambda10_ (self, terms_in, terms_out);
03205 }
03206 
03207 
03208 static GObject * unity_music_lens_rhythmbox_collection_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
03209        GObject * obj;
03210        GObjectClass * parent_class;
03211        UnityMusicLensRhythmboxCollection * self;
03212        const gchar* _tmp0_ = NULL;
03213        gchar* _tmp1_ = NULL;
03214        GHashFunc _tmp2_;
03215        GEqualFunc _tmp3_;
03216        GHashTable* _tmp4_;
03217        GHashFunc _tmp5_;
03218        GEqualFunc _tmp6_;
03219        GHashTable* _tmp7_;
03220        DeeSequenceModel* _tmp8_;
03221        DeeSequenceModel* _tmp9_;
03222        DeeSequenceModel* _tmp10_;
03223        guint _tmp11_;
03224        gchar** _tmp12_ = NULL;
03225        DeeSequenceModel* _tmp13_;
03226        DeeModelTag* _tmp14_;
03227        GHashFunc _tmp15_;
03228        GEqualFunc _tmp16_;
03229        GHashTable* _tmp17_;
03230        DeeFilter _tmp18_ = {0};
03231        DeeFilter filter;
03232        DeeSequenceModel* _tmp19_;
03233        DeeFilter _tmp20_;
03234        DeeFilterModel* _tmp21_;
03235        DeeICUTermFilter* _tmp22_;
03236        DeeTextAnalyzer* _tmp23_;
03237        DeeAnalyzer* _tmp24_;
03238        parent_class = G_OBJECT_CLASS (unity_music_lens_rhythmbox_collection_parent_class);
03239        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
03240        self = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION (obj);
03241        G_STATIC_ASSERT (12 == ((gint) UNITY_MUSIC_LENS_COLUMNS_N_COLUMNS));
03242        _tmp0_ = g_get_user_cache_dir ();
03243        _tmp1_ = g_build_filename (_tmp0_, "media-art", NULL);
03244        _g_free0 (self->priv->media_art_dir);
03245        self->priv->media_art_dir = _tmp1_;
03246        _tmp2_ = g_str_hash;
03247        _tmp3_ = g_str_equal;
03248        _tmp4_ = g_hash_table_new_full (_tmp2_, _tmp3_, NULL, _g_variant_unref0_);
03249        _g_hash_table_unref0 (self->priv->variant_store);
03250        self->priv->variant_store = _tmp4_;
03251        _tmp5_ = g_direct_hash;
03252        _tmp6_ = g_direct_equal;
03253        _tmp7_ = g_hash_table_new_full (_tmp5_, _tmp6_, NULL, _g_variant_unref0_);
03254        _g_hash_table_unref0 (self->priv->int_variant_store);
03255        self->priv->int_variant_store = _tmp7_;
03256        _tmp8_ = (DeeSequenceModel*) dee_sequence_model_new ();
03257        _g_object_unref0 (self->priv->all_tracks);
03258        self->priv->all_tracks = _tmp8_;
03259        _tmp9_ = self->priv->all_tracks;
03260        dee_model_set_schema ((DeeModel*) _tmp9_, "i", "s", "s", "s", "s", "s", "s", "s", "s", "i", "i", "i", NULL);
03261        _tmp10_ = self->priv->all_tracks;
03262        _tmp12_ = dee_model_get_schema ((DeeModel*) _tmp10_, &_tmp11_);
03263        g_assert (_tmp11_ == ((gint) UNITY_MUSIC_LENS_COLUMNS_N_COLUMNS));
03264        _tmp13_ = self->priv->all_tracks;
03265        _tmp14_ = dee_model_register_tag ((DeeModel*) _tmp13_, NULL);
03266        self->priv->album_art_tag = _tmp14_;
03267        _tmp15_ = g_str_hash;
03268        _tmp16_ = g_str_equal;
03269        _tmp17_ = g_hash_table_new_full (_tmp15_, _tmp16_, _g_free0_, _g_ptr_array_unref0_);
03270        _g_hash_table_unref0 (self->priv->album_to_tracks_map);
03271        self->priv->album_to_tracks_map = _tmp17_;
03272        dee_filter_new_sort (__unity_music_lens_rhythmbox_collection___lambda9__dee_compare_row_func, g_object_ref (self), g_object_unref, &_tmp18_);
03273        filter = _tmp18_;
03274        _tmp19_ = self->priv->all_tracks;
03275        _tmp20_ = filter;
03276        _tmp21_ = (DeeFilterModel*) dee_filter_model_new ((DeeModel*) _tmp19_, &_tmp20_);
03277        _g_object_unref0 (self->priv->tracks_by_play_count);
03278        self->priv->tracks_by_play_count = _tmp21_;
03279        _tmp22_ = dee_icu_term_filter_new_ascii_folder ();
03280        _dee_icu_term_filter_destroy0 (self->priv->ascii_filter);
03281        self->priv->ascii_filter = _tmp22_;
03282        _tmp23_ = dee_text_analyzer_new ();
03283        _g_object_unref0 (self->priv->analyzer);
03284        self->priv->analyzer = (DeeAnalyzer*) _tmp23_;
03285        _tmp24_ = self->priv->analyzer;
03286        dee_analyzer_add_term_filter (_tmp24_, __unity_music_lens_rhythmbox_collection___lambda10__dee_term_filter_func, g_object_ref (self), g_object_unref);
03287        unity_music_lens_rhythmbox_collection_initialize_index (self);
03288        return obj;
03289 }
03290 
03291 
03292 static void _unity_music_lens_rhythmbox_collection_xml_parser_start_tag_gmarkup_parser_start_element_func (GMarkupParseContext* context, const gchar* element_name, gchar** attribute_names, gchar** attribute_values, gpointer self, GError** error) {
03293        unity_music_lens_rhythmbox_collection_xml_parser_start_tag (self, context, element_name, attribute_names, attribute_values, error);
03294 }
03295 
03296 
03297 static void _unity_music_lens_rhythmbox_collection_xml_parser_end_tag_gmarkup_parser_end_element_func (GMarkupParseContext* context, const gchar* element_name, gpointer self, GError** error) {
03298        unity_music_lens_rhythmbox_collection_xml_parser_end_tag (self, context, element_name, error);
03299 }
03300 
03301 
03302 static void _unity_music_lens_rhythmbox_collection_xml_parser_process_text_gmarkup_parser_text_func (GMarkupParseContext* context, const gchar* text, gsize text_len, gpointer self, GError** error) {
03303        unity_music_lens_rhythmbox_collection_xml_parser_process_text (self, context, text, text_len, error);
03304 }
03305 
03306 
03307 gboolean unity_music_lens_rhythmbox_collection_xml_parser_parse (UnityMusicLensRhythmboxCollectionXmlParser* self, const gchar* content, gsize len, GError** error) {
03308        gboolean result = FALSE;
03309        GMarkupParseContext* _tmp0_;
03310        const gchar* _tmp1_;
03311        gsize _tmp2_;
03312        gboolean _tmp3_ = FALSE;
03313        gboolean _tmp4_;
03314        GError * _inner_error_ = NULL;
03315        g_return_val_if_fail (self != NULL, FALSE);
03316        g_return_val_if_fail (content != NULL, FALSE);
03317        _tmp0_ = self->priv->context;
03318        _tmp1_ = content;
03319        _tmp2_ = len;
03320        _tmp3_ = g_markup_parse_context_parse (_tmp0_, _tmp1_, (gssize) _tmp2_, &_inner_error_);
03321        _tmp4_ = _tmp3_;
03322        if (_inner_error_ != NULL) {
03323               if (_inner_error_->domain == G_MARKUP_ERROR) {
03324                      g_propagate_error (error, _inner_error_);
03325                      return FALSE;
03326               } else {
03327                      g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
03328                      g_clear_error (&_inner_error_);
03329                      return FALSE;
03330               }
03331        }
03332        result = _tmp4_;
03333        return result;
03334 }
03335 
03336 
03337 static void unity_music_lens_rhythmbox_collection_xml_parser_start_tag (UnityMusicLensRhythmboxCollectionXmlParser* self, GMarkupParseContext* context, const gchar* name, gchar** attr_names, gchar** attr_values, GError** error) {
03338        gboolean _tmp0_;
03339        g_return_if_fail (self != NULL);
03340        g_return_if_fail (context != NULL);
03341        g_return_if_fail (name != NULL);
03342        _tmp0_ = self->priv->processing_track;
03343        if (!_tmp0_) {
03344               const gchar* _tmp1_;
03345               const gchar* _tmp2_;
03346               GQuark _tmp4_ = 0U;
03347               static GQuark _tmp3_label0 = 0;
03348               static GQuark _tmp3_label1 = 0;
03349               _tmp1_ = name;
03350               _tmp2_ = _tmp1_;
03351               _tmp4_ = (NULL == _tmp2_) ? 0 : g_quark_from_string (_tmp2_);
03352               if (_tmp4_ == ((0 != _tmp3_label0) ? _tmp3_label0 : (_tmp3_label0 = g_quark_from_static_string ("rhythmdb")))) {
03353                      switch (0) {
03354                             default:
03355                             {
03356                                    self->priv->is_rhythmdb_xml = TRUE;
03357                                    break;
03358                             }
03359                      }
03360               } else if (_tmp4_ == ((0 != _tmp3_label1) ? _tmp3_label1 : (_tmp3_label1 = g_quark_from_static_string ("entry")))) {
03361                      switch (0) {
03362                             default:
03363                             {
03364                                    gchar* accepted_element_name;
03365                                    const gchar* _tmp28_;
03366                                    UnityMusicLensTrack* _tmp29_;
03367                                    UnityMusicLensTrackType _tmp30_ = 0;
03368                                    const gchar* _tmp31_;
03369                                    UnityMusicLensTrack* _tmp32_;
03370                                    UnityMusicLensTrackType _tmp33_;
03371                                    accepted_element_name = NULL;
03372                                    {
03373                                           gint i;
03374                                           i = 0;
03375                                           {
03376                                                  gboolean _tmp5_;
03377                                                  _tmp5_ = TRUE;
03378                                                  while (TRUE) {
03379                                                         gboolean _tmp6_;
03380                                                         gchar** _tmp8_;
03381                                                         gint _tmp8__length1;
03382                                                         gint _tmp9_;
03383                                                         const gchar* _tmp10_;
03384                                                         gboolean _tmp11_ = FALSE;
03385                                                         gchar** _tmp12_;
03386                                                         gint _tmp12__length1;
03387                                                         gint _tmp13_;
03388                                                         const gchar* _tmp14_;
03389                                                         gboolean _tmp23_;
03390                                                         _tmp6_ = _tmp5_;
03391                                                         if (!_tmp6_) {
03392                                                                gint _tmp7_;
03393                                                                _tmp7_ = i;
03394                                                                i = _tmp7_ + 1;
03395                                                         }
03396                                                         _tmp5_ = FALSE;
03397                                                         _tmp8_ = attr_names;
03398                                                         _tmp8__length1 = _vala_array_length (attr_names);
03399                                                         _tmp9_ = i;
03400                                                         _tmp10_ = _tmp8_[_tmp9_];
03401                                                         if (!(_tmp10_ != NULL)) {
03402                                                                break;
03403                                                         }
03404                                                         _tmp12_ = attr_names;
03405                                                         _tmp12__length1 = _vala_array_length (attr_names);
03406                                                         _tmp13_ = i;
03407                                                         _tmp14_ = _tmp12_[_tmp13_];
03408                                                         if (g_strcmp0 (_tmp14_, "type") == 0) {
03409                                                                gboolean _tmp15_ = FALSE;
03410                                                                gchar** _tmp16_;
03411                                                                gint _tmp16__length1;
03412                                                                gint _tmp17_;
03413                                                                const gchar* _tmp18_;
03414                                                                gboolean _tmp22_;
03415                                                                _tmp16_ = attr_values;
03416                                                                _tmp16__length1 = _vala_array_length (attr_values);
03417                                                                _tmp17_ = i;
03418                                                                _tmp18_ = _tmp16_[_tmp17_];
03419                                                                if (g_strcmp0 (_tmp18_, "song") == 0) {
03420                                                                       _tmp15_ = TRUE;
03421                                                                } else {
03422                                                                       gchar** _tmp19_;
03423                                                                       gint _tmp19__length1;
03424                                                                       gint _tmp20_;
03425                                                                       const gchar* _tmp21_;
03426                                                                       _tmp19_ = attr_values;
03427                                                                       _tmp19__length1 = _vala_array_length (attr_values);
03428                                                                       _tmp20_ = i;
03429                                                                       _tmp21_ = _tmp19_[_tmp20_];
03430                                                                       _tmp15_ = g_strcmp0 (_tmp21_, "iradio") == 0;
03431                                                                }
03432                                                                _tmp22_ = _tmp15_;
03433                                                                _tmp11_ = _tmp22_;
03434                                                         } else {
03435                                                                _tmp11_ = FALSE;
03436                                                         }
03437                                                         _tmp23_ = _tmp11_;
03438                                                         if (_tmp23_) {
03439                                                                gchar** _tmp24_;
03440                                                                gint _tmp24__length1;
03441                                                                gint _tmp25_;
03442                                                                const gchar* _tmp26_;
03443                                                                gchar* _tmp27_;
03444                                                                _tmp24_ = attr_values;
03445                                                                _tmp24__length1 = _vala_array_length (attr_values);
03446                                                                _tmp25_ = i;
03447                                                                _tmp26_ = _tmp24_[_tmp25_];
03448                                                                _tmp27_ = g_strdup (_tmp26_);
03449                                                                _g_free0 (accepted_element_name);
03450                                                                accepted_element_name = _tmp27_;
03451                                                         }
03452                                                  }
03453                                           }
03454                                    }
03455                                    _tmp28_ = accepted_element_name;
03456                                    if (_tmp28_ == NULL) {
03457                                           _g_free0 (accepted_element_name);
03458                                           return;
03459                                    }
03460                                    self->priv->processing_track = TRUE;
03461                                    _tmp29_ = unity_music_lens_track_new ();
03462                                    _g_object_unref0 (self->priv->current_track);
03463                                    self->priv->current_track = _tmp29_;
03464                                    _tmp31_ = accepted_element_name;
03465                                    if (g_strcmp0 (_tmp31_, "song") == 0) {
03466                                           _tmp30_ = UNITY_MUSIC_LENS_TRACK_TYPE_SONG;
03467                                    } else {
03468                                           _tmp30_ = UNITY_MUSIC_LENS_TRACK_TYPE_RADIO;
03469                                    }
03470                                    _tmp32_ = self->priv->current_track;
03471                                    _tmp33_ = _tmp30_;
03472                                    unity_music_lens_track_set_type_track (_tmp32_, _tmp33_);
03473                                    _g_free0 (accepted_element_name);
03474                                    break;
03475                             }
03476                      }
03477               }
03478        } else {
03479               const gchar* _tmp34_;
03480               const gchar* _tmp35_;
03481               GQuark _tmp37_ = 0U;
03482               static GQuark _tmp36_label0 = 0;
03483               static GQuark _tmp36_label1 = 0;
03484               static GQuark _tmp36_label2 = 0;
03485               static GQuark _tmp36_label3 = 0;
03486               static GQuark _tmp36_label4 = 0;
03487               static GQuark _tmp36_label5 = 0;
03488               static GQuark _tmp36_label6 = 0;
03489               static GQuark _tmp36_label7 = 0;
03490               static GQuark _tmp36_label8 = 0;
03491               static GQuark _tmp36_label9 = 0;
03492               _tmp34_ = name;
03493               _tmp35_ = _tmp34_;
03494               _tmp37_ = (NULL == _tmp35_) ? 0 : g_quark_from_string (_tmp35_);
03495               if (_tmp37_ == ((0 != _tmp36_label0) ? _tmp36_label0 : (_tmp36_label0 = g_quark_from_static_string ("location")))) {
03496                      switch (0) {
03497                             default:
03498                             {
03499                                    self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_URI;
03500                                    break;
03501                             }
03502                      }
03503               } else if (_tmp37_ == ((0 != _tmp36_label1) ? _tmp36_label1 : (_tmp36_label1 = g_quark_from_static_string ("title")))) {
03504                      switch (0) {
03505                             default:
03506                             {
03507                                    self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_TITLE;
03508                                    break;
03509                             }
03510                      }
03511               } else if (_tmp37_ == ((0 != _tmp36_label2) ? _tmp36_label2 : (_tmp36_label2 = g_quark_from_static_string ("artist")))) {
03512                      switch (0) {
03513                             default:
03514                             {
03515                                    self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_ARTIST;
03516                                    break;
03517                             }
03518                      }
03519               } else if (_tmp37_ == ((0 != _tmp36_label3) ? _tmp36_label3 : (_tmp36_label3 = g_quark_from_static_string ("album")))) {
03520                      switch (0) {
03521                             default:
03522                             {
03523                                    self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_ALBUM;
03524                                    break;
03525                             }
03526                      }
03527               } else if (_tmp37_ == ((0 != _tmp36_label4) ? _tmp36_label4 : (_tmp36_label4 = g_quark_from_static_string ("genre")))) {
03528                      switch (0) {
03529                             default:
03530                             {
03531                                    self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_GENRE;
03532                                    break;
03533                             }
03534                      }
03535               } else if (_tmp37_ == ((0 != _tmp36_label5) ? _tmp36_label5 : (_tmp36_label5 = g_quark_from_static_string ("track-number")))) {
03536                      switch (0) {
03537                             default:
03538                             {
03539                                    self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_TRACK_NUMBER;
03540                                    break;
03541                             }
03542                      }
03543               } else if (_tmp37_ == ((0 != _tmp36_label6) ? _tmp36_label6 : (_tmp36_label6 = g_quark_from_static_string ("play-count")))) {
03544                      switch (0) {
03545                             default:
03546                             {
03547                                    self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_PLAY_COUNT;
03548                                    break;
03549                             }
03550                      }
03551               } else if (_tmp37_ == ((0 != _tmp36_label7) ? _tmp36_label7 : (_tmp36_label7 = g_quark_from_static_string ("date")))) {
03552                      switch (0) {
03553                             default:
03554                             {
03555                                    self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_YEAR;
03556                                    break;
03557                             }
03558                      }
03559               } else if (_tmp37_ == ((0 != _tmp36_label8) ? _tmp36_label8 : (_tmp36_label8 = g_quark_from_static_string ("media-type")))) {
03560                      switch (0) {
03561                             default:
03562                             {
03563                                    self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_MIMETYPE;
03564                                    break;
03565                             }
03566                      }
03567               } else if (_tmp37_ == ((0 != _tmp36_label9) ? _tmp36_label9 : (_tmp36_label9 = g_quark_from_static_string ("album-artist")))) {
03568                      switch (0) {
03569                             default:
03570                             {
03571                                    self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_ALBUM_ARTIST;
03572                                    break;
03573                             }
03574                      }
03575               } else {
03576                      switch (0) {
03577                             default:
03578                             {
03579                                    self->priv->current_data = -1;
03580                                    break;
03581                             }
03582                      }
03583               }
03584        }
03585 }
03586 
03587 
03588 static void unity_music_lens_rhythmbox_collection_xml_parser_end_tag (UnityMusicLensRhythmboxCollectionXmlParser* self, GMarkupParseContext* content, const gchar* name, GError** error) {
03589        const gchar* _tmp0_;
03590        const gchar* _tmp1_;
03591        GQuark _tmp3_ = 0U;
03592        static GQuark _tmp2_label0 = 0;
03593        static GQuark _tmp2_label1 = 0;
03594        static GQuark _tmp2_label2 = 0;
03595        static GQuark _tmp2_label3 = 0;
03596        static GQuark _tmp2_label4 = 0;
03597        static GQuark _tmp2_label5 = 0;
03598        static GQuark _tmp2_label6 = 0;
03599        static GQuark _tmp2_label7 = 0;
03600        static GQuark _tmp2_label8 = 0;
03601        static GQuark _tmp2_label9 = 0;
03602        static GQuark _tmp2_label10 = 0;
03603        static GQuark _tmp2_label11 = 0;
03604        g_return_if_fail (self != NULL);
03605        g_return_if_fail (content != NULL);
03606        g_return_if_fail (name != NULL);
03607        _tmp0_ = name;
03608        _tmp1_ = _tmp0_;
03609        _tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
03610        if ((((((((((_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("location")))) || (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("title"))))) || (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("artist"))))) || (_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("album"))))) || (_tmp3_ == ((0 != _tmp2_label4) ? _tmp2_label4 : (_tmp2_label4 = g_quark_from_static_string ("genre"))))) || (_tmp3_ == ((0 != _tmp2_label5) ? _tmp2_label5 : (_tmp2_label5 = g_quark_from_static_string ("track-number"))))) || (_tmp3_ == ((0 != _tmp2_label6) ? _tmp2_label6 : (_tmp2_label6 = g_quark_from_static_string ("play-count"))))) || (_tmp3_ == ((0 != _tmp2_label7) ? _tmp2_label7 : (_tmp2_label7 = g_quark_from_static_string ("date"))))) || (_tmp3_ == ((0 != _tmp2_label8) ? _tmp2_label8 : (_tmp2_label8 = g_quark_from_static_string ("media-type"))))) || (_tmp3_ == ((0 != _tmp2_label9) ? _tmp2_label9 : (_tmp2_label9 = g_quark_from_static_string ("album-artist"))))) {
03611               switch (0) {
03612                      default:
03613                      {
03614                             gint _tmp4_;
03615                             _tmp4_ = self->priv->current_data;
03616                             if (_tmp4_ >= 0) {
03617                                    self->priv->current_data = -1;
03618                             }
03619                             break;
03620                      }
03621               }
03622        } else if (_tmp3_ == ((0 != _tmp2_label10) ? _tmp2_label10 : (_tmp2_label10 = g_quark_from_static_string ("hidden")))) {
03623               switch (0) {
03624                      default:
03625                      {
03626                             gboolean _tmp5_;
03627                             _tmp5_ = self->priv->processing_track;
03628                             if (_tmp5_) {
03629                                    self->priv->processing_track = FALSE;
03630                             }
03631                             break;
03632                      }
03633               }
03634        } else if (_tmp3_ == ((0 != _tmp2_label11) ? _tmp2_label11 : (_tmp2_label11 = g_quark_from_static_string ("entry")))) {
03635               switch (0) {
03636                      default:
03637                      {
03638                             gboolean _tmp6_ = FALSE;
03639                             gboolean _tmp7_;
03640                             gboolean _tmp9_;
03641                             _tmp7_ = self->priv->processing_track;
03642                             if (_tmp7_) {
03643                                    UnityMusicLensTrack* _tmp8_;
03644                                    _tmp8_ = self->priv->current_track;
03645                                    _tmp6_ = _tmp8_ != NULL;
03646                             } else {
03647                                    _tmp6_ = FALSE;
03648                             }
03649                             _tmp9_ = _tmp6_;
03650                             if (_tmp9_) {
03651                                    UnityMusicLensTrack* _tmp10_;
03652                                    _tmp10_ = self->priv->current_track;
03653                                    g_signal_emit_by_name (self, "track-info-ready", _tmp10_);
03654                             }
03655                             self->priv->processing_track = FALSE;
03656                             break;
03657                      }
03658               }
03659        }
03660 }
03661 
03662 
03663 static void unity_music_lens_rhythmbox_collection_xml_parser_process_text (UnityMusicLensRhythmboxCollectionXmlParser* self, GMarkupParseContext* context, const gchar* text, gsize text_len, GError** error) {
03664        gboolean _tmp0_ = FALSE;
03665        gboolean _tmp1_;
03666        gboolean _tmp3_;
03667        gint _tmp4_;
03668        g_return_if_fail (self != NULL);
03669        g_return_if_fail (context != NULL);
03670        g_return_if_fail (text != NULL);
03671        _tmp1_ = self->priv->processing_track;
03672        if (!_tmp1_) {
03673               _tmp0_ = TRUE;
03674        } else {
03675               gint _tmp2_;
03676               _tmp2_ = self->priv->current_data;
03677               _tmp0_ = _tmp2_ < 0;
03678        }
03679        _tmp3_ = _tmp0_;
03680        if (_tmp3_) {
03681               return;
03682        }
03683        _tmp4_ = self->priv->current_data;
03684        switch (_tmp4_) {
03685               case UNITY_MUSIC_LENS_COLUMNS_URI:
03686               {
03687                      UnityMusicLensTrack* _tmp5_;
03688                      const gchar* _tmp6_;
03689                      _tmp5_ = self->priv->current_track;
03690                      _tmp6_ = text;
03691                      unity_music_lens_track_set_uri (_tmp5_, _tmp6_);
03692                      break;
03693               }
03694               case UNITY_MUSIC_LENS_COLUMNS_TITLE:
03695               {
03696                      UnityMusicLensTrack* _tmp7_;
03697                      const gchar* _tmp8_;
03698                      _tmp7_ = self->priv->current_track;
03699                      _tmp8_ = text;
03700                      unity_music_lens_track_set_title (_tmp7_, _tmp8_);
03701                      break;
03702               }
03703               case UNITY_MUSIC_LENS_COLUMNS_ARTIST:
03704               {
03705                      UnityMusicLensTrack* _tmp9_;
03706                      const gchar* _tmp10_;
03707                      _tmp9_ = self->priv->current_track;
03708                      _tmp10_ = text;
03709                      unity_music_lens_track_set_artist (_tmp9_, _tmp10_);
03710                      break;
03711               }
03712               case UNITY_MUSIC_LENS_COLUMNS_ALBUM:
03713               {
03714                      UnityMusicLensTrack* _tmp11_;
03715                      const gchar* _tmp12_;
03716                      _tmp11_ = self->priv->current_track;
03717                      _tmp12_ = text;
03718                      unity_music_lens_track_set_album (_tmp11_, _tmp12_);
03719                      break;
03720               }
03721               case UNITY_MUSIC_LENS_COLUMNS_ALBUM_ARTIST:
03722               {
03723                      UnityMusicLensTrack* _tmp13_;
03724                      const gchar* _tmp14_;
03725                      _tmp13_ = self->priv->current_track;
03726                      _tmp14_ = text;
03727                      unity_music_lens_track_set_album_artist (_tmp13_, _tmp14_);
03728                      break;
03729               }
03730               case UNITY_MUSIC_LENS_COLUMNS_GENRE:
03731               {
03732                      UnityMusicLensTrack* _tmp15_;
03733                      UnityMusicLensGenre* _tmp16_;
03734                      const gchar* _tmp17_;
03735                      gchar* _tmp18_ = NULL;
03736                      gchar* _tmp19_;
03737                      gchar* _tmp20_ = NULL;
03738                      gchar* _tmp21_;
03739                      _tmp15_ = self->priv->current_track;
03740                      _tmp16_ = self->priv->genre;
03741                      _tmp17_ = text;
03742                      _tmp18_ = g_utf8_strdown (_tmp17_, (gssize) (-1));
03743                      _tmp19_ = _tmp18_;
03744                      _tmp20_ = unity_music_lens_genre_get_id_for_genre (_tmp16_, _tmp19_);
03745                      _tmp21_ = _tmp20_;
03746                      unity_music_lens_track_set_genre (_tmp15_, _tmp21_);
03747                      _g_free0 (_tmp21_);
03748                      _g_free0 (_tmp19_);
03749                      break;
03750               }
03751               case UNITY_MUSIC_LENS_COLUMNS_MIMETYPE:
03752               {
03753                      UnityMusicLensTrack* _tmp22_;
03754                      const gchar* _tmp23_;
03755                      _tmp22_ = self->priv->current_track;
03756                      _tmp23_ = text;
03757                      unity_music_lens_track_set_mime_type (_tmp22_, _tmp23_);
03758                      break;
03759               }
03760               case UNITY_MUSIC_LENS_COLUMNS_YEAR:
03761               {
03762                      UnityMusicLensTrack* _tmp24_;
03763                      const gchar* _tmp25_;
03764                      gint _tmp26_ = 0;
03765                      _tmp24_ = self->priv->current_track;
03766                      _tmp25_ = text;
03767                      _tmp26_ = atoi (_tmp25_);
03768                      unity_music_lens_track_set_year (_tmp24_, _tmp26_ / 365);
03769                      break;
03770               }
03771               case UNITY_MUSIC_LENS_COLUMNS_PLAY_COUNT:
03772               {
03773                      UnityMusicLensTrack* _tmp27_;
03774                      const gchar* _tmp28_;
03775                      gint _tmp29_ = 0;
03776                      _tmp27_ = self->priv->current_track;
03777                      _tmp28_ = text;
03778                      _tmp29_ = atoi (_tmp28_);
03779                      unity_music_lens_track_set_play_count (_tmp27_, _tmp29_);
03780                      break;
03781               }
03782               case UNITY_MUSIC_LENS_COLUMNS_TRACK_NUMBER:
03783               {
03784                      UnityMusicLensTrack* _tmp30_;
03785                      const gchar* _tmp31_;
03786                      gint _tmp32_ = 0;
03787                      _tmp30_ = self->priv->current_track;
03788                      _tmp31_ = text;
03789                      _tmp32_ = atoi (_tmp31_);
03790                      unity_music_lens_track_set_track_number (_tmp30_, _tmp32_);
03791                      break;
03792               }
03793               default:
03794               break;
03795        }
03796 }
03797 
03798 
03799 UnityMusicLensRhythmboxCollectionXmlParser* unity_music_lens_rhythmbox_collection_xml_parser_construct (GType object_type) {
03800        UnityMusicLensRhythmboxCollectionXmlParser * self = NULL;
03801        self = (UnityMusicLensRhythmboxCollectionXmlParser*) g_object_new (object_type, NULL);
03802        return self;
03803 }
03804 
03805 
03806 UnityMusicLensRhythmboxCollectionXmlParser* unity_music_lens_rhythmbox_collection_xml_parser_new (void) {
03807        return unity_music_lens_rhythmbox_collection_xml_parser_construct (UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER);
03808 }
03809 
03810 
03811 static GObject * unity_music_lens_rhythmbox_collection_xml_parser_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
03812        GObject * obj;
03813        GObjectClass * parent_class;
03814        UnityMusicLensRhythmboxCollectionXmlParser * self;
03815        GMarkupParseContext* _tmp0_;
03816        parent_class = G_OBJECT_CLASS (unity_music_lens_rhythmbox_collection_xml_parser_parent_class);
03817        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
03818        self = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER (obj);
03819        _tmp0_ = g_markup_parse_context_new (&UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER_parser, 0, self, NULL);
03820        _g_markup_parse_context_free0 (self->priv->context);
03821        self->priv->context = _tmp0_;
03822        return obj;
03823 }
03824 
03825 
03826 static void unity_music_lens_rhythmbox_collection_xml_parser_class_init (UnityMusicLensRhythmboxCollectionXmlParserClass * klass) {
03827        unity_music_lens_rhythmbox_collection_xml_parser_parent_class = g_type_class_peek_parent (klass);
03828        g_type_class_add_private (klass, sizeof (UnityMusicLensRhythmboxCollectionXmlParserPrivate));
03829        G_OBJECT_CLASS (klass)->constructor = unity_music_lens_rhythmbox_collection_xml_parser_constructor;
03830        G_OBJECT_CLASS (klass)->finalize = unity_music_lens_rhythmbox_collection_xml_parser_finalize;
03831        g_signal_new ("track_info_ready", UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, UNITY_MUSIC_LENS_TYPE_TRACK);
03832 }
03833 
03834 
03835 static void unity_music_lens_rhythmbox_collection_xml_parser_instance_init (UnityMusicLensRhythmboxCollectionXmlParser * self) {
03836        UnityMusicLensGenre* _tmp0_;
03837        self->priv = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER_GET_PRIVATE (self);
03838        _tmp0_ = unity_music_lens_genre_new ();
03839        self->priv->genre = _tmp0_;
03840        self->priv->is_rhythmdb_xml = FALSE;
03841        self->priv->current_data = -1;
03842 }
03843 
03844 
03845 static void unity_music_lens_rhythmbox_collection_xml_parser_finalize (GObject* obj) {
03846        UnityMusicLensRhythmboxCollectionXmlParser * self;
03847        self = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER (obj);
03848        _g_object_unref0 (self->priv->genre);
03849        _g_markup_parse_context_free0 (self->priv->context);
03850        _g_object_unref0 (self->priv->current_track);
03851        G_OBJECT_CLASS (unity_music_lens_rhythmbox_collection_xml_parser_parent_class)->finalize (obj);
03852 }
03853 
03854 
03855 GType unity_music_lens_rhythmbox_collection_xml_parser_get_type (void) {
03856        static volatile gsize unity_music_lens_rhythmbox_collection_xml_parser_type_id__volatile = 0;
03857        if (g_once_init_enter (&unity_music_lens_rhythmbox_collection_xml_parser_type_id__volatile)) {
03858               static const GTypeInfo g_define_type_info = { sizeof (UnityMusicLensRhythmboxCollectionXmlParserClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_music_lens_rhythmbox_collection_xml_parser_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityMusicLensRhythmboxCollectionXmlParser), 0, (GInstanceInitFunc) unity_music_lens_rhythmbox_collection_xml_parser_instance_init, NULL };
03859               GType unity_music_lens_rhythmbox_collection_xml_parser_type_id;
03860               unity_music_lens_rhythmbox_collection_xml_parser_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityMusicLensRhythmboxCollectionXmlParser", &g_define_type_info, 0);
03861               g_once_init_leave (&unity_music_lens_rhythmbox_collection_xml_parser_type_id__volatile, unity_music_lens_rhythmbox_collection_xml_parser_type_id);
03862        }
03863        return unity_music_lens_rhythmbox_collection_xml_parser_type_id__volatile;
03864 }
03865 
03866 
03867 static void unity_music_lens_rhythmbox_collection_class_init (UnityMusicLensRhythmboxCollectionClass * klass) {
03868        unity_music_lens_rhythmbox_collection_parent_class = g_type_class_peek_parent (klass);
03869        g_type_class_add_private (klass, sizeof (UnityMusicLensRhythmboxCollectionPrivate));
03870        G_OBJECT_CLASS (klass)->constructor = unity_music_lens_rhythmbox_collection_constructor;
03871        G_OBJECT_CLASS (klass)->finalize = unity_music_lens_rhythmbox_collection_finalize;
03872 }
03873 
03874 
03875 static void unity_music_lens_rhythmbox_collection_instance_init (UnityMusicLensRhythmboxCollection * self) {
03876        self->priv = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_GET_PRIVATE (self);
03877 }
03878 
03879 
03880 static void unity_music_lens_rhythmbox_collection_finalize (GObject* obj) {
03881        UnityMusicLensRhythmboxCollection * self;
03882        self = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION (obj);
03883        _g_object_unref0 (self->priv->all_tracks);
03884        _g_object_unref0 (self->priv->tracks_by_play_count);
03885        _g_hash_table_unref0 (self->priv->album_to_tracks_map);
03886        _tdb_close0 (self->priv->album_art_tdb);
03887        _g_object_unref0 (self->priv->tdb_monitor);
03888        _g_hash_table_unref0 (self->priv->variant_store);
03889        _g_hash_table_unref0 (self->priv->int_variant_store);
03890        _vala_array_destroy (self->priv->row_buffer, 12, (GDestroyNotify) g_variant_unref);
03891        _g_object_unref0 (self->priv->analyzer);
03892        _g_object_unref0 (self->priv->index);
03893        _dee_icu_term_filter_destroy0 (self->priv->ascii_filter);
03894        _g_free0 (self->priv->media_art_dir);
03895        G_OBJECT_CLASS (unity_music_lens_rhythmbox_collection_parent_class)->finalize (obj);
03896 }
03897 
03898 
03899 GType unity_music_lens_rhythmbox_collection_get_type (void) {
03900        static volatile gsize unity_music_lens_rhythmbox_collection_type_id__volatile = 0;
03901        if (g_once_init_enter (&unity_music_lens_rhythmbox_collection_type_id__volatile)) {
03902               static const GTypeInfo g_define_type_info = { sizeof (UnityMusicLensRhythmboxCollectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_music_lens_rhythmbox_collection_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityMusicLensRhythmboxCollection), 0, (GInstanceInitFunc) unity_music_lens_rhythmbox_collection_instance_init, NULL };
03903               GType unity_music_lens_rhythmbox_collection_type_id;
03904               unity_music_lens_rhythmbox_collection_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityMusicLensRhythmboxCollection", &g_define_type_info, 0);
03905               g_once_init_leave (&unity_music_lens_rhythmbox_collection_type_id__volatile, unity_music_lens_rhythmbox_collection_type_id);
03906        }
03907        return unity_music_lens_rhythmbox_collection_type_id__volatile;
03908 }
03909 
03910 
03911 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
03912        if ((array != NULL) && (destroy_func != NULL)) {
03913               int i;
03914               for (i = 0; i < array_length; i = i + 1) {
03915                      if (((gpointer*) array)[i] != NULL) {
03916                             destroy_func (((gpointer*) array)[i]);
03917                      }
03918               }
03919        }
03920 }
03921 
03922 
03923 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
03924        _vala_array_destroy (array, array_length, destroy_func);
03925        g_free (array);
03926 }
03927 
03928 
03929 static gint _vala_array_length (gpointer array) {
03930        int length;
03931        length = 0;
03932        if (array) {
03933               while (((gpointer*) array)[length]) {
03934                      length++;
03935               }
03936        }
03937        return length;
03938 }
03939 
03940 
03941