1
/* rhythmbox-collection.c generated by valac 0.16.1, the Vala compiler
2
* generated from rhythmbox-collection.vala, do not modify */
5
* Copyright (C) 2012 Canonical Ltd
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License version 3 as
9
* published by the Free Software Foundation.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
* Authored by David Calle <davidc@framli.eu>
20
* Michal Hruby <michal.hruby@canonical.com>
25
#include <glib-object.h>
32
#include <glib/gi18n-lib.h>
33
#include <glib/gstdio.h>
35
#include <sys/types.h>
40
#define UNITY_MUSIC_LENS_TYPE_COLUMNS (unity_music_lens_columns_get_type ())
42
#define UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION (unity_music_lens_rhythmbox_collection_get_type ())
43
#define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION, UnityMusicLensRhythmboxCollection))
44
#define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION, UnityMusicLensRhythmboxCollectionClass))
45
#define UNITY_MUSIC_LENS_IS_RHYTHMBOX_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION))
46
#define UNITY_MUSIC_LENS_IS_RHYTHMBOX_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION))
47
#define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION, UnityMusicLensRhythmboxCollectionClass))
49
typedef struct _UnityMusicLensRhythmboxCollection UnityMusicLensRhythmboxCollection;
50
typedef struct _UnityMusicLensRhythmboxCollectionClass UnityMusicLensRhythmboxCollectionClass;
51
typedef struct _UnityMusicLensRhythmboxCollectionPrivate UnityMusicLensRhythmboxCollectionPrivate;
53
#define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_RESULT_TYPE (unity_music_lens_rhythmbox_collection_result_type_get_type ())
54
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
55
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
56
#define _tdb_close0(var) ((var == NULL) ? NULL : (var = (tdb_close (var), NULL)))
57
#define _dee_icu_term_filter_destroy0(var) ((var == NULL) ? NULL : (var = (dee_icu_term_filter_destroy (var), NULL)))
58
#define _g_free0(var) (var = (g_free (var), NULL))
59
#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
60
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
61
#define _g_byte_array_unref0(var) ((var == NULL) ? NULL : (var = (g_byte_array_unref (var), NULL)))
63
#define UNITY_MUSIC_LENS_TYPE_TRACK (unity_music_lens_track_get_type ())
64
#define UNITY_MUSIC_LENS_TRACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_TRACK, UnityMusicLensTrack))
65
#define UNITY_MUSIC_LENS_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_TRACK, UnityMusicLensTrackClass))
66
#define UNITY_MUSIC_LENS_IS_TRACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_TRACK))
67
#define UNITY_MUSIC_LENS_IS_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_TRACK))
68
#define UNITY_MUSIC_LENS_TRACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_TRACK, UnityMusicLensTrackClass))
70
typedef struct _UnityMusicLensTrack UnityMusicLensTrack;
71
typedef struct _UnityMusicLensTrackClass UnityMusicLensTrackClass;
72
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
73
#define _g_slist_free0(var) ((var == NULL) ? NULL : (var = (g_slist_free (var), NULL)))
74
#define __g_slist_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_slist_free__g_object_unref0_ (var), NULL)))
76
#define UNITY_MUSIC_LENS_TYPE_TRACK_TYPE (unity_music_lens_track_type_get_type ())
77
typedef struct _Block2Data Block2Data;
78
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
80
#define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER (unity_music_lens_rhythmbox_collection_xml_parser_get_type ())
81
#define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER, UnityMusicLensRhythmboxCollectionXmlParser))
82
#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))
83
#define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_IS_XML_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER))
84
#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))
85
#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))
87
typedef struct _UnityMusicLensRhythmboxCollectionXmlParser UnityMusicLensRhythmboxCollectionXmlParser;
88
typedef struct _UnityMusicLensRhythmboxCollectionXmlParserClass UnityMusicLensRhythmboxCollectionXmlParserClass;
89
typedef struct _Block3Data Block3Data;
90
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
91
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
93
#define UNITY_MUSIC_LENS_TYPE_FILTER_PARSER (unity_music_lens_filter_parser_get_type ())
94
#define UNITY_MUSIC_LENS_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParser))
95
#define UNITY_MUSIC_LENS_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserClass))
96
#define UNITY_MUSIC_LENS_IS_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER))
97
#define UNITY_MUSIC_LENS_IS_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER))
98
#define UNITY_MUSIC_LENS_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserClass))
100
typedef struct _UnityMusicLensFilterParser UnityMusicLensFilterParser;
101
typedef struct _UnityMusicLensFilterParserClass UnityMusicLensFilterParserClass;
103
#define UNITY_MUSIC_LENS_TYPE_CATEGORY (unity_music_lens_category_get_type ())
104
#define _g_sequence_free0(var) ((var == NULL) ? NULL : (var = (g_sequence_free (var), NULL)))
106
#define UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER (unity_music_lens_decade_filter_parser_get_type ())
107
#define UNITY_MUSIC_LENS_DECADE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER, UnityMusicLensDecadeFilterParser))
108
#define UNITY_MUSIC_LENS_DECADE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER, UnityMusicLensDecadeFilterParserClass))
109
#define UNITY_MUSIC_LENS_IS_DECADE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER))
110
#define UNITY_MUSIC_LENS_IS_DECADE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER))
111
#define UNITY_MUSIC_LENS_DECADE_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER, UnityMusicLensDecadeFilterParserClass))
113
typedef struct _UnityMusicLensDecadeFilterParser UnityMusicLensDecadeFilterParser;
114
typedef struct _UnityMusicLensDecadeFilterParserClass UnityMusicLensDecadeFilterParserClass;
116
#define UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER (unity_music_lens_genre_filter_parser_get_type ())
117
#define UNITY_MUSIC_LENS_GENRE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER, UnityMusicLensGenreFilterParser))
118
#define UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER, UnityMusicLensGenreFilterParserClass))
119
#define UNITY_MUSIC_LENS_IS_GENRE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER))
120
#define UNITY_MUSIC_LENS_IS_GENRE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER))
121
#define UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER, UnityMusicLensGenreFilterParserClass))
123
typedef struct _UnityMusicLensGenreFilterParser UnityMusicLensGenreFilterParser;
124
typedef struct _UnityMusicLensGenreFilterParserClass UnityMusicLensGenreFilterParserClass;
125
typedef struct _UnityMusicLensRhythmboxCollectionXmlParserPrivate UnityMusicLensRhythmboxCollectionXmlParserPrivate;
127
#define UNITY_MUSIC_LENS_TYPE_GENRE (unity_music_lens_genre_get_type ())
128
#define UNITY_MUSIC_LENS_GENRE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_GENRE, UnityMusicLensGenre))
129
#define UNITY_MUSIC_LENS_GENRE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_GENRE, UnityMusicLensGenreClass))
130
#define UNITY_MUSIC_LENS_IS_GENRE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_GENRE))
131
#define UNITY_MUSIC_LENS_IS_GENRE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_GENRE))
132
#define UNITY_MUSIC_LENS_GENRE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_GENRE, UnityMusicLensGenreClass))
134
typedef struct _UnityMusicLensGenre UnityMusicLensGenre;
135
typedef struct _UnityMusicLensGenreClass UnityMusicLensGenreClass;
136
#define _g_markup_parse_context_free0(var) ((var == NULL) ? NULL : (var = (g_markup_parse_context_free (var), NULL)))
139
UNITY_MUSIC_LENS_COLUMNS_TYPE,
140
UNITY_MUSIC_LENS_COLUMNS_URI,
141
UNITY_MUSIC_LENS_COLUMNS_TITLE,
142
UNITY_MUSIC_LENS_COLUMNS_ARTIST,
143
UNITY_MUSIC_LENS_COLUMNS_ALBUM,
144
UNITY_MUSIC_LENS_COLUMNS_ARTWORK,
145
UNITY_MUSIC_LENS_COLUMNS_MIMETYPE,
146
UNITY_MUSIC_LENS_COLUMNS_GENRE,
147
UNITY_MUSIC_LENS_COLUMNS_ALBUM_ARTIST,
148
UNITY_MUSIC_LENS_COLUMNS_TRACK_NUMBER,
149
UNITY_MUSIC_LENS_COLUMNS_YEAR,
150
UNITY_MUSIC_LENS_COLUMNS_PLAY_COUNT,
151
UNITY_MUSIC_LENS_COLUMNS_DURATION,
152
UNITY_MUSIC_LENS_COLUMNS_N_COLUMNS
153
} UnityMusicLensColumns;
155
struct _UnityMusicLensRhythmboxCollection {
156
GObject parent_instance;
157
UnityMusicLensRhythmboxCollectionPrivate * priv;
160
struct _UnityMusicLensRhythmboxCollectionClass {
161
GObjectClass parent_class;
164
struct _UnityMusicLensRhythmboxCollectionPrivate {
165
DeeSequenceModel* all_tracks;
166
DeeModelTag* album_art_tag;
167
DeeFilterModel* tracks_by_play_count;
168
GHashTable* album_to_tracks_map;
169
TDB_CONTEXT* album_art_tdb;
170
GFileMonitor* tdb_monitor;
171
gint current_album_art_tag;
172
GHashTable* variant_store;
173
GHashTable* int_variant_store;
174
GVariant* row_buffer[13];
175
DeeAnalyzer* analyzer;
177
DeeICUTermFilter* ascii_filter;
178
gchar* media_art_dir;
182
UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_ALBUM,
183
UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_SONG,
184
UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_RADIO
185
} UnityMusicLensRhythmboxCollectionResultType;
188
UNITY_MUSIC_LENS_TRACK_TYPE_SONG,
189
UNITY_MUSIC_LENS_TRACK_TYPE_RADIO
190
} UnityMusicLensTrackType;
194
UnityMusicLensRhythmboxCollection * self;
201
GCompareDataFunc compare_func;
202
gpointer compare_func_target;
206
UNITY_MUSIC_LENS_CATEGORY_SONGS,
207
UNITY_MUSIC_LENS_CATEGORY_ALBUMS,
208
UNITY_MUSIC_LENS_CATEGORY_PURCHASE,
209
UNITY_MUSIC_LENS_CATEGORY_MUSIC,
210
UNITY_MUSIC_LENS_CATEGORY_RADIOS
211
} UnityMusicLensCategory;
213
struct _UnityMusicLensRhythmboxCollectionXmlParser {
214
GObject parent_instance;
215
UnityMusicLensRhythmboxCollectionXmlParserPrivate * priv;
218
struct _UnityMusicLensRhythmboxCollectionXmlParserClass {
219
GObjectClass parent_class;
222
struct _UnityMusicLensRhythmboxCollectionXmlParserPrivate {
223
UnityMusicLensGenre* genre;
224
GMarkupParseContext* context;
225
gboolean is_rhythmdb_xml;
226
gboolean processing_track;
227
UnityMusicLensTrack* current_track;
232
static gpointer unity_music_lens_rhythmbox_collection_parent_class = NULL;
233
static gpointer unity_music_lens_rhythmbox_collection_xml_parser_parent_class = NULL;
235
GType unity_music_lens_columns_get_type (void) G_GNUC_CONST;
236
GType unity_music_lens_rhythmbox_collection_get_type (void) G_GNUC_CONST;
237
#define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION, UnityMusicLensRhythmboxCollectionPrivate))
239
UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_DUMMY_PROPERTY
241
static GType unity_music_lens_rhythmbox_collection_result_type_get_type (void) G_GNUC_UNUSED;
242
#define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_UNKNOWN_ALBUM _ ("Unknown")
243
static void unity_music_lens_rhythmbox_collection_initialize_index (UnityMusicLensRhythmboxCollection* self);
244
static gchar* __lambda6_ (UnityMusicLensRhythmboxCollection* self, DeeModel* model, DeeModelIter* iter);
245
static gchar* ___lambda6__dee_model_reader_func (DeeModel* model, DeeModelIter* iter, gpointer self);
246
static gchar* unity_music_lens_rhythmbox_collection_check_album_art_tdb (UnityMusicLensRhythmboxCollection* self, const gchar* artist, const gchar* album);
247
GType unity_music_lens_track_get_type (void) G_GNUC_CONST;
248
static gchar* unity_music_lens_rhythmbox_collection_get_albumart (UnityMusicLensRhythmboxCollection* self, UnityMusicLensTrack* track);
249
const gchar* unity_music_lens_track_get_album_artist (UnityMusicLensTrack* self);
250
const gchar* unity_music_lens_track_get_artist (UnityMusicLensTrack* self);
251
const gchar* unity_music_lens_track_get_album (UnityMusicLensTrack* self);
252
const gchar* unity_music_lens_track_get_uri (UnityMusicLensTrack* self);
253
GSList* unity_music_lens_rhythmbox_collection_get_album_tracks (UnityMusicLensRhythmboxCollection* self, const gchar* album_key);
254
static UnityMusicLensTrack* unity_music_lens_rhythmbox_collection_get_track (UnityMusicLensRhythmboxCollection* self, DeeModelIter* iter);
255
UnityMusicLensTrack* unity_music_lens_track_new (void);
256
UnityMusicLensTrack* unity_music_lens_track_construct (GType object_type);
257
void unity_music_lens_track_set_uri (UnityMusicLensTrack* self, const gchar* value);
258
void unity_music_lens_track_set_title (UnityMusicLensTrack* self, const gchar* value);
259
void unity_music_lens_track_set_artist (UnityMusicLensTrack* self, const gchar* value);
260
void unity_music_lens_track_set_album (UnityMusicLensTrack* self, const gchar* value);
261
void unity_music_lens_track_set_artwork_path (UnityMusicLensTrack* self, const gchar* value);
262
void unity_music_lens_track_set_mime_type (UnityMusicLensTrack* self, const gchar* value);
263
void unity_music_lens_track_set_genre (UnityMusicLensTrack* self, const gchar* value);
264
void unity_music_lens_track_set_album_artist (UnityMusicLensTrack* self, const gchar* value);
265
void unity_music_lens_track_set_track_number (UnityMusicLensTrack* self, gint value);
266
void unity_music_lens_track_set_year (UnityMusicLensTrack* self, gint value);
267
void unity_music_lens_track_set_play_count (UnityMusicLensTrack* self, gint value);
268
void unity_music_lens_track_set_duration (UnityMusicLensTrack* self, gint value);
269
UnityMusicLensTrack* unity_music_lens_rhythmbox_collection_get_album_track (UnityMusicLensRhythmboxCollection* self, const gchar* uri);
270
GSList* unity_music_lens_rhythmbox_collection_get_album_tracks_detailed (UnityMusicLensRhythmboxCollection* self, const gchar* album_key);
271
static void _g_object_unref0_ (gpointer var);
272
static void _g_slist_free__g_object_unref0_ (GSList* self);
273
static GVariant* unity_music_lens_rhythmbox_collection_cached_variant_for_string (UnityMusicLensRhythmboxCollection* self, const gchar* input);
274
static GVariant* unity_music_lens_rhythmbox_collection_cached_variant_for_int (UnityMusicLensRhythmboxCollection* self, gint input);
275
static void unity_music_lens_rhythmbox_collection_prepare_row_buffer (UnityMusicLensRhythmboxCollection* self, UnityMusicLensTrack* track);
276
GType unity_music_lens_track_type_get_type (void) G_GNUC_CONST;
277
UnityMusicLensTrackType unity_music_lens_track_get_type_track (UnityMusicLensTrack* self);
278
const gchar* unity_music_lens_track_get_title (UnityMusicLensTrack* self);
279
const gchar* unity_music_lens_track_get_mime_type (UnityMusicLensTrack* self);
280
const gchar* unity_music_lens_track_get_artwork_path (UnityMusicLensTrack* self);
281
const gchar* unity_music_lens_track_get_genre (UnityMusicLensTrack* self);
282
gint unity_music_lens_track_get_track_number (UnityMusicLensTrack* self);
283
gint unity_music_lens_track_get_year (UnityMusicLensTrack* self);
284
gint unity_music_lens_track_get_play_count (UnityMusicLensTrack* self);
285
gint unity_music_lens_track_get_duration (UnityMusicLensTrack* self);
286
void unity_music_lens_rhythmbox_collection_parse_metadata_file (UnityMusicLensRhythmboxCollection* self, const gchar* path);
287
static Block2Data* block2_data_ref (Block2Data* _data2_);
288
static void block2_data_unref (void * _userdata_);
289
static void ____lambda7_ (Block2Data* _data2_);
290
static void _____lambda7__g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self);
291
void unity_music_lens_rhythmbox_collection_parse_file (UnityMusicLensRhythmboxCollection* self, const gchar* path);
292
UnityMusicLensRhythmboxCollectionXmlParser* unity_music_lens_rhythmbox_collection_xml_parser_new (void);
293
UnityMusicLensRhythmboxCollectionXmlParser* unity_music_lens_rhythmbox_collection_xml_parser_construct (GType object_type);
294
GType unity_music_lens_rhythmbox_collection_xml_parser_get_type (void) G_GNUC_CONST;
295
static void __lambda8_ (UnityMusicLensRhythmboxCollection* self, UnityMusicLensTrack* track);
296
static void ___lambda8__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready (UnityMusicLensRhythmboxCollectionXmlParser* _sender, UnityMusicLensTrack* track, gpointer self);
297
gboolean unity_music_lens_rhythmbox_collection_xml_parser_parse (UnityMusicLensRhythmboxCollectionXmlParser* self, const gchar* content, gsize len, GError** error);
298
static Block3Data* block3_data_ref (Block3Data* _data3_);
299
static void block3_data_unref (void * _userdata_);
300
static gint ___lambda1__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
301
static gint ____lambda9_ (UnityMusicLensRhythmboxCollection* self, DeeModelIter* a, DeeModelIter* b);
302
static gint _____lambda9__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
303
static void unity_music_lens_rhythmbox_collection_add_result (UnityMusicLensRhythmboxCollection* self, DeeModel* results_model, DeeModel* model, DeeModelIter* iter, UnityMusicLensRhythmboxCollectionResultType result_type, guint category_id);
304
GType unity_music_lens_filter_parser_get_type (void) G_GNUC_CONST;
305
void unity_music_lens_rhythmbox_collection_search (UnityMusicLensRhythmboxCollection* self, UnityLensSearch* search, UnitySearchType search_type, GList* filters, gint max_results, gint category_override);
306
static void unity_music_lens_rhythmbox_collection_get_decade_filter (UnityMusicLensRhythmboxCollection* self, GList* filters, gint* min_year, gint* max_year);
307
static GeeSet* unity_music_lens_rhythmbox_collection_get_genre_filter (UnityMusicLensRhythmboxCollection* self, GList* filters);
308
GType unity_music_lens_category_get_type (void) G_GNUC_CONST;
309
static gint ____lambda10_ (UnityMusicLensRhythmboxCollection* self, DeeModelIter* a, DeeModelIter* b);
310
static gint _____lambda10__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
311
GType unity_music_lens_decade_filter_parser_get_type (void) G_GNUC_CONST;
312
UnityFilter* unity_music_lens_filter_parser_get_filter (UnityMusicLensFilterParser* self);
313
GType unity_music_lens_genre_filter_parser_get_type (void) G_GNUC_CONST;
314
UnityMusicLensRhythmboxCollection* unity_music_lens_rhythmbox_collection_new (void);
315
UnityMusicLensRhythmboxCollection* unity_music_lens_rhythmbox_collection_construct (GType object_type);
316
static GObject * unity_music_lens_rhythmbox_collection_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
317
static void _g_variant_unref0_ (gpointer var);
318
static void _g_free0_ (gpointer var);
319
static void _g_ptr_array_unref0_ (gpointer var);
320
static gint _unity_music_lens_rhythmbox_collection___lambda11_ (UnityMusicLensRhythmboxCollection* self, GVariant** row1, int row1_length1, GVariant** row2, int row2_length1);
321
static gint __unity_music_lens_rhythmbox_collection___lambda11__dee_compare_row_func (GVariant** row1, GVariant** row2, gpointer self);
322
static void _unity_music_lens_rhythmbox_collection___lambda12_ (UnityMusicLensRhythmboxCollection* self, DeeTermList* terms_in, DeeTermList* terms_out);
323
static void __unity_music_lens_rhythmbox_collection___lambda12__dee_term_filter_func (DeeTermList* terms_in, DeeTermList* terms_out, gpointer self);
324
GType unity_music_lens_genre_get_type (void) G_GNUC_CONST;
325
#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))
327
UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER_DUMMY_PROPERTY
329
UnityMusicLensGenre* unity_music_lens_genre_new (void);
330
UnityMusicLensGenre* unity_music_lens_genre_construct (GType object_type);
331
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);
332
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);
333
static void unity_music_lens_rhythmbox_collection_xml_parser_end_tag (UnityMusicLensRhythmboxCollectionXmlParser* self, GMarkupParseContext* content, const gchar* name, GError** error);
334
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);
335
static void unity_music_lens_rhythmbox_collection_xml_parser_process_text (UnityMusicLensRhythmboxCollectionXmlParser* self, GMarkupParseContext* context, const gchar* text, gsize text_len, GError** error);
336
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);
337
void unity_music_lens_track_set_type_track (UnityMusicLensTrack* self, UnityMusicLensTrackType value);
338
gchar* unity_music_lens_genre_get_id_for_genre (UnityMusicLensGenre* self, const gchar* genre);
339
static GObject * unity_music_lens_rhythmbox_collection_xml_parser_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
340
static void unity_music_lens_rhythmbox_collection_xml_parser_finalize (GObject* obj);
341
static void unity_music_lens_rhythmbox_collection_finalize (GObject* obj);
342
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
343
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
344
static gint _vala_array_length (gpointer array);
346
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};
348
GType unity_music_lens_columns_get_type (void) {
349
static volatile gsize unity_music_lens_columns_type_id__volatile = 0;
350
if (g_once_init_enter (&unity_music_lens_columns_type_id__volatile)) {
351
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_DURATION, "UNITY_MUSIC_LENS_COLUMNS_DURATION", "duration"}, {UNITY_MUSIC_LENS_COLUMNS_N_COLUMNS, "UNITY_MUSIC_LENS_COLUMNS_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
352
GType unity_music_lens_columns_type_id;
353
unity_music_lens_columns_type_id = g_enum_register_static ("UnityMusicLensColumns", values);
354
g_once_init_leave (&unity_music_lens_columns_type_id__volatile, unity_music_lens_columns_type_id);
356
return unity_music_lens_columns_type_id__volatile;
360
static GType unity_music_lens_rhythmbox_collection_result_type_get_type (void) {
361
static volatile gsize unity_music_lens_rhythmbox_collection_result_type_type_id__volatile = 0;
362
if (g_once_init_enter (&unity_music_lens_rhythmbox_collection_result_type_type_id__volatile)) {
363
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}};
364
GType unity_music_lens_rhythmbox_collection_result_type_type_id;
365
unity_music_lens_rhythmbox_collection_result_type_type_id = g_enum_register_static ("UnityMusicLensRhythmboxCollectionResultType", values);
366
g_once_init_leave (&unity_music_lens_rhythmbox_collection_result_type_type_id__volatile, unity_music_lens_rhythmbox_collection_result_type_type_id);
368
return unity_music_lens_rhythmbox_collection_result_type_type_id__volatile;
372
static gchar* __lambda6_ (UnityMusicLensRhythmboxCollection* self, DeeModel* model, DeeModelIter* iter) {
373
gchar* result = NULL;
375
DeeModelIter* _tmp1_;
376
const gchar* _tmp2_ = NULL;
378
DeeModelIter* _tmp4_;
379
const gchar* _tmp5_ = NULL;
381
DeeModelIter* _tmp7_;
382
const gchar* _tmp8_ = NULL;
383
gchar* _tmp9_ = NULL;
385
g_return_val_if_fail (model != NULL, NULL);
386
g_return_val_if_fail (iter != NULL, NULL);
389
_tmp2_ = dee_model_get_string (_tmp0_, _tmp1_, (guint) UNITY_MUSIC_LENS_COLUMNS_TITLE);
392
_tmp5_ = dee_model_get_string (_tmp3_, _tmp4_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTIST);
395
_tmp8_ = dee_model_get_string (_tmp6_, _tmp7_, (guint) UNITY_MUSIC_LENS_COLUMNS_ALBUM);
396
_tmp9_ = g_strdup_printf ("%s\n%s\n%s", _tmp2_, _tmp5_, _tmp8_);
403
static gchar* ___lambda6__dee_model_reader_func (DeeModel* model, DeeModelIter* iter, gpointer self) {
405
result = __lambda6_ (self, model, iter);
410
static void unity_music_lens_rhythmbox_collection_initialize_index (UnityMusicLensRhythmboxCollection* self) {
411
DeeModelReader _tmp0_ = {0};
412
DeeModelReader reader;
413
DeeSequenceModel* _tmp1_;
415
DeeModelReader _tmp3_;
416
DeeTreeIndex* _tmp4_;
417
g_return_if_fail (self != NULL);
418
dee_model_reader_new (___lambda6__dee_model_reader_func, g_object_ref (self), g_object_unref, &_tmp0_);
420
_tmp1_ = self->priv->all_tracks;
421
_tmp2_ = self->priv->analyzer;
423
_tmp4_ = dee_tree_index_new ((DeeModel*) _tmp1_, _tmp2_, &_tmp3_);
424
_g_object_unref0 (self->priv->index);
425
self->priv->index = (DeeIndex*) _tmp4_;
429
static guint8* string_get_data (const gchar* self, int* result_length1) {
441
g_return_val_if_fail (self != NULL, NULL);
442
res = (guint8*) self;
444
_res_size_ = res_length1;
445
_tmp0_ = strlen (self);
447
res_length1 = (gint) _tmp1_;
448
_tmp2_ = res_length1;
450
_tmp3__length1 = res_length1;
452
_tmp4__length1 = _tmp3__length1;
453
if (result_length1) {
454
*result_length1 = _tmp4__length1;
461
static gchar* unity_music_lens_rhythmbox_collection_check_album_art_tdb (UnityMusicLensRhythmboxCollection* self, const gchar* artist, const gchar* album) {
462
gchar* result = NULL;
464
guint8 _tmp1_[1] = {0};
465
guint8 null_helper[1];
467
GByteArray* byte_arr;
479
gint _tmp10__length1;
483
gint _tmp13__length1;
485
gint _tmp14__length1;
488
const gchar* _tmp17_;
490
gint _tmp18__length1;
492
gint _tmp19__length1;
497
gint _tmp22__length1;
498
TDB_CONTEXT* _tmp23_;
500
TDB_DATA _tmp25_ = {0};
504
gint _tmp27__length1;
505
g_return_val_if_fail (self != NULL, NULL);
506
g_return_val_if_fail (artist != NULL, NULL);
507
g_return_val_if_fail (album != NULL, NULL);
508
_tmp0_ = self->priv->album_art_tdb;
509
if (_tmp0_ == NULL) {
513
_tmp1_[0] = (guint8) 0;
514
memcpy (null_helper, _tmp1_, 1 * sizeof (guint8));
515
_tmp2_ = g_byte_array_new ();
518
_tmp4_ = string_get_data ("album", &_tmp4__length1);
520
_tmp5__length1 = _tmp4__length1;
521
g_byte_array_append (_tmp3_, _tmp5_, _tmp5__length1);
523
g_byte_array_append (_tmp6_, null_helper, 1);
526
_tmp9_ = string_get_data (_tmp8_, &_tmp9__length1);
528
_tmp10__length1 = _tmp9__length1;
529
g_byte_array_append (_tmp7_, _tmp10_, _tmp10__length1);
531
g_byte_array_append (_tmp11_, null_helper, 1);
533
_tmp13_ = string_get_data ("artist", &_tmp13__length1);
535
_tmp14__length1 = _tmp13__length1;
536
g_byte_array_append (_tmp12_, _tmp14_, _tmp14__length1);
538
g_byte_array_append (_tmp15_, null_helper, 1);
541
_tmp18_ = string_get_data (_tmp17_, &_tmp18__length1);
543
_tmp19__length1 = _tmp18__length1;
544
g_byte_array_append (_tmp16_, _tmp19_, _tmp19__length1);
546
g_byte_array_append (_tmp20_, null_helper, 1);
549
_tmp22_ = _tmp21_->data;
550
_tmp22__length1 = (gint) _tmp21_->len;
552
key.dsize = _tmp22__length1;
553
_tmp23_ = self->priv->album_art_tdb;
555
_tmp25_ = tdb_fetch (_tmp23_, _tmp24_);
558
_tmp27_ = _tmp26_.dptr;
559
_tmp27__length1 = (gint) _tmp26_.dsize;
560
if (_tmp27_ != NULL) {
561
GVariantType* _tmp28_;
562
GVariantType* _tmp29_;
565
gint _tmp31__length1;
566
GVariant* _tmp32_ = NULL;
571
const GVariantType* _tmp36_;
572
GVariant* _tmp37_ = NULL;
573
GVariant* file_variant;
575
_tmp28_ = g_variant_type_new ("a{sv}");
578
_tmp31_ = _tmp30_.dptr;
579
_tmp31__length1 = (gint) _tmp30_.dsize;
580
_tmp32_ = g_variant_new_from_data (_tmp29_, _tmp31_, _tmp31__length1, FALSE, NULL, NULL);
581
_tmp33_ = g_variant_ref_sink (_tmp32_);
583
_g_variant_type_free0 (_tmp29_);
586
_tmp36_ = G_VARIANT_TYPE_STRING;
587
_tmp37_ = g_variant_lookup_value (_tmp35_, "file", _tmp36_);
588
file_variant = _tmp37_;
589
_tmp38_ = file_variant;
590
if (_tmp38_ != NULL) {
592
const gchar* _tmp40_ = NULL;
594
_tmp39_ = file_variant;
595
_tmp40_ = g_variant_get_string (_tmp39_, NULL);
596
_tmp41_ = g_strdup (_tmp40_);
598
_g_variant_unref0 (file_variant);
599
_g_variant_unref0 (v);
600
_g_byte_array_unref0 (byte_arr);
603
_g_variant_unref0 (file_variant);
604
_g_variant_unref0 (v);
607
_g_byte_array_unref0 (byte_arr);
612
static gchar* unity_music_lens_rhythmbox_collection_get_albumart (UnityMusicLensRhythmboxCollection* self, UnityMusicLensTrack* track) {
613
gchar* result = NULL;
614
gchar* filename = NULL;
615
UnityMusicLensTrack* _tmp0_;
621
const gchar* _tmp10_;
624
UnityMusicLensTrack* _tmp12_;
625
const gchar* _tmp13_;
626
const gchar* _tmp14_;
629
const gchar* _tmp16_;
630
gchar* _tmp17_ = NULL;
632
const gchar* _tmp18_;
633
gchar* _tmp19_ = NULL;
635
const gchar* _tmp20_;
636
const gchar* _tmp21_;
637
gchar* _tmp22_ = NULL;
638
const gchar* _tmp23_;
639
const gchar* _tmp29_;
640
gchar* _tmp30_ = NULL;
642
const gchar* _tmp31_;
643
gchar* _tmp32_ = NULL;
645
const gchar* _tmp33_;
646
const gchar* _tmp34_;
647
const gchar* _tmp35_;
648
gchar* _tmp36_ = NULL;
650
gchar* _tmp38_ = NULL;
651
const gchar* _tmp39_;
652
gboolean _tmp40_ = FALSE;
653
const gchar* _tmp41_;
654
const gchar* _tmp42_;
655
gchar* _tmp43_ = NULL;
657
gchar* _tmp45_ = NULL;
660
const gchar* _tmp47_;
661
const gchar* _tmp48_;
662
gchar* _tmp49_ = NULL;
664
gchar* _tmp51_ = NULL;
666
gchar* _tmp53_ = NULL;
667
const gchar* _tmp54_;
668
gboolean _tmp55_ = FALSE;
669
const gchar* _tmp66_ = NULL;
670
UnityMusicLensTrack* _tmp67_;
671
const gchar* _tmp68_;
672
const gchar* _tmp69_;
673
UnityMusicLensTrack* _tmp70_;
674
const gchar* _tmp71_;
675
const gchar* _tmp72_;
676
gchar* _tmp73_ = NULL;
678
gchar* _tmp75_ = NULL;
681
const gchar* _tmp77_;
682
gboolean _tmp78_ = FALSE;
683
GError * _inner_error_ = NULL;
684
g_return_val_if_fail (self != NULL, NULL);
685
g_return_val_if_fail (track != NULL, NULL);
687
_tmp1_ = unity_music_lens_track_get_album_artist (_tmp0_);
689
_tmp3_ = g_strdup (_tmp2_);
692
if (_tmp5_ == NULL) {
693
UnityMusicLensTrack* _tmp6_;
698
_tmp7_ = unity_music_lens_track_get_artist (_tmp6_);
700
_tmp9_ = g_strdup (_tmp8_);
705
_tmp11_ = g_strdup (_tmp10_);
708
_tmp13_ = unity_music_lens_track_get_album (_tmp12_);
710
_tmp15_ = g_strdup (_tmp14_);
713
_tmp17_ = g_utf8_normalize (_tmp16_, (gssize) (-1), G_NORMALIZE_NFKD);
714
artist_norm = _tmp17_;
716
_tmp19_ = g_utf8_normalize (_tmp18_, (gssize) (-1), G_NORMALIZE_NFKD);
717
album_norm = _tmp19_;
720
_tmp22_ = unity_music_lens_rhythmbox_collection_check_album_art_tdb (self, _tmp20_, _tmp21_);
724
if (_tmp23_ != NULL) {
725
const gchar* _tmp24_ = NULL;
726
const gchar* _tmp25_;
727
gchar* _tmp26_ = NULL;
728
const gchar* _tmp27_;
729
gboolean _tmp28_ = FALSE;
730
_tmp24_ = g_get_user_cache_dir ();
732
_tmp26_ = g_build_filename (_tmp24_, "rhythmbox", "album-art", _tmp25_, NULL);
736
_tmp28_ = g_file_test (_tmp27_, G_FILE_TEST_EXISTS);
739
_g_free0 (album_norm);
740
_g_free0 (artist_norm);
747
_tmp29_ = artist_norm;
748
_tmp30_ = g_compute_checksum_for_string (G_CHECKSUM_MD5, _tmp29_, (gsize) (-1));
749
artist_md5 = _tmp30_;
750
_tmp31_ = album_norm;
751
_tmp32_ = g_compute_checksum_for_string (G_CHECKSUM_MD5, _tmp31_, (gsize) (-1));
753
_tmp33_ = self->priv->media_art_dir;
754
_tmp34_ = artist_md5;
756
_tmp36_ = g_strdup_printf ("album-%s-%s", _tmp34_, _tmp35_);
758
_tmp38_ = g_build_filename (_tmp33_, _tmp37_, NULL);
763
_tmp40_ = g_file_test (_tmp39_, G_FILE_TEST_EXISTS);
766
_g_free0 (album_md5);
767
_g_free0 (artist_md5);
768
_g_free0 (album_norm);
769
_g_free0 (artist_norm);
777
_tmp43_ = g_strdup_printf ("%s\t%s", _tmp41_, _tmp42_);
779
_tmp45_ = g_utf8_normalize (_tmp44_, (gssize) (-1), G_NORMALIZE_NFKD);
783
_tmp47_ = self->priv->media_art_dir;
785
_tmp49_ = g_compute_checksum_for_string (G_CHECKSUM_MD5, _tmp48_, (gsize) (-1));
787
_tmp51_ = g_strdup_printf ("album-%s.jpg", _tmp50_);
789
_tmp53_ = g_build_filename (_tmp47_, _tmp52_, NULL);
795
_tmp55_ = g_file_test (_tmp54_, G_FILE_TEST_EXISTS);
799
_g_free0 (album_md5);
800
_g_free0 (artist_md5);
801
_g_free0 (album_norm);
802
_g_free0 (artist_norm);
809
UnityMusicLensTrack* _tmp56_;
810
const gchar* _tmp57_;
811
const gchar* _tmp58_;
812
GFile* _tmp59_ = NULL;
815
GFileInfo* _tmp61_ = NULL;
818
const gchar* _tmp63_ = NULL;
820
gchar* thumbnail_path;
821
const gchar* _tmp65_;
823
_tmp57_ = unity_music_lens_track_get_uri (_tmp56_);
825
_tmp59_ = g_file_new_for_uri (_tmp58_);
826
artwork_file = _tmp59_;
827
_tmp60_ = artwork_file;
828
_tmp61_ = g_file_query_info (_tmp60_, G_FILE_ATTRIBUTE_THUMBNAIL_PATH, 0, NULL, &_inner_error_);
830
if (_inner_error_ != NULL) {
831
_g_object_unref0 (artwork_file);
832
goto __catch10_g_error;
835
_tmp63_ = g_file_info_get_attribute_string (_tmp62_, G_FILE_ATTRIBUTE_THUMBNAIL_PATH);
836
_tmp64_ = g_strdup (_tmp63_);
837
thumbnail_path = _tmp64_;
838
_tmp65_ = thumbnail_path;
839
if (_tmp65_ != NULL) {
840
result = thumbnail_path;
841
_g_object_unref0 (info);
842
_g_object_unref0 (artwork_file);
844
_g_free0 (album_md5);
845
_g_free0 (artist_md5);
846
_g_free0 (album_norm);
847
_g_free0 (artist_norm);
854
_g_free0 (thumbnail_path);
855
_g_object_unref0 (info);
856
_g_object_unref0 (artwork_file);
861
g_clear_error (&_inner_error_);
862
_inner_error_ = NULL;
865
if (_inner_error_ != NULL) {
867
_g_free0 (album_md5);
868
_g_free0 (artist_md5);
869
_g_free0 (album_norm);
870
_g_free0 (artist_norm);
875
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);
876
g_clear_error (&_inner_error_);
879
_tmp66_ = g_get_user_cache_dir ();
881
_tmp68_ = unity_music_lens_track_get_artist (_tmp67_);
884
_tmp71_ = unity_music_lens_track_get_album (_tmp70_);
886
_tmp73_ = g_strdup_printf ("%s - %s.jpg", _tmp69_, _tmp72_);
888
_tmp75_ = g_build_filename (_tmp66_, "rhythmbox", "covers", _tmp74_, NULL);
893
_tmp78_ = g_file_test (_tmp77_, G_FILE_TEST_EXISTS);
897
_g_free0 (album_md5);
898
_g_free0 (artist_md5);
899
_g_free0 (album_norm);
900
_g_free0 (artist_norm);
910
_g_free0 (album_md5);
911
_g_free0 (artist_md5);
912
_g_free0 (album_norm);
913
_g_free0 (artist_norm);
922
static gpointer _g_ptr_array_ref0 (gpointer self) {
923
return self ? g_ptr_array_ref (self) : NULL;
927
static gint g_ptr_array_get_length (GPtrArray* self) {
930
g_return_val_if_fail (self != NULL, 0);
932
result = (gint) _tmp0_;
937
static void g_ptr_array_set_length (GPtrArray* self, gint value) {
939
g_return_if_fail (self != NULL);
941
g_ptr_array_set_size (self, _tmp0_);
945
GSList* unity_music_lens_rhythmbox_collection_get_album_tracks (UnityMusicLensRhythmboxCollection* self, const gchar* album_key) {
946
GSList* result = NULL;
950
gconstpointer _tmp2_ = NULL;
954
g_return_val_if_fail (self != NULL, NULL);
955
g_return_val_if_fail (album_key != NULL, NULL);
957
_tmp0_ = self->priv->album_to_tracks_map;
959
_tmp2_ = g_hash_table_lookup (_tmp0_, _tmp1_);
960
_tmp3_ = _g_ptr_array_ref0 ((GPtrArray*) _tmp2_);
963
if (_tmp4_ != NULL) {
970
_tmp6_ = g_ptr_array_get_length (_tmp5_);
979
DeeSequenceModel* _tmp12_;
982
gconstpointer _tmp15_ = NULL;
983
const gchar* _tmp16_ = NULL;
992
if (!(_tmp11_ >= 0)) {
995
_tmp12_ = self->priv->all_tracks;
998
_tmp15_ = g_ptr_array_index (_tmp13_, (guint) _tmp14_);
999
_tmp16_ = dee_model_get_string ((DeeModel*) _tmp12_, (DeeModelIter*) _tmp15_, (guint) UNITY_MUSIC_LENS_COLUMNS_URI);
1000
results = g_slist_prepend (results, _tmp16_);
1006
_g_ptr_array_unref0 (iter_arr);
1011
static UnityMusicLensTrack* unity_music_lens_rhythmbox_collection_get_track (UnityMusicLensRhythmboxCollection* self, DeeModelIter* iter) {
1012
UnityMusicLensTrack* result = NULL;
1013
UnityMusicLensTrack* _tmp0_;
1014
UnityMusicLensTrack* track;
1015
DeeSequenceModel* _tmp1_;
1016
DeeModelIter* _tmp2_;
1017
const gchar* _tmp3_ = NULL;
1018
DeeSequenceModel* _tmp4_;
1019
DeeModelIter* _tmp5_;
1020
const gchar* _tmp6_ = NULL;
1021
DeeSequenceModel* _tmp7_;
1022
DeeModelIter* _tmp8_;
1023
const gchar* _tmp9_ = NULL;
1024
DeeSequenceModel* _tmp10_;
1025
DeeModelIter* _tmp11_;
1026
const gchar* _tmp12_ = NULL;
1027
DeeSequenceModel* _tmp13_;
1028
DeeModelIter* _tmp14_;
1029
const gchar* _tmp15_ = NULL;
1030
DeeSequenceModel* _tmp16_;
1031
DeeModelIter* _tmp17_;
1032
const gchar* _tmp18_ = NULL;
1033
DeeSequenceModel* _tmp19_;
1034
DeeModelIter* _tmp20_;
1035
const gchar* _tmp21_ = NULL;
1036
DeeSequenceModel* _tmp22_;
1037
DeeModelIter* _tmp23_;
1038
const gchar* _tmp24_ = NULL;
1039
DeeSequenceModel* _tmp25_;
1040
DeeModelIter* _tmp26_;
1042
DeeSequenceModel* _tmp28_;
1043
DeeModelIter* _tmp29_;
1045
DeeSequenceModel* _tmp31_;
1046
DeeModelIter* _tmp32_;
1048
DeeSequenceModel* _tmp34_;
1049
DeeModelIter* _tmp35_;
1051
g_return_val_if_fail (self != NULL, NULL);
1052
g_return_val_if_fail (iter != NULL, NULL);
1053
_tmp0_ = unity_music_lens_track_new ();
1055
_tmp1_ = self->priv->all_tracks;
1057
_tmp3_ = dee_model_get_string ((DeeModel*) _tmp1_, _tmp2_, (guint) UNITY_MUSIC_LENS_COLUMNS_URI);
1058
unity_music_lens_track_set_uri (track, _tmp3_);
1059
_tmp4_ = self->priv->all_tracks;
1061
_tmp6_ = dee_model_get_string ((DeeModel*) _tmp4_, _tmp5_, (guint) UNITY_MUSIC_LENS_COLUMNS_TITLE);
1062
unity_music_lens_track_set_title (track, _tmp6_);
1063
_tmp7_ = self->priv->all_tracks;
1065
_tmp9_ = dee_model_get_string ((DeeModel*) _tmp7_, _tmp8_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTIST);
1066
unity_music_lens_track_set_artist (track, _tmp9_);
1067
_tmp10_ = self->priv->all_tracks;
1069
_tmp12_ = dee_model_get_string ((DeeModel*) _tmp10_, _tmp11_, (guint) UNITY_MUSIC_LENS_COLUMNS_ALBUM);
1070
unity_music_lens_track_set_album (track, _tmp12_);
1071
_tmp13_ = self->priv->all_tracks;
1073
_tmp15_ = dee_model_get_string ((DeeModel*) _tmp13_, _tmp14_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTWORK);
1074
unity_music_lens_track_set_artwork_path (track, _tmp15_);
1075
_tmp16_ = self->priv->all_tracks;
1077
_tmp18_ = dee_model_get_string ((DeeModel*) _tmp16_, _tmp17_, (guint) UNITY_MUSIC_LENS_COLUMNS_MIMETYPE);
1078
unity_music_lens_track_set_mime_type (track, _tmp18_);
1079
_tmp19_ = self->priv->all_tracks;
1081
_tmp21_ = dee_model_get_string ((DeeModel*) _tmp19_, _tmp20_, (guint) UNITY_MUSIC_LENS_COLUMNS_GENRE);
1082
unity_music_lens_track_set_genre (track, _tmp21_);
1083
_tmp22_ = self->priv->all_tracks;
1085
_tmp24_ = dee_model_get_string ((DeeModel*) _tmp22_, _tmp23_, (guint) UNITY_MUSIC_LENS_COLUMNS_ALBUM_ARTIST);
1086
unity_music_lens_track_set_album_artist (track, _tmp24_);
1087
_tmp25_ = self->priv->all_tracks;
1089
_tmp27_ = dee_model_get_int32 ((DeeModel*) _tmp25_, _tmp26_, (guint) UNITY_MUSIC_LENS_COLUMNS_TRACK_NUMBER);
1090
unity_music_lens_track_set_track_number (track, (gint) _tmp27_);
1091
_tmp28_ = self->priv->all_tracks;
1093
_tmp30_ = dee_model_get_int32 ((DeeModel*) _tmp28_, _tmp29_, (guint) UNITY_MUSIC_LENS_COLUMNS_YEAR);
1094
unity_music_lens_track_set_year (track, (gint) _tmp30_);
1095
_tmp31_ = self->priv->all_tracks;
1097
_tmp33_ = dee_model_get_int32 ((DeeModel*) _tmp31_, _tmp32_, (guint) UNITY_MUSIC_LENS_COLUMNS_PLAY_COUNT);
1098
unity_music_lens_track_set_play_count (track, (gint) _tmp33_);
1099
_tmp34_ = self->priv->all_tracks;
1101
_tmp36_ = dee_model_get_int32 ((DeeModel*) _tmp34_, _tmp35_, (guint) UNITY_MUSIC_LENS_COLUMNS_DURATION);
1102
unity_music_lens_track_set_duration (track, (gint) _tmp36_);
1108
UnityMusicLensTrack* unity_music_lens_rhythmbox_collection_get_album_track (UnityMusicLensRhythmboxCollection* self, const gchar* uri) {
1109
UnityMusicLensTrack* result = NULL;
1110
DeeSequenceModel* _tmp0_;
1111
DeeModelIter* _tmp1_ = NULL;
1113
DeeSequenceModel* _tmp2_;
1114
DeeModelIter* _tmp3_ = NULL;
1115
DeeModelIter* end_iter;
1116
g_return_val_if_fail (self != NULL, NULL);
1117
g_return_val_if_fail (uri != NULL, NULL);
1118
_tmp0_ = self->priv->all_tracks;
1119
_tmp1_ = dee_model_get_first_iter ((DeeModel*) _tmp0_);
1121
_tmp2_ = self->priv->all_tracks;
1122
_tmp3_ = dee_model_get_last_iter ((DeeModel*) _tmp2_);
1125
DeeModelIter* _tmp4_;
1126
DeeModelIter* _tmp5_;
1127
DeeSequenceModel* _tmp6_;
1128
DeeModelIter* _tmp7_;
1129
const gchar* _tmp8_ = NULL;
1130
const gchar* _tmp9_;
1131
DeeSequenceModel* _tmp12_;
1132
DeeModelIter* _tmp13_;
1133
DeeModelIter* _tmp14_ = NULL;
1136
if (!(_tmp4_ != _tmp5_)) {
1139
_tmp6_ = self->priv->all_tracks;
1141
_tmp8_ = dee_model_get_string ((DeeModel*) _tmp6_, _tmp7_, (guint) UNITY_MUSIC_LENS_COLUMNS_URI);
1143
if (g_strcmp0 (_tmp8_, _tmp9_) == 0) {
1144
DeeModelIter* _tmp10_;
1145
UnityMusicLensTrack* _tmp11_ = NULL;
1147
_tmp11_ = unity_music_lens_rhythmbox_collection_get_track (self, _tmp10_);
1151
_tmp12_ = self->priv->all_tracks;
1153
_tmp14_ = dee_model_next ((DeeModel*) _tmp12_, _tmp13_);
1161
static void _g_object_unref0_ (gpointer var) {
1162
(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
1166
static void _g_slist_free__g_object_unref0_ (GSList* self) {
1167
g_slist_foreach (self, (GFunc) _g_object_unref0_, NULL);
1168
g_slist_free (self);
1172
GSList* unity_music_lens_rhythmbox_collection_get_album_tracks_detailed (UnityMusicLensRhythmboxCollection* self, const gchar* album_key) {
1173
GSList* result = NULL;
1176
const gchar* _tmp1_;
1177
gconstpointer _tmp2_ = NULL;
1179
GPtrArray* iter_arr;
1181
g_return_val_if_fail (self != NULL, NULL);
1182
g_return_val_if_fail (album_key != NULL, NULL);
1184
_tmp0_ = self->priv->album_to_tracks_map;
1186
_tmp2_ = g_hash_table_lookup (_tmp0_, _tmp1_);
1187
_tmp3_ = _g_ptr_array_ref0 ((GPtrArray*) _tmp2_);
1190
if (_tmp4_ != NULL) {
1197
_tmp6_ = g_ptr_array_get_length (_tmp5_);
1208
gconstpointer _tmp14_ = NULL;
1209
UnityMusicLensTrack* _tmp15_ = NULL;
1218
if (!(_tmp11_ >= 0)) {
1223
_tmp14_ = g_ptr_array_index (_tmp12_, (guint) _tmp13_);
1224
_tmp15_ = unity_music_lens_rhythmbox_collection_get_track (self, (DeeModelIter*) _tmp14_);
1225
results = g_slist_prepend (results, _tmp15_);
1231
_g_ptr_array_unref0 (iter_arr);
1236
static gpointer _g_variant_ref0 (gpointer self) {
1237
return self ? g_variant_ref (self) : NULL;
1241
static GVariant* unity_music_lens_rhythmbox_collection_cached_variant_for_string (UnityMusicLensRhythmboxCollection* self, const gchar* input) {
1242
GVariant* result = NULL;
1243
const gchar* _tmp0_ = NULL;
1244
const gchar* _tmp1_;
1245
const gchar* _tmp3_;
1248
const gchar* _tmp5_;
1249
gconstpointer _tmp6_ = NULL;
1253
const gchar* _tmp9_;
1256
GHashTable* _tmp12_;
1258
const gchar* _tmp14_ = NULL;
1261
g_return_val_if_fail (self != NULL, NULL);
1263
if (_tmp1_ != NULL) {
1264
const gchar* _tmp2_;
1272
_tmp4_ = self->priv->variant_store;
1274
_tmp6_ = g_hash_table_lookup (_tmp4_, _tmp5_);
1275
_tmp7_ = _g_variant_ref0 ((GVariant*) _tmp6_);
1278
if (_tmp8_ != NULL) {
1283
_tmp10_ = g_variant_new_string (_tmp9_);
1284
_tmp11_ = g_variant_ref_sink (_tmp10_);
1285
_g_variant_unref0 (v);
1287
_tmp12_ = self->priv->variant_store;
1289
_tmp14_ = g_variant_get_string (_tmp13_, NULL);
1291
_tmp16_ = _g_variant_ref0 (_tmp15_);
1292
g_hash_table_insert (_tmp12_, _tmp14_, _tmp16_);
1298
static GVariant* unity_music_lens_rhythmbox_collection_cached_variant_for_int (UnityMusicLensRhythmboxCollection* self, gint input) {
1299
GVariant* result = NULL;
1302
gconstpointer _tmp2_ = NULL;
1310
g_return_val_if_fail (self != NULL, NULL);
1311
_tmp0_ = self->priv->int_variant_store;
1313
_tmp2_ = g_hash_table_lookup (_tmp0_, GINT_TO_POINTER (_tmp1_));
1314
_tmp3_ = _g_variant_ref0 ((GVariant*) _tmp2_);
1317
if (_tmp4_ != NULL) {
1322
_tmp6_ = g_variant_new_int32 ((gint32) _tmp5_);
1323
_tmp7_ = g_variant_ref_sink (_tmp6_);
1324
_g_variant_unref0 (v);
1332
_tmp9_ = self->priv->int_variant_store;
1335
_tmp12_ = _g_variant_ref0 (_tmp11_);
1336
g_hash_table_insert (_tmp9_, GINT_TO_POINTER (_tmp10_), _tmp12_);
1343
static void unity_music_lens_rhythmbox_collection_prepare_row_buffer (UnityMusicLensRhythmboxCollection* self, UnityMusicLensTrack* track) {
1344
UnityMusicLensTrack* _tmp0_;
1345
UnityMusicLensTrackType _tmp1_;
1346
UnityMusicLensTrackType _tmp2_;
1347
GVariant* _tmp3_ = NULL;
1349
UnityMusicLensTrack* _tmp4_;
1350
const gchar* _tmp5_;
1351
const gchar* _tmp6_;
1355
UnityMusicLensTrack* _tmp9_;
1356
const gchar* _tmp10_;
1357
const gchar* _tmp11_;
1361
UnityMusicLensTrack* _tmp14_;
1362
const gchar* _tmp15_;
1363
const gchar* _tmp16_;
1364
GVariant* _tmp17_ = NULL;
1366
UnityMusicLensTrack* _tmp18_;
1367
const gchar* _tmp19_;
1368
const gchar* _tmp20_;
1369
GVariant* _tmp21_ = NULL;
1370
GVariant* album_artist;
1371
UnityMusicLensTrack* _tmp22_;
1372
const gchar* _tmp23_;
1373
const gchar* _tmp24_;
1374
GVariant* _tmp25_ = NULL;
1376
UnityMusicLensTrack* _tmp26_;
1377
const gchar* _tmp27_;
1378
const gchar* _tmp28_;
1379
GVariant* _tmp29_ = NULL;
1380
GVariant* mime_type;
1381
UnityMusicLensTrack* _tmp30_;
1382
const gchar* _tmp31_;
1383
const gchar* _tmp32_;
1384
GVariant* _tmp33_ = NULL;
1386
UnityMusicLensTrack* _tmp34_;
1387
const gchar* _tmp35_;
1388
const gchar* _tmp36_;
1389
GVariant* _tmp37_ = NULL;
1391
UnityMusicLensTrack* _tmp38_;
1394
GVariant* _tmp41_ = NULL;
1395
GVariant* track_number;
1396
UnityMusicLensTrack* _tmp42_;
1399
GVariant* _tmp45_ = NULL;
1401
UnityMusicLensTrack* _tmp46_;
1404
GVariant* _tmp49_ = NULL;
1405
GVariant* play_count;
1406
UnityMusicLensTrack* _tmp50_;
1409
GVariant* _tmp53_ = NULL;
1437
g_return_if_fail (self != NULL);
1438
g_return_if_fail (track != NULL);
1440
_tmp1_ = unity_music_lens_track_get_type_track (_tmp0_);
1442
_tmp3_ = unity_music_lens_rhythmbox_collection_cached_variant_for_int (self, (gint) _tmp2_);
1445
_tmp5_ = unity_music_lens_track_get_uri (_tmp4_);
1447
_tmp7_ = g_variant_new_string (_tmp6_);
1448
_tmp8_ = g_variant_ref_sink (_tmp7_);
1451
_tmp10_ = unity_music_lens_track_get_title (_tmp9_);
1453
_tmp12_ = g_variant_new_string (_tmp11_);
1454
_tmp13_ = g_variant_ref_sink (_tmp12_);
1457
_tmp15_ = unity_music_lens_track_get_artist (_tmp14_);
1459
_tmp17_ = unity_music_lens_rhythmbox_collection_cached_variant_for_string (self, _tmp16_);
1462
_tmp19_ = unity_music_lens_track_get_album_artist (_tmp18_);
1464
_tmp21_ = unity_music_lens_rhythmbox_collection_cached_variant_for_string (self, _tmp20_);
1465
album_artist = _tmp21_;
1467
_tmp23_ = unity_music_lens_track_get_album (_tmp22_);
1469
_tmp25_ = unity_music_lens_rhythmbox_collection_cached_variant_for_string (self, _tmp24_);
1472
_tmp27_ = unity_music_lens_track_get_mime_type (_tmp26_);
1474
_tmp29_ = unity_music_lens_rhythmbox_collection_cached_variant_for_string (self, _tmp28_);
1475
mime_type = _tmp29_;
1477
_tmp31_ = unity_music_lens_track_get_artwork_path (_tmp30_);
1479
_tmp33_ = unity_music_lens_rhythmbox_collection_cached_variant_for_string (self, _tmp32_);
1482
_tmp35_ = unity_music_lens_track_get_genre (_tmp34_);
1484
_tmp37_ = unity_music_lens_rhythmbox_collection_cached_variant_for_string (self, _tmp36_);
1487
_tmp39_ = unity_music_lens_track_get_track_number (_tmp38_);
1489
_tmp41_ = unity_music_lens_rhythmbox_collection_cached_variant_for_int (self, _tmp40_);
1490
track_number = _tmp41_;
1492
_tmp43_ = unity_music_lens_track_get_year (_tmp42_);
1494
_tmp45_ = unity_music_lens_rhythmbox_collection_cached_variant_for_int (self, _tmp44_);
1497
_tmp47_ = unity_music_lens_track_get_play_count (_tmp46_);
1499
_tmp49_ = unity_music_lens_rhythmbox_collection_cached_variant_for_int (self, _tmp48_);
1500
play_count = _tmp49_;
1502
_tmp51_ = unity_music_lens_track_get_duration (_tmp50_);
1504
_tmp53_ = unity_music_lens_rhythmbox_collection_cached_variant_for_int (self, _tmp52_);
1506
_tmp54_ = _g_variant_ref0 (type);
1507
_g_variant_unref0 (self->priv->row_buffer[0]);
1508
self->priv->row_buffer[0] = _tmp54_;
1509
_tmp55_ = self->priv->row_buffer[0];
1510
_tmp56_ = _g_variant_ref0 (uri);
1511
_g_variant_unref0 (self->priv->row_buffer[1]);
1512
self->priv->row_buffer[1] = _tmp56_;
1513
_tmp57_ = self->priv->row_buffer[1];
1514
_tmp58_ = _g_variant_ref0 (title);
1515
_g_variant_unref0 (self->priv->row_buffer[2]);
1516
self->priv->row_buffer[2] = _tmp58_;
1517
_tmp59_ = self->priv->row_buffer[2];
1518
_tmp60_ = _g_variant_ref0 (artist);
1519
_g_variant_unref0 (self->priv->row_buffer[3]);
1520
self->priv->row_buffer[3] = _tmp60_;
1521
_tmp61_ = self->priv->row_buffer[3];
1522
_tmp62_ = _g_variant_ref0 (album);
1523
_g_variant_unref0 (self->priv->row_buffer[4]);
1524
self->priv->row_buffer[4] = _tmp62_;
1525
_tmp63_ = self->priv->row_buffer[4];
1526
_tmp64_ = _g_variant_ref0 (artwork);
1527
_g_variant_unref0 (self->priv->row_buffer[5]);
1528
self->priv->row_buffer[5] = _tmp64_;
1529
_tmp65_ = self->priv->row_buffer[5];
1530
_tmp66_ = _g_variant_ref0 (mime_type);
1531
_g_variant_unref0 (self->priv->row_buffer[6]);
1532
self->priv->row_buffer[6] = _tmp66_;
1533
_tmp67_ = self->priv->row_buffer[6];
1534
_tmp68_ = _g_variant_ref0 (genre);
1535
_g_variant_unref0 (self->priv->row_buffer[7]);
1536
self->priv->row_buffer[7] = _tmp68_;
1537
_tmp69_ = self->priv->row_buffer[7];
1538
_tmp70_ = _g_variant_ref0 (album_artist);
1539
_g_variant_unref0 (self->priv->row_buffer[8]);
1540
self->priv->row_buffer[8] = _tmp70_;
1541
_tmp71_ = self->priv->row_buffer[8];
1542
_tmp72_ = _g_variant_ref0 (track_number);
1543
_g_variant_unref0 (self->priv->row_buffer[9]);
1544
self->priv->row_buffer[9] = _tmp72_;
1545
_tmp73_ = self->priv->row_buffer[9];
1546
_tmp74_ = _g_variant_ref0 (year);
1547
_g_variant_unref0 (self->priv->row_buffer[10]);
1548
self->priv->row_buffer[10] = _tmp74_;
1549
_tmp75_ = self->priv->row_buffer[10];
1550
_tmp76_ = _g_variant_ref0 (play_count);
1551
_g_variant_unref0 (self->priv->row_buffer[11]);
1552
self->priv->row_buffer[11] = _tmp76_;
1553
_tmp77_ = self->priv->row_buffer[11];
1554
_tmp78_ = _g_variant_ref0 (duration);
1555
_g_variant_unref0 (self->priv->row_buffer[12]);
1556
self->priv->row_buffer[12] = _tmp78_;
1557
_tmp79_ = self->priv->row_buffer[12];
1558
_g_variant_unref0 (duration);
1559
_g_variant_unref0 (play_count);
1560
_g_variant_unref0 (year);
1561
_g_variant_unref0 (track_number);
1562
_g_variant_unref0 (genre);
1563
_g_variant_unref0 (artwork);
1564
_g_variant_unref0 (mime_type);
1565
_g_variant_unref0 (album);
1566
_g_variant_unref0 (album_artist);
1567
_g_variant_unref0 (artist);
1568
_g_variant_unref0 (title);
1569
_g_variant_unref0 (uri);
1570
_g_variant_unref0 (type);
1574
static Block2Data* block2_data_ref (Block2Data* _data2_) {
1575
g_atomic_int_inc (&_data2_->_ref_count_);
1580
static void block2_data_unref (void * _userdata_) {
1581
Block2Data* _data2_;
1582
_data2_ = (Block2Data*) _userdata_;
1583
if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
1584
UnityMusicLensRhythmboxCollection * self;
1585
self = _data2_->self;
1586
_g_free0 (_data2_->path);
1587
_g_object_unref0 (self);
1588
g_slice_free (Block2Data, _data2_);
1593
static void ____lambda7_ (Block2Data* _data2_) {
1594
UnityMusicLensRhythmboxCollection * self;
1595
TDB_CONTEXT* _tmp0_;
1596
self = _data2_->self;
1597
_tmp0_ = self->priv->album_art_tdb;
1598
if (_tmp0_ == NULL) {
1599
const gchar* _tmp1_;
1600
_tmp1_ = _data2_->path;
1601
unity_music_lens_rhythmbox_collection_parse_metadata_file (self, _tmp1_);
1604
_tmp2_ = self->priv->current_album_art_tag;
1605
self->priv->current_album_art_tag = _tmp2_ + 1;
1610
static void _____lambda7__g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self) {
1611
____lambda7_ (self);
1615
void unity_music_lens_rhythmbox_collection_parse_metadata_file (UnityMusicLensRhythmboxCollection* self, const gchar* path) {
1616
Block2Data* _data2_;
1617
const gchar* _tmp0_;
1619
TDB_CONTEXT* _tmp2_;
1620
GFileMonitor* _tmp3_;
1622
const gchar* _tmp12_;
1624
TDB_CONTEXT* _tmp14_;
1625
TDB_CONTEXT* _tmp15_;
1626
GError * _inner_error_ = NULL;
1627
g_return_if_fail (self != NULL);
1628
g_return_if_fail (path != NULL);
1629
_data2_ = g_slice_new0 (Block2Data);
1630
_data2_->_ref_count_ = 1;
1631
_data2_->self = g_object_ref (self);
1633
_tmp1_ = g_strdup (_tmp0_);
1634
_data2_->path = _tmp1_;
1635
_tmp2_ = self->priv->album_art_tdb;
1636
if (_tmp2_ != NULL) {
1637
block2_data_unref (_data2_);
1641
_tmp3_ = self->priv->tdb_monitor;
1642
if (_tmp3_ == NULL) {
1643
const gchar* _tmp4_;
1644
GFile* _tmp5_ = NULL;
1646
_tmp4_ = _data2_->path;
1647
_tmp5_ = g_file_new_for_path (_tmp4_);
1651
GFileMonitor* _tmp7_ = NULL;
1652
GFileMonitor* _tmp8_;
1653
GFileMonitor* _tmp9_;
1655
_tmp7_ = g_file_monitor (_tmp6_, G_FILE_MONITOR_NONE, NULL, &_inner_error_);
1657
if (_inner_error_ != NULL) {
1658
goto __catch11_g_error;
1660
_g_object_unref0 (self->priv->tdb_monitor);
1661
self->priv->tdb_monitor = _tmp8_;
1662
_tmp9_ = self->priv->tdb_monitor;
1663
g_signal_connect_data (_tmp9_, "changed", (GCallback) _____lambda7__g_file_monitor_changed, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
1670
const gchar* _tmp11_;
1671
err = _inner_error_;
1672
_inner_error_ = NULL;
1674
_tmp11_ = _tmp10_->message;
1675
g_warning ("rhythmbox-collection.vala:495: %s", _tmp11_);
1676
_g_error_free0 (err);
1679
if (_inner_error_ != NULL) {
1680
_g_object_unref0 (tdb_file);
1681
block2_data_unref (_data2_);
1683
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);
1684
g_clear_error (&_inner_error_);
1687
_g_object_unref0 (tdb_file);
1689
flags = (TDB_INCOMPATIBLE_HASH | TDB_SEQNUM) | TDB_NOLOCK;
1690
_tmp12_ = _data2_->path;
1692
_tmp14_ = tdb_open (_tmp12_, 999, _tmp13_, O_RDONLY, (mode_t) 0600);
1693
_tdb_close0 (self->priv->album_art_tdb);
1694
self->priv->album_art_tdb = _tmp14_;
1695
_tmp15_ = self->priv->album_art_tdb;
1696
if (_tmp15_ == NULL) {
1697
g_warning ("rhythmbox-collection.vala:504: Unable to open album-art DB!");
1698
block2_data_unref (_data2_);
1702
block2_data_unref (_data2_);
1707
static void __lambda8_ (UnityMusicLensRhythmboxCollection* self, UnityMusicLensTrack* track) {
1708
UnityMusicLensTrack* _tmp0_;
1709
gchar* _tmp1_ = NULL;
1711
const gchar* _tmp2_;
1712
UnityMusicLensTrack* _tmp6_;
1713
DeeSequenceModel* _tmp7_;
1714
DeeModelIter* _tmp8_ = NULL;
1716
gboolean _tmp9_ = FALSE;
1717
UnityMusicLensTrack* _tmp10_;
1718
const gchar* _tmp11_;
1719
const gchar* _tmp12_;
1721
const gchar* _tmp17_ = NULL;
1722
UnityMusicLensTrack* _tmp18_;
1723
const gchar* _tmp19_;
1724
const gchar* _tmp20_;
1725
UnityMusicLensTrack* _tmp27_;
1726
const gchar* _tmp28_;
1727
const gchar* _tmp29_;
1728
const gchar* _tmp30_;
1729
gchar* _tmp31_ = NULL;
1731
GHashTable* _tmp32_;
1732
const gchar* _tmp33_;
1733
gconstpointer _tmp34_ = NULL;
1738
DeeModelIter* _tmp44_;
1739
g_return_if_fail (track != NULL);
1741
_tmp1_ = unity_music_lens_rhythmbox_collection_get_albumart (self, _tmp0_);
1744
if (_tmp2_ != NULL) {
1745
UnityMusicLensTrack* _tmp3_;
1746
const gchar* _tmp4_;
1749
unity_music_lens_track_set_artwork_path (_tmp3_, _tmp4_);
1751
UnityMusicLensTrack* _tmp5_;
1753
unity_music_lens_track_set_artwork_path (_tmp5_, "audio-x-generic");
1756
unity_music_lens_rhythmbox_collection_prepare_row_buffer (self, _tmp6_);
1757
_tmp7_ = self->priv->all_tracks;
1758
_tmp8_ = dee_model_append_row ((DeeModel*) _tmp7_, self->priv->row_buffer);
1761
_tmp11_ = unity_music_lens_track_get_album (_tmp10_);
1763
if (g_strcmp0 (_tmp12_, "") == 0) {
1766
UnityMusicLensTrack* _tmp13_;
1767
const gchar* _tmp14_;
1768
const gchar* _tmp15_;
1770
_tmp14_ = unity_music_lens_track_get_album (_tmp13_);
1772
_tmp9_ = g_strcmp0 (_tmp15_, UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_UNKNOWN_ALBUM) == 0;
1776
_g_free0 (albumart);
1780
_tmp19_ = unity_music_lens_track_get_album_artist (_tmp18_);
1782
if (_tmp20_ != NULL) {
1783
UnityMusicLensTrack* _tmp21_;
1784
const gchar* _tmp22_;
1785
const gchar* _tmp23_;
1787
_tmp22_ = unity_music_lens_track_get_album_artist (_tmp21_);
1791
UnityMusicLensTrack* _tmp24_;
1792
const gchar* _tmp25_;
1793
const gchar* _tmp26_;
1795
_tmp25_ = unity_music_lens_track_get_artist (_tmp24_);
1800
_tmp28_ = unity_music_lens_track_get_album (_tmp27_);
1803
_tmp31_ = g_strdup_printf ("%s - %s", _tmp29_, _tmp30_);
1804
album_key = _tmp31_;
1805
_tmp32_ = self->priv->album_to_tracks_map;
1806
_tmp33_ = album_key;
1807
_tmp34_ = g_hash_table_lookup (_tmp32_, _tmp33_);
1808
_tmp35_ = _g_ptr_array_ref0 ((GPtrArray*) _tmp34_);
1811
if (_tmp36_ == NULL) {
1813
GHashTable* _tmp38_;
1814
const gchar* _tmp39_;
1818
_tmp37_ = g_ptr_array_new_with_free_func (NULL);
1819
_g_ptr_array_unref0 (arr);
1821
_tmp38_ = self->priv->album_to_tracks_map;
1822
_tmp39_ = album_key;
1823
_tmp40_ = g_strdup (_tmp39_);
1825
_tmp42_ = _g_ptr_array_ref0 (_tmp41_);
1826
g_hash_table_insert (_tmp38_, _tmp40_, _tmp42_);
1830
g_ptr_array_add (_tmp43_, _tmp44_);
1831
_g_ptr_array_unref0 (arr);
1832
_g_free0 (album_key);
1833
_g_free0 (albumart);
1837
static void ___lambda8__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready (UnityMusicLensRhythmboxCollectionXmlParser* _sender, UnityMusicLensTrack* track, gpointer self) {
1838
__lambda8_ (self, track);
1842
static Block3Data* block3_data_ref (Block3Data* _data3_) {
1843
g_atomic_int_inc (&_data3_->_ref_count_);
1848
static void block3_data_unref (void * _userdata_) {
1849
Block3Data* _data3_;
1850
_data3_ = (Block3Data*) _userdata_;
1851
if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
1853
self = _data3_->self;
1854
_g_ptr_array_unref0 (self);
1855
g_slice_free (Block3Data, _data3_);
1860
static gint __lambda1_ (Block3Data* _data3_, gconstpointer** a, gconstpointer** b) {
1863
GCompareDataFunc _tmp0_;
1864
void* _tmp0__target;
1865
gconstpointer** _tmp1_;
1866
gconstpointer** _tmp2_;
1868
self = _data3_->self;
1869
_tmp0_ = _data3_->compare_func;
1870
_tmp0__target = _data3_->compare_func_target;
1873
_tmp3_ = _tmp0_ ((gconstpointer**) (*_tmp1_), (gconstpointer**) (*_tmp2_), _tmp0__target);
1879
static gint ___lambda1__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
1881
result = __lambda1_ (self, a, b);
1886
static void vala_g_ptr_array_sort_with_data (GPtrArray* self, GCompareDataFunc compare_func, void* compare_func_target) {
1887
Block3Data* _data3_;
1888
GCompareDataFunc _tmp0_;
1889
void* _tmp0__target;
1890
g_return_if_fail (self != NULL);
1891
_data3_ = g_slice_new0 (Block3Data);
1892
_data3_->_ref_count_ = 1;
1893
_data3_->self = g_ptr_array_ref (self);
1894
_tmp0_ = compare_func;
1895
_tmp0__target = compare_func_target;
1896
_data3_->compare_func = _tmp0_;
1897
_data3_->compare_func_target = _tmp0__target;
1898
g_ptr_array_sort_with_data (self, ___lambda1__gcompare_data_func, _data3_);
1899
block3_data_unref (_data3_);
1904
static gint ____lambda9_ (UnityMusicLensRhythmboxCollection* self, DeeModelIter* a, DeeModelIter* b) {
1906
DeeSequenceModel* _tmp0_;
1907
DeeModelIter* _tmp1_;
1910
DeeSequenceModel* _tmp3_;
1911
DeeModelIter* _tmp4_;
1914
g_return_val_if_fail (a != NULL, 0);
1915
g_return_val_if_fail (b != NULL, 0);
1916
_tmp0_ = self->priv->all_tracks;
1918
_tmp2_ = dee_model_get_int32 ((DeeModel*) _tmp0_, _tmp1_, (guint) UNITY_MUSIC_LENS_COLUMNS_TRACK_NUMBER);
1920
_tmp3_ = self->priv->all_tracks;
1922
_tmp5_ = dee_model_get_int32 ((DeeModel*) _tmp3_, _tmp4_, (guint) UNITY_MUSIC_LENS_COLUMNS_TRACK_NUMBER);
1924
result = (gint) (trackno1 - trackno2);
1929
static gint _____lambda9__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
1931
result = ____lambda9_ (self, a, b);
1936
void unity_music_lens_rhythmbox_collection_parse_file (UnityMusicLensRhythmboxCollection* self, const gchar* path) {
1937
DeeSequenceModel* _tmp0_;
1939
UnityMusicLensRhythmboxCollectionXmlParser* _tmp2_;
1940
UnityMusicLensRhythmboxCollectionXmlParser* parser;
1941
UnityMusicLensRhythmboxCollectionXmlParser* _tmp3_;
1942
const gchar* _tmp4_;
1943
GFile* _tmp5_ = NULL;
1945
GHashTable* _tmp16_;
1946
GList* _tmp17_ = NULL;
1949
GError * _inner_error_ = NULL;
1950
g_return_if_fail (self != NULL);
1951
g_return_if_fail (path != NULL);
1952
_g_object_unref0 (self->priv->index);
1953
self->priv->index = NULL;
1954
_tmp0_ = self->priv->all_tracks;
1955
dee_model_clear ((DeeModel*) _tmp0_);
1956
unity_music_lens_rhythmbox_collection_initialize_index (self);
1957
self->priv->current_album_art_tag = 0;
1958
_tmp1_ = self->priv->album_to_tracks_map;
1959
g_hash_table_remove_all (_tmp1_);
1960
_tmp2_ = unity_music_lens_rhythmbox_collection_xml_parser_new ();
1963
g_signal_connect_object (_tmp3_, "track-info-ready", (GCallback) ___lambda8__unity_music_lens_rhythmbox_collection_xml_parser_track_info_ready, self, 0);
1965
_tmp5_ = g_file_new_for_path (_tmp4_);
1969
GFileInputStream* _tmp7_ = NULL;
1970
GFileInputStream* stream;
1971
guint8 buffer[65536] = {0};
1972
gsize bytes_read = 0UL;
1974
_tmp7_ = g_file_read (_tmp6_, NULL, &_inner_error_);
1976
if (_inner_error_ != NULL) {
1977
goto __catch12_g_error;
1980
GFileInputStream* _tmp8_;
1984
UnityMusicLensRhythmboxCollectionXmlParser* _tmp12_;
1987
_tmp9_ = g_input_stream_read ((GInputStream*) _tmp8_, buffer, (gsize) 65536, NULL, &_inner_error_);
1989
if (_inner_error_ != NULL) {
1990
_g_object_unref0 (stream);
1991
goto __catch12_g_error;
1993
bytes_read = (gsize) _tmp10_;
1994
_tmp11_ = bytes_read;
1995
if (!(_tmp11_ > ((gsize) 0))) {
1999
_tmp13_ = bytes_read;
2000
unity_music_lens_rhythmbox_collection_xml_parser_parse (_tmp12_, (const gchar*) buffer, _tmp13_, &_inner_error_);
2001
if (_inner_error_ != NULL) {
2002
_g_object_unref0 (stream);
2003
goto __catch12_g_error;
2006
_g_object_unref0 (stream);
2013
const gchar* _tmp15_;
2014
err = _inner_error_;
2015
_inner_error_ = NULL;
2017
_tmp15_ = _tmp14_->message;
2018
g_warning ("rhythmbox-collection.vala:570: Error while parsing rhythmbox DB: %s", _tmp15_);
2019
_g_error_free0 (err);
2022
if (_inner_error_ != NULL) {
2023
_g_object_unref0 (file);
2024
_g_object_unref0 (parser);
2025
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);
2026
g_clear_error (&_inner_error_);
2029
_tmp16_ = self->priv->album_to_tracks_map;
2030
_tmp17_ = g_hash_table_get_keys (_tmp16_);
2031
all_albums = _tmp17_;
2032
_tmp18_ = all_albums;
2034
GList* s_collection = NULL;
2036
s_collection = _tmp18_;
2037
for (s_it = s_collection; s_it != NULL; s_it = s_it->next) {
2038
const gchar* s = NULL;
2039
s = (const gchar*) s_it->data;
2041
GHashTable* _tmp19_;
2042
const gchar* _tmp20_;
2043
gconstpointer _tmp21_ = NULL;
2044
_tmp19_ = self->priv->album_to_tracks_map;
2046
_tmp21_ = g_hash_table_lookup (_tmp19_, _tmp20_);
2047
vala_g_ptr_array_sort_with_data ((GPtrArray*) _tmp21_, _____lambda9__gcompare_data_func, self);
2051
_g_list_free0 (all_albums);
2052
_g_object_unref0 (file);
2053
_g_object_unref0 (parser);
2057
static void unity_music_lens_rhythmbox_collection_add_result (UnityMusicLensRhythmboxCollection* self, DeeModel* results_model, DeeModel* model, DeeModelIter* iter, UnityMusicLensRhythmboxCollectionResultType result_type, guint category_id) {
2058
DeeModelTag* _tmp0_;
2060
DeeModelIter* _tmp2_;
2061
gconstpointer _tmp3_ = NULL;
2065
UnityMusicLensColumns _tmp42_ = 0;
2066
gboolean _tmp43_ = FALSE;
2067
UnityMusicLensRhythmboxCollectionResultType _tmp44_;
2069
UnityMusicLensColumns _tmp47_;
2070
UnityMusicLensColumns title_col;
2072
DeeModelIter* _tmp49_;
2073
UnityMusicLensColumns _tmp50_;
2074
const gchar* _tmp51_ = NULL;
2077
DeeModelIter* _tmp53_;
2078
const gchar* _tmp54_ = NULL;
2082
DeeModelIter* _tmp57_;
2083
const gchar* _tmp58_ = NULL;
2086
UnityMusicLensRhythmboxCollectionResultType _tmp60_;
2088
const gchar* _tmp85_;
2090
DeeModelIter* _tmp87_;
2091
const gchar* _tmp88_ = NULL;
2094
DeeModelIter* _tmp91_;
2095
const gchar* _tmp92_ = NULL;
2096
const gchar* _tmp93_;
2098
DeeModelIter* _tmp95_;
2099
const gchar* _tmp96_ = NULL;
2100
const gchar* _tmp97_;
2101
g_return_if_fail (self != NULL);
2102
g_return_if_fail (results_model != NULL);
2103
g_return_if_fail (model != NULL);
2104
g_return_if_fail (iter != NULL);
2105
_tmp0_ = self->priv->album_art_tag;
2108
_tmp3_ = dee_model_get_tag (_tmp1_, _tmp2_, _tmp0_);
2109
tag = GPOINTER_TO_INT (_tmp3_);
2111
_tmp5_ = self->priv->current_album_art_tag;
2112
if (_tmp4_ < _tmp5_) {
2114
DeeModelIter* _tmp7_;
2115
const gchar* _tmp8_ = NULL;
2118
DeeModelIter* _tmp10_;
2119
const gchar* _tmp11_ = NULL;
2120
const gchar* artist;
2121
const gchar* _tmp12_;
2122
const gchar* _tmp16_;
2123
const gchar* _tmp17_;
2124
gchar* _tmp18_ = NULL;
2125
gchar* album_art_string;
2126
const gchar* _tmp19_;
2127
DeeModelTag* _tmp38_;
2129
DeeModelIter* _tmp40_;
2133
_tmp8_ = dee_model_get_string (_tmp6_, _tmp7_, (guint) UNITY_MUSIC_LENS_COLUMNS_ALBUM);
2137
_tmp11_ = dee_model_get_string (_tmp9_, _tmp10_, (guint) UNITY_MUSIC_LENS_COLUMNS_ALBUM_ARTIST);
2140
if (g_strcmp0 (_tmp12_, "") == 0) {
2142
DeeModelIter* _tmp14_;
2143
const gchar* _tmp15_ = NULL;
2146
_tmp15_ = dee_model_get_string (_tmp13_, _tmp14_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTIST);
2151
_tmp18_ = unity_music_lens_rhythmbox_collection_check_album_art_tdb (self, _tmp16_, _tmp17_);
2152
album_art_string = _tmp18_;
2153
_tmp19_ = album_art_string;
2154
if (_tmp19_ != NULL) {
2155
gchar* filename = NULL;
2156
const gchar* _tmp20_ = NULL;
2157
const gchar* _tmp21_;
2158
gchar* _tmp22_ = NULL;
2159
const gchar* _tmp23_ = NULL;
2160
const gchar* _tmp24_;
2161
gboolean _tmp25_ = FALSE;
2162
const gchar* _tmp27_;
2164
const gchar* _tmp29_;
2166
DeeModelIter* _tmp31_;
2167
const gchar* _tmp32_ = NULL;
2168
_tmp20_ = g_get_user_cache_dir ();
2169
_tmp21_ = album_art_string;
2170
_tmp22_ = g_build_filename (_tmp20_, "rhythmbox", "album-art", _tmp21_, NULL);
2171
_g_free0 (filename);
2174
_tmp25_ = g_file_test (_tmp24_, G_FILE_TEST_EXISTS);
2176
const gchar* _tmp26_;
2180
_tmp23_ = "audio-x-generic";
2183
_tmp28_ = g_strdup (_tmp27_);
2184
_g_free0 (album_art_string);
2185
album_art_string = _tmp28_;
2186
_tmp29_ = album_art_string;
2189
_tmp32_ = dee_model_get_string (_tmp30_, _tmp31_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTWORK);
2190
if (g_strcmp0 (_tmp29_, _tmp32_) != 0) {
2192
DeeModelIter* _tmp34_;
2193
const gchar* _tmp35_;
2194
GVariant* _tmp36_ = NULL;
2198
_tmp35_ = album_art_string;
2199
_tmp36_ = unity_music_lens_rhythmbox_collection_cached_variant_for_string (self, _tmp35_);
2201
dee_model_set_value (_tmp33_, _tmp34_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTWORK, _tmp37_);
2202
_g_variant_unref0 (_tmp37_);
2204
_g_free0 (filename);
2206
_tmp38_ = self->priv->album_art_tag;
2209
_tmp41_ = self->priv->current_album_art_tag;
2210
dee_model_set_tag (_tmp39_, _tmp40_, _tmp38_, GINT_TO_POINTER (_tmp41_));
2211
_g_free0 (album_art_string);
2213
_tmp44_ = result_type;
2214
if (_tmp44_ == UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_SONG) {
2217
UnityMusicLensRhythmboxCollectionResultType _tmp45_;
2218
_tmp45_ = result_type;
2219
_tmp43_ = _tmp45_ == UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_RADIO;
2223
_tmp42_ = UNITY_MUSIC_LENS_COLUMNS_TITLE;
2225
_tmp42_ = UNITY_MUSIC_LENS_COLUMNS_ALBUM;
2228
title_col = _tmp47_;
2231
_tmp50_ = title_col;
2232
_tmp51_ = dee_model_get_string (_tmp48_, _tmp49_, (guint) _tmp50_);
2236
_tmp54_ = dee_model_get_string (_tmp52_, _tmp53_, (guint) UNITY_MUSIC_LENS_COLUMNS_URI);
2237
_tmp55_ = g_strdup (_tmp54_);
2241
_tmp58_ = dee_model_get_string (_tmp56_, _tmp57_, (guint) UNITY_MUSIC_LENS_COLUMNS_URI);
2242
_tmp59_ = g_strdup (_tmp58_);
2244
_tmp60_ = result_type;
2245
if (_tmp60_ == UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_ALBUM) {
2246
gboolean _tmp61_ = FALSE;
2247
const gchar* _tmp62_;
2250
DeeModelIter* _tmp66_;
2251
const gchar* _tmp67_ = NULL;
2252
const gchar* artist;
2253
const gchar* _tmp68_;
2254
const gchar* _tmp72_;
2255
const gchar* _tmp73_;
2256
gchar* _tmp74_ = NULL;
2260
const gchar* _tmp76_;
2261
GSList* _tmp77_ = NULL;
2264
const gchar* _tmp82_;
2265
gchar* _tmp83_ = NULL;
2267
if (g_strcmp0 (_tmp62_, "") == 0) {
2270
const gchar* _tmp63_;
2272
_tmp61_ = g_strcmp0 (_tmp63_, UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_UNKNOWN_ALBUM) == 0;
2282
_tmp67_ = dee_model_get_string (_tmp65_, _tmp66_, (guint) UNITY_MUSIC_LENS_COLUMNS_ALBUM_ARTIST);
2285
if (g_strcmp0 (_tmp68_, "") == 0) {
2287
DeeModelIter* _tmp70_;
2288
const gchar* _tmp71_ = NULL;
2291
_tmp71_ = dee_model_get_string (_tmp69_, _tmp70_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTIST);
2296
_tmp74_ = g_strdup_printf ("%s - %s", _tmp72_, _tmp73_);
2297
album_key = _tmp74_;
2298
_tmp75_ = g_string_new ("");
2300
_tmp76_ = album_key;
2301
_tmp77_ = unity_music_lens_rhythmbox_collection_get_album_tracks (self, _tmp76_);
2303
GSList* track_uri_collection = NULL;
2304
GSList* track_uri_it = NULL;
2305
track_uri_collection = _tmp77_;
2306
for (track_uri_it = track_uri_collection; track_uri_it != NULL; track_uri_it = track_uri_it->next) {
2307
const gchar* track_uri = NULL;
2308
track_uri = (const gchar*) track_uri_it->data;
2311
const gchar* _tmp79_;
2313
_tmp79_ = track_uri;
2314
g_string_append_printf (_tmp78_, "%s\r\n", _tmp79_);
2317
_g_slist_free0 (track_uri_collection);
2320
_tmp81_ = _tmp80_->str;
2321
_tmp80_->str = NULL;
2324
_tmp82_ = album_key;
2325
_tmp83_ = g_strdup_printf ("album://%s", _tmp82_);
2328
_g_string_free0 (sb);
2329
_g_free0 (album_key);
2331
_tmp84_ = results_model;
2335
_tmp88_ = dee_model_get_string (_tmp86_, _tmp87_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTWORK);
2336
_tmp89_ = category_id;
2339
_tmp92_ = dee_model_get_string (_tmp90_, _tmp91_, (guint) UNITY_MUSIC_LENS_COLUMNS_MIMETYPE);
2343
_tmp96_ = dee_model_get_string (_tmp94_, _tmp95_, (guint) UNITY_MUSIC_LENS_COLUMNS_ARTIST);
2345
dee_model_append (_tmp84_, _tmp85_, _tmp88_, _tmp89_, _tmp92_, _tmp93_, _tmp96_, _tmp97_, NULL);
2351
static gchar* string_strip (const gchar* self) {
2352
gchar* result = NULL;
2353
gchar* _tmp0_ = NULL;
2355
const gchar* _tmp1_;
2356
g_return_val_if_fail (self != NULL, NULL);
2357
_tmp0_ = g_strdup (self);
2360
g_strstrip (_tmp1_);
2366
static gpointer _g_object_ref0 (gpointer self) {
2367
return self ? g_object_ref (self) : NULL;
2371
static gint ____lambda10_ (UnityMusicLensRhythmboxCollection* self, DeeModelIter* a, DeeModelIter* b) {
2374
DeeModelIter* _tmp1_;
2375
DeeModelIter* _tmp2_;
2377
g_return_val_if_fail (a != NULL, 0);
2378
g_return_val_if_fail (b != NULL, 0);
2381
if (_tmp1_ == _tmp2_) {
2385
DeeModelIter* _tmp4_;
2386
DeeModelIter* _tmp5_;
2390
if (((void*) _tmp4_) > ((void*) _tmp5_)) {
2404
static gint _____lambda10__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
2406
result = ____lambda10_ (self, a, b);
2411
void unity_music_lens_rhythmbox_collection_search (UnityMusicLensRhythmboxCollection* self, UnityLensSearch* search, UnitySearchType search_type, GList* filters, gint max_results, gint category_override) {
2413
UnityLensSearch* _tmp0_;
2414
const gchar* _tmp1_;
2415
const gchar* _tmp2_;
2416
gchar* _tmp3_ = NULL;
2419
gboolean empty_search;
2422
gint category_id = 0;
2423
UnityMusicLensRhythmboxCollectionResultType result_type = 0;
2424
DeeSequenceModel* _tmp6_;
2431
GeeSet* _tmp12_ = NULL;
2432
GeeSet* active_genres;
2433
UnityLensSearch* _tmp13_;
2434
DeeSerializableModel* _tmp14_;
2435
DeeSerializableModel* _tmp15_;
2436
DeeSerializableModel* _tmp16_;
2437
DeeSerializableModel* helper_model;
2440
GObject* _tmp95_ = NULL;
2442
DeeTermList* term_list;
2443
DeeAnalyzer* _tmp97_;
2444
DeeICUTermFilter* _tmp98_;
2445
UnityLensSearch* _tmp99_;
2446
const gchar* _tmp100_;
2447
const gchar* _tmp101_;
2448
gchar* _tmp102_ = NULL;
2450
DeeTermList* _tmp104_;
2451
GSequence* _tmp105_;
2453
gboolean first_pass;
2454
GSequence* _tmp145_;
2455
GSequenceIter* _tmp146_ = NULL;
2456
GSequenceIter* seq_iter;
2457
GSequence* _tmp147_;
2458
GSequenceIter* _tmp148_ = NULL;
2459
GSequenceIter* seq_end_iter;
2460
GeeHashSet* _tmp149_;
2461
GeeHashSet* albums_list;
2462
DeeSerializableModel* _tmp213_;
2463
UnityLensSearch* _tmp214_;
2464
DeeSerializableModel* _tmp215_;
2465
DeeSerializableModel* _tmp216_;
2466
DeeSerializableModel* _tmp217_;
2467
DeeModelIter* _tmp218_ = NULL;
2469
DeeSerializableModel* _tmp219_;
2470
DeeModelIter* _tmp220_ = NULL;
2472
g_return_if_fail (self != NULL);
2473
g_return_if_fail (search != NULL);
2476
_tmp1_ = unity_lens_search_get_search_string (_tmp0_);
2478
_tmp3_ = string_strip (_tmp2_);
2480
_tmp5_ = g_strcmp0 (_tmp4_, "") == 0;
2482
empty_search = _tmp5_;
2483
_tmp6_ = self->priv->all_tracks;
2484
_tmp7_ = _g_object_ref0 ((DeeModel*) _tmp6_);
2487
unity_music_lens_rhythmbox_collection_get_decade_filter (self, _tmp8_, &_tmp9_, &_tmp10_);
2491
_tmp12_ = unity_music_lens_rhythmbox_collection_get_genre_filter (self, _tmp11_);
2492
active_genres = _tmp12_;
2494
_tmp14_ = unity_lens_search_get_results_model (_tmp13_);
2496
_tmp16_ = _g_object_ref0 (_tmp15_);
2497
helper_model = _tmp16_;
2498
_tmp17_ = category_override;
2500
DeeSequenceModel* _tmp18_;
2501
DeeSerializableModel* _tmp19_;
2502
UnityLensSearch* _tmp20_;
2503
DeeSerializableModel* _tmp21_;
2504
DeeSerializableModel* _tmp22_;
2506
gchar** _tmp24_ = NULL;
2507
_tmp18_ = (DeeSequenceModel*) dee_sequence_model_new ();
2508
_g_object_unref0 (helper_model);
2509
helper_model = (DeeSerializableModel*) _tmp18_;
2510
_tmp19_ = helper_model;
2512
_tmp21_ = unity_lens_search_get_results_model (_tmp20_);
2514
_tmp24_ = dee_model_get_schema ((DeeModel*) _tmp22_, &_tmp23_);
2515
dee_model_set_schema_full ((DeeModel*) _tmp19_, _tmp24_, (guint) _tmp23_);
2517
_tmp25_ = empty_search;
2519
DeeFilterModel* _tmp26_;
2522
DeeModelIter* _tmp29_ = NULL;
2525
DeeModelIter* _tmp31_ = NULL;
2526
DeeModelIter* end_iter;
2527
GeeHashSet* _tmp32_;
2528
GeeHashSet* albums_list_nosearch;
2529
_tmp26_ = self->priv->tracks_by_play_count;
2530
_tmp27_ = _g_object_ref0 ((DeeModel*) _tmp26_);
2531
_g_object_unref0 (model);
2534
_tmp29_ = dee_model_get_first_iter (_tmp28_);
2537
_tmp31_ = dee_model_get_last_iter (_tmp30_);
2539
_tmp32_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
2540
albums_list_nosearch = _tmp32_;
2542
DeeModelIter* _tmp33_;
2543
DeeModelIter* _tmp34_;
2545
DeeModelIter* _tmp36_;
2549
DeeModelIter* _tmp39_;
2550
const gchar* _tmp40_ = NULL;
2552
gboolean _tmp41_ = FALSE;
2558
DeeModelIter* _tmp58_;
2561
DeeSerializableModel* _tmp81_;
2563
DeeModelIter* _tmp83_;
2564
UnityMusicLensRhythmboxCollectionResultType _tmp84_;
2567
gboolean _tmp87_ = FALSE;
2571
DeeModelIter* _tmp93_;
2572
DeeModelIter* _tmp94_ = NULL;
2575
if (!(_tmp33_ != _tmp34_)) {
2580
_tmp37_ = dee_model_get_int32 (_tmp35_, _tmp36_, (guint) UNITY_MUSIC_LENS_COLUMNS_YEAR);
2581
year = (gint) _tmp37_;
2584
_tmp40_ = dee_model_get_string (_tmp38_, _tmp39_, (guint) UNITY_MUSIC_LENS_COLUMNS_GENRE);
2588
if (_tmp42_ < _tmp43_) {
2595
_tmp41_ = _tmp44_ > _tmp45_;
2600
DeeModelIter* _tmp48_;
2601
DeeModelIter* _tmp49_ = NULL;
2604
_tmp49_ = dee_model_next (_tmp47_, _tmp48_);
2608
_tmp50_ = active_genres;
2609
if (_tmp50_ != NULL) {
2611
const gchar* _tmp52_;
2612
gboolean _tmp53_ = FALSE;
2613
_tmp51_ = active_genres;
2615
_tmp53_ = gee_collection_contains ((GeeCollection*) _tmp51_, _tmp52_);
2618
DeeModelIter* _tmp55_;
2619
DeeModelIter* _tmp56_ = NULL;
2622
_tmp56_ = dee_model_next (_tmp54_, _tmp55_);
2629
_tmp59_ = dee_model_get_int32 (_tmp57_, _tmp58_, (guint) UNITY_MUSIC_LENS_COLUMNS_TYPE);
2630
if (_tmp59_ == ((gint32) UNITY_MUSIC_LENS_TRACK_TYPE_SONG)) {
2632
DeeModelIter* _tmp61_;
2633
const gchar* _tmp62_ = NULL;
2635
GeeHashSet* _tmp63_;
2636
const gchar* _tmp64_;
2637
gboolean _tmp65_ = FALSE;
2638
gboolean first_track_from_album;
2639
GeeHashSet* _tmp66_;
2640
const gchar* _tmp67_;
2644
_tmp62_ = dee_model_get_string (_tmp60_, _tmp61_, (guint) UNITY_MUSIC_LENS_COLUMNS_ALBUM);
2646
_tmp63_ = albums_list_nosearch;
2648
_tmp65_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp63_, _tmp64_);
2649
first_track_from_album = !_tmp65_;
2650
_tmp66_ = albums_list_nosearch;
2652
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp66_, _tmp67_);
2653
_tmp68_ = first_track_from_album;
2658
UnityLensSearch* _tmp73_;
2659
DeeSerializableModel* _tmp74_;
2660
DeeSerializableModel* _tmp75_;
2662
DeeModelIter* _tmp77_;
2664
_tmp70_ = category_override;
2667
_tmp71_ = category_override;
2670
_tmp69_ = (gint) UNITY_MUSIC_LENS_CATEGORY_ALBUMS;
2673
category_id = _tmp72_;
2675
_tmp74_ = unity_lens_search_get_results_model (_tmp73_);
2679
_tmp78_ = category_id;
2680
unity_music_lens_rhythmbox_collection_add_result (self, (DeeModel*) _tmp75_, _tmp76_, _tmp77_, UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_ALBUM, (guint) _tmp78_);
2682
category_id = (gint) UNITY_MUSIC_LENS_CATEGORY_SONGS;
2683
result_type = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_SONG;
2685
category_id = (gint) UNITY_MUSIC_LENS_CATEGORY_RADIOS;
2686
result_type = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_RADIO;
2688
_tmp79_ = category_override;
2691
_tmp80_ = category_override;
2692
category_id = _tmp80_;
2694
_tmp81_ = helper_model;
2697
_tmp84_ = result_type;
2698
_tmp85_ = category_id;
2699
unity_music_lens_rhythmbox_collection_add_result (self, (DeeModel*) _tmp81_, _tmp82_, _tmp83_, _tmp84_, (guint) _tmp85_);
2700
_tmp86_ = num_results;
2701
num_results = _tmp86_ + 1;
2702
_tmp88_ = max_results;
2706
_tmp89_ = num_results;
2707
_tmp90_ = max_results;
2708
_tmp87_ = _tmp89_ >= _tmp90_;
2718
_tmp94_ = dee_model_next (_tmp92_, _tmp93_);
2721
_g_object_unref0 (albums_list_nosearch);
2722
_g_object_unref0 (helper_model);
2723
_g_object_unref0 (active_genres);
2724
_g_object_unref0 (model);
2727
_tmp95_ = g_object_new (dee_term_list_get_type (), NULL);
2728
_tmp96_ = G_IS_INITIALLY_UNOWNED (_tmp95_) ? g_object_ref_sink (_tmp95_) : _tmp95_;
2729
term_list = DEE_IS_TERM_LIST (_tmp96_) ? ((DeeTermList*) _tmp96_) : NULL;
2730
_tmp97_ = self->priv->analyzer;
2731
_tmp98_ = self->priv->ascii_filter;
2733
_tmp100_ = unity_lens_search_get_search_string (_tmp99_);
2734
_tmp101_ = _tmp100_;
2735
_tmp102_ = dee_icu_term_filter_apply (_tmp98_, _tmp101_);
2736
_tmp103_ = _tmp102_;
2737
_tmp104_ = term_list;
2738
dee_analyzer_tokenize (_tmp97_, _tmp103_, _tmp104_);
2739
_g_free0 (_tmp103_);
2740
_tmp105_ = g_sequence_new (NULL);
2744
DeeTermList* _tmp106_;
2745
DeeTermList* _tmp107_;
2746
DeeTermList* _term_list;
2747
DeeTermList* _tmp108_;
2752
_tmp106_ = term_list;
2753
_tmp107_ = _g_object_ref0 (_tmp106_);
2754
_term_list = _tmp107_;
2755
_tmp108_ = _term_list;
2756
_tmp109_ = dee_term_list_num_terms (_tmp108_);
2757
_tmp110_ = _tmp109_;
2758
_term_size = _tmp110_;
2764
DeeTermList* _tmp114_;
2766
const gchar* _tmp116_ = NULL;
2769
const gchar* _tmp118_;
2770
DeeResultSet* _tmp119_ = NULL;
2771
DeeResultSet* result_set;
2772
GCompareDataFunc cmp_func;
2773
void* cmp_func_target;
2774
GDestroyNotify cmp_func_target_destroy_notify;
2775
GSequence* _tmp120_;
2776
GSequence* remaining;
2778
GSequence* _tmp141_;
2779
GSequenceIter* _tmp142_ = NULL;
2780
GSequence* _tmp143_;
2781
GSequenceIter* _tmp144_ = NULL;
2782
_tmp111_ = _term_index;
2783
_term_index = _tmp111_ + 1;
2784
_tmp112_ = _term_index;
2785
_tmp113_ = _term_size;
2786
if (!(((guint) _tmp112_) < _tmp113_)) {
2789
_tmp114_ = _term_list;
2790
_tmp115_ = _term_index;
2791
_tmp116_ = dee_term_list_get_term (_tmp114_, (guint) _tmp115_);
2793
_tmp117_ = self->priv->index;
2795
_tmp119_ = dee_index_lookup (_tmp117_, _tmp118_, DEE_TERM_MATCH_PREFIX);
2796
result_set = _tmp119_;
2797
cmp_func = _____lambda10__gcompare_data_func;
2798
cmp_func_target = g_object_ref (self);
2799
cmp_func_target_destroy_notify = g_object_unref;
2800
_tmp120_ = g_sequence_new (NULL);
2801
remaining = _tmp120_;
2803
DeeResultSet* _tmp121_;
2804
DeeResultSet* _tmp122_ = NULL;
2805
DeeResultSet* _item_it;
2806
DeeModelIter* item = NULL;
2807
_tmp121_ = result_set;
2808
_tmp122_ = _vala_dee_result_set_iterator (_tmp121_);
2809
_item_it = _tmp122_;
2811
DeeResultSet* _tmp123_;
2812
DeeModelIter* _tmp124_ = NULL;
2813
DeeModelIter* _tmp125_;
2815
_tmp123_ = _item_it;
2816
_tmp124_ = _vala_dee_result_set_next_value (_tmp123_);
2819
if (!(_tmp125_ != NULL)) {
2822
_tmp126_ = first_pass;
2824
GSequence* _tmp127_;
2825
DeeModelIter* _tmp128_;
2826
GCompareDataFunc _tmp129_;
2827
void* _tmp129__target;
2828
GSequenceIter* _tmp130_ = NULL;
2831
_tmp129_ = cmp_func;
2832
_tmp129__target = cmp_func_target;
2833
_tmp130_ = g_sequence_insert_sorted (_tmp127_, _tmp128_, _tmp129_, _tmp129__target);
2835
GSequence* _tmp131_;
2836
DeeModelIter* _tmp132_;
2837
GCompareDataFunc _tmp133_;
2838
void* _tmp133__target;
2839
GSequenceIter* _tmp134_ = NULL;
2842
_tmp133_ = cmp_func;
2843
_tmp133__target = cmp_func_target;
2844
_tmp134_ = g_sequence_lookup (_tmp131_, _tmp132_, _tmp133_, _tmp133__target);
2845
if (_tmp134_ != NULL) {
2846
GSequence* _tmp135_;
2847
DeeModelIter* _tmp136_;
2848
GCompareDataFunc _tmp137_;
2849
void* _tmp137__target;
2850
GSequenceIter* _tmp138_ = NULL;
2851
_tmp135_ = remaining;
2853
_tmp137_ = cmp_func;
2854
_tmp137__target = cmp_func_target;
2855
_tmp138_ = g_sequence_insert_sorted (_tmp135_, _tmp136_, _tmp137_, _tmp137__target);
2859
_g_object_unref0 (_item_it);
2861
_tmp139_ = first_pass;
2863
GSequence* _tmp140_;
2864
_tmp140_ = remaining;
2866
_g_sequence_free0 (matches);
2870
_tmp142_ = g_sequence_get_begin_iter (_tmp141_);
2872
_tmp144_ = g_sequence_get_end_iter (_tmp143_);
2873
if (_tmp142_ == _tmp144_) {
2874
_g_sequence_free0 (remaining);
2875
(cmp_func_target_destroy_notify == NULL) ? NULL : (cmp_func_target_destroy_notify (cmp_func_target), NULL);
2877
cmp_func_target = NULL;
2878
cmp_func_target_destroy_notify = NULL;
2879
_g_object_unref0 (result_set);
2883
_g_sequence_free0 (remaining);
2884
(cmp_func_target_destroy_notify == NULL) ? NULL : (cmp_func_target_destroy_notify (cmp_func_target), NULL);
2886
cmp_func_target = NULL;
2887
cmp_func_target_destroy_notify = NULL;
2888
_g_object_unref0 (result_set);
2890
_g_object_unref0 (_term_list);
2893
_tmp146_ = g_sequence_get_begin_iter (_tmp145_);
2894
seq_iter = _tmp146_;
2896
_tmp148_ = g_sequence_get_end_iter (_tmp147_);
2897
seq_end_iter = _tmp148_;
2898
_tmp149_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
2899
albums_list = _tmp149_;
2901
GSequenceIter* _tmp150_;
2902
GSequenceIter* _tmp151_;
2903
GSequenceIter* _tmp152_;
2904
gconstpointer _tmp153_ = NULL;
2905
DeeModelIter* model_iter;
2907
DeeModelIter* _tmp155_;
2908
gint32 _tmp156_ = 0;
2911
DeeModelIter* _tmp158_;
2912
const gchar* _tmp159_ = NULL;
2915
gboolean _tmp161_ = FALSE;
2921
DeeModelIter* _tmp177_;
2922
gint32 _tmp178_ = 0;
2924
DeeSerializableModel* _tmp200_;
2926
DeeModelIter* _tmp202_;
2927
UnityMusicLensRhythmboxCollectionResultType _tmp203_;
2930
gboolean _tmp206_ = FALSE;
2933
GSequenceIter* _tmp211_;
2934
GSequenceIter* _tmp212_ = NULL;
2935
_tmp150_ = seq_iter;
2936
_tmp151_ = seq_end_iter;
2937
if (!(_tmp150_ != _tmp151_)) {
2940
_tmp152_ = seq_iter;
2941
_tmp153_ = g_sequence_get (_tmp152_);
2942
model_iter = (DeeModelIter*) _tmp153_;
2944
_tmp155_ = model_iter;
2945
_tmp156_ = dee_model_get_int32 (_tmp154_, _tmp155_, (guint) UNITY_MUSIC_LENS_COLUMNS_YEAR);
2946
year = (gint) _tmp156_;
2948
_tmp158_ = model_iter;
2949
_tmp159_ = dee_model_get_string (_tmp157_, _tmp158_, (guint) UNITY_MUSIC_LENS_COLUMNS_GENRE);
2950
_tmp160_ = g_strdup (_tmp159_);
2953
_tmp163_ = min_year;
2954
if (_tmp162_ < _tmp163_) {
2960
_tmp165_ = max_year;
2961
_tmp161_ = _tmp164_ > _tmp165_;
2963
_tmp166_ = _tmp161_;
2965
GSequenceIter* _tmp167_;
2966
GSequenceIter* _tmp168_ = NULL;
2967
_tmp167_ = seq_iter;
2968
_tmp168_ = g_sequence_iter_next (_tmp167_);
2969
seq_iter = _tmp168_;
2973
_tmp169_ = active_genres;
2974
if (_tmp169_ != NULL) {
2976
const gchar* _tmp171_;
2977
gboolean _tmp172_ = FALSE;
2978
gboolean genre_match;
2980
_tmp170_ = active_genres;
2982
_tmp172_ = gee_collection_contains ((GeeCollection*) _tmp170_, _tmp171_);
2983
genre_match = _tmp172_;
2984
_tmp173_ = genre_match;
2986
GSequenceIter* _tmp174_;
2987
GSequenceIter* _tmp175_ = NULL;
2988
_tmp174_ = seq_iter;
2989
_tmp175_ = g_sequence_iter_next (_tmp174_);
2990
seq_iter = _tmp175_;
2996
_tmp177_ = model_iter;
2997
_tmp178_ = dee_model_get_int32 (_tmp176_, _tmp177_, (guint) UNITY_MUSIC_LENS_COLUMNS_TYPE);
2998
if (_tmp178_ == ((gint32) UNITY_MUSIC_LENS_TRACK_TYPE_SONG)) {
3000
DeeModelIter* _tmp180_;
3001
const gchar* _tmp181_ = NULL;
3003
GeeHashSet* _tmp182_;
3004
const gchar* _tmp183_;
3005
gboolean _tmp184_ = FALSE;
3006
gboolean first_track_from_album;
3007
GeeHashSet* _tmp185_;
3008
const gchar* _tmp186_;
3011
_tmp180_ = model_iter;
3012
_tmp181_ = dee_model_get_string (_tmp179_, _tmp180_, (guint) UNITY_MUSIC_LENS_COLUMNS_ALBUM);
3014
_tmp182_ = albums_list;
3016
_tmp184_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp182_, _tmp183_);
3017
first_track_from_album = !_tmp184_;
3018
_tmp185_ = albums_list;
3020
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp185_, _tmp186_);
3021
_tmp187_ = first_track_from_album;
3026
UnityLensSearch* _tmp192_;
3027
DeeSerializableModel* _tmp193_;
3028
DeeSerializableModel* _tmp194_;
3030
DeeModelIter* _tmp196_;
3032
_tmp189_ = category_override;
3033
if (_tmp189_ >= 0) {
3035
_tmp190_ = category_override;
3036
_tmp188_ = _tmp190_;
3038
_tmp188_ = (gint) UNITY_MUSIC_LENS_CATEGORY_ALBUMS;
3040
_tmp191_ = _tmp188_;
3041
category_id = _tmp191_;
3043
_tmp193_ = unity_lens_search_get_results_model (_tmp192_);
3044
_tmp194_ = _tmp193_;
3046
_tmp196_ = model_iter;
3047
_tmp197_ = category_id;
3048
unity_music_lens_rhythmbox_collection_add_result (self, (DeeModel*) _tmp194_, _tmp195_, _tmp196_, UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_ALBUM, (guint) _tmp197_);
3050
category_id = (gint) UNITY_MUSIC_LENS_CATEGORY_SONGS;
3051
result_type = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_SONG;
3053
category_id = (gint) UNITY_MUSIC_LENS_CATEGORY_RADIOS;
3054
result_type = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_RESULT_TYPE_RADIO;
3056
_tmp198_ = category_override;
3057
if (_tmp198_ >= 0) {
3059
_tmp199_ = category_override;
3060
category_id = _tmp199_;
3062
_tmp200_ = helper_model;
3064
_tmp202_ = model_iter;
3065
_tmp203_ = result_type;
3066
_tmp204_ = category_id;
3067
unity_music_lens_rhythmbox_collection_add_result (self, (DeeModel*) _tmp200_, _tmp201_, _tmp202_, _tmp203_, (guint) _tmp204_);
3068
_tmp205_ = num_results;
3069
num_results = _tmp205_ + 1;
3070
_tmp207_ = max_results;
3071
if (_tmp207_ >= 0) {
3074
_tmp208_ = num_results;
3075
_tmp209_ = max_results;
3076
_tmp206_ = _tmp208_ >= _tmp209_;
3080
_tmp210_ = _tmp206_;
3085
_tmp211_ = seq_iter;
3086
_tmp212_ = g_sequence_iter_next (_tmp211_);
3087
seq_iter = _tmp212_;
3090
_tmp213_ = helper_model;
3092
_tmp215_ = unity_lens_search_get_results_model (_tmp214_);
3093
_tmp216_ = _tmp215_;
3094
if (_tmp213_ == _tmp216_) {
3095
_g_object_unref0 (albums_list);
3096
_g_sequence_free0 (matches);
3097
_g_object_unref0 (term_list);
3098
_g_object_unref0 (helper_model);
3099
_g_object_unref0 (active_genres);
3100
_g_object_unref0 (model);
3103
_tmp217_ = helper_model;
3104
_tmp218_ = dee_model_get_first_iter ((DeeModel*) _tmp217_);
3106
_tmp219_ = helper_model;
3107
_tmp220_ = dee_model_get_last_iter ((DeeModel*) _tmp219_);
3110
DeeModelIter* _tmp221_;
3111
DeeModelIter* _tmp222_;
3112
DeeSerializableModel* _tmp223_;
3113
DeeModelIter* _tmp224_;
3114
GVariant** _tmp225_;
3115
GVariant** _tmp226_ = NULL;
3119
UnityLensSearch* _tmp227_;
3120
DeeSerializableModel* _tmp228_;
3121
DeeSerializableModel* _tmp229_;
3122
GVariant** _tmp230_;
3123
gint _tmp230__length1;
3124
DeeSerializableModel* _tmp231_;
3125
DeeModelIter* _tmp232_;
3126
DeeModelIter* _tmp233_ = NULL;
3129
if (!(_tmp221_ != _tmp222_)) {
3132
_tmp223_ = helper_model;
3134
_tmp226_ = _tmp225_ = dee_model_get_row ((DeeModel*) _tmp223_, _tmp224_, NULL);
3136
row_length1 = _vala_array_length (_tmp225_);
3137
_row_size_ = row_length1;
3139
_tmp228_ = unity_lens_search_get_results_model (_tmp227_);
3140
_tmp229_ = _tmp228_;
3142
_tmp230__length1 = row_length1;
3143
dee_model_append_row ((DeeModel*) _tmp229_, _tmp230_);
3144
_tmp231_ = helper_model;
3146
_tmp233_ = dee_model_next ((DeeModel*) _tmp231_, _tmp232_);
3148
row = (_vala_array_free (row, row_length1, (GDestroyNotify) g_variant_unref), NULL);
3150
_g_object_unref0 (albums_list);
3151
_g_sequence_free0 (matches);
3152
_g_object_unref0 (term_list);
3153
_g_object_unref0 (helper_model);
3154
_g_object_unref0 (active_genres);
3155
_g_object_unref0 (model);
3159
static void unity_music_lens_rhythmbox_collection_get_decade_filter (UnityMusicLensRhythmboxCollection* self, GList* filters, gint* min_year, gint* max_year) {
3160
gint _vala_min_year = 0;
3161
gint _vala_max_year = 0;
3162
UnityFilter* filter;
3164
gboolean _tmp7_ = FALSE;
3165
UnityFilter* _tmp8_;
3167
UnityFilter* _tmp14_;
3168
UnityMultiRangeFilter* _tmp15_;
3169
UnityMultiRangeFilter* mrf;
3170
UnityMultiRangeFilter* _tmp16_;
3171
UnityFilterOption* _tmp17_ = NULL;
3172
UnityFilterOption* _tmp18_;
3173
const gchar* _tmp19_;
3174
const gchar* _tmp20_;
3176
UnityMultiRangeFilter* _tmp22_;
3177
UnityFilterOption* _tmp23_ = NULL;
3178
UnityFilterOption* _tmp24_;
3179
const gchar* _tmp25_;
3180
const gchar* _tmp26_;
3182
g_return_if_fail (self != NULL);
3186
GList* parser_collection = NULL;
3187
GList* parser_it = NULL;
3188
parser_collection = _tmp0_;
3189
for (parser_it = parser_collection; parser_it != NULL; parser_it = parser_it->next) {
3190
UnityMusicLensFilterParser* _tmp1_;
3191
UnityMusicLensFilterParser* parser = NULL;
3192
_tmp1_ = _g_object_ref0 ((UnityMusicLensFilterParser*) parser_it->data);
3195
UnityMusicLensFilterParser* _tmp2_;
3197
if (UNITY_MUSIC_LENS_IS_DECADE_FILTER_PARSER (_tmp2_)) {
3198
UnityMusicLensFilterParser* _tmp3_;
3199
UnityFilter* _tmp4_;
3200
UnityFilter* _tmp5_;
3201
UnityFilter* _tmp6_;
3203
_tmp4_ = unity_music_lens_filter_parser_get_filter (_tmp3_);
3205
_tmp6_ = _g_object_ref0 (_tmp5_);
3206
_g_object_unref0 (filter);
3209
_g_object_unref0 (parser);
3214
if (_tmp8_ == NULL) {
3217
UnityFilter* _tmp9_;
3221
_tmp10_ = unity_filter_get_filtering (_tmp9_);
3230
_vala_max_year = _tmp13_;
3231
_g_object_unref0 (filter);
3233
*min_year = _vala_min_year;
3236
*max_year = _vala_max_year;
3241
_tmp15_ = _g_object_ref0 (UNITY_IS_MULTI_RANGE_FILTER (_tmp14_) ? ((UnityMultiRangeFilter*) _tmp14_) : NULL);
3244
_tmp17_ = unity_multi_range_filter_get_first_active (_tmp16_);
3246
_tmp19_ = unity_filter_option_get_id (_tmp18_);
3248
_tmp21_ = atoi (_tmp20_);
3249
_vala_min_year = _tmp21_;
3250
_g_object_unref0 (_tmp18_);
3252
_tmp23_ = unity_multi_range_filter_get_last_active (_tmp22_);
3254
_tmp25_ = unity_filter_option_get_id (_tmp24_);
3256
_tmp27_ = atoi (_tmp26_);
3257
_vala_max_year = _tmp27_ + 9;
3258
_g_object_unref0 (_tmp24_);
3259
_g_object_unref0 (mrf);
3260
_g_object_unref0 (filter);
3262
*min_year = _vala_min_year;
3265
*max_year = _vala_max_year;
3270
static GeeSet* unity_music_lens_rhythmbox_collection_get_genre_filter (UnityMusicLensRhythmboxCollection* self, GList* filters) {
3271
GeeSet* result = NULL;
3272
UnityFilter* filter;
3274
gboolean _tmp7_ = FALSE;
3275
UnityFilter* _tmp8_;
3277
GeeHashSet* _tmp13_;
3278
GeeHashSet* active_genres;
3279
UnityFilter* _tmp14_;
3280
UnityCheckOptionFilterCompact* _tmp15_;
3281
UnityCheckOptionFilterCompact* all_genres;
3282
UnityCheckOptionFilterCompact* _tmp16_;
3284
g_return_val_if_fail (self != NULL, NULL);
3288
GList* parser_collection = NULL;
3289
GList* parser_it = NULL;
3290
parser_collection = _tmp0_;
3291
for (parser_it = parser_collection; parser_it != NULL; parser_it = parser_it->next) {
3292
UnityMusicLensFilterParser* _tmp1_;
3293
UnityMusicLensFilterParser* parser = NULL;
3294
_tmp1_ = _g_object_ref0 ((UnityMusicLensFilterParser*) parser_it->data);
3297
UnityMusicLensFilterParser* _tmp2_;
3299
if (UNITY_MUSIC_LENS_IS_GENRE_FILTER_PARSER (_tmp2_)) {
3300
UnityMusicLensFilterParser* _tmp3_;
3301
UnityFilter* _tmp4_;
3302
UnityFilter* _tmp5_;
3303
UnityFilter* _tmp6_;
3305
_tmp4_ = unity_music_lens_filter_parser_get_filter (_tmp3_);
3307
_tmp6_ = _g_object_ref0 (_tmp5_);
3308
_g_object_unref0 (filter);
3311
_g_object_unref0 (parser);
3316
if (_tmp8_ == NULL) {
3319
UnityFilter* _tmp9_;
3323
_tmp10_ = unity_filter_get_filtering (_tmp9_);
3330
_g_object_unref0 (filter);
3333
_tmp13_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
3334
active_genres = _tmp13_;
3336
_tmp15_ = _g_object_ref0 (UNITY_IS_CHECK_OPTION_FILTER_COMPACT (_tmp14_) ? ((UnityCheckOptionFilterCompact*) _tmp14_) : NULL);
3337
all_genres = _tmp15_;
3338
_tmp16_ = all_genres;
3339
_tmp17_ = ((UnityOptionsFilter*) _tmp16_)->options;
3341
GList* option_collection = NULL;
3342
GList* option_it = NULL;
3343
option_collection = _tmp17_;
3344
for (option_it = option_collection; option_it != NULL; option_it = option_it->next) {
3345
UnityFilterOption* _tmp18_;
3346
UnityFilterOption* option = NULL;
3347
_tmp18_ = _g_object_ref0 ((UnityFilterOption*) option_it->data);
3350
gboolean _tmp19_ = FALSE;
3351
UnityFilterOption* _tmp20_;
3352
const gchar* _tmp21_;
3353
const gchar* _tmp22_;
3355
GeeHashSet* _tmp27_;
3356
UnityFilterOption* _tmp28_;
3357
const gchar* _tmp29_;
3358
const gchar* _tmp30_;
3360
_tmp21_ = unity_filter_option_get_id (_tmp20_);
3362
if (_tmp22_ == NULL) {
3365
UnityFilterOption* _tmp23_;
3369
_tmp24_ = unity_filter_option_get_active (_tmp23_);
3375
_g_object_unref0 (option);
3378
_tmp27_ = active_genres;
3380
_tmp29_ = unity_filter_option_get_id (_tmp28_);
3382
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp27_, _tmp30_);
3383
_g_object_unref0 (option);
3387
result = (GeeSet*) active_genres;
3388
_g_object_unref0 (all_genres);
3389
_g_object_unref0 (filter);
3394
UnityMusicLensRhythmboxCollection* unity_music_lens_rhythmbox_collection_construct (GType object_type) {
3395
UnityMusicLensRhythmboxCollection * self = NULL;
3396
self = (UnityMusicLensRhythmboxCollection*) g_object_new (object_type, NULL);
3401
UnityMusicLensRhythmboxCollection* unity_music_lens_rhythmbox_collection_new (void) {
3402
return unity_music_lens_rhythmbox_collection_construct (UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION);
3406
static void _g_variant_unref0_ (gpointer var) {
3407
(var == NULL) ? NULL : (var = (g_variant_unref (var), NULL));
3411
static void _g_free0_ (gpointer var) {
3412
var = (g_free (var), NULL);
3416
static void _g_ptr_array_unref0_ (gpointer var) {
3417
(var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL));
3421
static gint _unity_music_lens_rhythmbox_collection___lambda11_ (UnityMusicLensRhythmboxCollection* self, GVariant** row1, int row1_length1, GVariant** row2, int row2_length1) {
3424
gint _tmp0__length1;
3429
gint _tmp3__length1;
3436
_tmp0__length1 = row1_length1;
3437
_tmp1_ = _tmp0_[UNITY_MUSIC_LENS_COLUMNS_PLAY_COUNT];
3438
_tmp2_ = g_variant_get_int32 (_tmp1_);
3441
_tmp3__length1 = row2_length1;
3442
_tmp4_ = _tmp3_[UNITY_MUSIC_LENS_COLUMNS_PLAY_COUNT];
3443
_tmp5_ = g_variant_get_int32 (_tmp4_);
3447
result = _tmp6_ - _tmp7_;
3452
static gint __unity_music_lens_rhythmbox_collection___lambda11__dee_compare_row_func (GVariant** row1, GVariant** row2, gpointer self) {
3454
result = _unity_music_lens_rhythmbox_collection___lambda11_ (self, row1, -1, row2, -1);
3459
static void _unity_music_lens_rhythmbox_collection___lambda12_ (UnityMusicLensRhythmboxCollection* self, DeeTermList* terms_in, DeeTermList* terms_out) {
3460
g_return_if_fail (terms_in != NULL);
3461
g_return_if_fail (terms_out != NULL);
3463
DeeTermList* _tmp0_;
3464
DeeTermList* _tmp1_;
3465
DeeTermList* _term_list;
3466
DeeTermList* _tmp2_;
3472
_tmp1_ = _g_object_ref0 (_tmp0_);
3473
_term_list = _tmp1_;
3474
_tmp2_ = _term_list;
3475
_tmp3_ = dee_term_list_num_terms (_tmp2_);
3477
_term_size = _tmp4_;
3483
DeeTermList* _tmp8_;
3485
const gchar* _tmp10_ = NULL;
3487
DeeICUTermFilter* _tmp11_;
3488
const gchar* _tmp12_;
3489
gchar* _tmp13_ = NULL;
3491
DeeTermList* _tmp14_;
3492
const gchar* _tmp15_;
3493
const gchar* _tmp16_;
3494
const gchar* _tmp17_;
3495
_tmp5_ = _term_index;
3496
_term_index = _tmp5_ + 1;
3497
_tmp6_ = _term_index;
3498
_tmp7_ = _term_size;
3499
if (!(((guint) _tmp6_) < _tmp7_)) {
3502
_tmp8_ = _term_list;
3503
_tmp9_ = _term_index;
3504
_tmp10_ = dee_term_list_get_term (_tmp8_, (guint) _tmp9_);
3506
_tmp11_ = self->priv->ascii_filter;
3508
_tmp13_ = dee_icu_term_filter_apply (_tmp11_, _tmp12_);
3510
_tmp14_ = terms_out;
3512
dee_term_list_add_term (_tmp14_, _tmp15_);
3515
if (g_strcmp0 (_tmp16_, _tmp17_) != 0) {
3516
DeeTermList* _tmp18_;
3517
const gchar* _tmp19_;
3518
_tmp18_ = terms_out;
3520
dee_term_list_add_term (_tmp18_, _tmp19_);
3524
_g_object_unref0 (_term_list);
3529
static void __unity_music_lens_rhythmbox_collection___lambda12__dee_term_filter_func (DeeTermList* terms_in, DeeTermList* terms_out, gpointer self) {
3530
_unity_music_lens_rhythmbox_collection___lambda12_ (self, terms_in, terms_out);
3534
static GObject * unity_music_lens_rhythmbox_collection_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
3536
GObjectClass * parent_class;
3537
UnityMusicLensRhythmboxCollection * self;
3538
const gchar* _tmp0_ = NULL;
3539
gchar* _tmp1_ = NULL;
3546
DeeSequenceModel* _tmp8_;
3547
DeeSequenceModel* _tmp9_;
3548
DeeSequenceModel* _tmp10_;
3550
gchar** _tmp12_ = NULL;
3551
DeeSequenceModel* _tmp13_;
3552
DeeModelTag* _tmp14_;
3555
GHashTable* _tmp17_;
3556
DeeFilter _tmp18_ = {0};
3558
DeeSequenceModel* _tmp19_;
3560
DeeFilterModel* _tmp21_;
3561
DeeICUTermFilter* _tmp22_;
3562
DeeTextAnalyzer* _tmp23_;
3563
DeeAnalyzer* _tmp24_;
3564
parent_class = G_OBJECT_CLASS (unity_music_lens_rhythmbox_collection_parent_class);
3565
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
3566
self = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION (obj);
3567
G_STATIC_ASSERT (13 == ((gint) UNITY_MUSIC_LENS_COLUMNS_N_COLUMNS));
3568
_tmp0_ = g_get_user_cache_dir ();
3569
_tmp1_ = g_build_filename (_tmp0_, "media-art", NULL);
3570
_g_free0 (self->priv->media_art_dir);
3571
self->priv->media_art_dir = _tmp1_;
3572
_tmp2_ = g_str_hash;
3573
_tmp3_ = g_str_equal;
3574
_tmp4_ = g_hash_table_new_full (_tmp2_, _tmp3_, NULL, _g_variant_unref0_);
3575
_g_hash_table_unref0 (self->priv->variant_store);
3576
self->priv->variant_store = _tmp4_;
3577
_tmp5_ = g_direct_hash;
3578
_tmp6_ = g_direct_equal;
3579
_tmp7_ = g_hash_table_new_full (_tmp5_, _tmp6_, NULL, _g_variant_unref0_);
3580
_g_hash_table_unref0 (self->priv->int_variant_store);
3581
self->priv->int_variant_store = _tmp7_;
3582
_tmp8_ = (DeeSequenceModel*) dee_sequence_model_new ();
3583
_g_object_unref0 (self->priv->all_tracks);
3584
self->priv->all_tracks = _tmp8_;
3585
_tmp9_ = self->priv->all_tracks;
3586
dee_model_set_schema ((DeeModel*) _tmp9_, "i", "s", "s", "s", "s", "s", "s", "s", "s", "i", "i", "i", "i", NULL);
3587
_tmp10_ = self->priv->all_tracks;
3588
_tmp12_ = dee_model_get_schema ((DeeModel*) _tmp10_, &_tmp11_);
3589
g_assert (_tmp11_ == ((gint) UNITY_MUSIC_LENS_COLUMNS_N_COLUMNS));
3590
_tmp13_ = self->priv->all_tracks;
3591
_tmp14_ = dee_model_register_tag ((DeeModel*) _tmp13_, NULL);
3592
self->priv->album_art_tag = _tmp14_;
3593
_tmp15_ = g_str_hash;
3594
_tmp16_ = g_str_equal;
3595
_tmp17_ = g_hash_table_new_full (_tmp15_, _tmp16_, _g_free0_, _g_ptr_array_unref0_);
3596
_g_hash_table_unref0 (self->priv->album_to_tracks_map);
3597
self->priv->album_to_tracks_map = _tmp17_;
3598
dee_filter_new_sort (__unity_music_lens_rhythmbox_collection___lambda11__dee_compare_row_func, g_object_ref (self), g_object_unref, &_tmp18_);
3600
_tmp19_ = self->priv->all_tracks;
3602
_tmp21_ = (DeeFilterModel*) dee_filter_model_new ((DeeModel*) _tmp19_, &_tmp20_);
3603
_g_object_unref0 (self->priv->tracks_by_play_count);
3604
self->priv->tracks_by_play_count = _tmp21_;
3605
_tmp22_ = dee_icu_term_filter_new_ascii_folder ();
3606
_dee_icu_term_filter_destroy0 (self->priv->ascii_filter);
3607
self->priv->ascii_filter = _tmp22_;
3608
_tmp23_ = dee_text_analyzer_new ();
3609
_g_object_unref0 (self->priv->analyzer);
3610
self->priv->analyzer = (DeeAnalyzer*) _tmp23_;
3611
_tmp24_ = self->priv->analyzer;
3612
dee_analyzer_add_term_filter (_tmp24_, __unity_music_lens_rhythmbox_collection___lambda12__dee_term_filter_func, g_object_ref (self), g_object_unref);
3613
unity_music_lens_rhythmbox_collection_initialize_index (self);
3618
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) {
3619
unity_music_lens_rhythmbox_collection_xml_parser_start_tag (self, context, element_name, attribute_names, attribute_values, error);
3623
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) {
3624
unity_music_lens_rhythmbox_collection_xml_parser_end_tag (self, context, element_name, error);
3628
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) {
3629
unity_music_lens_rhythmbox_collection_xml_parser_process_text (self, context, text, text_len, error);
3633
gboolean unity_music_lens_rhythmbox_collection_xml_parser_parse (UnityMusicLensRhythmboxCollectionXmlParser* self, const gchar* content, gsize len, GError** error) {
3634
gboolean result = FALSE;
3635
GMarkupParseContext* _tmp0_;
3636
const gchar* _tmp1_;
3638
gboolean _tmp3_ = FALSE;
3640
GError * _inner_error_ = NULL;
3641
g_return_val_if_fail (self != NULL, FALSE);
3642
g_return_val_if_fail (content != NULL, FALSE);
3643
_tmp0_ = self->priv->context;
3646
_tmp3_ = g_markup_parse_context_parse (_tmp0_, _tmp1_, (gssize) _tmp2_, &_inner_error_);
3648
if (_inner_error_ != NULL) {
3649
if (_inner_error_->domain == G_MARKUP_ERROR) {
3650
g_propagate_error (error, _inner_error_);
3653
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);
3654
g_clear_error (&_inner_error_);
3663
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) {
3665
g_return_if_fail (self != NULL);
3666
g_return_if_fail (context != NULL);
3667
g_return_if_fail (name != NULL);
3668
_tmp0_ = self->priv->processing_track;
3670
const gchar* _tmp1_;
3671
const gchar* _tmp2_;
3673
static GQuark _tmp3_label0 = 0;
3674
static GQuark _tmp3_label1 = 0;
3677
_tmp4_ = (NULL == _tmp2_) ? 0 : g_quark_from_string (_tmp2_);
3678
if (_tmp4_ == ((0 != _tmp3_label0) ? _tmp3_label0 : (_tmp3_label0 = g_quark_from_static_string ("rhythmdb")))) {
3682
self->priv->is_rhythmdb_xml = TRUE;
3686
} else if (_tmp4_ == ((0 != _tmp3_label1) ? _tmp3_label1 : (_tmp3_label1 = g_quark_from_static_string ("entry")))) {
3690
gchar* accepted_element_name;
3691
const gchar* _tmp28_;
3692
UnityMusicLensTrack* _tmp29_;
3693
UnityMusicLensTrackType _tmp30_ = 0;
3694
const gchar* _tmp31_;
3695
UnityMusicLensTrack* _tmp32_;
3696
UnityMusicLensTrackType _tmp33_;
3697
accepted_element_name = NULL;
3707
gint _tmp8__length1;
3709
const gchar* _tmp10_;
3710
gboolean _tmp11_ = FALSE;
3712
gint _tmp12__length1;
3714
const gchar* _tmp14_;
3723
_tmp8_ = attr_names;
3724
_tmp8__length1 = _vala_array_length (attr_names);
3726
_tmp10_ = _tmp8_[_tmp9_];
3727
if (!(_tmp10_ != NULL)) {
3730
_tmp12_ = attr_names;
3731
_tmp12__length1 = _vala_array_length (attr_names);
3733
_tmp14_ = _tmp12_[_tmp13_];
3734
if (g_strcmp0 (_tmp14_, "type") == 0) {
3735
gboolean _tmp15_ = FALSE;
3737
gint _tmp16__length1;
3739
const gchar* _tmp18_;
3741
_tmp16_ = attr_values;
3742
_tmp16__length1 = _vala_array_length (attr_values);
3744
_tmp18_ = _tmp16_[_tmp17_];
3745
if (g_strcmp0 (_tmp18_, "song") == 0) {
3749
gint _tmp19__length1;
3751
const gchar* _tmp21_;
3752
_tmp19_ = attr_values;
3753
_tmp19__length1 = _vala_array_length (attr_values);
3755
_tmp21_ = _tmp19_[_tmp20_];
3756
_tmp15_ = g_strcmp0 (_tmp21_, "iradio") == 0;
3766
gint _tmp24__length1;
3768
const gchar* _tmp26_;
3770
_tmp24_ = attr_values;
3771
_tmp24__length1 = _vala_array_length (attr_values);
3773
_tmp26_ = _tmp24_[_tmp25_];
3774
_tmp27_ = g_strdup (_tmp26_);
3775
_g_free0 (accepted_element_name);
3776
accepted_element_name = _tmp27_;
3781
_tmp28_ = accepted_element_name;
3782
if (_tmp28_ == NULL) {
3783
_g_free0 (accepted_element_name);
3786
self->priv->processing_track = TRUE;
3787
_tmp29_ = unity_music_lens_track_new ();
3788
_g_object_unref0 (self->priv->current_track);
3789
self->priv->current_track = _tmp29_;
3790
_tmp31_ = accepted_element_name;
3791
if (g_strcmp0 (_tmp31_, "song") == 0) {
3792
_tmp30_ = UNITY_MUSIC_LENS_TRACK_TYPE_SONG;
3794
_tmp30_ = UNITY_MUSIC_LENS_TRACK_TYPE_RADIO;
3796
_tmp32_ = self->priv->current_track;
3798
unity_music_lens_track_set_type_track (_tmp32_, _tmp33_);
3799
_g_free0 (accepted_element_name);
3805
const gchar* _tmp34_;
3806
const gchar* _tmp35_;
3807
GQuark _tmp37_ = 0U;
3808
static GQuark _tmp36_label0 = 0;
3809
static GQuark _tmp36_label1 = 0;
3810
static GQuark _tmp36_label2 = 0;
3811
static GQuark _tmp36_label3 = 0;
3812
static GQuark _tmp36_label4 = 0;
3813
static GQuark _tmp36_label5 = 0;
3814
static GQuark _tmp36_label6 = 0;
3815
static GQuark _tmp36_label7 = 0;
3816
static GQuark _tmp36_label8 = 0;
3817
static GQuark _tmp36_label9 = 0;
3818
static GQuark _tmp36_label10 = 0;
3821
_tmp37_ = (NULL == _tmp35_) ? 0 : g_quark_from_string (_tmp35_);
3822
if (_tmp37_ == ((0 != _tmp36_label0) ? _tmp36_label0 : (_tmp36_label0 = g_quark_from_static_string ("location")))) {
3826
self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_URI;
3830
} else if (_tmp37_ == ((0 != _tmp36_label1) ? _tmp36_label1 : (_tmp36_label1 = g_quark_from_static_string ("title")))) {
3834
self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_TITLE;
3838
} else if (_tmp37_ == ((0 != _tmp36_label2) ? _tmp36_label2 : (_tmp36_label2 = g_quark_from_static_string ("duration")))) {
3842
self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_DURATION;
3846
} else if (_tmp37_ == ((0 != _tmp36_label3) ? _tmp36_label3 : (_tmp36_label3 = g_quark_from_static_string ("artist")))) {
3850
self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_ARTIST;
3854
} else if (_tmp37_ == ((0 != _tmp36_label4) ? _tmp36_label4 : (_tmp36_label4 = g_quark_from_static_string ("album")))) {
3858
self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_ALBUM;
3862
} else if (_tmp37_ == ((0 != _tmp36_label5) ? _tmp36_label5 : (_tmp36_label5 = g_quark_from_static_string ("genre")))) {
3866
self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_GENRE;
3870
} else if (_tmp37_ == ((0 != _tmp36_label6) ? _tmp36_label6 : (_tmp36_label6 = g_quark_from_static_string ("track-number")))) {
3874
self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_TRACK_NUMBER;
3878
} else if (_tmp37_ == ((0 != _tmp36_label7) ? _tmp36_label7 : (_tmp36_label7 = g_quark_from_static_string ("play-count")))) {
3882
self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_PLAY_COUNT;
3886
} else if (_tmp37_ == ((0 != _tmp36_label8) ? _tmp36_label8 : (_tmp36_label8 = g_quark_from_static_string ("date")))) {
3890
self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_YEAR;
3894
} else if (_tmp37_ == ((0 != _tmp36_label9) ? _tmp36_label9 : (_tmp36_label9 = g_quark_from_static_string ("media-type")))) {
3898
self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_MIMETYPE;
3902
} else if (_tmp37_ == ((0 != _tmp36_label10) ? _tmp36_label10 : (_tmp36_label10 = g_quark_from_static_string ("album-artist")))) {
3906
self->priv->current_data = (gint) UNITY_MUSIC_LENS_COLUMNS_ALBUM_ARTIST;
3914
self->priv->current_data = -1;
3923
static void unity_music_lens_rhythmbox_collection_xml_parser_end_tag (UnityMusicLensRhythmboxCollectionXmlParser* self, GMarkupParseContext* content, const gchar* name, GError** error) {
3924
const gchar* _tmp0_;
3925
const gchar* _tmp1_;
3927
static GQuark _tmp2_label0 = 0;
3928
static GQuark _tmp2_label1 = 0;
3929
static GQuark _tmp2_label2 = 0;
3930
static GQuark _tmp2_label3 = 0;
3931
static GQuark _tmp2_label4 = 0;
3932
static GQuark _tmp2_label5 = 0;
3933
static GQuark _tmp2_label6 = 0;
3934
static GQuark _tmp2_label7 = 0;
3935
static GQuark _tmp2_label8 = 0;
3936
static GQuark _tmp2_label9 = 0;
3937
static GQuark _tmp2_label10 = 0;
3938
static GQuark _tmp2_label11 = 0;
3939
static GQuark _tmp2_label12 = 0;
3940
g_return_if_fail (self != NULL);
3941
g_return_if_fail (content != NULL);
3942
g_return_if_fail (name != NULL);
3945
_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
3946
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 ("duration"))))) || (_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("artist"))))) || (_tmp3_ == ((0 != _tmp2_label4) ? _tmp2_label4 : (_tmp2_label4 = g_quark_from_static_string ("album"))))) || (_tmp3_ == ((0 != _tmp2_label5) ? _tmp2_label5 : (_tmp2_label5 = g_quark_from_static_string ("genre"))))) || (_tmp3_ == ((0 != _tmp2_label6) ? _tmp2_label6 : (_tmp2_label6 = g_quark_from_static_string ("track-number"))))) || (_tmp3_ == ((0 != _tmp2_label7) ? _tmp2_label7 : (_tmp2_label7 = g_quark_from_static_string ("play-count"))))) || (_tmp3_ == ((0 != _tmp2_label8) ? _tmp2_label8 : (_tmp2_label8 = g_quark_from_static_string ("date"))))) || (_tmp3_ == ((0 != _tmp2_label9) ? _tmp2_label9 : (_tmp2_label9 = g_quark_from_static_string ("media-type"))))) || (_tmp3_ == ((0 != _tmp2_label10) ? _tmp2_label10 : (_tmp2_label10 = g_quark_from_static_string ("album-artist"))))) {
3951
_tmp4_ = self->priv->current_data;
3953
self->priv->current_data = -1;
3958
} else if (_tmp3_ == ((0 != _tmp2_label11) ? _tmp2_label11 : (_tmp2_label11 = g_quark_from_static_string ("hidden")))) {
3963
_tmp5_ = self->priv->processing_track;
3965
self->priv->processing_track = FALSE;
3970
} else if (_tmp3_ == ((0 != _tmp2_label12) ? _tmp2_label12 : (_tmp2_label12 = g_quark_from_static_string ("entry")))) {
3974
gboolean _tmp6_ = FALSE;
3977
_tmp7_ = self->priv->processing_track;
3979
UnityMusicLensTrack* _tmp8_;
3980
_tmp8_ = self->priv->current_track;
3981
_tmp6_ = _tmp8_ != NULL;
3987
UnityMusicLensTrack* _tmp10_;
3988
_tmp10_ = self->priv->current_track;
3989
g_signal_emit_by_name (self, "track-info-ready", _tmp10_);
3991
self->priv->processing_track = FALSE;
3999
static void unity_music_lens_rhythmbox_collection_xml_parser_process_text (UnityMusicLensRhythmboxCollectionXmlParser* self, GMarkupParseContext* context, const gchar* text, gsize text_len, GError** error) {
4000
gboolean _tmp0_ = FALSE;
4004
g_return_if_fail (self != NULL);
4005
g_return_if_fail (context != NULL);
4006
g_return_if_fail (text != NULL);
4007
_tmp1_ = self->priv->processing_track;
4012
_tmp2_ = self->priv->current_data;
4013
_tmp0_ = _tmp2_ < 0;
4019
_tmp4_ = self->priv->current_data;
4021
case UNITY_MUSIC_LENS_COLUMNS_URI:
4023
UnityMusicLensTrack* _tmp5_;
4024
const gchar* _tmp6_;
4025
_tmp5_ = self->priv->current_track;
4027
unity_music_lens_track_set_uri (_tmp5_, _tmp6_);
4030
case UNITY_MUSIC_LENS_COLUMNS_TITLE:
4032
UnityMusicLensTrack* _tmp7_;
4033
const gchar* _tmp8_;
4034
_tmp7_ = self->priv->current_track;
4036
unity_music_lens_track_set_title (_tmp7_, _tmp8_);
4039
case UNITY_MUSIC_LENS_COLUMNS_ARTIST:
4041
UnityMusicLensTrack* _tmp9_;
4042
const gchar* _tmp10_;
4043
_tmp9_ = self->priv->current_track;
4045
unity_music_lens_track_set_artist (_tmp9_, _tmp10_);
4048
case UNITY_MUSIC_LENS_COLUMNS_ALBUM:
4050
UnityMusicLensTrack* _tmp11_;
4051
const gchar* _tmp12_;
4052
_tmp11_ = self->priv->current_track;
4054
unity_music_lens_track_set_album (_tmp11_, _tmp12_);
4057
case UNITY_MUSIC_LENS_COLUMNS_ALBUM_ARTIST:
4059
UnityMusicLensTrack* _tmp13_;
4060
const gchar* _tmp14_;
4061
_tmp13_ = self->priv->current_track;
4063
unity_music_lens_track_set_album_artist (_tmp13_, _tmp14_);
4066
case UNITY_MUSIC_LENS_COLUMNS_GENRE:
4068
UnityMusicLensTrack* _tmp15_;
4069
UnityMusicLensGenre* _tmp16_;
4070
const gchar* _tmp17_;
4071
gchar* _tmp18_ = NULL;
4073
gchar* _tmp20_ = NULL;
4075
_tmp15_ = self->priv->current_track;
4076
_tmp16_ = self->priv->genre;
4078
_tmp18_ = g_utf8_strdown (_tmp17_, (gssize) (-1));
4080
_tmp20_ = unity_music_lens_genre_get_id_for_genre (_tmp16_, _tmp19_);
4082
unity_music_lens_track_set_genre (_tmp15_, _tmp21_);
4087
case UNITY_MUSIC_LENS_COLUMNS_MIMETYPE:
4089
UnityMusicLensTrack* _tmp22_;
4090
const gchar* _tmp23_;
4091
_tmp22_ = self->priv->current_track;
4093
unity_music_lens_track_set_mime_type (_tmp22_, _tmp23_);
4096
case UNITY_MUSIC_LENS_COLUMNS_YEAR:
4098
UnityMusicLensTrack* _tmp24_;
4099
const gchar* _tmp25_;
4101
_tmp24_ = self->priv->current_track;
4103
_tmp26_ = atoi (_tmp25_);
4104
unity_music_lens_track_set_year (_tmp24_, _tmp26_ / 365);
4107
case UNITY_MUSIC_LENS_COLUMNS_PLAY_COUNT:
4109
UnityMusicLensTrack* _tmp27_;
4110
const gchar* _tmp28_;
4112
_tmp27_ = self->priv->current_track;
4114
_tmp29_ = atoi (_tmp28_);
4115
unity_music_lens_track_set_play_count (_tmp27_, _tmp29_);
4118
case UNITY_MUSIC_LENS_COLUMNS_TRACK_NUMBER:
4120
UnityMusicLensTrack* _tmp30_;
4121
const gchar* _tmp31_;
4123
_tmp30_ = self->priv->current_track;
4125
_tmp32_ = atoi (_tmp31_);
4126
unity_music_lens_track_set_track_number (_tmp30_, _tmp32_);
4129
case UNITY_MUSIC_LENS_COLUMNS_DURATION:
4131
UnityMusicLensTrack* _tmp33_;
4132
const gchar* _tmp34_;
4134
_tmp33_ = self->priv->current_track;
4136
_tmp35_ = atoi (_tmp34_);
4137
unity_music_lens_track_set_duration (_tmp33_, _tmp35_);
4146
UnityMusicLensRhythmboxCollectionXmlParser* unity_music_lens_rhythmbox_collection_xml_parser_construct (GType object_type) {
4147
UnityMusicLensRhythmboxCollectionXmlParser * self = NULL;
4148
self = (UnityMusicLensRhythmboxCollectionXmlParser*) g_object_new (object_type, NULL);
4153
UnityMusicLensRhythmboxCollectionXmlParser* unity_music_lens_rhythmbox_collection_xml_parser_new (void) {
4154
return unity_music_lens_rhythmbox_collection_xml_parser_construct (UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_TYPE_XML_PARSER);
4158
static GObject * unity_music_lens_rhythmbox_collection_xml_parser_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
4160
GObjectClass * parent_class;
4161
UnityMusicLensRhythmboxCollectionXmlParser * self;
4162
GMarkupParseContext* _tmp0_;
4163
parent_class = G_OBJECT_CLASS (unity_music_lens_rhythmbox_collection_xml_parser_parent_class);
4164
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
4165
self = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER (obj);
4166
_tmp0_ = g_markup_parse_context_new (&UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER_parser, 0, self, NULL);
4167
_g_markup_parse_context_free0 (self->priv->context);
4168
self->priv->context = _tmp0_;
4173
static void unity_music_lens_rhythmbox_collection_xml_parser_class_init (UnityMusicLensRhythmboxCollectionXmlParserClass * klass) {
4174
unity_music_lens_rhythmbox_collection_xml_parser_parent_class = g_type_class_peek_parent (klass);
4175
g_type_class_add_private (klass, sizeof (UnityMusicLensRhythmboxCollectionXmlParserPrivate));
4176
G_OBJECT_CLASS (klass)->constructor = unity_music_lens_rhythmbox_collection_xml_parser_constructor;
4177
G_OBJECT_CLASS (klass)->finalize = unity_music_lens_rhythmbox_collection_xml_parser_finalize;
4178
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);
4182
static void unity_music_lens_rhythmbox_collection_xml_parser_instance_init (UnityMusicLensRhythmboxCollectionXmlParser * self) {
4183
UnityMusicLensGenre* _tmp0_;
4184
self->priv = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER_GET_PRIVATE (self);
4185
_tmp0_ = unity_music_lens_genre_new ();
4186
self->priv->genre = _tmp0_;
4187
self->priv->is_rhythmdb_xml = FALSE;
4188
self->priv->current_data = -1;
4192
static void unity_music_lens_rhythmbox_collection_xml_parser_finalize (GObject* obj) {
4193
UnityMusicLensRhythmboxCollectionXmlParser * self;
4194
self = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_XML_PARSER (obj);
4195
_g_object_unref0 (self->priv->genre);
4196
_g_markup_parse_context_free0 (self->priv->context);
4197
_g_object_unref0 (self->priv->current_track);
4198
G_OBJECT_CLASS (unity_music_lens_rhythmbox_collection_xml_parser_parent_class)->finalize (obj);
4202
GType unity_music_lens_rhythmbox_collection_xml_parser_get_type (void) {
4203
static volatile gsize unity_music_lens_rhythmbox_collection_xml_parser_type_id__volatile = 0;
4204
if (g_once_init_enter (&unity_music_lens_rhythmbox_collection_xml_parser_type_id__volatile)) {
4205
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 };
4206
GType unity_music_lens_rhythmbox_collection_xml_parser_type_id;
4207
unity_music_lens_rhythmbox_collection_xml_parser_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityMusicLensRhythmboxCollectionXmlParser", &g_define_type_info, 0);
4208
g_once_init_leave (&unity_music_lens_rhythmbox_collection_xml_parser_type_id__volatile, unity_music_lens_rhythmbox_collection_xml_parser_type_id);
4210
return unity_music_lens_rhythmbox_collection_xml_parser_type_id__volatile;
4214
static void unity_music_lens_rhythmbox_collection_class_init (UnityMusicLensRhythmboxCollectionClass * klass) {
4215
unity_music_lens_rhythmbox_collection_parent_class = g_type_class_peek_parent (klass);
4216
g_type_class_add_private (klass, sizeof (UnityMusicLensRhythmboxCollectionPrivate));
4217
G_OBJECT_CLASS (klass)->constructor = unity_music_lens_rhythmbox_collection_constructor;
4218
G_OBJECT_CLASS (klass)->finalize = unity_music_lens_rhythmbox_collection_finalize;
4222
static void unity_music_lens_rhythmbox_collection_instance_init (UnityMusicLensRhythmboxCollection * self) {
4223
self->priv = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_GET_PRIVATE (self);
4227
static void unity_music_lens_rhythmbox_collection_finalize (GObject* obj) {
4228
UnityMusicLensRhythmboxCollection * self;
4229
self = UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION (obj);
4230
_g_object_unref0 (self->priv->all_tracks);
4231
_g_object_unref0 (self->priv->tracks_by_play_count);
4232
_g_hash_table_unref0 (self->priv->album_to_tracks_map);
4233
_tdb_close0 (self->priv->album_art_tdb);
4234
_g_object_unref0 (self->priv->tdb_monitor);
4235
_g_hash_table_unref0 (self->priv->variant_store);
4236
_g_hash_table_unref0 (self->priv->int_variant_store);
4237
_vala_array_destroy (self->priv->row_buffer, 13, (GDestroyNotify) g_variant_unref);
4238
_g_object_unref0 (self->priv->analyzer);
4239
_g_object_unref0 (self->priv->index);
4240
_dee_icu_term_filter_destroy0 (self->priv->ascii_filter);
4241
_g_free0 (self->priv->media_art_dir);
4242
G_OBJECT_CLASS (unity_music_lens_rhythmbox_collection_parent_class)->finalize (obj);
4246
GType unity_music_lens_rhythmbox_collection_get_type (void) {
4247
static volatile gsize unity_music_lens_rhythmbox_collection_type_id__volatile = 0;
4248
if (g_once_init_enter (&unity_music_lens_rhythmbox_collection_type_id__volatile)) {
4249
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 };
4250
GType unity_music_lens_rhythmbox_collection_type_id;
4251
unity_music_lens_rhythmbox_collection_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityMusicLensRhythmboxCollection", &g_define_type_info, 0);
4252
g_once_init_leave (&unity_music_lens_rhythmbox_collection_type_id__volatile, unity_music_lens_rhythmbox_collection_type_id);
4254
return unity_music_lens_rhythmbox_collection_type_id__volatile;
4258
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
4259
if ((array != NULL) && (destroy_func != NULL)) {
4261
for (i = 0; i < array_length; i = i + 1) {
4262
if (((gpointer*) array)[i] != NULL) {
4263
destroy_func (((gpointer*) array)[i]);
4270
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
4271
_vala_array_destroy (array, array_length, destroy_func);
4276
static gint _vala_array_length (gpointer array) {
4280
while (((gpointer*) array)[length]) {