/* DataImportJob.c generated by valac 0.56.19, the Vala compiler
 * generated from DataImportJob.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU LGPL (version 2.1 or later).
 * See the COPYING file in this distribution.
 */

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include "shotwell-plugin-dev-1.0.h"
#include <gee.h>

#define TAG_PATH_SEPARATOR_STRING "/"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TYPE_BATCH_IMPORT_JOB (batch_import_job_get_type ())
#define BATCH_IMPORT_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BATCH_IMPORT_JOB, BatchImportJob))
#define BATCH_IMPORT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BATCH_IMPORT_JOB, BatchImportJobClass))
#define IS_BATCH_IMPORT_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BATCH_IMPORT_JOB))
#define IS_BATCH_IMPORT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BATCH_IMPORT_JOB))
#define BATCH_IMPORT_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BATCH_IMPORT_JOB, BatchImportJobClass))

typedef struct _BatchImportJob BatchImportJob;
typedef struct _BatchImportJobClass BatchImportJobClass;
typedef struct _BatchImportJobPrivate BatchImportJobPrivate;

#define TYPE_DUPLICATED_FILE (duplicated_file_get_type ())
#define DUPLICATED_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DUPLICATED_FILE, DuplicatedFile))
#define DUPLICATED_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DUPLICATED_FILE, DuplicatedFileClass))
#define IS_DUPLICATED_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DUPLICATED_FILE))
#define IS_DUPLICATED_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DUPLICATED_FILE))
#define DUPLICATED_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DUPLICATED_FILE, DuplicatedFileClass))

typedef struct _DuplicatedFile DuplicatedFile;
typedef struct _DuplicatedFileClass DuplicatedFileClass;

#define TYPE_DATA_OBJECT (data_object_get_type ())
#define DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_OBJECT, DataObject))
#define DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_OBJECT, DataObjectClass))
#define IS_DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_OBJECT))
#define IS_DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_OBJECT))
#define DATA_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_OBJECT, DataObjectClass))

typedef struct _DataObject DataObject;
typedef struct _DataObjectClass DataObjectClass;

#define TYPE_DATA_SOURCE (data_source_get_type ())
#define DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_SOURCE, DataSource))
#define DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_SOURCE, DataSourceClass))
#define IS_DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_SOURCE))
#define IS_DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_SOURCE))
#define DATA_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_SOURCE, DataSourceClass))

typedef struct _DataSource DataSource;
typedef struct _DataSourceClass DataSourceClass;

#define TYPE_THUMBNAIL_SOURCE (thumbnail_source_get_type ())
#define THUMBNAIL_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THUMBNAIL_SOURCE, ThumbnailSource))
#define THUMBNAIL_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THUMBNAIL_SOURCE, ThumbnailSourceClass))
#define IS_THUMBNAIL_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THUMBNAIL_SOURCE))
#define IS_THUMBNAIL_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THUMBNAIL_SOURCE))
#define THUMBNAIL_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THUMBNAIL_SOURCE, ThumbnailSourceClass))

typedef struct _ThumbnailSource ThumbnailSource;
typedef struct _ThumbnailSourceClass ThumbnailSourceClass;

#define TYPE_MEDIA_SOURCE (media_source_get_type ())
#define MEDIA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_SOURCE, MediaSource))
#define MEDIA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_SOURCE, MediaSourceClass))
#define IS_MEDIA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_SOURCE))
#define IS_MEDIA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_SOURCE))
#define MEDIA_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_SOURCE, MediaSourceClass))

typedef struct _MediaSource MediaSource;
typedef struct _MediaSourceClass MediaSourceClass;

#define TYPE_BATCH_IMPORT_ROLL (batch_import_roll_get_type ())
#define BATCH_IMPORT_ROLL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BATCH_IMPORT_ROLL, BatchImportRoll))
#define BATCH_IMPORT_ROLL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BATCH_IMPORT_ROLL, BatchImportRollClass))
#define IS_BATCH_IMPORT_ROLL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BATCH_IMPORT_ROLL))
#define IS_BATCH_IMPORT_ROLL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BATCH_IMPORT_ROLL))
#define BATCH_IMPORT_ROLL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BATCH_IMPORT_ROLL, BatchImportRollClass))

typedef struct _BatchImportRoll BatchImportRoll;
typedef struct _BatchImportRollClass BatchImportRollClass;

#define SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB (spit_data_imports_data_import_job_get_type ())
#define SPIT_DATA_IMPORTS_DATA_IMPORT_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB, SpitDataImportsDataImportJob))
#define SPIT_DATA_IMPORTS_DATA_IMPORT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB, SpitDataImportsDataImportJobClass))
#define SPIT_DATA_IMPORTS_IS_DATA_IMPORT_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB))
#define SPIT_DATA_IMPORTS_IS_DATA_IMPORT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB))
#define SPIT_DATA_IMPORTS_DATA_IMPORT_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB, SpitDataImportsDataImportJobClass))

typedef struct _SpitDataImportsDataImportJob SpitDataImportsDataImportJob;
typedef struct _SpitDataImportsDataImportJobClass SpitDataImportsDataImportJobClass;
typedef struct _SpitDataImportsDataImportJobPrivate SpitDataImportsDataImportJobPrivate;

#define SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_SOURCE (spit_data_imports_data_import_source_get_type ())
#define SPIT_DATA_IMPORTS_DATA_IMPORT_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_SOURCE, SpitDataImportsDataImportSource))
#define SPIT_DATA_IMPORTS_DATA_IMPORT_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_SOURCE, SpitDataImportsDataImportSourceClass))
#define SPIT_DATA_IMPORTS_IS_DATA_IMPORT_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_SOURCE))
#define SPIT_DATA_IMPORTS_IS_DATA_IMPORT_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_SOURCE))
#define SPIT_DATA_IMPORTS_DATA_IMPORT_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_SOURCE, SpitDataImportsDataImportSourceClass))

typedef struct _SpitDataImportsDataImportSource SpitDataImportsDataImportSource;
typedef struct _SpitDataImportsDataImportSourceClass SpitDataImportsDataImportSourceClass;

#define TYPE_HIERARCHICAL_TAG_INDEX (hierarchical_tag_index_get_type ())
#define HIERARCHICAL_TAG_INDEX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_HIERARCHICAL_TAG_INDEX, HierarchicalTagIndex))
#define HIERARCHICAL_TAG_INDEX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_HIERARCHICAL_TAG_INDEX, HierarchicalTagIndexClass))
#define IS_HIERARCHICAL_TAG_INDEX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_HIERARCHICAL_TAG_INDEX))
#define IS_HIERARCHICAL_TAG_INDEX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_HIERARCHICAL_TAG_INDEX))
#define HIERARCHICAL_TAG_INDEX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_HIERARCHICAL_TAG_INDEX, HierarchicalTagIndexClass))

typedef struct _HierarchicalTagIndex HierarchicalTagIndex;
typedef struct _HierarchicalTagIndexClass HierarchicalTagIndexClass;
#define _spit_data_imports_data_import_source_unref0(var) ((var == NULL) ? NULL : (var = (spit_data_imports_data_import_source_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _batch_import_job_unref0(var) ((var == NULL) ? NULL : (var = (batch_import_job_unref (var), NULL)))
#define _hierarchical_tag_index_unref0(var) ((var == NULL) ? NULL : (var = (hierarchical_tag_index_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_PHOTO_SOURCE (photo_source_get_type ())
#define PHOTO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_SOURCE, PhotoSource))
#define PHOTO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_SOURCE, PhotoSourceClass))
#define IS_PHOTO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_SOURCE))
#define IS_PHOTO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_SOURCE))
#define PHOTO_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_SOURCE, PhotoSourceClass))

typedef struct _PhotoSource PhotoSource;
typedef struct _PhotoSourceClass PhotoSourceClass;

#define TYPE_PHOTO (photo_get_type ())
#define PHOTO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO, Photo))
#define PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO, PhotoClass))
#define IS_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO))
#define IS_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO))
#define PHOTO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO, PhotoClass))

typedef struct _Photo Photo;
typedef struct _PhotoClass PhotoClass;

#define TYPE_LIBRARY_PHOTO (library_photo_get_type ())
#define LIBRARY_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_PHOTO, LibraryPhoto))
#define LIBRARY_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_PHOTO, LibraryPhotoClass))
#define IS_LIBRARY_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_PHOTO))
#define IS_LIBRARY_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_PHOTO))
#define LIBRARY_PHOTO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_PHOTO, LibraryPhotoClass))

typedef struct _LibraryPhoto LibraryPhoto;
typedef struct _LibraryPhotoClass LibraryPhotoClass;

#define TYPE_TAG (tag_get_type ())
#define TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG, Tag))
#define TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG, TagClass))
#define IS_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG))
#define IS_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG))
#define TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG, TagClass))

typedef struct _Tag Tag;
typedef struct _TagClass TagClass;

#define TYPE_DATA_COLLECTION (data_collection_get_type ())
#define DATA_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_COLLECTION, DataCollection))
#define DATA_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_COLLECTION, DataCollectionClass))
#define IS_DATA_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_COLLECTION))
#define IS_DATA_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_COLLECTION))
#define DATA_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_COLLECTION, DataCollectionClass))

typedef struct _DataCollection DataCollection;
typedef struct _DataCollectionClass DataCollectionClass;

#define TYPE_SOURCE_COLLECTION (source_collection_get_type ())
#define SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SOURCE_COLLECTION, SourceCollection))
#define SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SOURCE_COLLECTION, SourceCollectionClass))
#define IS_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SOURCE_COLLECTION))
#define IS_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SOURCE_COLLECTION))
#define SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SOURCE_COLLECTION, SourceCollectionClass))

typedef struct _SourceCollection SourceCollection;
typedef struct _SourceCollectionClass SourceCollectionClass;

#define TYPE_DATABASE_SOURCE_COLLECTION (database_source_collection_get_type ())
#define DATABASE_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollection))
#define DATABASE_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollectionClass))
#define IS_DATABASE_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATABASE_SOURCE_COLLECTION))
#define IS_DATABASE_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATABASE_SOURCE_COLLECTION))
#define DATABASE_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollectionClass))

typedef struct _DatabaseSourceCollection DatabaseSourceCollection;
typedef struct _DatabaseSourceCollectionClass DatabaseSourceCollectionClass;

#define TYPE_CONTAINER_SOURCE_COLLECTION (container_source_collection_get_type ())
#define CONTAINER_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollection))
#define CONTAINER_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollectionClass))
#define IS_CONTAINER_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONTAINER_SOURCE_COLLECTION))
#define IS_CONTAINER_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONTAINER_SOURCE_COLLECTION))
#define CONTAINER_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollectionClass))

typedef struct _ContainerSourceCollection ContainerSourceCollection;
typedef struct _ContainerSourceCollectionClass ContainerSourceCollectionClass;

#define TYPE_TAG_SOURCE_COLLECTION (tag_source_collection_get_type ())
#define TAG_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG_SOURCE_COLLECTION, TagSourceCollection))
#define TAG_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG_SOURCE_COLLECTION, TagSourceCollectionClass))
#define IS_TAG_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG_SOURCE_COLLECTION))
#define IS_TAG_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG_SOURCE_COLLECTION))
#define TAG_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG_SOURCE_COLLECTION, TagSourceCollectionClass))

typedef struct _TagSourceCollection TagSourceCollection;
typedef struct _TagSourceCollectionClass TagSourceCollectionClass;
typedef enum  {
	PREPARE_INPUT_TEXT_OPTIONS_EMPTY_IS_NULL = 1 << 0,
	PREPARE_INPUT_TEXT_OPTIONS_VALIDATE = 1 << 1,
	PREPARE_INPUT_TEXT_OPTIONS_INVALID_IS_NULL = 1 << 2,
	PREPARE_INPUT_TEXT_OPTIONS_STRIP = 1 << 3,
	PREPARE_INPUT_TEXT_OPTIONS_STRIP_CRLF = 1 << 4,
	PREPARE_INPUT_TEXT_OPTIONS_NORMALIZE = 1 << 5,
	PREPARE_INPUT_TEXT_OPTIONS_DEFAULT = ((((PREPARE_INPUT_TEXT_OPTIONS_EMPTY_IS_NULL | PREPARE_INPUT_TEXT_OPTIONS_VALIDATE) | PREPARE_INPUT_TEXT_OPTIONS_INVALID_IS_NULL) | PREPARE_INPUT_TEXT_OPTIONS_STRIP_CRLF) | PREPARE_INPUT_TEXT_OPTIONS_STRIP) | PREPARE_INPUT_TEXT_OPTIONS_NORMALIZE
} PrepareInputTextOptions;

#define TYPE_PREPARE_INPUT_TEXT_OPTIONS (prepare_input_text_options_get_type ())

#define TYPE_VIEW_COLLECTION (view_collection_get_type ())
#define VIEW_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIEW_COLLECTION, ViewCollection))
#define VIEW_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIEW_COLLECTION, ViewCollectionClass))
#define IS_VIEW_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIEW_COLLECTION))
#define IS_VIEW_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIEW_COLLECTION))
#define VIEW_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIEW_COLLECTION, ViewCollectionClass))

typedef struct _ViewCollection ViewCollection;
typedef struct _ViewCollectionClass ViewCollectionClass;
typedef struct _BatchImportRollPrivate BatchImportRollPrivate;

#define TYPE_IMPORT_ID (import_id_get_type ())
typedef struct _ImportID ImportID;
typedef enum  {
	RATING_REJECTED = -1,
	RATING_UNRATED = 0,
	RATING_ONE = 1,
	RATING_TWO = 2,
	RATING_THREE = 3,
	RATING_FOUR = 4,
	RATING_FIVE = 5
} Rating;

#define TYPE_RATING (rating_get_type ())

#define TYPE_DATEABLE (dateable_get_type ())
#define DATEABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATEABLE, Dateable))
#define IS_DATEABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATEABLE))
#define DATEABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_DATEABLE, DateableIface))

typedef struct _Dateable Dateable;
typedef struct _DateableIface DateableIface;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _BatchImportJob {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BatchImportJobPrivate * priv;
};

struct _BatchImportJobClass {
	GTypeClass parent_class;
	void (*finalize) (BatchImportJob *self);
	gchar* (*get_dest_identifier) (BatchImportJob* self);
	gchar* (*get_source_identifier) (BatchImportJob* self);
	gboolean (*is_directory) (BatchImportJob* self);
	gchar* (*get_basename) (BatchImportJob* self);
	gchar* (*get_path) (BatchImportJob* self);
	DuplicatedFile* (*get_duplicated_file) (BatchImportJob* self);
	GFile* (*get_associated_file) (BatchImportJob* self);
	void (*set_associated) (BatchImportJob* self, BatchImportJob* associated);
	gboolean (*determine_file_size) (BatchImportJob* self, guint64* filesize, GFile** file_or_dir);
	gboolean (*prepare) (BatchImportJob* self, GFile** file_to_import, gboolean* copy_to_library, GError** error);
	gboolean (*complete) (BatchImportJob* self, MediaSource* source, BatchImportRoll* import_roll, GError** error);
	GDateTime* (*get_exposure_time_override) (BatchImportJob* self);
	gboolean (*recurse) (BatchImportJob* self);
};

struct _SpitDataImportsDataImportJob {
	BatchImportJob parent_instance;
	SpitDataImportsDataImportJobPrivate * priv;
};

struct _SpitDataImportsDataImportJobClass {
	BatchImportJobClass parent_class;
};

struct _SpitDataImportsDataImportJobPrivate {
	SpitDataImportsDataImportSource* import_source;
	GFile* src_file;
	guint64 filesize;
	GDateTime* exposure_time;
	SpitDataImportsDataImportJob* associated;
	HierarchicalTagIndex* detected_htags;
};

struct _ImportID {
	gint64 id;
};

struct _BatchImportRoll {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BatchImportRollPrivate * priv;
	ImportID import_id;
	ViewCollection* generated_events;
};

struct _BatchImportRollClass {
	GTypeClass parent_class;
	void (*finalize) (BatchImportRoll *self);
};

struct _DateableIface {
	GTypeInterface parent_iface;
	void (*set_exposure_time) (Dateable* self, GDateTime* target_time);
	GDateTime* (*get_exposure_time) (Dateable* self);
};

static gint SpitDataImportsDataImportJob_private_offset;
static gpointer spit_data_imports_data_import_job_parent_class = NULL;
VALA_EXTERN TagSourceCollection* tag_global;

VALA_EXTERN gpointer batch_import_job_ref (gpointer instance);
VALA_EXTERN void batch_import_job_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_batch_import_job (const gchar* name,
                                         const gchar* nick,
                                         const gchar* blurb,
                                         GType object_type,
                                         GParamFlags flags);
VALA_EXTERN void value_set_batch_import_job (GValue* value,
                                 gpointer v_object);
VALA_EXTERN void value_take_batch_import_job (GValue* value,
                                  gpointer v_object);
VALA_EXTERN gpointer value_get_batch_import_job (const GValue* value);
VALA_EXTERN GType batch_import_job_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BatchImportJob, batch_import_job_unref)
VALA_EXTERN GType duplicated_file_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DuplicatedFile, g_object_unref)
VALA_EXTERN GType data_object_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataObject, g_object_unref)
VALA_EXTERN GType data_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataSource, g_object_unref)
VALA_EXTERN GType thumbnail_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThumbnailSource, g_object_unref)
VALA_EXTERN GType media_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MediaSource, g_object_unref)
VALA_EXTERN gpointer batch_import_roll_ref (gpointer instance);
VALA_EXTERN void batch_import_roll_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_batch_import_roll (const gchar* name,
                                          const gchar* nick,
                                          const gchar* blurb,
                                          GType object_type,
                                          GParamFlags flags);
VALA_EXTERN void value_set_batch_import_roll (GValue* value,
                                  gpointer v_object);
VALA_EXTERN void value_take_batch_import_roll (GValue* value,
                                   gpointer v_object);
VALA_EXTERN gpointer value_get_batch_import_roll (const GValue* value);
VALA_EXTERN GType batch_import_roll_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BatchImportRoll, batch_import_roll_unref)
VALA_EXTERN GType spit_data_imports_data_import_job_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpitDataImportsDataImportJob, batch_import_job_unref)
VALA_EXTERN gpointer spit_data_imports_data_import_source_ref (gpointer instance);
VALA_EXTERN void spit_data_imports_data_import_source_unref (gpointer instance);
VALA_EXTERN GParamSpec* spit_data_imports_param_spec_data_import_source (const gchar* name,
                                                             const gchar* nick,
                                                             const gchar* blurb,
                                                             GType object_type,
                                                             GParamFlags flags);
VALA_EXTERN void spit_data_imports_value_set_data_import_source (GValue* value,
                                                     gpointer v_object);
VALA_EXTERN void spit_data_imports_value_take_data_import_source (GValue* value,
                                                      gpointer v_object);
VALA_EXTERN gpointer spit_data_imports_value_get_data_import_source (const GValue* value);
VALA_EXTERN GType spit_data_imports_data_import_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpitDataImportsDataImportSource, spit_data_imports_data_import_source_unref)
VALA_EXTERN gpointer hierarchical_tag_index_ref (gpointer instance);
VALA_EXTERN void hierarchical_tag_index_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_hierarchical_tag_index (const gchar* name,
                                               const gchar* nick,
                                               const gchar* blurb,
                                               GType object_type,
                                               GParamFlags flags);
VALA_EXTERN void value_set_hierarchical_tag_index (GValue* value,
                                       gpointer v_object);
VALA_EXTERN void value_take_hierarchical_tag_index (GValue* value,
                                        gpointer v_object);
VALA_EXTERN gpointer value_get_hierarchical_tag_index (const GValue* value);
VALA_EXTERN GType hierarchical_tag_index_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (HierarchicalTagIndex, hierarchical_tag_index_unref)
VALA_EXTERN gchar* batch_import_job_get_dest_identifier (BatchImportJob* self);
VALA_EXTERN gchar* batch_import_job_get_source_identifier (BatchImportJob* self);
VALA_EXTERN gboolean batch_import_job_is_directory (BatchImportJob* self);
VALA_EXTERN gchar* batch_import_job_get_basename (BatchImportJob* self);
VALA_EXTERN gchar* batch_import_job_get_path (BatchImportJob* self);
VALA_EXTERN void batch_import_job_set_associated (BatchImportJob* self,
                                      BatchImportJob* associated);
VALA_EXTERN gboolean batch_import_job_determine_file_size (BatchImportJob* self,
                                               guint64* filesize,
                                               GFile** file_or_dir);
VALA_EXTERN gboolean batch_import_job_prepare (BatchImportJob* self,
                                   GFile** file_to_import,
                                   gboolean* copy_to_library,
                                   GError** error);
VALA_EXTERN gboolean batch_import_job_complete (BatchImportJob* self,
                                    MediaSource* source,
                                    BatchImportRoll* import_roll,
                                    GError** error);
VALA_EXTERN SpitDataImportsDataImportJob* spit_data_imports_data_import_job_new (SpitDataImportsDataImportSource* import_source);
VALA_EXTERN SpitDataImportsDataImportJob* spit_data_imports_data_import_job_construct (GType object_type,
                                                                           SpitDataImportsDataImportSource* import_source);
VALA_EXTERN BatchImportJob* batch_import_job_construct (GType object_type);
VALA_EXTERN GFile* spit_data_imports_data_import_source_get_file (SpitDataImportsDataImportSource* self);
VALA_EXTERN guint64 spit_data_imports_data_import_source_get_filesize (SpitDataImportsDataImportSource* self);
VALA_EXTERN GDateTime* spit_data_imports_data_import_source_get_exposure_time (SpitDataImportsDataImportSource* self);
static HierarchicalTagIndex* spit_data_imports_data_import_job_build_exclusion_index (SpitDataImportsDataImportJob* self,
                                                                               SpitDataImportsImportableTag** src_tags,
                                                                               gint src_tags_length1);
VALA_EXTERN gchar* hierarchical_tag_utilities_join_path_components (gchar** path_components,
                                                        gint path_components_length1);
VALA_EXTERN gchar** tag_prep_tag_names (gchar** names,
                            gint names_length1,
                            gint* result_length1);
static gchar** spit_data_imports_data_import_job_build_path_components (SpitDataImportsDataImportJob* self,
                                                                 SpitDataImportsImportableTag* tag,
                                                                 gint* result_length1);
VALA_EXTERN GeeList* hierarchical_tag_utilities_enumerate_parent_paths (const gchar* in_path);
VALA_EXTERN HierarchicalTagIndex* hierarchical_tag_index_from_paths (GeeCollection* client_paths);
VALA_EXTERN GDateTime* spit_data_imports_data_import_job_get_exposure_time (SpitDataImportsDataImportJob* self);
static gchar* spit_data_imports_data_import_job_real_get_dest_identifier (BatchImportJob* base);
VALA_EXTERN gchar* spit_data_imports_data_import_source_get_filename (SpitDataImportsDataImportSource* self);
static gchar* spit_data_imports_data_import_job_real_get_source_identifier (BatchImportJob* base);
static gboolean spit_data_imports_data_import_job_real_is_directory (BatchImportJob* base);
static gchar* spit_data_imports_data_import_job_real_get_basename (BatchImportJob* base);
static gchar* spit_data_imports_data_import_job_real_get_path (BatchImportJob* base);
static void spit_data_imports_data_import_job_real_set_associated (BatchImportJob* base,
                                                            BatchImportJob* associated);
static gboolean spit_data_imports_data_import_job_real_determine_file_size (BatchImportJob* base,
                                                                     guint64* filesize,
                                                                     GFile** file);
static gboolean spit_data_imports_data_import_job_real_prepare (BatchImportJob* base,
                                                         GFile** file_to_import,
                                                         gboolean* copy_to_library,
                                                         GError** error);
VALA_EXTERN SpitDataImportsImportableMediaItem* spit_data_imports_data_import_source_get_photo (SpitDataImportsDataImportSource* self);
static gboolean spit_data_imports_data_import_job_real_complete (BatchImportJob* base,
                                                          MediaSource* source,
                                                          BatchImportRoll* import_roll,
                                                          GError** error);
VALA_EXTERN GType photo_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PhotoSource, g_object_unref)
VALA_EXTERN GType photo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Photo, g_object_unref)
VALA_EXTERN GType library_photo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryPhoto, g_object_unref)
VALA_EXTERN GeeCollection* hierarchical_tag_index_get_all_paths (HierarchicalTagIndex* self);
VALA_EXTERN GType tag_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Tag, g_object_unref)
VALA_EXTERN Tag* tag_for_path (const gchar* name);
VALA_EXTERN GeeList* hierarchical_tag_utilities_enumerate_path_components (const gchar* in_path);
VALA_EXTERN gchar* hierarchical_tag_utilities_hierarchical_to_flat (const gchar* path);
VALA_EXTERN gpointer data_collection_ref (gpointer instance);
VALA_EXTERN void data_collection_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_data_collection (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_data_collection (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_data_collection (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_data_collection (const GValue* value);
VALA_EXTERN GType data_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataCollection, data_collection_unref)
VALA_EXTERN GType source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SourceCollection, data_collection_unref)
VALA_EXTERN GType database_source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DatabaseSourceCollection, data_collection_unref)
VALA_EXTERN GType container_source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ContainerSourceCollection, data_collection_unref)
VALA_EXTERN GType tag_source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TagSourceCollection, data_collection_unref)
VALA_EXTERN gboolean tag_source_collection_exists (TagSourceCollection* self,
                                       const gchar* name,
                                       gboolean treat_htags_as_root);
VALA_EXTERN void tag_promote (Tag* self);
VALA_EXTERN void tag_attach (Tag* self,
                 MediaSource* source);
VALA_EXTERN GType prepare_input_text_options_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gchar* prepare_input_text (const gchar* text,
                           PrepareInputTextOptions options,
                           gint dest_length);
VALA_EXTERN GType view_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewCollection, data_collection_unref)
VALA_EXTERN void event_generate_single_event (MediaSource* media,
                                  ViewCollection* events_so_far,
                                  const gchar* event_name);
VALA_EXTERN GType import_id_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ImportID* import_id_dup (const ImportID* self);
VALA_EXTERN void import_id_free (ImportID* self);
VALA_EXTERN GType rating_get_type (void) G_GNUC_CONST ;
VALA_EXTERN Rating rating_unserialize (gint value);
VALA_EXTERN void media_source_set_rating (MediaSource* self,
                              Rating rating);
VALA_EXTERN void media_source_set_title (MediaSource* self,
                             const gchar* title);
VALA_EXTERN GType dateable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Dateable, g_object_unref)
VALA_EXTERN void dateable_set_exposure_time (Dateable* self,
                                 GDateTime* target_time);
VALA_EXTERN void photo_set_import_id (Photo* self,
                          ImportID* import_id);
VALA_EXTERN gchar* hierarchical_tag_utilities_make_flat_tag_safe (const gchar* in_tag);
static void spit_data_imports_data_import_job_finalize (BatchImportJob * obj);
static GType spit_data_imports_data_import_job_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
spit_data_imports_data_import_job_get_instance_private (SpitDataImportsDataImportJob* self)
{
	return G_STRUCT_MEMBER_P (self, SpitDataImportsDataImportJob_private_offset);
}

static gpointer
_spit_data_imports_data_import_source_ref0 (gpointer self)
{
	return self ? spit_data_imports_data_import_source_ref (self) : NULL;
}

SpitDataImportsDataImportJob*
spit_data_imports_data_import_job_construct (GType object_type,
                                             SpitDataImportsDataImportSource* import_source)
{
	SpitDataImportsDataImportJob* self = NULL;
	SpitDataImportsDataImportSource* _tmp0_;
	GFile* _tmp1_;
	GDateTime* _tmp2_;
	g_return_val_if_fail (SPIT_DATA_IMPORTS_IS_DATA_IMPORT_SOURCE (import_source), NULL);
	self = (SpitDataImportsDataImportJob*) batch_import_job_construct (object_type);
	_tmp0_ = _spit_data_imports_data_import_source_ref0 (import_source);
	_spit_data_imports_data_import_source_unref0 (self->priv->import_source);
	self->priv->import_source = _tmp0_;
	_tmp1_ = spit_data_imports_data_import_source_get_file (import_source);
	_g_object_unref0 (self->priv->src_file);
	self->priv->src_file = _tmp1_;
	self->priv->filesize = spit_data_imports_data_import_source_get_filesize (import_source);
	_tmp2_ = spit_data_imports_data_import_source_get_exposure_time (import_source);
	_g_date_time_unref0 (self->priv->exposure_time);
	self->priv->exposure_time = _tmp2_;
	return self;
}

SpitDataImportsDataImportJob*
spit_data_imports_data_import_job_new (SpitDataImportsDataImportSource* import_source)
{
	return spit_data_imports_data_import_job_construct (SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB, import_source);
}

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

static HierarchicalTagIndex*
spit_data_imports_data_import_job_build_exclusion_index (SpitDataImportsDataImportJob* self,
                                                         SpitDataImportsImportableTag** src_tags,
                                                         gint src_tags_length1)
{
	GeeSet* detected_htags = NULL;
	GeeHashSet* _tmp0_;
	HierarchicalTagIndex* _tmp28_ = NULL;
	GeeSet* _tmp29_;
	gint _tmp30_;
	gint _tmp31_;
	HierarchicalTagIndex* _tmp34_;
	HierarchicalTagIndex* result;
	g_return_val_if_fail (SPIT_DATA_IMPORTS_IS_DATA_IMPORT_JOB (self), NULL);
	_tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	detected_htags = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SET, GeeSet);
	{
		SpitDataImportsImportableTag** src_tag_collection = NULL;
		gint src_tag_collection_length1 = 0;
		gint _src_tag_collection_size_ = 0;
		gint src_tag_it = 0;
		src_tag_collection = src_tags;
		src_tag_collection_length1 = src_tags_length1;
		for (src_tag_it = 0; src_tag_it < src_tag_collection_length1; src_tag_it = src_tag_it + 1) {
			SpitDataImportsImportableTag* _tmp1_;
			SpitDataImportsImportableTag* src_tag = NULL;
			_tmp1_ = _g_object_ref0 (src_tag_collection[src_tag_it]);
			src_tag = _tmp1_;
			{
				gchar* prepped = NULL;
				SpitDataImportsImportableTag* _tmp2_;
				gint _tmp3_ = 0;
				gchar** _tmp4_;
				gchar** _tmp5_;
				gint _tmp5__length1;
				gint _tmp6_ = 0;
				gchar** _tmp7_;
				gchar** _tmp8_;
				gint _tmp8__length1;
				gchar* _tmp9_;
				gchar* _tmp10_;
				gboolean _tmp11_ = FALSE;
				const gchar* _tmp12_;
				_tmp2_ = src_tag;
				_tmp4_ = spit_data_imports_data_import_job_build_path_components (self, _tmp2_, &_tmp3_);
				_tmp5_ = _tmp4_;
				_tmp5__length1 = _tmp3_;
				_tmp7_ = tag_prep_tag_names (_tmp5_, (gint) _tmp3_, &_tmp6_);
				_tmp8_ = _tmp7_;
				_tmp8__length1 = _tmp6_;
				_tmp9_ = hierarchical_tag_utilities_join_path_components (_tmp8_, (gint) _tmp6_);
				_tmp10_ = _tmp9_;
				_tmp8_ = (_vala_array_free (_tmp8_, _tmp8__length1, (GDestroyNotify) g_free), NULL);
				_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_free), NULL);
				prepped = _tmp10_;
				_tmp12_ = prepped;
				if (_tmp12_ != NULL) {
					const gchar* _tmp13_;
					_tmp13_ = prepped;
					_tmp11_ = g_str_has_prefix (_tmp13_, TAG_PATH_SEPARATOR_STRING);
				} else {
					_tmp11_ = FALSE;
				}
				if (_tmp11_) {
					GeeSet* _tmp14_;
					const gchar* _tmp15_;
					GeeList* parents = NULL;
					const gchar* _tmp16_;
					GeeList* _tmp17_;
					_tmp14_ = detected_htags;
					_tmp15_ = prepped;
					gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, GEE_TYPE_COLLECTION, GeeCollection), _tmp15_);
					_tmp16_ = prepped;
					_tmp17_ = hierarchical_tag_utilities_enumerate_parent_paths (_tmp16_);
					parents = _tmp17_;
					{
						GeeList* _parent_list = NULL;
						GeeList* _tmp18_;
						gint _parent_size = 0;
						GeeList* _tmp19_;
						gint _tmp20_;
						gint _tmp21_;
						gint _parent_index = 0;
						_tmp18_ = parents;
						_parent_list = _tmp18_;
						_tmp19_ = _parent_list;
						_tmp20_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GEE_TYPE_COLLECTION, GeeCollection));
						_tmp21_ = _tmp20_;
						_parent_size = _tmp21_;
						_parent_index = -1;
						while (TRUE) {
							gint _tmp22_;
							gint _tmp23_;
							gchar* parent = NULL;
							GeeList* _tmp24_;
							gpointer _tmp25_;
							GeeSet* _tmp26_;
							const gchar* _tmp27_;
							_parent_index = _parent_index + 1;
							_tmp22_ = _parent_index;
							_tmp23_ = _parent_size;
							if (!(_tmp22_ < _tmp23_)) {
								break;
							}
							_tmp24_ = _parent_list;
							_tmp25_ = gee_list_get (_tmp24_, _parent_index);
							parent = (gchar*) _tmp25_;
							_tmp26_ = detected_htags;
							_tmp27_ = parent;
							gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, GEE_TYPE_COLLECTION, GeeCollection), _tmp27_);
							_g_free0 (parent);
						}
					}
					_g_object_unref0 (parents);
				}
				_g_free0 (prepped);
				_g_object_unref0 (src_tag);
			}
		}
	}
	_tmp29_ = detected_htags;
	_tmp30_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp31_ = _tmp30_;
	if (_tmp31_ > 0) {
		GeeSet* _tmp32_;
		HierarchicalTagIndex* _tmp33_;
		_tmp32_ = detected_htags;
		_tmp33_ = hierarchical_tag_index_from_paths (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, GEE_TYPE_COLLECTION, GeeCollection));
		_hierarchical_tag_index_unref0 (_tmp28_);
		_tmp28_ = _tmp33_;
	} else {
		_hierarchical_tag_index_unref0 (_tmp28_);
		_tmp28_ = NULL;
	}
	_tmp34_ = _tmp28_;
	_tmp28_ = NULL;
	result = _tmp34_;
	_hierarchical_tag_index_unref0 (_tmp28_);
	_g_object_unref0 (detected_htags);
	return result;
}

static gpointer
_g_date_time_ref0 (gpointer self)
{
	return self ? g_date_time_ref (self) : NULL;
}

GDateTime*
spit_data_imports_data_import_job_get_exposure_time (SpitDataImportsDataImportJob* self)
{
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* result;
	g_return_val_if_fail (SPIT_DATA_IMPORTS_IS_DATA_IMPORT_JOB (self), NULL);
	_tmp0_ = self->priv->exposure_time;
	_tmp1_ = _g_date_time_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static gchar*
spit_data_imports_data_import_job_real_get_dest_identifier (BatchImportJob* base)
{
	SpitDataImportsDataImportJob * self;
	SpitDataImportsDataImportSource* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB, SpitDataImportsDataImportJob);
	_tmp0_ = self->priv->import_source;
	_tmp1_ = spit_data_imports_data_import_source_get_filename (_tmp0_);
	result = _tmp1_;
	return result;
}

static gchar*
spit_data_imports_data_import_job_real_get_source_identifier (BatchImportJob* base)
{
	SpitDataImportsDataImportJob * self;
	SpitDataImportsDataImportSource* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB, SpitDataImportsDataImportJob);
	_tmp0_ = self->priv->import_source;
	_tmp1_ = spit_data_imports_data_import_source_get_filename (_tmp0_);
	result = _tmp1_;
	return result;
}

static gboolean
spit_data_imports_data_import_job_real_is_directory (BatchImportJob* base)
{
	SpitDataImportsDataImportJob * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB, SpitDataImportsDataImportJob);
	result = FALSE;
	return result;
}

static gchar*
spit_data_imports_data_import_job_real_get_basename (BatchImportJob* base)
{
	SpitDataImportsDataImportJob * self;
	GFile* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB, SpitDataImportsDataImportJob);
	_tmp0_ = self->priv->src_file;
	_tmp1_ = g_file_get_basename (_tmp0_);
	result = _tmp1_;
	return result;
}

static gchar*
spit_data_imports_data_import_job_real_get_path (BatchImportJob* base)
{
	SpitDataImportsDataImportJob * self;
	GFile* _tmp0_;
	GFile* _tmp1_;
	GFile* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB, SpitDataImportsDataImportJob);
	_tmp0_ = self->priv->src_file;
	_tmp1_ = g_file_get_parent (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_file_get_path (_tmp2_);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp2_);
	result = _tmp4_;
	return result;
}

static gpointer
_batch_import_job_ref0 (gpointer self)
{
	return self ? batch_import_job_ref (self) : NULL;
}

static void
spit_data_imports_data_import_job_real_set_associated (BatchImportJob* base,
                                                       BatchImportJob* associated)
{
	SpitDataImportsDataImportJob * self;
	SpitDataImportsDataImportJob* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB, SpitDataImportsDataImportJob);
	g_return_if_fail (IS_BATCH_IMPORT_JOB (associated));
	_tmp0_ = _batch_import_job_ref0 (SPIT_DATA_IMPORTS_IS_DATA_IMPORT_JOB (associated) ? ((SpitDataImportsDataImportJob*) associated) : NULL);
	_batch_import_job_unref0 (self->priv->associated);
	self->priv->associated = _tmp0_;
}

static gboolean
spit_data_imports_data_import_job_real_determine_file_size (BatchImportJob* base,
                                                            guint64* filesize,
                                                            GFile** file)
{
	SpitDataImportsDataImportJob * self;
	guint64 _vala_filesize = 0ULL;
	GFile* _vala_file = NULL;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB, SpitDataImportsDataImportJob);
	_g_object_unref0 (_vala_file);
	_vala_file = NULL;
	_vala_filesize = self->priv->filesize;
	result = TRUE;
	if (filesize) {
		*filesize = _vala_filesize;
	}
	if (file) {
		*file = _vala_file;
	} else {
		_g_object_unref0 (_vala_file);
	}
	return result;
}

static gboolean
spit_data_imports_data_import_job_real_prepare (BatchImportJob* base,
                                                GFile** file_to_import,
                                                gboolean* copy_to_library,
                                                GError** error)
{
	SpitDataImportsDataImportJob * self;
	GFile* _vala_file_to_import = NULL;
	gboolean _vala_copy_to_library = FALSE;
	GFile* _tmp0_;
	GFile* _tmp1_;
	SpitDataImportsDataImportSource* _tmp2_;
	SpitDataImportsImportableMediaItem* _tmp3_;
	SpitDataImportsImportableMediaItem* _tmp4_;
	gint _tmp5_ = 0;
	SpitDataImportsImportableTag** _tmp6_;
	SpitDataImportsImportableTag** _tmp7_;
	gint _tmp7__length1;
	HierarchicalTagIndex* _tmp8_;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB, SpitDataImportsDataImportJob);
	_tmp0_ = self->priv->src_file;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_vala_file_to_import);
	_vala_file_to_import = _tmp1_;
	_vala_copy_to_library = FALSE;
	_tmp2_ = self->priv->import_source;
	_tmp3_ = spit_data_imports_data_import_source_get_photo (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp6_ = spit_data_imports_importable_media_item_get_tags (_tmp4_, &_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp7__length1 = _tmp5_;
	_tmp8_ = spit_data_imports_data_import_job_build_exclusion_index (self, _tmp7_, (gint) _tmp5_);
	_hierarchical_tag_index_unref0 (self->priv->detected_htags);
	self->priv->detected_htags = _tmp8_;
	_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (_tmp4_);
	result = TRUE;
	if (file_to_import) {
		*file_to_import = _vala_file_to_import;
	} else {
		_g_object_unref0 (_vala_file_to_import);
	}
	if (copy_to_library) {
		*copy_to_library = _vala_copy_to_library;
	}
	return result;
}

static gboolean
spit_data_imports_data_import_job_real_complete (BatchImportJob* base,
                                                 MediaSource* source,
                                                 BatchImportRoll* import_roll,
                                                 GError** error)
{
	SpitDataImportsDataImportJob * self;
	LibraryPhoto* photo = NULL;
	LibraryPhoto* _tmp0_;
	LibraryPhoto* _tmp1_;
	SpitDataImportsImportableMediaItem* src_photo = NULL;
	SpitDataImportsDataImportSource* _tmp2_;
	SpitDataImportsImportableMediaItem* _tmp3_;
	HierarchicalTagIndex* _tmp4_;
	SpitDataImportsImportableTag** src_tags = NULL;
	SpitDataImportsImportableMediaItem* _tmp15_;
	gint _tmp16_ = 0;
	SpitDataImportsImportableTag** _tmp17_;
	gint src_tags_length1;
	gint _src_tags_size_;
	SpitDataImportsImportableTag** _tmp18_;
	gint _tmp18__length1;
	SpitDataImportsImportableEvent* src_event = NULL;
	SpitDataImportsImportableMediaItem* _tmp57_;
	SpitDataImportsImportableEvent* _tmp58_;
	SpitDataImportsImportableEvent* _tmp59_;
	Rating dst_rating = 0;
	SpitDataImportsImportableRating* src_rating = NULL;
	SpitDataImportsImportableMediaItem* _tmp69_;
	SpitDataImportsImportableRating* _tmp70_;
	SpitDataImportsImportableRating* _tmp71_;
	LibraryPhoto* _tmp74_;
	gchar* title = NULL;
	SpitDataImportsImportableMediaItem* _tmp75_;
	gchar* _tmp76_;
	const gchar* _tmp77_;
	GDateTime* date_time = NULL;
	SpitDataImportsImportableMediaItem* _tmp80_;
	GDateTime* _tmp81_;
	GDateTime* _tmp82_;
	LibraryPhoto* _tmp85_;
	ImportID _tmp86_;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB, SpitDataImportsDataImportJob);
	g_return_val_if_fail (IS_MEDIA_SOURCE (source), FALSE);
	g_return_val_if_fail (IS_BATCH_IMPORT_ROLL (import_roll), FALSE);
	_tmp0_ = _g_object_ref0 (IS_LIBRARY_PHOTO (source) ? ((LibraryPhoto*) source) : NULL);
	photo = _tmp0_;
	_tmp1_ = photo;
	if (_tmp1_ == NULL) {
		result = FALSE;
		_g_object_unref0 (photo);
		return result;
	}
	_tmp2_ = self->priv->import_source;
	_tmp3_ = spit_data_imports_data_import_source_get_photo (_tmp2_);
	src_photo = _tmp3_;
	_tmp4_ = self->priv->detected_htags;
	if (_tmp4_ != NULL) {
		GeeCollection* paths = NULL;
		HierarchicalTagIndex* _tmp5_;
		GeeCollection* _tmp6_;
		_tmp5_ = self->priv->detected_htags;
		_tmp6_ = hierarchical_tag_index_get_all_paths (_tmp5_);
		paths = _tmp6_;
		{
			GeeIterator* _path_it = NULL;
			GeeCollection* _tmp7_;
			GeeIterator* _tmp8_;
			_tmp7_ = paths;
			_tmp8_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_ITERABLE, GeeIterable));
			_path_it = _tmp8_;
			while (TRUE) {
				GeeIterator* _tmp9_;
				gchar* path = NULL;
				GeeIterator* _tmp10_;
				gpointer _tmp11_;
				const gchar* _tmp12_;
				Tag* _tmp13_;
				Tag* _tmp14_;
				_tmp9_ = _path_it;
				if (!gee_iterator_next (_tmp9_)) {
					break;
				}
				_tmp10_ = _path_it;
				_tmp11_ = gee_iterator_get (_tmp10_);
				path = (gchar*) _tmp11_;
				_tmp12_ = path;
				_tmp13_ = tag_for_path (_tmp12_);
				_tmp14_ = _tmp13_;
				_g_object_unref0 (_tmp14_);
				_g_free0 (path);
			}
			_g_object_unref0 (_path_it);
		}
		_g_object_unref0 (paths);
	}
	_tmp15_ = src_photo;
	_tmp17_ = spit_data_imports_importable_media_item_get_tags (_tmp15_, &_tmp16_);
	src_tags = _tmp17_;
	src_tags_length1 = _tmp16_;
	_src_tags_size_ = src_tags_length1;
	_tmp18_ = src_tags;
	_tmp18__length1 = src_tags_length1;
	{
		SpitDataImportsImportableTag** src_tag_collection = NULL;
		gint src_tag_collection_length1 = 0;
		gint _src_tag_collection_size_ = 0;
		gint src_tag_it = 0;
		src_tag_collection = _tmp18_;
		src_tag_collection_length1 = _tmp18__length1;
		for (src_tag_it = 0; src_tag_it < src_tag_collection_length1; src_tag_it = src_tag_it + 1) {
			SpitDataImportsImportableTag* _tmp19_;
			SpitDataImportsImportableTag* src_tag = NULL;
			_tmp19_ = _g_object_ref0 (src_tag_collection[src_tag_it]);
			src_tag = _tmp19_;
			{
				gchar* prepped = NULL;
				SpitDataImportsImportableTag* _tmp20_;
				gint _tmp21_ = 0;
				gchar** _tmp22_;
				gchar** _tmp23_;
				gint _tmp23__length1;
				gint _tmp24_ = 0;
				gchar** _tmp25_;
				gchar** _tmp26_;
				gint _tmp26__length1;
				gchar* _tmp27_;
				gchar* _tmp28_;
				const gchar* _tmp29_;
				_tmp20_ = src_tag;
				_tmp22_ = spit_data_imports_data_import_job_build_path_components (self, _tmp20_, &_tmp21_);
				_tmp23_ = _tmp22_;
				_tmp23__length1 = _tmp21_;
				_tmp25_ = tag_prep_tag_names (_tmp23_, (gint) _tmp21_, &_tmp24_);
				_tmp26_ = _tmp25_;
				_tmp26__length1 = _tmp24_;
				_tmp27_ = hierarchical_tag_utilities_join_path_components (_tmp26_, (gint) _tmp24_);
				_tmp28_ = _tmp27_;
				_tmp26_ = (_vala_array_free (_tmp26_, _tmp26__length1, (GDestroyNotify) g_free), NULL);
				_tmp23_ = (_vala_array_free (_tmp23_, _tmp23__length1, (GDestroyNotify) g_free), NULL);
				prepped = _tmp28_;
				_tmp29_ = prepped;
				if (_tmp29_ != NULL) {
					const gchar* _tmp30_;
					GeeList* _tmp31_;
					GeeList* _tmp32_;
					gint _tmp33_;
					gint _tmp34_;
					gboolean _tmp35_;
					const gchar* _tmp53_;
					Tag* _tmp54_;
					Tag* _tmp55_;
					LibraryPhoto* _tmp56_;
					_tmp30_ = prepped;
					_tmp31_ = hierarchical_tag_utilities_enumerate_path_components (_tmp30_);
					_tmp32_ = _tmp31_;
					_tmp33_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, GEE_TYPE_COLLECTION, GeeCollection));
					_tmp34_ = _tmp33_;
					_tmp35_ = _tmp34_ == 1;
					_g_object_unref0 (_tmp32_);
					if (_tmp35_) {
						const gchar* _tmp36_;
						_tmp36_ = prepped;
						if (g_str_has_prefix (_tmp36_, TAG_PATH_SEPARATOR_STRING)) {
							const gchar* _tmp37_;
							gchar* _tmp38_;
							_tmp37_ = prepped;
							_tmp38_ = hierarchical_tag_utilities_hierarchical_to_flat (_tmp37_);
							_g_free0 (prepped);
							prepped = _tmp38_;
						}
					} else {
						GeeList* parents = NULL;
						const gchar* _tmp39_;
						GeeList* _tmp40_;
						GeeList* _tmp41_;
						gint _tmp42_;
						gint _tmp43_;
						gchar* top_level_parent = NULL;
						GeeList* _tmp44_;
						gpointer _tmp45_;
						gchar* flat_top_level_parent = NULL;
						const gchar* _tmp46_;
						gchar* _tmp47_;
						TagSourceCollection* _tmp48_;
						const gchar* _tmp49_;
						_tmp39_ = prepped;
						_tmp40_ = hierarchical_tag_utilities_enumerate_parent_paths (_tmp39_);
						parents = _tmp40_;
						_tmp41_ = parents;
						_tmp42_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, GEE_TYPE_COLLECTION, GeeCollection));
						_tmp43_ = _tmp42_;
						_vala_assert (_tmp43_ > 0, "parents.size > 0");
						_tmp44_ = parents;
						_tmp45_ = gee_list_get (_tmp44_, 0);
						top_level_parent = (gchar*) _tmp45_;
						_tmp46_ = top_level_parent;
						_tmp47_ = hierarchical_tag_utilities_hierarchical_to_flat (_tmp46_);
						flat_top_level_parent = _tmp47_;
						_tmp48_ = tag_global;
						_tmp49_ = flat_top_level_parent;
						if (tag_source_collection_exists (_tmp48_, _tmp49_, FALSE)) {
							const gchar* _tmp50_;
							Tag* _tmp51_;
							Tag* _tmp52_;
							_tmp50_ = flat_top_level_parent;
							_tmp51_ = tag_for_path (_tmp50_);
							_tmp52_ = _tmp51_;
							tag_promote (_tmp52_);
							_g_object_unref0 (_tmp52_);
						}
						_g_free0 (flat_top_level_parent);
						_g_free0 (top_level_parent);
						_g_object_unref0 (parents);
					}
					_tmp53_ = prepped;
					_tmp54_ = tag_for_path (_tmp53_);
					_tmp55_ = _tmp54_;
					_tmp56_ = photo;
					tag_attach (_tmp55_, G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, TYPE_MEDIA_SOURCE, MediaSource));
					_g_object_unref0 (_tmp55_);
				}
				_g_free0 (prepped);
				_g_object_unref0 (src_tag);
			}
		}
	}
	_tmp57_ = src_photo;
	_tmp58_ = spit_data_imports_importable_media_item_get_event (_tmp57_);
	src_event = _tmp58_;
	_tmp59_ = src_event;
	if (_tmp59_ != NULL) {
		gchar* prepped = NULL;
		SpitDataImportsImportableEvent* _tmp60_;
		gchar* _tmp61_;
		gchar* _tmp62_;
		gchar* _tmp63_;
		gchar* _tmp64_;
		const gchar* _tmp65_;
		_tmp60_ = src_event;
		_tmp61_ = spit_data_imports_importable_event_get_name (_tmp60_);
		_tmp62_ = _tmp61_;
		_tmp63_ = prepare_input_text (_tmp62_, PREPARE_INPUT_TEXT_OPTIONS_DEFAULT, -1);
		_tmp64_ = _tmp63_;
		_g_free0 (_tmp62_);
		prepped = _tmp64_;
		_tmp65_ = prepped;
		if (_tmp65_ != NULL) {
			LibraryPhoto* _tmp66_;
			ViewCollection* _tmp67_;
			const gchar* _tmp68_;
			_tmp66_ = photo;
			_tmp67_ = import_roll->generated_events;
			_tmp68_ = prepped;
			event_generate_single_event (G_TYPE_CHECK_INSTANCE_CAST (_tmp66_, TYPE_MEDIA_SOURCE, MediaSource), _tmp67_, _tmp68_);
		}
		_g_free0 (prepped);
	}
	_tmp69_ = src_photo;
	_tmp70_ = spit_data_imports_importable_media_item_get_rating (_tmp69_);
	src_rating = _tmp70_;
	_tmp71_ = src_rating;
	if (spit_data_imports_importable_rating_is_rejected (_tmp71_)) {
		dst_rating = RATING_REJECTED;
	} else {
		SpitDataImportsImportableRating* _tmp72_;
		_tmp72_ = src_rating;
		if (spit_data_imports_importable_rating_is_unrated (_tmp72_)) {
			dst_rating = RATING_UNRATED;
		} else {
			SpitDataImportsImportableRating* _tmp73_;
			_tmp73_ = src_rating;
			dst_rating = rating_unserialize (spit_data_imports_importable_rating_get_value (_tmp73_));
		}
	}
	_tmp74_ = photo;
	media_source_set_rating (G_TYPE_CHECK_INSTANCE_CAST (_tmp74_, TYPE_MEDIA_SOURCE, MediaSource), dst_rating);
	_tmp75_ = src_photo;
	_tmp76_ = spit_data_imports_importable_media_item_get_title (_tmp75_);
	title = _tmp76_;
	_tmp77_ = title;
	if (_tmp77_ != NULL) {
		LibraryPhoto* _tmp78_;
		const gchar* _tmp79_;
		_tmp78_ = photo;
		_tmp79_ = title;
		media_source_set_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp78_, TYPE_MEDIA_SOURCE, MediaSource), _tmp79_);
	}
	_tmp80_ = src_photo;
	_tmp81_ = spit_data_imports_importable_media_item_get_exposure_time (_tmp80_);
	date_time = _tmp81_;
	_tmp82_ = date_time;
	if (_tmp82_ != NULL) {
		LibraryPhoto* _tmp83_;
		GDateTime* _tmp84_;
		_tmp83_ = photo;
		_tmp84_ = date_time;
		dateable_set_exposure_time (G_TYPE_CHECK_INSTANCE_CAST (_tmp83_, TYPE_DATEABLE, Dateable), _tmp84_);
	}
	_tmp85_ = photo;
	_tmp86_ = import_roll->import_id;
	photo_set_import_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp85_, TYPE_PHOTO, Photo), &_tmp86_);
	result = TRUE;
	_g_date_time_unref0 (date_time);
	_g_free0 (title);
	_g_object_unref0 (src_rating);
	_g_object_unref0 (src_event);
	src_tags = (_vala_array_free (src_tags, src_tags_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (src_photo);
	_g_object_unref0 (photo);
	return result;
}

static gchar**
spit_data_imports_data_import_job_build_path_components (SpitDataImportsDataImportJob* self,
                                                         SpitDataImportsImportableTag* tag,
                                                         gint* result_length1)
{
	GeeList* components = NULL;
	GeeLinkedList* _tmp0_;
	GeeList* _tmp12_;
	gint _tmp13_ = 0;
	gpointer* _tmp14_;
	gchar** _tmp15_;
	gint _tmp15__length1;
	gchar** result;
	g_return_val_if_fail (SPIT_DATA_IMPORTS_IS_DATA_IMPORT_JOB (self), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (tag, SPIT_DATA_IMPORTS_TYPE_IMPORTABLE_TAG), NULL);
	_tmp0_ = gee_linked_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	components = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_LIST, GeeList);
	{
		SpitDataImportsImportableTag* current_tag = NULL;
		SpitDataImportsImportableTag* _tmp1_;
		_tmp1_ = _g_object_ref0 (tag);
		current_tag = _tmp1_;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				SpitDataImportsImportableTag* _tmp5_;
				GeeList* _tmp6_;
				SpitDataImportsImportableTag* _tmp7_;
				gchar* _tmp8_;
				gchar* _tmp9_;
				gchar* _tmp10_;
				gchar* _tmp11_;
				if (!_tmp2_) {
					SpitDataImportsImportableTag* _tmp3_;
					SpitDataImportsImportableTag* _tmp4_;
					_tmp3_ = current_tag;
					_tmp4_ = spit_data_imports_importable_tag_get_parent (_tmp3_);
					_g_object_unref0 (current_tag);
					current_tag = _tmp4_;
				}
				_tmp2_ = FALSE;
				_tmp5_ = current_tag;
				if (!(_tmp5_ != NULL)) {
					break;
				}
				_tmp6_ = components;
				_tmp7_ = current_tag;
				_tmp8_ = spit_data_imports_importable_tag_get_name (_tmp7_);
				_tmp9_ = _tmp8_;
				_tmp10_ = hierarchical_tag_utilities_make_flat_tag_safe (_tmp9_);
				_tmp11_ = _tmp10_;
				gee_list_insert (_tmp6_, 0, _tmp11_);
				_g_free0 (_tmp11_);
				_g_free0 (_tmp9_);
			}
		}
		_g_object_unref0 (current_tag);
	}
	_tmp12_ = components;
	_tmp14_ = gee_collection_to_array (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_COLLECTION, GeeCollection), &_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp15__length1 = _tmp13_;
	if (result_length1) {
		*result_length1 = _tmp15__length1;
	}
	result = _tmp15_;
	_g_object_unref0 (components);
	return result;
}

static void
spit_data_imports_data_import_job_class_init (SpitDataImportsDataImportJobClass * klass,
                                              gpointer klass_data)
{
	spit_data_imports_data_import_job_parent_class = g_type_class_peek_parent (klass);
	((BatchImportJobClass *) klass)->finalize = spit_data_imports_data_import_job_finalize;
	g_type_class_adjust_private_offset (klass, &SpitDataImportsDataImportJob_private_offset);
	((BatchImportJobClass *) klass)->get_dest_identifier = (gchar* (*) (BatchImportJob*)) spit_data_imports_data_import_job_real_get_dest_identifier;
	((BatchImportJobClass *) klass)->get_source_identifier = (gchar* (*) (BatchImportJob*)) spit_data_imports_data_import_job_real_get_source_identifier;
	((BatchImportJobClass *) klass)->is_directory = (gboolean (*) (BatchImportJob*)) spit_data_imports_data_import_job_real_is_directory;
	((BatchImportJobClass *) klass)->get_basename = (gchar* (*) (BatchImportJob*)) spit_data_imports_data_import_job_real_get_basename;
	((BatchImportJobClass *) klass)->get_path = (gchar* (*) (BatchImportJob*)) spit_data_imports_data_import_job_real_get_path;
	((BatchImportJobClass *) klass)->set_associated = (void (*) (BatchImportJob*, BatchImportJob*)) spit_data_imports_data_import_job_real_set_associated;
	((BatchImportJobClass *) klass)->determine_file_size = (gboolean (*) (BatchImportJob*, guint64*, GFile**)) spit_data_imports_data_import_job_real_determine_file_size;
	((BatchImportJobClass *) klass)->prepare = (gboolean (*) (BatchImportJob*, GFile**, gboolean*, GError**)) spit_data_imports_data_import_job_real_prepare;
	((BatchImportJobClass *) klass)->complete = (gboolean (*) (BatchImportJob*, MediaSource*, BatchImportRoll*, GError**)) spit_data_imports_data_import_job_real_complete;
}

static void
spit_data_imports_data_import_job_instance_init (SpitDataImportsDataImportJob * self,
                                                 gpointer klass)
{
	self->priv = spit_data_imports_data_import_job_get_instance_private (self);
	self->priv->associated = NULL;
	self->priv->detected_htags = NULL;
}

static void
spit_data_imports_data_import_job_finalize (BatchImportJob * obj)
{
	SpitDataImportsDataImportJob * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SPIT_DATA_IMPORTS_TYPE_DATA_IMPORT_JOB, SpitDataImportsDataImportJob);
	_spit_data_imports_data_import_source_unref0 (self->priv->import_source);
	_g_object_unref0 (self->priv->src_file);
	_g_date_time_unref0 (self->priv->exposure_time);
	_batch_import_job_unref0 (self->priv->associated);
	_hierarchical_tag_index_unref0 (self->priv->detected_htags);
	BATCH_IMPORT_JOB_CLASS (spit_data_imports_data_import_job_parent_class)->finalize (obj);
}

/**
 * A specialized import job implementation for alien databases.
 */
static GType
spit_data_imports_data_import_job_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SpitDataImportsDataImportJobClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) spit_data_imports_data_import_job_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SpitDataImportsDataImportJob), 0, (GInstanceInitFunc) spit_data_imports_data_import_job_instance_init, NULL };
	GType spit_data_imports_data_import_job_type_id;
	spit_data_imports_data_import_job_type_id = g_type_register_static (TYPE_BATCH_IMPORT_JOB, "SpitDataImportsDataImportJob", &g_define_type_info, 0);
	SpitDataImportsDataImportJob_private_offset = g_type_add_instance_private (spit_data_imports_data_import_job_type_id, sizeof (SpitDataImportsDataImportJobPrivate));
	return spit_data_imports_data_import_job_type_id;
}

GType
spit_data_imports_data_import_job_get_type (void)
{
	static volatile gsize spit_data_imports_data_import_job_type_id__once = 0;
	if (g_once_init_enter (&spit_data_imports_data_import_job_type_id__once)) {
		GType spit_data_imports_data_import_job_type_id;
		spit_data_imports_data_import_job_type_id = spit_data_imports_data_import_job_get_type_once ();
		g_once_init_leave (&spit_data_imports_data_import_job_type_id__once, spit_data_imports_data_import_job_type_id);
	}
	return spit_data_imports_data_import_job_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize 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,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

