/* rygel-external-item-factory.c generated by valac 0.30.0, the Vala compiler
 * generated from rygel-external-item-factory.vala, do not modify */

/*
 * Copyright (C) 2009 Zeeshan Ali (Khattak) <zeeshanak@gnome.org>.
 * Copyright (C) 2009,2010 Nokia Corporation.
 *
 * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
 *                               <zeeshan.ali@nokia.com>
 *
 * This file is part of Rygel.
 *
 * Rygel is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Rygel is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <rygel-server.h>
#include <gee.h>
#include <gobject/gvaluecollector.h>


#define RYGEL_EXTERNAL_TYPE_ITEM_FACTORY (rygel_external_item_factory_get_type ())
#define RYGEL_EXTERNAL_ITEM_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_EXTERNAL_TYPE_ITEM_FACTORY, RygelExternalItemFactory))
#define RYGEL_EXTERNAL_ITEM_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_EXTERNAL_TYPE_ITEM_FACTORY, RygelExternalItemFactoryClass))
#define RYGEL_EXTERNAL_IS_ITEM_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_EXTERNAL_TYPE_ITEM_FACTORY))
#define RYGEL_EXTERNAL_IS_ITEM_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_EXTERNAL_TYPE_ITEM_FACTORY))
#define RYGEL_EXTERNAL_ITEM_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_EXTERNAL_TYPE_ITEM_FACTORY, RygelExternalItemFactoryClass))

typedef struct _RygelExternalItemFactory RygelExternalItemFactory;
typedef struct _RygelExternalItemFactoryClass RygelExternalItemFactoryClass;
typedef struct _RygelExternalItemFactoryPrivate RygelExternalItemFactoryPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _rygel_external_item_factory_unref0(var) ((var == NULL) ? NULL : (var = (rygel_external_item_factory_unref (var), NULL)))

#define RYGEL_EXTERNAL_TYPE_DUMMY_CONTAINER (rygel_external_dummy_container_get_type ())
#define RYGEL_EXTERNAL_DUMMY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_EXTERNAL_TYPE_DUMMY_CONTAINER, RygelExternalDummyContainer))
#define RYGEL_EXTERNAL_DUMMY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_EXTERNAL_TYPE_DUMMY_CONTAINER, RygelExternalDummyContainerClass))
#define RYGEL_EXTERNAL_IS_DUMMY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_EXTERNAL_TYPE_DUMMY_CONTAINER))
#define RYGEL_EXTERNAL_IS_DUMMY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_EXTERNAL_TYPE_DUMMY_CONTAINER))
#define RYGEL_EXTERNAL_DUMMY_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_EXTERNAL_TYPE_DUMMY_CONTAINER, RygelExternalDummyContainerClass))

typedef struct _RygelExternalDummyContainer RygelExternalDummyContainer;
typedef struct _RygelExternalDummyContainerClass RygelExternalDummyContainerClass;
typedef struct _RygelExternalItemFactoryCreateData RygelExternalItemFactoryCreateData;

#define RYGEL_EXTERNAL_TYPE_ALBUM_ART_FACTORY (rygel_external_album_art_factory_get_type ())
#define RYGEL_EXTERNAL_ALBUM_ART_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_EXTERNAL_TYPE_ALBUM_ART_FACTORY, RygelExternalAlbumArtFactory))
#define RYGEL_EXTERNAL_ALBUM_ART_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_EXTERNAL_TYPE_ALBUM_ART_FACTORY, RygelExternalAlbumArtFactoryClass))
#define RYGEL_EXTERNAL_IS_ALBUM_ART_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_EXTERNAL_TYPE_ALBUM_ART_FACTORY))
#define RYGEL_EXTERNAL_IS_ALBUM_ART_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_EXTERNAL_TYPE_ALBUM_ART_FACTORY))
#define RYGEL_EXTERNAL_ALBUM_ART_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_EXTERNAL_TYPE_ALBUM_ART_FACTORY, RygelExternalAlbumArtFactoryClass))

typedef struct _RygelExternalAlbumArtFactory RygelExternalAlbumArtFactory;
typedef struct _RygelExternalAlbumArtFactoryClass RygelExternalAlbumArtFactoryClass;
#define _rygel_external_album_art_factory_unref0(var) ((var == NULL) ? NULL : (var = (rygel_external_album_art_factory_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _rygel_icon_info_unref0(var) ((var == NULL) ? NULL : (var = (rygel_icon_info_unref (var), NULL)))
typedef struct _RygelExternalItemFactorySetMusicMetadataData RygelExternalItemFactorySetMusicMetadataData;

#define RYGEL_EXTERNAL_TYPE_THUMBNAIL_FACTORY (rygel_external_thumbnail_factory_get_type ())
#define RYGEL_EXTERNAL_THUMBNAIL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_EXTERNAL_TYPE_THUMBNAIL_FACTORY, RygelExternalThumbnailFactory))
#define RYGEL_EXTERNAL_THUMBNAIL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_EXTERNAL_TYPE_THUMBNAIL_FACTORY, RygelExternalThumbnailFactoryClass))
#define RYGEL_EXTERNAL_IS_THUMBNAIL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_EXTERNAL_TYPE_THUMBNAIL_FACTORY))
#define RYGEL_EXTERNAL_IS_THUMBNAIL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_EXTERNAL_TYPE_THUMBNAIL_FACTORY))
#define RYGEL_EXTERNAL_THUMBNAIL_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_EXTERNAL_TYPE_THUMBNAIL_FACTORY, RygelExternalThumbnailFactoryClass))

typedef struct _RygelExternalThumbnailFactory RygelExternalThumbnailFactory;
typedef struct _RygelExternalThumbnailFactoryClass RygelExternalThumbnailFactoryClass;
#define _rygel_external_thumbnail_factory_unref0(var) ((var == NULL) ? NULL : (var = (rygel_external_thumbnail_factory_unref (var), NULL)))
typedef struct _RygelExternalItemFactorySetVisualMetadataData RygelExternalItemFactorySetVisualMetadataData;
typedef struct _RygelExternalItemFactorySetVideoMetadataData RygelExternalItemFactorySetVideoMetadataData;
typedef struct _RygelExternalParamSpecItemFactory RygelExternalParamSpecItemFactory;

struct _RygelExternalItemFactory {
	GTypeInstance parent_instance;
	volatile int ref_count;
	RygelExternalItemFactoryPrivate * priv;
};

struct _RygelExternalItemFactoryClass {
	GTypeClass parent_class;
	void (*finalize) (RygelExternalItemFactory *self);
};

struct _RygelExternalItemFactoryCreateData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RygelExternalItemFactory* self;
	gchar* id;
	gchar* type;
	gchar* title;
	GHashTable* props;
	gchar* service_name;
	RygelMediaContainer* parent;
	RygelMediaFileItem* result;
	RygelMediaFileItem* item;
	gboolean _tmp0_;
	const gchar* _tmp1_;
	gboolean _tmp2_;
	const gchar* _tmp3_;
	gboolean _tmp4_;
	const gchar* _tmp5_;
	RygelMediaContainer* _tmp6_;
	const gchar* _tmp7_;
	RygelMusicItem* _tmp8_;
	RygelMediaFileItem* _tmp9_;
	GHashTable* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gboolean _tmp13_;
	const gchar* _tmp14_;
	RygelMediaContainer* _tmp15_;
	const gchar* _tmp16_;
	RygelAudioItem* _tmp17_;
	RygelMediaFileItem* _tmp18_;
	GHashTable* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	gboolean _tmp22_;
	const gchar* _tmp23_;
	RygelMediaContainer* _tmp24_;
	const gchar* _tmp25_;
	RygelVideoItem* _tmp26_;
	RygelMediaFileItem* _tmp27_;
	GHashTable* _tmp28_;
	const gchar* _tmp29_;
	const gchar* _tmp30_;
	RygelMediaContainer* _tmp31_;
	const gchar* _tmp32_;
	RygelImageItem* _tmp33_;
	RygelMediaFileItem* _tmp34_;
	GHashTable* _tmp35_;
	const gchar* _tmp36_;
	RygelMediaFileItem* _tmp37_;
	GHashTable* _tmp38_;
	const gchar* _tmp39_;
	RygelMediaContainer* _tmp40_;
	RygelMediaFileItem* _tmp41_;
	RygelMediaContainer* _tmp42_;
	RygelMediaEngine* media_engine;
	RygelMediaEngine* _tmp43_;
	GeeList* resources;
	RygelMediaEngine* _tmp44_;
	RygelMediaFileItem* _tmp45_;
	GeeList* _tmp46_;
	RygelMediaFileItem* _tmp47_;
	GeeList* _tmp48_;
	GeeList* _tmp49_;
	GeeList* _tmp50_;
	GError * _inner_error_;
};

struct _RygelExternalItemFactorySetMusicMetadataData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RygelExternalItemFactory* self;
	RygelMusicItem* music;
	GHashTable* props;
	gchar* service_name;
	RygelMusicItem* _tmp0_;
	GHashTable* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	RygelMusicItem* _tmp4_;
	GHashTable* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	RygelMusicItem* _tmp8_;
	GHashTable* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	RygelMusicItem* _tmp12_;
	GHashTable* _tmp13_;
	gint _tmp14_;
	GVariant* value;
	GHashTable* _tmp15_;
	gconstpointer _tmp16_;
	GVariant* _tmp17_;
	GVariant* _tmp18_;
	RygelExternalAlbumArtFactory* cover_factory;
	RygelExternalAlbumArtFactory* _tmp19_;
	RygelThumbnail* _tmp20_;
	RygelExternalAlbumArtFactory* _tmp21_;
	const gchar* _tmp22_;
	GVariant* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	RygelThumbnail* _tmp26_;
	RygelThumbnail* _tmp27_;
	RygelMusicItem* _tmp28_;
	RygelMusicItem* _tmp29_;
	GHashTable* _tmp30_;
	const gchar* _tmp31_;
	GError * _inner_error_;
};

struct _RygelExternalItemFactorySetVisualMetadataData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RygelExternalItemFactory* self;
	RygelVisualItem* visual;
	GHashTable* props;
	gchar* service_name;
	RygelVisualItem* _tmp0_;
	GHashTable* _tmp1_;
	gint _tmp2_;
	RygelVisualItem* _tmp3_;
	GHashTable* _tmp4_;
	gint _tmp5_;
	RygelVisualItem* _tmp6_;
	GHashTable* _tmp7_;
	gint _tmp8_;
	GVariant* value;
	GHashTable* _tmp9_;
	gconstpointer _tmp10_;
	GVariant* _tmp11_;
	GVariant* _tmp12_;
	RygelExternalThumbnailFactory* factory;
	RygelExternalThumbnailFactory* _tmp13_;
	RygelThumbnail* thumbnail;
	RygelExternalThumbnailFactory* _tmp14_;
	GVariant* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	const gchar* _tmp18_;
	RygelThumbnail* _tmp19_;
	RygelThumbnail* _tmp20_;
	RygelVisualItem* _tmp21_;
	GeeArrayList* _tmp22_;
	GeeArrayList* _tmp23_;
	RygelThumbnail* _tmp24_;
	GError * _inner_error_;
};

struct _RygelExternalItemFactorySetVideoMetadataData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RygelExternalItemFactory* self;
	RygelVideoItem* video;
	GHashTable* props;
	gchar* service_name;
	RygelVideoItem* _tmp0_;
	GHashTable* _tmp1_;
	const gchar* _tmp2_;
	RygelVideoItem* _tmp3_;
	GHashTable* _tmp4_;
	const gchar* _tmp5_;
	GError * _inner_error_;
};

struct _RygelExternalParamSpecItemFactory {
	GParamSpec parent_instance;
};


static gpointer rygel_external_item_factory_parent_class = NULL;

gpointer rygel_external_item_factory_ref (gpointer instance);
void rygel_external_item_factory_unref (gpointer instance);
GParamSpec* rygel_external_param_spec_item_factory (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void rygel_external_value_set_item_factory (GValue* value, gpointer v_object);
void rygel_external_value_take_item_factory (GValue* value, gpointer v_object);
gpointer rygel_external_value_get_item_factory (const GValue* value);
GType rygel_external_item_factory_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_EXTERNAL_ITEM_FACTORY_DUMMY_PROPERTY
};
static void rygel_external_item_factory_create_data_free (gpointer _data);
void rygel_external_item_factory_create (RygelExternalItemFactory* self, const gchar* id, const gchar* type, const gchar* title, GHashTable* props, const gchar* service_name, RygelMediaContainer* parent, GAsyncReadyCallback _callback_, gpointer _user_data_);
RygelMediaFileItem* rygel_external_item_factory_create_finish (RygelExternalItemFactory* self, GAsyncResult* _res_, GError** error);
static gboolean rygel_external_item_factory_create_co (RygelExternalItemFactoryCreateData* _data_);
static void rygel_external_item_factory_set_music_metadata (RygelExternalItemFactory* self, RygelMusicItem* music, GHashTable* props, const gchar* service_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void rygel_external_item_factory_set_music_metadata_finish (RygelExternalItemFactory* self, GAsyncResult* _res_, GError** error);
static void rygel_external_item_factory_create_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void rygel_external_item_factory_set_audio_metadata (RygelExternalItemFactory* self, RygelAudioItem* audio, GHashTable* props, const gchar* service_name, GError** error);
static void rygel_external_item_factory_set_video_metadata (RygelExternalItemFactory* self, RygelVideoItem* video, GHashTable* props, const gchar* service_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void rygel_external_item_factory_set_video_metadata_finish (RygelExternalItemFactory* self, GAsyncResult* _res_, GError** error);
static void rygel_external_item_factory_set_visual_metadata (RygelExternalItemFactory* self, RygelVisualItem* visual, GHashTable* props, const gchar* service_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void rygel_external_item_factory_set_visual_metadata_finish (RygelExternalItemFactory* self, GAsyncResult* _res_, GError** error);
static void rygel_external_item_factory_set_generic_metadata (RygelExternalItemFactory* self, RygelMediaFileItem* item, GHashTable* props, const gchar* service_name);
GType rygel_external_dummy_container_get_type (void) G_GNUC_CONST;
static void rygel_external_item_factory_set_music_metadata_data_free (gpointer _data);
static gboolean rygel_external_item_factory_set_music_metadata_co (RygelExternalItemFactorySetMusicMetadataData* _data_);
static gchar* rygel_external_item_factory_get_string (RygelExternalItemFactory* self, GHashTable* props, const gchar* prop);
static gint rygel_external_item_factory_get_int (RygelExternalItemFactory* self, GHashTable* props, const gchar* prop);
gpointer rygel_external_album_art_factory_ref (gpointer instance);
void rygel_external_album_art_factory_unref (gpointer instance);
GParamSpec* rygel_external_param_spec_album_art_factory (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void rygel_external_value_set_album_art_factory (GValue* value, gpointer v_object);
void rygel_external_value_take_album_art_factory (GValue* value, gpointer v_object);
gpointer rygel_external_value_get_album_art_factory (const GValue* value);
GType rygel_external_album_art_factory_get_type (void) G_GNUC_CONST;
RygelExternalAlbumArtFactory* rygel_external_album_art_factory_new (void);
RygelExternalAlbumArtFactory* rygel_external_album_art_factory_construct (GType object_type);
void rygel_external_album_art_factory_create (RygelExternalAlbumArtFactory* self, const gchar* service_name, const gchar* object_path, GAsyncReadyCallback _callback_, gpointer _user_data_);
RygelThumbnail* rygel_external_album_art_factory_create_finish (RygelExternalAlbumArtFactory* self, GAsyncResult* _res_, GError** error);
static gchar* _variant_get13 (GVariant* value);
static void rygel_external_item_factory_set_music_metadata_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void rygel_external_item_factory_set_visual_metadata_data_free (gpointer _data);
static gboolean rygel_external_item_factory_set_visual_metadata_co (RygelExternalItemFactorySetVisualMetadataData* _data_);
gpointer rygel_external_thumbnail_factory_ref (gpointer instance);
void rygel_external_thumbnail_factory_unref (gpointer instance);
GParamSpec* rygel_external_param_spec_thumbnail_factory (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void rygel_external_value_set_thumbnail_factory (GValue* value, gpointer v_object);
void rygel_external_value_take_thumbnail_factory (GValue* value, gpointer v_object);
gpointer rygel_external_value_get_thumbnail_factory (const GValue* value);
GType rygel_external_thumbnail_factory_get_type (void) G_GNUC_CONST;
RygelExternalThumbnailFactory* rygel_external_thumbnail_factory_new (void);
RygelExternalThumbnailFactory* rygel_external_thumbnail_factory_construct (GType object_type);
void rygel_external_thumbnail_factory_create (RygelExternalThumbnailFactory* self, const gchar* service_name, const gchar* object_path, GAsyncReadyCallback _callback_, gpointer _user_data_);
RygelThumbnail* rygel_external_thumbnail_factory_create_finish (RygelExternalThumbnailFactory* self, GAsyncResult* _res_, GError** error);
static gchar* _variant_get14 (GVariant* value);
static void rygel_external_item_factory_set_visual_metadata_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void rygel_external_item_factory_set_video_metadata_data_free (gpointer _data);
static gboolean rygel_external_item_factory_set_video_metadata_co (RygelExternalItemFactorySetVideoMetadataData* _data_);
static void rygel_external_item_factory_set_video_metadata_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
gchar* rygel_external_get_mandatory_string_value (GHashTable* props, const gchar* key, const gchar* _default_, const gchar* service_name);
gchar** rygel_external_get_mandatory_string_list_value (GHashTable* props, const gchar* key, gchar** _default_, int _default__length1, const gchar* service_name, int* result_length1);
static gint64 _variant_get15 (GVariant* value);
static gchar* _variant_get16 (GVariant* value);
static gint _variant_get17 (GVariant* value);
RygelExternalItemFactory* rygel_external_item_factory_new (void);
RygelExternalItemFactory* rygel_external_item_factory_construct (GType object_type);
static void rygel_external_item_factory_finalize (RygelExternalItemFactory* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


static void rygel_external_item_factory_create_data_free (gpointer _data) {
	RygelExternalItemFactoryCreateData* _data_;
	_data_ = _data;
	_g_free0 (_data_->id);
	_g_free0 (_data_->type);
	_g_free0 (_data_->title);
	_g_hash_table_unref0 (_data_->props);
	_g_free0 (_data_->service_name);
	_g_object_unref0 (_data_->parent);
	_g_object_unref0 (_data_->result);
	_rygel_external_item_factory_unref0 (_data_->self);
	g_slice_free (RygelExternalItemFactoryCreateData, _data_);
}


static gpointer _rygel_external_item_factory_ref0 (gpointer self) {
	return self ? rygel_external_item_factory_ref (self) : NULL;
}


static gpointer _g_hash_table_ref0 (gpointer self) {
	return self ? g_hash_table_ref (self) : NULL;
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


void rygel_external_item_factory_create (RygelExternalItemFactory* self, const gchar* id, const gchar* type, const gchar* title, GHashTable* props, const gchar* service_name, RygelMediaContainer* parent, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RygelExternalItemFactoryCreateData* _data_;
	RygelExternalItemFactory* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	GHashTable* _tmp7_ = NULL;
	GHashTable* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	RygelMediaContainer* _tmp11_ = NULL;
	RygelMediaContainer* _tmp12_ = NULL;
	_data_ = g_slice_new0 (RygelExternalItemFactoryCreateData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, rygel_external_item_factory_create);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_external_item_factory_create_data_free);
	_tmp0_ = _rygel_external_item_factory_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = id;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (_data_->id);
	_data_->id = _tmp2_;
	_tmp3_ = type;
	_tmp4_ = g_strdup (_tmp3_);
	_g_free0 (_data_->type);
	_data_->type = _tmp4_;
	_tmp5_ = title;
	_tmp6_ = g_strdup (_tmp5_);
	_g_free0 (_data_->title);
	_data_->title = _tmp6_;
	_tmp7_ = props;
	_tmp8_ = _g_hash_table_ref0 (_tmp7_);
	_g_hash_table_unref0 (_data_->props);
	_data_->props = _tmp8_;
	_tmp9_ = service_name;
	_tmp10_ = g_strdup (_tmp9_);
	_g_free0 (_data_->service_name);
	_data_->service_name = _tmp10_;
	_tmp11_ = parent;
	_tmp12_ = _g_object_ref0 (_tmp11_);
	_g_object_unref0 (_data_->parent);
	_data_->parent = _tmp12_;
	rygel_external_item_factory_create_co (_data_);
}


RygelMediaFileItem* rygel_external_item_factory_create_finish (RygelExternalItemFactory* self, GAsyncResult* _res_, GError** error) {
	RygelMediaFileItem* result;
	RygelExternalItemFactoryCreateData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void rygel_external_item_factory_create_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	RygelExternalItemFactoryCreateData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	rygel_external_item_factory_create_co (_data_);
}


static gboolean rygel_external_item_factory_create_co (RygelExternalItemFactoryCreateData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _data_->type;
	_data_->_tmp2_ = FALSE;
	_data_->_tmp2_ = g_str_has_prefix (_data_->_tmp1_, "music");
	if (_data_->_tmp2_) {
		_data_->_tmp0_ = TRUE;
	} else {
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = _data_->type;
		_data_->_tmp4_ = FALSE;
		_data_->_tmp4_ = g_str_has_prefix (_data_->_tmp3_, "audio.music");
		_data_->_tmp0_ = _data_->_tmp4_;
	}
	if (_data_->_tmp0_) {
		_data_->_tmp5_ = NULL;
		_data_->_tmp5_ = _data_->id;
		_data_->_tmp6_ = NULL;
		_data_->_tmp6_ = _data_->parent;
		_data_->_tmp7_ = NULL;
		_data_->_tmp7_ = _data_->title;
		_data_->_tmp8_ = NULL;
		_data_->_tmp8_ = rygel_music_item_new (_data_->_tmp5_, _data_->_tmp6_, _data_->_tmp7_, RYGEL_MUSIC_ITEM_UPNP_CLASS);
		_g_object_unref0 (_data_->item);
		_data_->item = (RygelMediaFileItem*) _data_->_tmp8_;
		_data_->_tmp9_ = NULL;
		_data_->_tmp9_ = _data_->item;
		_data_->_tmp10_ = NULL;
		_data_->_tmp10_ = _data_->props;
		_data_->_tmp11_ = NULL;
		_data_->_tmp11_ = _data_->service_name;
		_data_->_state_ = 1;
		rygel_external_item_factory_set_music_metadata (_data_->self, G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp9_, RYGEL_TYPE_MUSIC_ITEM) ? ((RygelMusicItem*) _data_->_tmp9_) : NULL, _data_->_tmp10_, _data_->_tmp11_, rygel_external_item_factory_create_ready, _data_);
		return FALSE;
		_state_1:
		rygel_external_item_factory_set_music_metadata_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			if ((_data_->_inner_error_->domain == G_IO_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) {
				g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
				g_error_free (_data_->_inner_error_);
				_g_object_unref0 (_data_->item);
				if (_data_->_state_ == 0) {
					g_simple_async_result_complete_in_idle (_data_->_async_result);
				} else {
					g_simple_async_result_complete (_data_->_async_result);
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_g_object_unref0 (_data_->item);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
				g_clear_error (&_data_->_inner_error_);
				return FALSE;
			}
		}
	} else {
		_data_->_tmp12_ = NULL;
		_data_->_tmp12_ = _data_->type;
		_data_->_tmp13_ = FALSE;
		_data_->_tmp13_ = g_str_has_prefix (_data_->_tmp12_, "audio");
		if (_data_->_tmp13_) {
			_data_->_tmp14_ = NULL;
			_data_->_tmp14_ = _data_->id;
			_data_->_tmp15_ = NULL;
			_data_->_tmp15_ = _data_->parent;
			_data_->_tmp16_ = NULL;
			_data_->_tmp16_ = _data_->title;
			_data_->_tmp17_ = NULL;
			_data_->_tmp17_ = rygel_audio_item_new (_data_->_tmp14_, _data_->_tmp15_, _data_->_tmp16_, RYGEL_AUDIO_ITEM_UPNP_CLASS);
			_g_object_unref0 (_data_->item);
			_data_->item = (RygelMediaFileItem*) _data_->_tmp17_;
			_data_->_tmp18_ = NULL;
			_data_->_tmp18_ = _data_->item;
			_data_->_tmp19_ = NULL;
			_data_->_tmp19_ = _data_->props;
			_data_->_tmp20_ = NULL;
			_data_->_tmp20_ = _data_->service_name;
			rygel_external_item_factory_set_audio_metadata (_data_->self, G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp18_, RYGEL_TYPE_AUDIO_ITEM) ? ((RygelAudioItem*) _data_->_tmp18_) : NULL, _data_->_tmp19_, _data_->_tmp20_, &_data_->_inner_error_);
			if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
				if ((_data_->_inner_error_->domain == G_IO_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) {
					g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
					g_error_free (_data_->_inner_error_);
					_g_object_unref0 (_data_->item);
					if (_data_->_state_ == 0) {
						g_simple_async_result_complete_in_idle (_data_->_async_result);
					} else {
						g_simple_async_result_complete (_data_->_async_result);
					}
					g_object_unref (_data_->_async_result);
					return FALSE;
				} else {
					_g_object_unref0 (_data_->item);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
					g_clear_error (&_data_->_inner_error_);
					return FALSE;
				}
			}
		} else {
			_data_->_tmp21_ = NULL;
			_data_->_tmp21_ = _data_->type;
			_data_->_tmp22_ = FALSE;
			_data_->_tmp22_ = g_str_has_prefix (_data_->_tmp21_, "video");
			if (_data_->_tmp22_) {
				_data_->_tmp23_ = NULL;
				_data_->_tmp23_ = _data_->id;
				_data_->_tmp24_ = NULL;
				_data_->_tmp24_ = _data_->parent;
				_data_->_tmp25_ = NULL;
				_data_->_tmp25_ = _data_->title;
				_data_->_tmp26_ = NULL;
				_data_->_tmp26_ = rygel_video_item_new (_data_->_tmp23_, _data_->_tmp24_, _data_->_tmp25_, RYGEL_VIDEO_ITEM_UPNP_CLASS);
				_g_object_unref0 (_data_->item);
				_data_->item = (RygelMediaFileItem*) _data_->_tmp26_;
				_data_->_tmp27_ = NULL;
				_data_->_tmp27_ = _data_->item;
				_data_->_tmp28_ = NULL;
				_data_->_tmp28_ = _data_->props;
				_data_->_tmp29_ = NULL;
				_data_->_tmp29_ = _data_->service_name;
				_data_->_state_ = 2;
				rygel_external_item_factory_set_video_metadata (_data_->self, G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp27_, RYGEL_TYPE_VIDEO_ITEM) ? ((RygelVideoItem*) _data_->_tmp27_) : NULL, _data_->_tmp28_, _data_->_tmp29_, rygel_external_item_factory_create_ready, _data_);
				return FALSE;
				_state_2:
				rygel_external_item_factory_set_video_metadata_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((_data_->_inner_error_->domain == G_IO_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						_g_object_unref0 (_data_->item);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						_g_object_unref0 (_data_->item);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
			} else {
				_data_->_tmp30_ = NULL;
				_data_->_tmp30_ = _data_->id;
				_data_->_tmp31_ = NULL;
				_data_->_tmp31_ = _data_->parent;
				_data_->_tmp32_ = NULL;
				_data_->_tmp32_ = _data_->title;
				_data_->_tmp33_ = NULL;
				_data_->_tmp33_ = rygel_image_item_new (_data_->_tmp30_, _data_->_tmp31_, _data_->_tmp32_, RYGEL_IMAGE_ITEM_UPNP_CLASS);
				_g_object_unref0 (_data_->item);
				_data_->item = (RygelMediaFileItem*) _data_->_tmp33_;
				_data_->_tmp34_ = NULL;
				_data_->_tmp34_ = _data_->item;
				_data_->_tmp35_ = NULL;
				_data_->_tmp35_ = _data_->props;
				_data_->_tmp36_ = NULL;
				_data_->_tmp36_ = _data_->service_name;
				_data_->_state_ = 3;
				rygel_external_item_factory_set_visual_metadata (_data_->self, G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp34_, RYGEL_TYPE_VISUAL_ITEM) ? ((RygelVisualItem*) _data_->_tmp34_) : NULL, _data_->_tmp35_, _data_->_tmp36_, rygel_external_item_factory_create_ready, _data_);
				return FALSE;
				_state_3:
				rygel_external_item_factory_set_visual_metadata_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((_data_->_inner_error_->domain == G_IO_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						_g_object_unref0 (_data_->item);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						_g_object_unref0 (_data_->item);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
			}
		}
	}
	_data_->_tmp37_ = NULL;
	_data_->_tmp37_ = _data_->item;
	_data_->_tmp38_ = NULL;
	_data_->_tmp38_ = _data_->props;
	_data_->_tmp39_ = NULL;
	_data_->_tmp39_ = _data_->service_name;
	rygel_external_item_factory_set_generic_metadata (_data_->self, _data_->_tmp37_, _data_->_tmp38_, _data_->_tmp39_);
	_data_->_tmp40_ = NULL;
	_data_->_tmp40_ = _data_->parent;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp40_, RYGEL_EXTERNAL_TYPE_DUMMY_CONTAINER)) {
		_data_->_tmp41_ = NULL;
		_data_->_tmp41_ = _data_->item;
		_data_->_tmp42_ = NULL;
		_data_->_tmp42_ = _data_->parent;
		rygel_media_object_set_parent_ref ((RygelMediaObject*) _data_->_tmp41_, _data_->_tmp42_);
	}
	_data_->_tmp43_ = NULL;
	_data_->_tmp43_ = rygel_media_engine_get_default ();
	_data_->media_engine = _data_->_tmp43_;
	_data_->_tmp44_ = NULL;
	_data_->_tmp44_ = _data_->media_engine;
	_data_->_tmp45_ = NULL;
	_data_->_tmp45_ = _data_->item;
	_data_->_state_ = 4;
	rygel_media_engine_get_resources_for_item (_data_->_tmp44_, (RygelMediaObject*) _data_->_tmp45_, rygel_external_item_factory_create_ready, _data_);
	return FALSE;
	_state_4:
	_data_->_tmp46_ = NULL;
	_data_->_tmp46_ = rygel_media_engine_get_resources_for_item_finish (_data_->_tmp44_, _data_->_res_);
	_data_->resources = _data_->_tmp46_;
	_data_->_tmp47_ = NULL;
	_data_->_tmp47_ = _data_->item;
	_data_->_tmp48_ = NULL;
	_data_->_tmp48_ = rygel_media_object_get_resource_list ((RygelMediaObject*) _data_->_tmp47_);
	_data_->_tmp49_ = NULL;
	_data_->_tmp49_ = _data_->_tmp48_;
	_data_->_tmp50_ = NULL;
	_data_->_tmp50_ = _data_->resources;
	gee_collection_add_all ((GeeCollection*) _data_->_tmp49_, (GeeCollection*) _data_->_tmp50_);
	_g_object_unref0 (_data_->_tmp49_);
	_data_->result = _data_->item;
	_g_object_unref0 (_data_->resources);
	_g_object_unref0 (_data_->media_engine);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_object_unref0 (_data_->resources);
	_g_object_unref0 (_data_->media_engine);
	_g_object_unref0 (_data_->item);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void rygel_external_item_factory_set_music_metadata_data_free (gpointer _data) {
	RygelExternalItemFactorySetMusicMetadataData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->music);
	_g_hash_table_unref0 (_data_->props);
	_g_free0 (_data_->service_name);
	_rygel_external_item_factory_unref0 (_data_->self);
	g_slice_free (RygelExternalItemFactorySetMusicMetadataData, _data_);
}


static void rygel_external_item_factory_set_music_metadata (RygelExternalItemFactory* self, RygelMusicItem* music, GHashTable* props, const gchar* service_name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RygelExternalItemFactorySetMusicMetadataData* _data_;
	RygelExternalItemFactory* _tmp0_ = NULL;
	RygelMusicItem* _tmp1_ = NULL;
	RygelMusicItem* _tmp2_ = NULL;
	GHashTable* _tmp3_ = NULL;
	GHashTable* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	_data_ = g_slice_new0 (RygelExternalItemFactorySetMusicMetadataData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, rygel_external_item_factory_set_music_metadata);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_external_item_factory_set_music_metadata_data_free);
	_tmp0_ = _rygel_external_item_factory_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = music;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->music);
	_data_->music = _tmp2_;
	_tmp3_ = props;
	_tmp4_ = _g_hash_table_ref0 (_tmp3_);
	_g_hash_table_unref0 (_data_->props);
	_data_->props = _tmp4_;
	_tmp5_ = service_name;
	_tmp6_ = g_strdup (_tmp5_);
	_g_free0 (_data_->service_name);
	_data_->service_name = _tmp6_;
	rygel_external_item_factory_set_music_metadata_co (_data_);
}


static void rygel_external_item_factory_set_music_metadata_finish (RygelExternalItemFactory* self, GAsyncResult* _res_, GError** error) {
	RygelExternalItemFactorySetMusicMetadataData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gpointer _g_variant_ref0 (gpointer self) {
	return self ? g_variant_ref (self) : NULL;
}


static gchar* _variant_get13 (GVariant* value) {
	return g_variant_dup_string (value, NULL);
}


static void rygel_external_item_factory_set_music_metadata_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	RygelExternalItemFactorySetMusicMetadataData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	rygel_external_item_factory_set_music_metadata_co (_data_);
}


static gboolean rygel_external_item_factory_set_music_metadata_co (RygelExternalItemFactorySetMusicMetadataData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = _data_->music;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _data_->props;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = rygel_external_item_factory_get_string (_data_->self, _data_->_tmp1_, "Artist");
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = _data_->_tmp2_;
	rygel_media_object_set_artist ((RygelMediaObject*) _data_->_tmp0_, _data_->_tmp3_);
	_g_free0 (_data_->_tmp3_);
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = _data_->music;
	_data_->_tmp5_ = NULL;
	_data_->_tmp5_ = _data_->props;
	_data_->_tmp6_ = NULL;
	_data_->_tmp6_ = rygel_external_item_factory_get_string (_data_->self, _data_->_tmp5_, "Album");
	_data_->_tmp7_ = NULL;
	_data_->_tmp7_ = _data_->_tmp6_;
	rygel_audio_item_set_album ((RygelAudioItem*) _data_->_tmp4_, _data_->_tmp7_);
	_g_free0 (_data_->_tmp7_);
	_data_->_tmp8_ = NULL;
	_data_->_tmp8_ = _data_->music;
	_data_->_tmp9_ = NULL;
	_data_->_tmp9_ = _data_->props;
	_data_->_tmp10_ = NULL;
	_data_->_tmp10_ = rygel_external_item_factory_get_string (_data_->self, _data_->_tmp9_, "Genre");
	_data_->_tmp11_ = NULL;
	_data_->_tmp11_ = _data_->_tmp10_;
	rygel_media_object_set_genre ((RygelMediaObject*) _data_->_tmp8_, _data_->_tmp11_);
	_g_free0 (_data_->_tmp11_);
	_data_->_tmp12_ = NULL;
	_data_->_tmp12_ = _data_->music;
	_data_->_tmp13_ = NULL;
	_data_->_tmp13_ = _data_->props;
	_data_->_tmp14_ = 0;
	_data_->_tmp14_ = rygel_external_item_factory_get_int (_data_->self, _data_->_tmp13_, "TrackNumber");
	rygel_music_item_set_track_number (_data_->_tmp12_, _data_->_tmp14_);
	_data_->_tmp15_ = NULL;
	_data_->_tmp15_ = _data_->props;
	_data_->_tmp16_ = NULL;
	_data_->_tmp16_ = g_hash_table_lookup (_data_->_tmp15_, "AlbumArt");
	_data_->_tmp17_ = NULL;
	_data_->_tmp17_ = _g_variant_ref0 ((GVariant*) _data_->_tmp16_);
	_data_->value = _data_->_tmp17_;
	_data_->_tmp18_ = NULL;
	_data_->_tmp18_ = _data_->value;
	if (_data_->_tmp18_ != NULL) {
		_data_->_tmp19_ = NULL;
		_data_->_tmp19_ = rygel_external_album_art_factory_new ();
		_data_->cover_factory = _data_->_tmp19_;
		_data_->_tmp21_ = NULL;
		_data_->_tmp21_ = _data_->cover_factory;
		_data_->_tmp22_ = NULL;
		_data_->_tmp22_ = _data_->service_name;
		_data_->_tmp23_ = NULL;
		_data_->_tmp23_ = _data_->value;
		_data_->_tmp24_ = NULL;
		_data_->_tmp24_ = _variant_get13 (_data_->_tmp23_);
		_data_->_tmp25_ = NULL;
		_data_->_tmp25_ = _data_->_tmp24_;
		_data_->_state_ = 1;
		rygel_external_album_art_factory_create (_data_->_tmp21_, _data_->_tmp22_, _data_->_tmp25_, rygel_external_item_factory_set_music_metadata_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp26_ = NULL;
		_data_->_tmp26_ = rygel_external_album_art_factory_create_finish (_data_->_tmp21_, _data_->_res_, &_data_->_inner_error_);
		_data_->_tmp27_ = NULL;
		_data_->_tmp27_ = _data_->_tmp26_;
		_g_free0 (_data_->_tmp25_);
		_data_->_tmp20_ = _data_->_tmp27_;
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			if ((_data_->_inner_error_->domain == G_IO_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) {
				g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
				g_error_free (_data_->_inner_error_);
				_rygel_external_album_art_factory_unref0 (_data_->cover_factory);
				_g_variant_unref0 (_data_->value);
				if (_data_->_state_ == 0) {
					g_simple_async_result_complete_in_idle (_data_->_async_result);
				} else {
					g_simple_async_result_complete (_data_->_async_result);
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_rygel_external_album_art_factory_unref0 (_data_->cover_factory);
				_g_variant_unref0 (_data_->value);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
				g_clear_error (&_data_->_inner_error_);
				return FALSE;
			}
		}
		_data_->_tmp28_ = NULL;
		_data_->_tmp28_ = _data_->music;
		rygel_music_item_set_album_art (_data_->_tmp28_, _data_->_tmp20_);
		_rygel_icon_info_unref0 (_data_->_tmp20_);
		_rygel_external_album_art_factory_unref0 (_data_->cover_factory);
	}
	_data_->_tmp29_ = NULL;
	_data_->_tmp29_ = _data_->music;
	_data_->_tmp30_ = NULL;
	_data_->_tmp30_ = _data_->props;
	_data_->_tmp31_ = NULL;
	_data_->_tmp31_ = _data_->service_name;
	rygel_external_item_factory_set_audio_metadata (_data_->self, (RygelAudioItem*) _data_->_tmp29_, _data_->_tmp30_, _data_->_tmp31_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if ((_data_->_inner_error_->domain == G_IO_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_variant_unref0 (_data_->value);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_variant_unref0 (_data_->value);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_g_variant_unref0 (_data_->value);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void rygel_external_item_factory_set_audio_metadata (RygelExternalItemFactory* self, RygelAudioItem* audio, GHashTable* props, const gchar* service_name, GError** error) {
	RygelAudioItem* _tmp0_ = NULL;
	GHashTable* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	RygelAudioItem* _tmp3_ = NULL;
	GHashTable* _tmp4_ = NULL;
	gint _tmp5_ = 0;
	RygelAudioItem* _tmp6_ = NULL;
	GHashTable* _tmp7_ = NULL;
	gint _tmp8_ = 0;
	RygelAudioItem* _tmp9_ = NULL;
	GHashTable* _tmp10_ = NULL;
	gint _tmp11_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (audio != NULL);
	g_return_if_fail (props != NULL);
	g_return_if_fail (service_name != NULL);
	_tmp0_ = audio;
	_tmp1_ = props;
	_tmp2_ = rygel_external_item_factory_get_int (self, _tmp1_, "Duration");
	rygel_audio_item_set_duration (_tmp0_, (glong) _tmp2_);
	_tmp3_ = audio;
	_tmp4_ = props;
	_tmp5_ = rygel_external_item_factory_get_int (self, _tmp4_, "Bitrate");
	rygel_audio_item_set_bitrate (_tmp3_, _tmp5_);
	_tmp6_ = audio;
	_tmp7_ = props;
	_tmp8_ = rygel_external_item_factory_get_int (self, _tmp7_, "SampleRate");
	rygel_audio_item_set_sample_freq (_tmp6_, _tmp8_);
	_tmp9_ = audio;
	_tmp10_ = props;
	_tmp11_ = rygel_external_item_factory_get_int (self, _tmp10_, "BitsPerSample");
	rygel_audio_item_set_bits_per_sample (_tmp9_, _tmp11_);
}


static void rygel_external_item_factory_set_visual_metadata_data_free (gpointer _data) {
	RygelExternalItemFactorySetVisualMetadataData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->visual);
	_g_hash_table_unref0 (_data_->props);
	_g_free0 (_data_->service_name);
	_rygel_external_item_factory_unref0 (_data_->self);
	g_slice_free (RygelExternalItemFactorySetVisualMetadataData, _data_);
}


static void rygel_external_item_factory_set_visual_metadata (RygelExternalItemFactory* self, RygelVisualItem* visual, GHashTable* props, const gchar* service_name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RygelExternalItemFactorySetVisualMetadataData* _data_;
	RygelExternalItemFactory* _tmp0_ = NULL;
	RygelVisualItem* _tmp1_ = NULL;
	RygelVisualItem* _tmp2_ = NULL;
	GHashTable* _tmp3_ = NULL;
	GHashTable* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	_data_ = g_slice_new0 (RygelExternalItemFactorySetVisualMetadataData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, rygel_external_item_factory_set_visual_metadata);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_external_item_factory_set_visual_metadata_data_free);
	_tmp0_ = _rygel_external_item_factory_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = visual;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->visual);
	_data_->visual = _tmp2_;
	_tmp3_ = props;
	_tmp4_ = _g_hash_table_ref0 (_tmp3_);
	_g_hash_table_unref0 (_data_->props);
	_data_->props = _tmp4_;
	_tmp5_ = service_name;
	_tmp6_ = g_strdup (_tmp5_);
	_g_free0 (_data_->service_name);
	_data_->service_name = _tmp6_;
	rygel_external_item_factory_set_visual_metadata_co (_data_);
}


static void rygel_external_item_factory_set_visual_metadata_finish (RygelExternalItemFactory* self, GAsyncResult* _res_, GError** error) {
	RygelExternalItemFactorySetVisualMetadataData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gchar* _variant_get14 (GVariant* value) {
	return g_variant_dup_string (value, NULL);
}


static void rygel_external_item_factory_set_visual_metadata_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	RygelExternalItemFactorySetVisualMetadataData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	rygel_external_item_factory_set_visual_metadata_co (_data_);
}


static gboolean rygel_external_item_factory_set_visual_metadata_co (RygelExternalItemFactorySetVisualMetadataData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = _data_->visual;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _data_->props;
	_data_->_tmp2_ = 0;
	_data_->_tmp2_ = rygel_external_item_factory_get_int (_data_->self, _data_->_tmp1_, "Width");
	rygel_visual_item_set_width (_data_->_tmp0_, _data_->_tmp2_);
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = _data_->visual;
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = _data_->props;
	_data_->_tmp5_ = 0;
	_data_->_tmp5_ = rygel_external_item_factory_get_int (_data_->self, _data_->_tmp4_, "Height");
	rygel_visual_item_set_height (_data_->_tmp3_, _data_->_tmp5_);
	_data_->_tmp6_ = NULL;
	_data_->_tmp6_ = _data_->visual;
	_data_->_tmp7_ = NULL;
	_data_->_tmp7_ = _data_->props;
	_data_->_tmp8_ = 0;
	_data_->_tmp8_ = rygel_external_item_factory_get_int (_data_->self, _data_->_tmp7_, "ColorDepth");
	rygel_visual_item_set_color_depth (_data_->_tmp6_, _data_->_tmp8_);
	_data_->_tmp9_ = NULL;
	_data_->_tmp9_ = _data_->props;
	_data_->_tmp10_ = NULL;
	_data_->_tmp10_ = g_hash_table_lookup (_data_->_tmp9_, "Thumbnail");
	_data_->_tmp11_ = NULL;
	_data_->_tmp11_ = _g_variant_ref0 ((GVariant*) _data_->_tmp10_);
	_data_->value = _data_->_tmp11_;
	_data_->_tmp12_ = NULL;
	_data_->_tmp12_ = _data_->value;
	if (_data_->_tmp12_ != NULL) {
		_data_->_tmp13_ = NULL;
		_data_->_tmp13_ = rygel_external_thumbnail_factory_new ();
		_data_->factory = _data_->_tmp13_;
		_data_->_tmp14_ = NULL;
		_data_->_tmp14_ = _data_->factory;
		_data_->_tmp15_ = NULL;
		_data_->_tmp15_ = _data_->value;
		_data_->_tmp16_ = NULL;
		_data_->_tmp16_ = _variant_get14 (_data_->_tmp15_);
		_data_->_tmp17_ = NULL;
		_data_->_tmp17_ = _data_->_tmp16_;
		_data_->_tmp18_ = NULL;
		_data_->_tmp18_ = _data_->service_name;
		_data_->_state_ = 1;
		rygel_external_thumbnail_factory_create (_data_->_tmp14_, _data_->_tmp17_, _data_->_tmp18_, rygel_external_item_factory_set_visual_metadata_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp19_ = NULL;
		_data_->_tmp19_ = rygel_external_thumbnail_factory_create_finish (_data_->_tmp14_, _data_->_res_, &_data_->_inner_error_);
		_data_->_tmp20_ = NULL;
		_data_->_tmp20_ = _data_->_tmp19_;
		_g_free0 (_data_->_tmp17_);
		_data_->thumbnail = _data_->_tmp20_;
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			if ((_data_->_inner_error_->domain == G_IO_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) {
				g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
				g_error_free (_data_->_inner_error_);
				_rygel_external_thumbnail_factory_unref0 (_data_->factory);
				_g_variant_unref0 (_data_->value);
				if (_data_->_state_ == 0) {
					g_simple_async_result_complete_in_idle (_data_->_async_result);
				} else {
					g_simple_async_result_complete (_data_->_async_result);
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_rygel_external_thumbnail_factory_unref0 (_data_->factory);
				_g_variant_unref0 (_data_->value);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
				g_clear_error (&_data_->_inner_error_);
				return FALSE;
			}
		}
		_data_->_tmp21_ = NULL;
		_data_->_tmp21_ = _data_->visual;
		_data_->_tmp22_ = NULL;
		_data_->_tmp22_ = rygel_visual_item_get_thumbnails (_data_->_tmp21_);
		_data_->_tmp23_ = NULL;
		_data_->_tmp23_ = _data_->_tmp22_;
		_data_->_tmp24_ = NULL;
		_data_->_tmp24_ = _data_->thumbnail;
		gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp23_, _data_->_tmp24_);
		_rygel_icon_info_unref0 (_data_->thumbnail);
		_rygel_external_thumbnail_factory_unref0 (_data_->factory);
	}
	_g_variant_unref0 (_data_->value);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void rygel_external_item_factory_set_video_metadata_data_free (gpointer _data) {
	RygelExternalItemFactorySetVideoMetadataData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->video);
	_g_hash_table_unref0 (_data_->props);
	_g_free0 (_data_->service_name);
	_rygel_external_item_factory_unref0 (_data_->self);
	g_slice_free (RygelExternalItemFactorySetVideoMetadataData, _data_);
}


static void rygel_external_item_factory_set_video_metadata (RygelExternalItemFactory* self, RygelVideoItem* video, GHashTable* props, const gchar* service_name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RygelExternalItemFactorySetVideoMetadataData* _data_;
	RygelExternalItemFactory* _tmp0_ = NULL;
	RygelVideoItem* _tmp1_ = NULL;
	RygelVideoItem* _tmp2_ = NULL;
	GHashTable* _tmp3_ = NULL;
	GHashTable* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	_data_ = g_slice_new0 (RygelExternalItemFactorySetVideoMetadataData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, rygel_external_item_factory_set_video_metadata);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_external_item_factory_set_video_metadata_data_free);
	_tmp0_ = _rygel_external_item_factory_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = video;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->video);
	_data_->video = _tmp2_;
	_tmp3_ = props;
	_tmp4_ = _g_hash_table_ref0 (_tmp3_);
	_g_hash_table_unref0 (_data_->props);
	_data_->props = _tmp4_;
	_tmp5_ = service_name;
	_tmp6_ = g_strdup (_tmp5_);
	_g_free0 (_data_->service_name);
	_data_->service_name = _tmp6_;
	rygel_external_item_factory_set_video_metadata_co (_data_);
}


static void rygel_external_item_factory_set_video_metadata_finish (RygelExternalItemFactory* self, GAsyncResult* _res_, GError** error) {
	RygelExternalItemFactorySetVideoMetadataData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void rygel_external_item_factory_set_video_metadata_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	RygelExternalItemFactorySetVideoMetadataData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	rygel_external_item_factory_set_video_metadata_co (_data_);
}


static gboolean rygel_external_item_factory_set_video_metadata_co (RygelExternalItemFactorySetVideoMetadataData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = _data_->video;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _data_->props;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = _data_->service_name;
	_data_->_state_ = 1;
	rygel_external_item_factory_set_visual_metadata (_data_->self, (RygelVisualItem*) _data_->_tmp0_, _data_->_tmp1_, _data_->_tmp2_, rygel_external_item_factory_set_video_metadata_ready, _data_);
	return FALSE;
	_state_1:
	rygel_external_item_factory_set_visual_metadata_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if ((_data_->_inner_error_->domain == G_IO_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = _data_->video;
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = _data_->props;
	_data_->_tmp5_ = NULL;
	_data_->_tmp5_ = _data_->service_name;
	rygel_external_item_factory_set_audio_metadata (_data_->self, (RygelAudioItem*) _data_->_tmp3_, _data_->_tmp4_, _data_->_tmp5_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if ((_data_->_inner_error_->domain == G_IO_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static gint64 _variant_get15 (GVariant* value) {
	return g_variant_get_int64 (value);
}


static void rygel_external_item_factory_set_generic_metadata (RygelExternalItemFactory* self, RygelMediaFileItem* item, GHashTable* props, const gchar* service_name) {
	RygelMediaFileItem* _tmp0_ = NULL;
	GHashTable* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar** uris = NULL;
	GHashTable* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	gint _tmp7_ = 0;
	gchar** _tmp8_ = NULL;
	gint uris_length1 = 0;
	gint _uris_size_ = 0;
	gchar** _tmp9_ = NULL;
	gint _tmp9__length1 = 0;
	RygelMediaFileItem* _tmp19_ = NULL;
	GHashTable* _tmp20_ = NULL;
	gchar* _tmp21_ = NULL;
	gchar* _tmp22_ = NULL;
	GVariant* value = NULL;
	GHashTable* _tmp23_ = NULL;
	gconstpointer _tmp24_ = NULL;
	GVariant* _tmp25_ = NULL;
	GVariant* _tmp26_ = NULL;
	RygelMediaFileItem* _tmp30_ = NULL;
	GHashTable* _tmp31_ = NULL;
	gchar* _tmp32_ = NULL;
	gchar* _tmp33_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	g_return_if_fail (props != NULL);
	g_return_if_fail (service_name != NULL);
	_tmp0_ = item;
	_tmp1_ = props;
	_tmp2_ = service_name;
	_tmp3_ = rygel_external_get_mandatory_string_value (_tmp1_, "MIMEType", "image/jpeg", _tmp2_);
	_tmp4_ = _tmp3_;
	rygel_media_file_item_set_mime_type (_tmp0_, _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = props;
	_tmp6_ = service_name;
	_tmp8_ = rygel_external_get_mandatory_string_list_value (_tmp5_, "URLs", NULL, 0, _tmp6_, &_tmp7_);
	uris = _tmp8_;
	uris_length1 = _tmp7_;
	_uris_size_ = uris_length1;
	_tmp9_ = uris;
	_tmp9__length1 = uris_length1;
	if (_tmp9_ != NULL) {
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp10_ = FALSE;
				_tmp10_ = TRUE;
				while (TRUE) {
					gchar** _tmp12_ = NULL;
					gint _tmp12__length1 = 0;
					gint _tmp13_ = 0;
					const gchar* _tmp14_ = NULL;
					RygelMediaFileItem* _tmp15_ = NULL;
					gchar** _tmp16_ = NULL;
					gint _tmp16__length1 = 0;
					gint _tmp17_ = 0;
					const gchar* _tmp18_ = NULL;
					if (!_tmp10_) {
						gint _tmp11_ = 0;
						_tmp11_ = i;
						i = _tmp11_ + 1;
					}
					_tmp10_ = FALSE;
					_tmp12_ = uris;
					_tmp12__length1 = uris_length1;
					_tmp13_ = i;
					_tmp14_ = _tmp12_[_tmp13_];
					if (!(_tmp14_ != NULL)) {
						break;
					}
					_tmp15_ = item;
					_tmp16_ = uris;
					_tmp16__length1 = uris_length1;
					_tmp17_ = i;
					_tmp18_ = _tmp16_[_tmp17_];
					rygel_media_object_add_uri ((RygelMediaObject*) _tmp15_, _tmp18_);
				}
			}
		}
	}
	_tmp19_ = item;
	_tmp20_ = props;
	_tmp21_ = rygel_external_item_factory_get_string (self, _tmp20_, "DLNAProfile");
	_tmp22_ = _tmp21_;
	rygel_media_file_item_set_dlna_profile (_tmp19_, _tmp22_);
	_g_free0 (_tmp22_);
	_tmp23_ = props;
	_tmp24_ = g_hash_table_lookup (_tmp23_, "Size");
	_tmp25_ = _g_variant_ref0 ((GVariant*) _tmp24_);
	value = _tmp25_;
	_tmp26_ = value;
	if (_tmp26_ != NULL) {
		RygelMediaFileItem* _tmp27_ = NULL;
		GVariant* _tmp28_ = NULL;
		gint64 _tmp29_ = 0LL;
		_tmp27_ = item;
		_tmp28_ = value;
		_tmp29_ = _variant_get15 (_tmp28_);
		rygel_media_file_item_set_size (_tmp27_, _tmp29_);
	}
	_tmp30_ = item;
	_tmp31_ = props;
	_tmp32_ = rygel_external_item_factory_get_string (self, _tmp31_, "Date");
	_tmp33_ = _tmp32_;
	rygel_media_object_set_date ((RygelMediaObject*) _tmp30_, _tmp33_);
	_g_free0 (_tmp33_);
	_g_variant_unref0 (value);
	uris = (_vala_array_free (uris, uris_length1, (GDestroyNotify) g_free), NULL);
}


static gchar* _variant_get16 (GVariant* value) {
	return g_variant_dup_string (value, NULL);
}


static gchar* rygel_external_item_factory_get_string (RygelExternalItemFactory* self, GHashTable* props, const gchar* prop) {
	gchar* result = NULL;
	GVariant* value = NULL;
	GHashTable* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gconstpointer _tmp2_ = NULL;
	GVariant* _tmp3_ = NULL;
	GVariant* _tmp4_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (props != NULL, NULL);
	g_return_val_if_fail (prop != NULL, NULL);
	_tmp0_ = props;
	_tmp1_ = prop;
	_tmp2_ = g_hash_table_lookup (_tmp0_, _tmp1_);
	_tmp3_ = _g_variant_ref0 ((GVariant*) _tmp2_);
	value = _tmp3_;
	_tmp4_ = value;
	if (_tmp4_ != NULL) {
		GVariant* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		_tmp5_ = value;
		_tmp6_ = _variant_get16 (_tmp5_);
		result = _tmp6_;
		_g_variant_unref0 (value);
		return result;
	} else {
		result = NULL;
		_g_variant_unref0 (value);
		return result;
	}
	_g_variant_unref0 (value);
}


static gint _variant_get17 (GVariant* value) {
	return g_variant_get_int32 (value);
}


static gint rygel_external_item_factory_get_int (RygelExternalItemFactory* self, GHashTable* props, const gchar* prop) {
	gint result = 0;
	GVariant* value = NULL;
	GHashTable* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gconstpointer _tmp2_ = NULL;
	GVariant* _tmp3_ = NULL;
	GVariant* _tmp4_ = NULL;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (props != NULL, 0);
	g_return_val_if_fail (prop != NULL, 0);
	_tmp0_ = props;
	_tmp1_ = prop;
	_tmp2_ = g_hash_table_lookup (_tmp0_, _tmp1_);
	_tmp3_ = _g_variant_ref0 ((GVariant*) _tmp2_);
	value = _tmp3_;
	_tmp4_ = value;
	if (_tmp4_ != NULL) {
		GVariant* _tmp5_ = NULL;
		gint _tmp6_ = 0;
		_tmp5_ = value;
		_tmp6_ = _variant_get17 (_tmp5_);
		result = _tmp6_;
		_g_variant_unref0 (value);
		return result;
	} else {
		result = -1;
		_g_variant_unref0 (value);
		return result;
	}
	_g_variant_unref0 (value);
}


RygelExternalItemFactory* rygel_external_item_factory_construct (GType object_type) {
	RygelExternalItemFactory* self = NULL;
	self = (RygelExternalItemFactory*) g_type_create_instance (object_type);
	return self;
}


RygelExternalItemFactory* rygel_external_item_factory_new (void) {
	return rygel_external_item_factory_construct (RYGEL_EXTERNAL_TYPE_ITEM_FACTORY);
}


static void rygel_external_value_item_factory_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void rygel_external_value_item_factory_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		rygel_external_item_factory_unref (value->data[0].v_pointer);
	}
}


static void rygel_external_value_item_factory_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = rygel_external_item_factory_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer rygel_external_value_item_factory_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* rygel_external_value_item_factory_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		RygelExternalItemFactory* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = rygel_external_item_factory_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* rygel_external_value_item_factory_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	RygelExternalItemFactory** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = rygel_external_item_factory_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* rygel_external_param_spec_item_factory (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	RygelExternalParamSpecItemFactory* spec;
	g_return_val_if_fail (g_type_is_a (object_type, RYGEL_EXTERNAL_TYPE_ITEM_FACTORY), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer rygel_external_value_get_item_factory (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_EXTERNAL_TYPE_ITEM_FACTORY), NULL);
	return value->data[0].v_pointer;
}


void rygel_external_value_set_item_factory (GValue* value, gpointer v_object) {
	RygelExternalItemFactory* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_EXTERNAL_TYPE_ITEM_FACTORY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, RYGEL_EXTERNAL_TYPE_ITEM_FACTORY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		rygel_external_item_factory_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		rygel_external_item_factory_unref (old);
	}
}


void rygel_external_value_take_item_factory (GValue* value, gpointer v_object) {
	RygelExternalItemFactory* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_EXTERNAL_TYPE_ITEM_FACTORY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, RYGEL_EXTERNAL_TYPE_ITEM_FACTORY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		rygel_external_item_factory_unref (old);
	}
}


static void rygel_external_item_factory_class_init (RygelExternalItemFactoryClass * klass) {
	rygel_external_item_factory_parent_class = g_type_class_peek_parent (klass);
	((RygelExternalItemFactoryClass *) klass)->finalize = rygel_external_item_factory_finalize;
}


static void rygel_external_item_factory_instance_init (RygelExternalItemFactory * self) {
	self->ref_count = 1;
}


static void rygel_external_item_factory_finalize (RygelExternalItemFactory* obj) {
	RygelExternalItemFactory * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_EXTERNAL_TYPE_ITEM_FACTORY, RygelExternalItemFactory);
	g_signal_handlers_destroy (self);
}


/**
 * Creates item for external plugins.
 */
GType rygel_external_item_factory_get_type (void) {
	static volatile gsize rygel_external_item_factory_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_external_item_factory_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { rygel_external_value_item_factory_init, rygel_external_value_item_factory_free_value, rygel_external_value_item_factory_copy_value, rygel_external_value_item_factory_peek_pointer, "p", rygel_external_value_item_factory_collect_value, "p", rygel_external_value_item_factory_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (RygelExternalItemFactoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_external_item_factory_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelExternalItemFactory), 0, (GInstanceInitFunc) rygel_external_item_factory_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType rygel_external_item_factory_type_id;
		rygel_external_item_factory_type_id = g_type_register_fundamental (g_type_fundamental_next (), "RygelExternalItemFactory", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&rygel_external_item_factory_type_id__volatile, rygel_external_item_factory_type_id);
	}
	return rygel_external_item_factory_type_id__volatile;
}


gpointer rygel_external_item_factory_ref (gpointer instance) {
	RygelExternalItemFactory* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void rygel_external_item_factory_unref (gpointer instance) {
	RygelExternalItemFactory* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		RYGEL_EXTERNAL_ITEM_FACTORY_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



