summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common.am13
-rw-r--r--configure.ac32
-rw-r--r--src/Makefile.am2
-rw-r--r--src/librygel-db/Makefile.am40
-rw-r--r--src/librygel-db/collate.c (renamed from src/plugins/media-export/rygel-media-export-collate.c)4
-rw-r--r--src/librygel-db/database-cursor.vala (renamed from src/plugins/media-export/rygel-media-export-database-cursor.vala)8
-rw-r--r--src/librygel-db/database.vala (renamed from src/plugins/media-export/rygel-media-export-database.vala)32
-rw-r--r--src/librygel-db/filelist.am8
-rw-r--r--src/librygel-db/rygel-db-2.6.deps1
-rw-r--r--src/librygel-db/sqlite-wrapper.vala (renamed from src/plugins/media-export/rygel-media-export-sqlite-wrapper.vala)2
-rw-r--r--src/plugins/media-export/Makefile.am11
-rw-r--r--src/plugins/media-export/rygel-media-export-db-container.vala1
-rw-r--r--src/plugins/media-export/rygel-media-export-harvester.vala2
-rw-r--r--src/plugins/media-export/rygel-media-export-harvesting-task.vala2
-rw-r--r--src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala32
-rw-r--r--src/plugins/media-export/rygel-media-export-media-cache.vala7
-rw-r--r--src/plugins/media-export/rygel-media-export-root-container.vala6
17 files changed, 140 insertions, 63 deletions
diff --git a/common.am b/common.am
index 74c69942..285f06c5 100644
--- a/common.am
+++ b/common.am
@@ -47,6 +47,19 @@ RYGEL_COMMON_LIBRYGEL_CORE_CFLAGS = \
RYGEL_COMMON_LIBRYGEL_CORE_LIBS = \
$(top_builddir)/src/librygel-core/librygel-core-2.6.la
+RYGEL_COMMON_LIBRYGEL_DB_VALAFLAGS = \
+ --vapidir=$(top_srcdir)/src/librygel-db \
+ --pkg rygel-db-2.6 \
+ $(RYGEL_COMMON_LIBRYGEL_CORE_VALAFLAGS)
+
+RYGEL_COMMON_LIBRYGEL_DB_CFLAGS = \
+ $(RYGEL_COMMON_DEFINES_CFLAGS) \
+ -I$(top_builddir)/src/librygel-db \
+ -I$(top_srcdir)/src/librygel-db
+
+RYGEL_COMMON_LIBRYGEL_DB_LIBS = \
+ $(RYGEL_COMMON_LIBRYGEL_CORE_LIBS) \
+ $(top_builddir)/src/librygel-db/librygel-db-2.6.la
RYGEL_COMMON_LIBRYGEL_RENDERER_VALAFLAGS = \
--vapidir=$(top_srcdir)/src/librygel-renderer \
diff --git a/configure.ac b/configure.ac
index ea839eb5..270113e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -88,6 +88,27 @@ RYGEL_COMMON_MODULES="$RYGEL_BASE_MODULES gupnp-av-1.0 >= $GUPNP_AV_REQUIRED"
RYGEL_COMMON_MODULES_VALAFLAGS="$RYGEL_BASE_MODULES_VALAFLAGS --pkg gupnp-av-1.0"
########################################################
+## Db
+########################################################
+RYGEL_CHECK_PACKAGES([sqlite3])
+PKG_CHECK_MODULES([LIBRYGEL_DB_DEPS],
+ [$RYGEL_COMMON_MODULES
+ gio-2.0 >= $GIO_REQUIRED
+ sqlite3 >= $LIBSQLITE3_REQUIRED])
+LIBRYGEL_DB_DEPS_VALAFLAGS="$RYGEL_COMMON_MODULES_VALAFLAGS --pkg sqlite3 --pkg gio-2.0"
+AC_CHECK_HEADER([unistr.h],
+ AC_CHECK_LIB([unistring],
+ [u8_strcoll],
+ [have_unistring=yes],[have_unistring=no]))
+AS_IF([test "x$have_unistring" = "xyes"],
+ [
+ AC_DEFINE([HAVE_UNISTRING], [1], [Use libunistring for collation])
+ LIBRYGEL_DB_DEPS_LIBS="$LIBRYGEL_DB_DEPS_LIBS -lunistring"
+ ])
+AC_SUBST([LIBRYGEL_DB_DEPS_VALAFLAGS])
+
+
+########################################################
## Server
########################################################
PKG_CHECK_MODULES([LIBRYGEL_SERVER_DEPS],
@@ -369,15 +390,7 @@ AS_IF([test "x$enable_coverage" != "xno"],
dnl Check additional requirements for MediaExport plugins
if test "x$enable_media_export_plugin" = "xyes";
then
- RYGEL_CHECK_PACKAGES([sqlite3 gstreamer-tag-1.0 gstreamer-app-1.0])
- AC_CHECK_HEADER([unistr.h],
- AC_CHECK_LIB([unistring],
- [u8_strcoll],
- [have_unistring=yes],[have_unistring=no]))
- if test "x$have_unistring" = "xyes"; then
- AC_DEFINE([HAVE_UNISTRING],[1],[Use libunistring for collation])
- RYGEL_PLUGIN_MEDIA_EXPORT_DEPS_LIBS="$RYGEL_PLUGIN_MEDIA_EXPORT_DEPS_LIBS -lunistring"
- fi
+ RYGEL_CHECK_PACKAGES([gstreamer-tag-1.0 gstreamer-app-1.0])
fi
@@ -489,6 +502,7 @@ AC_CONFIG_FILES([
Makefile
src/Makefile
src/librygel-core/Makefile
+src/librygel-db/Makefile
src/librygel-renderer/Makefile
src/librygel-renderer-gst/Makefile
src/librygel-server/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 31b44eb8..8e6937bb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = librygel-core librygel-renderer librygel-server librygel-ruih
+SUBDIRS = librygel-core librygel-renderer librygel-server librygel-ruih librygel-db
if HAVE_GSTREAMER
SUBDIRS += librygel-renderer-gst
diff --git a/src/librygel-db/Makefile.am b/src/librygel-db/Makefile.am
new file mode 100644
index 00000000..8914ded2
--- /dev/null
+++ b/src/librygel-db/Makefile.am
@@ -0,0 +1,40 @@
+include $(top_srcdir)/common.am
+include $(srcdir)/filelist.am
+
+librygel_db_includedir=$(includedir)/rygel-2.6
+librygel_db_include_HEADERS = rygel-db.h
+
+lib_LTLIBRARIES = librygel-db-2.6.la
+
+LIBRYGEL_DB_VERSION=2:4:0
+
+librygel_db_2_6_la_SOURCES = \
+ $(LIBRYGEL_DB_VAPI_SOURCE_FILES) \
+ $(LIBRYGEL_DB_NONVAPI_SOURCE_FILES)
+
+librygel_db_2_6_la_VALAFLAGS = \
+ -H rygel-db.h --library=rygel-db-2.6 \
+ $(LIBRYGEL_DB_DEPS_VALAFLAGS) \
+ $(RYGEL_COMMON_LIBRYGEL_CORE_VALAFLAGS) \
+ $(RYGEL_COMMON_VALAFLAGS)
+
+librygel_db_2_6_la_CFLAGS = \
+ $(LIBRYGEL_DB_DEPS_CFLAGS) \
+ $(RYGEL_COMMON_LIBRYGEL_CORE_CFLAGS) \
+ -DENGINE_DIR='"$(enginedir)"' \
+ -DG_LOG_DOMAIN=\"RygelDb\"
+librygel_db_2_6_la_LIBADD = \
+ $(LIBRYGEL_DB_DEPS_LIBS) \
+ $(RYGEL_COMMON_LIBRYGEL_CORE_LIBS)
+
+librygel_db_2_6_la_LDFLAGS = \
+ $(RYGEL_DATA_DIR_DEFINES) \
+ -version-info $(LIBRYGEL_DB_VERSION)
+
+vapidir = $(VAPIDIR)
+vapi_DATA = rygel-db-2.6.vapi rygel-db-2.6.deps
+
+rygel-db.h rygel-db-2.6.vapi: librygel_db_2_6_la_vala.stamp
+
+DISTCLEANFILES = $(nodist_typelib_DATA)
+EXTRA_DIST = rygel-db.h rygel-db-2.6.vapi rygel-db-2.6.deps
diff --git a/src/plugins/media-export/rygel-media-export-collate.c b/src/librygel-db/collate.c
index aa2553fb..f547d1e1 100644
--- a/src/plugins/media-export/rygel-media-export-collate.c
+++ b/src/librygel-db/collate.c
@@ -26,8 +26,8 @@
# include <unistr.h>
#endif
-gint rygel_media_export_utf8_collate_str (const char *a, gsize alen,
- const char *b, gsize blen)
+gint rygel_database_utf8_collate_str (const char *a, gsize alen,
+ const char *b, gsize blen)
{
char *a_str, *b_str;
gint result;
diff --git a/src/plugins/media-export/rygel-media-export-database-cursor.vala b/src/librygel-db/database-cursor.vala
index 55a538ba..763f1d89 100644
--- a/src/plugins/media-export/rygel-media-export-database-cursor.vala
+++ b/src/librygel-db/database-cursor.vala
@@ -22,7 +22,7 @@
using Sqlite;
-internal class Rygel.MediaExport.DatabaseCursor : SqliteWrapper {
+public class Rygel.Database.Cursor : SqliteWrapper {
private Statement statement;
private int current_state = -1;
private bool dirty = true;
@@ -42,7 +42,7 @@ internal class Rygel.MediaExport.DatabaseCursor : SqliteWrapper {
* @param values array of values to bind to the SQL statement or null if
* none
*/
- public DatabaseCursor (Sqlite.Database db,
+ public Cursor (Sqlite.Database db,
string sql,
GLib.Value[]? arguments) throws DatabaseError {
base.wrap (db);
@@ -130,9 +130,9 @@ internal class Rygel.MediaExport.DatabaseCursor : SqliteWrapper {
}
public class Iterator {
- public DatabaseCursor cursor;
+ public Cursor cursor;
- public Iterator (DatabaseCursor cursor) {
+ public Iterator (Cursor cursor) {
this.cursor = cursor;
}
diff --git a/src/plugins/media-export/rygel-media-export-database.vala b/src/librygel-db/database.vala
index f6550599..25b3f974 100644
--- a/src/plugins/media-export/rygel-media-export-database.vala
+++ b/src/librygel-db/database.vala
@@ -22,13 +22,24 @@
using Sqlite;
-public errordomain Rygel.MediaExport.DatabaseError {
+public errordomain Rygel.Database.DatabaseError {
IO_ERROR,
SQLITE_ERROR
}
-namespace Rygel.MediaExport {
+namespace Rygel.Database {
extern static int utf8_collate_str (uint8[] a, uint8[] b);
+
+ /**
+ * Special GValue to pass to exec or exec_cursor to bind a column to
+ * NULL
+ */
+ public static GLib.Value @null () {
+ GLib.Value v = GLib.Value (typeof (void *));
+ v.set_pointer (null);
+
+ return v;
+ }
}
/**
@@ -37,7 +48,7 @@ namespace Rygel.MediaExport {
* It adds statement preparation based on GValue and a cancellable exec
* function.
*/
-internal class Rygel.MediaExport.Database : SqliteWrapper {
+public class Rygel.Database.Database : SqliteWrapper {
/**
* Function to implement the custom SQL function 'contains'
@@ -127,10 +138,10 @@ internal class Rygel.MediaExport.Database : SqliteWrapper {
* @param args Values to bind in the SQL query or null.
* @throws DatabaseError if the underlying SQLite operation fails.
*/
- public DatabaseCursor exec_cursor (string sql,
+ public Cursor exec_cursor (string sql,
GLib.Value[]? arguments = null)
throws DatabaseError {
- return new DatabaseCursor (this.db, sql, arguments);
+ return new Cursor (this.db, sql, arguments);
}
/**
@@ -181,17 +192,6 @@ internal class Rygel.MediaExport.Database : SqliteWrapper {
}
/**
- * Special GValue to pass to exec or exec_cursor to bind a column to
- * NULL
- */
- public static GLib.Value @null () {
- GLib.Value v = GLib.Value (typeof (void *));
- v.set_pointer (null);
-
- return v;
- }
-
- /**
* Start a transaction
*/
public void begin () throws DatabaseError {
diff --git a/src/librygel-db/filelist.am b/src/librygel-db/filelist.am
new file mode 100644
index 00000000..3feb5763
--- /dev/null
+++ b/src/librygel-db/filelist.am
@@ -0,0 +1,8 @@
+
+LIBRYGEL_DB_VAPI_SOURCE_FILES = \
+ database-cursor.vala \
+ database.vala \
+ sqlite-wrapper.vala
+
+LIBRYGEL_DB_NONVAPI_SOURCE_FILES = \
+ collate.c
diff --git a/src/librygel-db/rygel-db-2.6.deps b/src/librygel-db/rygel-db-2.6.deps
new file mode 100644
index 00000000..8b2f60c6
--- /dev/null
+++ b/src/librygel-db/rygel-db-2.6.deps
@@ -0,0 +1 @@
+sqlite3
diff --git a/src/plugins/media-export/rygel-media-export-sqlite-wrapper.vala b/src/librygel-db/sqlite-wrapper.vala
index 84a288bb..a1a01c99 100644
--- a/src/plugins/media-export/rygel-media-export-sqlite-wrapper.vala
+++ b/src/librygel-db/sqlite-wrapper.vala
@@ -22,7 +22,7 @@
using Sqlite;
-internal class Rygel.MediaExport.SqliteWrapper : Object {
+public class Rygel.Database.SqliteWrapper : Object {
private Sqlite.Database database = null;
private Sqlite.Database *reference = null;
diff --git a/src/plugins/media-export/Makefile.am b/src/plugins/media-export/Makefile.am
index ee19f169..2bbf458b 100644
--- a/src/plugins/media-export/Makefile.am
+++ b/src/plugins/media-export/Makefile.am
@@ -33,9 +33,6 @@ plugin_DATA = media-export.plugin
librygel_media_export_la_SOURCES = \
rygel-media-export-plugin.vala \
- rygel-media-export-database.vala \
- rygel-media-export-database-cursor.vala \
- rygel-media-export-sqlite-wrapper.vala \
rygel-media-export-db-container.vala \
rygel-media-export-sql-factory.vala \
rygel-media-export-media-cache.vala \
@@ -63,8 +60,7 @@ librygel_media_export_la_SOURCES = \
rygel-media-export-photo-item.vala \
rygel-media-export-playlist-item.vala \
rygel-media-export-trackable-db-container.vala \
- rygel-media-export-updatable-object.vala \
- rygel-media-export-collate.c
+ rygel-media-export-updatable-object.vala
librygel_media_export_la_VALAFLAGS = \
--enable-experimental \
@@ -75,16 +71,19 @@ librygel_media_export_la_VALAFLAGS = \
--pkg gio-unix-2.0 \
$(RYGEL_PLUGIN_MEDIA_EXPORT_DEPS_VALAFLAGS) \
$(RYGEL_COMMON_LIBRYGEL_SERVER_VALAFLAGS) \
+ $(RYGEL_COMMON_LIBRYGEL_DB_VALAFLAGS) \
$(RYGEL_COMMON_VALAFLAGS)
librygel_media_export_la_CFLAGS = \
$(RYGEL_PLUGIN_MEDIA_EXPORT_DEPS_CFLAGS) \
$(RYGEL_COMMON_LIBRYGEL_SERVER_CFLAGS) \
+ $(RYGEL_COMMON_LIBRYGEL_DB_CFLAGS) \
-DMX_EXTRACT_PATH='"$(MX_EXTRACT_PATH)"' \
-DG_LOG_DOMAIN='"MediaExport"'
librygel_media_export_la_LIBADD = \
$(RYGEL_PLUGIN_MEDIA_EXPORT_DEPS_LIBS) \
- $(RYGEL_COMMON_LIBRYGEL_SERVER_LIBS)
+ $(RYGEL_COMMON_LIBRYGEL_SERVER_LIBS) \
+ $(RYGEL_COMMON_LIBRYGEL_DB_LIBS)
librygel_media_export_la_LDFLAGS = \
$(RYGEL_PLUGIN_LINKER_FLAGS)
diff --git a/src/plugins/media-export/rygel-media-export-db-container.vala b/src/plugins/media-export/rygel-media-export-db-container.vala
index c9e2a1dd..fdd1e7e2 100644
--- a/src/plugins/media-export/rygel-media-export-db-container.vala
+++ b/src/plugins/media-export/rygel-media-export-db-container.vala
@@ -21,6 +21,7 @@
*/
using GUPnP;
using Gee;
+using Rygel.Database;
public class Rygel.MediaExport.DBContainer : MediaContainer,
SearchableContainer {
diff --git a/src/plugins/media-export/rygel-media-export-harvester.vala b/src/plugins/media-export/rygel-media-export-harvester.vala
index d1e077c0..b0c8007d 100644
--- a/src/plugins/media-export/rygel-media-export-harvester.vala
+++ b/src/plugins/media-export/rygel-media-export-harvester.vala
@@ -188,7 +188,7 @@ internal class Rygel.MediaExport.Harvester : GLib.Object {
var parent_container = cache.get_object (id)
as MediaContainer;
this.schedule (file, parent_container);
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
warning (_("Error fetching object '%s' from database: %s"),
id,
error.message);
diff --git a/src/plugins/media-export/rygel-media-export-harvesting-task.vala b/src/plugins/media-export/rygel-media-export-harvesting-task.vala
index 69bd1038..15b932b6 100644
--- a/src/plugins/media-export/rygel-media-export-harvesting-task.vala
+++ b/src/plugins/media-export/rygel-media-export-harvesting-task.vala
@@ -261,7 +261,7 @@ public class Rygel.MediaExport.HarvestingTask : Rygel.StateMachine,
foreach (var child in container.children) {
this.cache.remove_by_id (child);
}
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
warning (_("Failed to get children of container %s: %s"),
container.id,
error.message);
diff --git a/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala b/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala
index 633bb9b2..6a4b21af 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala
@@ -22,7 +22,7 @@
using Gee;
internal class Rygel.MediaExport.MediaCacheUpgrader {
- private unowned Database database;
+ private unowned Database.Database database;
private unowned SQLFactory sql;
private const string UPDATE_V3_V4_STRING_2 =
@@ -35,7 +35,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
private const string UPDATE_V3_V4_STRING_4 =
"UPDATE Object SET timestamp = 0";
- public MediaCacheUpgrader (Database database, SQLFactory sql) {
+ public MediaCacheUpgrader (Database.Database database, SQLFactory sql) {
this.database = database;
this.sql = sql;
}
@@ -137,7 +137,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
}
}
- private void force_reindex () throws DatabaseError {
+ private void force_reindex () throws Database.DatabaseError {
database.exec ("UPDATE Object SET timestamp = 0");
}
@@ -161,7 +161,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
database.exec (this.sql.make (SQLString.TRIGGER_COMMON));
database.exec ("UPDATE schema_info SET version = '4'");
database.commit ();
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
database.rollback ();
warning ("Database upgrade failed: %s", error.message);
database = null;
@@ -209,7 +209,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
database.commit ();
database.exec ("VACUUM");
database.analyze ();
- } catch (DatabaseError err) {
+ } catch (Database.DatabaseError err) {
database.rollback ();
warning ("Database upgrade failed: %s", err.message);
database = null;
@@ -230,7 +230,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
database.commit ();
database.exec ("VACUUM");
database.analyze ();
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
database.rollback ();
warning ("Database upgrade failed: %s", error.message);
database = null;
@@ -246,7 +246,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
database.commit ();
database.exec ("VACUUM");
database.analyze ();
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
database.rollback ();
warning ("Database upgrade failed: %s", error.message);
database = null;
@@ -263,7 +263,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
database.commit ();
database.exec ("VACUUM");
database.analyze ();
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
database.rollback ();
warning ("Database upgrade failed: %s", error.message);
database = null;
@@ -286,7 +286,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
this.database.exec ("UPDATE schema_info SET version = '9'");
this.database.commit ();
this.database.exec ("VACUUM");
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
database.rollback ();
warning ("Database upgrade failed: %s", error.message);
database = null;
@@ -355,7 +355,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
database.commit ();
database.exec ("VACUUM");
database.analyze ();
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
database.rollback ();
warning ("Database upgrade failed: %s", error.message);
database = null;
@@ -376,7 +376,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
database.commit ();
database.exec ("VACUUM");
database.analyze ();
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
database.rollback ();
warning ("Database upgrade failed: %s", error.message);
database = null;
@@ -419,7 +419,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
database.commit ();
database.exec ("VACUUM");
database.analyze ();
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
database.rollback ();
warning ("Database upgrade failed: %s", error.message);
database = null;
@@ -482,7 +482,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
this.database.commit ();
this.database.exec ("VACUUM");
this.database.analyze ();
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
this.database.rollback ();
warning ("Database upgrade failed: %s", error.message);
this.database = null;
@@ -501,7 +501,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
this.database.commit ();
this.database.exec ("VACUUM");
this.database.analyze ();
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
this.database.rollback ();
warning ("Database upgrade failed: %s", error.message);
this.database = null;
@@ -517,7 +517,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
database.commit ();
database.exec ("VACUUM");
database.analyze ();
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
database.rollback ();
warning ("Database upgrade failed: %s", error.message);
database = null;
@@ -536,7 +536,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
database.commit ();
database.exec ("VACUUM");
database.analyze ();
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
database.rollback ();
warning ("Database upgrade failed: %s", error.message);
database = null;
diff --git a/src/plugins/media-export/rygel-media-export-media-cache.vala b/src/plugins/media-export/rygel-media-export-media-cache.vala
index 332f34dc..9c8ff1da 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache.vala
@@ -27,6 +27,7 @@
using Gee;
using GUPnP;
using Sqlite;
+using Rygel.Database;
public errordomain Rygel.MediaExport.MediaCacheError {
SQLITE_ERROR,
@@ -52,7 +53,7 @@ internal struct Rygel.MediaExport.ExistsCacheEntry {
*/
public class Rygel.MediaExport.MediaCache : Object {
// Private members
- private Database db;
+ private Database.Database db;
private ObjectFactory factory;
private SQLFactory sql;
private HashMap<string, ExistsCacheEntry?> exists_cache;
@@ -617,7 +618,7 @@ public class Rygel.MediaExport.MediaCache : Object {
}
private void open_db (string name) throws Error {
- this.db = new Database (name);
+ this.db = new Database.Database (name);
int old_version = -1;
int current_version = int.parse (SQLFactory.SCHEMA_VERSION);
@@ -1170,7 +1171,7 @@ public class Rygel.MediaExport.MediaCache : Object {
return operator.to_string ();
}
- private DatabaseCursor exec_cursor (SQLString id,
+ private Database.Cursor exec_cursor (SQLString id,
GLib.Value[]? values = null)
throws DatabaseError {
return this.db.exec_cursor (this.sql.make (id), values);
diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala
index 06529414..08e9a171 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -408,7 +408,7 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
ArrayList<string> ids;
try {
ids = media_db.get_child_ids (FILESYSTEM_FOLDER_ID);
- } catch (DatabaseError e) {
+ } catch (Database.DatabaseError e) {
ids = new ArrayList<string> ();
}
@@ -436,7 +436,7 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
try {
// FIXME: I think this needs to emit objDel events...
this.media_db.remove_by_id (id);
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
warning (_("Failed to remove entry: %s"), error.message);
}
}
@@ -503,7 +503,7 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
this.harvester.cancel (file);
try {
this.media_db.remove_by_id (MediaCache.get_id (file));
- } catch (DatabaseError error) {
+ } catch (Database.DatabaseError error) {
warning (_("Failed to remove entry: %s"), error.message);
}
}