[rygel] core: Add timestamp to exists function
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rygel] core: Add timestamp to exists function
- Date: Wed, 9 Sep 2009 20:39:23 +0000 (UTC)
commit 5d6ce989ae49d00a814b088da64853e610644af5
Author: Jens Georg <mail jensge org>
Date: Sun Jun 28 21:01:58 2009 +0200
core: Add timestamp to exists function
src/rygel/rygel-media-db.vala | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/rygel/rygel-media-db.vala b/src/rygel/rygel-media-db.vala
index 4208e03..5fa2edf 100644
--- a/src/rygel/rygel-media-db.vala
+++ b/src/rygel/rygel-media-db.vala
@@ -178,10 +178,10 @@ public class Rygel.MediaDB : Object {
"SELECT COUNT(upnp_id) FROM Object WHERE Object.parent = ?";
private const string OBJECT_EXISTS_STRING =
- "SELECT COUNT(upnp_id) FROM Object WHERE Object.upnp_id = ?";
+ "SELECT COUNT(upnp_id), timestamp FROM Object WHERE Object.upnp_id = ?";
private const string OBJECT_DELETE_STRING =
- "DELETE FROM Object where Object.upnp_id = ?";
+ "DELETE FROM Object WHERE Object.upnp_id = ?";
private const string SWEEPER_STRING =
"DELETE FROM Object WHERE parent IS NULL";
@@ -661,7 +661,7 @@ public class Rygel.MediaDB : Object {
return count;
}
- public bool exists (string object_id) {
+ public bool exists (string object_id, out int64 timestamp) {
Statement statement;
bool exists = false;
var rc = db.prepare_v2 (OBJECT_EXISTS_STRING,
@@ -672,6 +672,7 @@ public class Rygel.MediaDB : Object {
statement.bind_text (1, object_id);
while ((rc = statement.step ()) == Sqlite.ROW) {
exists = statement.column_int (0) == 1;
+ timestamp = statement.column_int64 (1);
break;
}
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]