[rygel/wip/lms-tizen: 378/384] lms: add dtime=0 condition to all queries involving files table



commit 14cfc390e150144612ce10f23edb75344ed235f7
Author: Alexander Kanavin <alex kanavin gmail com>
Date:   Mon Mar 24 16:08:03 2014 +0200

    lms: add dtime=0 condition to all queries involving files table

 src/plugins/lms/rygel-lms-album.vala      |    8 ++++----
 src/plugins/lms/rygel-lms-albums.vala     |    4 ++--
 src/plugins/lms/rygel-lms-all-images.vala |    6 +++---
 src/plugins/lms/rygel-lms-all-music.vala  |    8 ++++----
 src/plugins/lms/rygel-lms-all-videos.vala |    6 +++---
 src/plugins/lms/rygel-lms-image-year.vala |    6 +++---
 6 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/src/plugins/lms/rygel-lms-album.vala b/src/plugins/lms/rygel-lms-album.vala
index 8bba210..9594614 100644
--- a/src/plugins/lms/rygel-lms-album.vala
+++ b/src/plugins/lms/rygel-lms-album.vala
@@ -34,13 +34,13 @@ public class Rygel.LMS.Album : Rygel.LMS.CategoryContainer {
         "ON audios.artist_id = audio_artists.id " +
         "LEFT JOIN audio_albums " +
         "ON audios.album_id = audio_albums.id " +
-        "WHERE audios.id = files.id AND audios.album_id = %s " +
+        "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = %s " +
         "LIMIT ? OFFSET ?;";
 
     private static const string SQL_COUNT_TEMPLATE =
         "SELECT COUNT(audios.id) " +
         "FROM audios, files " +
-        "WHERE audios.id = files.id AND audios.album_id = %s;";
+        "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = %s;";
 
     private static const string SQL_COUNT_WITH_FILTER_TEMPLATE =
         "SELECT COUNT(audios.id), audios.title as title, " +
@@ -51,7 +51,7 @@ public class Rygel.LMS.Album : Rygel.LMS.CategoryContainer {
         "ON audios.artist_id = audio_artists.id " +
         "LEFT JOIN audio_albums " +
         "ON audios.album_id = audio_albums.id " +
-        "WHERE audios.id = files.id AND audios.album_id = %s;";
+        "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = %s;";
 
     private static const string SQL_FIND_OBJECT_TEMPLATE =
         "SELECT files.id, files.path, files.size, " +
@@ -63,7 +63,7 @@ public class Rygel.LMS.Album : Rygel.LMS.CategoryContainer {
         "ON audios.artist_id = audio_artists.id " +
         "LEFT JOIN audio_albums " +
         "ON audios.album_id = audio_albums.id " +
-        "WHERE files.id = ? AND audios.id = files.id AND audios.album_id = %s;";
+        "WHERE dtime = 0 AND files.id = ? AND audios.id = files.id AND audios.album_id = %s;";
 
     protected override MediaObject? object_from_statement (Statement statement) {
         var id = statement.column_int (0);
diff --git a/src/plugins/lms/rygel-lms-albums.vala b/src/plugins/lms/rygel-lms-albums.vala
index 5a7bd32..6810299 100644
--- a/src/plugins/lms/rygel-lms-albums.vala
+++ b/src/plugins/lms/rygel-lms-albums.vala
@@ -60,7 +60,7 @@ public class Rygel.LMS.Albums : Rygel.LMS.CategoryContainer {
         "FROM audios, files, audio_albums " +
         "LEFT JOIN audio_artists " +
         "ON audios.artist_id = audio_artists.id " +
-        "WHERE audios.id = files.id AND audios.album_id = audio_albums.id %s;";
+        "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = audio_albums.id %s;";
 
     /* select songs inside albums */
     private static const string SQL_CHILD_ALL_WITH_FILTER_TEMPLATE =
@@ -71,7 +71,7 @@ public class Rygel.LMS.Albums : Rygel.LMS.CategoryContainer {
         "FROM audios, files, audio_albums " +
         "LEFT JOIN audio_artists " +
         "ON audios.artist_id = audio_artists.id " +
-        "WHERE audios.id = files.id AND audios.album_id = audio_albums.id %s " +
+        "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = audio_albums.id %s " +
         "LIMIT ? OFFSET ?;";
 
 
diff --git a/src/plugins/lms/rygel-lms-all-images.vala b/src/plugins/lms/rygel-lms-all-images.vala
index d6f2624..1bf219d 100644
--- a/src/plugins/lms/rygel-lms-all-images.vala
+++ b/src/plugins/lms/rygel-lms-all-images.vala
@@ -27,18 +27,18 @@ public class Rygel.LMS.AllImages : Rygel.LMS.CategoryContainer {
     private static const string SQL_ALL =
         "SELECT images.id, title, artist, date, width, height, path, size, dlna_profile, dlna_mime " +
         "FROM images, files " +
-        "WHERE images.id = files.id " +
+        "WHERE dtime = 0 AND images.id = files.id " +
         "LIMIT ? OFFSET ?;";
 
     private static const string SQL_COUNT =
         "SELECT count(images.id) " +
         "FROM images, files " +
-        "WHERE images.id = files.id;";
+        "WHERE dtime = 0 AND images.id = files.id;";
 
     private static const string SQL_FIND_OBJECT =
         "SELECT images.id, title, artist, date, width, height, path, size, dlna_profile, dlna_mime " +
         "FROM images, files " +
-        "WHERE files.id = ? AND images.id = files.id;";
+        "WHERE dtime = 0 AND files.id = ? AND images.id = files.id;";
 
     protected override MediaObject? object_from_statement (Statement statement) {
         var id = statement.column_int(0);
diff --git a/src/plugins/lms/rygel-lms-all-music.vala b/src/plugins/lms/rygel-lms-all-music.vala
index 532f68b..e9107ee 100644
--- a/src/plugins/lms/rygel-lms-all-music.vala
+++ b/src/plugins/lms/rygel-lms-all-music.vala
@@ -38,13 +38,13 @@ public class Rygel.LMS.AllMusic : Rygel.LMS.CategoryContainer {
         "ON audios.album_id = audio_albums.id " +
         "LEFT JOIN audio_genres " +
         "ON audios.genre_id = audio_genres.id " +
-        "WHERE audios.id = files.id %s " +
+        "WHERE dtime = 0 AND audios.id = files.id %s " +
         "LIMIT ? OFFSET ?;";
 
     private static const string SQL_COUNT =
         "SELECT COUNT(audios.id) " +
         "FROM audios, files " +
-        "WHERE audios.id = files.id;";
+        "WHERE dtime = 0 AND audios.id = files.id;";
 
     private static const string SQL_COUNT_WITH_FILTER_TEMPLATE =
         "SELECT COUNT(audios.id), audios.title as title, " +
@@ -52,7 +52,7 @@ public class Rygel.LMS.AllMusic : Rygel.LMS.CategoryContainer {
         "FROM audios, files " +
         "LEFT JOIN audio_artists " +
         "ON audios.artist_id = audio_artists.id " +
-        "WHERE audios.id = files.id %s;";
+        "WHERE dtime = 0 AND audios.id = files.id %s;";
 
     private static const string SQL_FIND_OBJECT =
         "SELECT files.id, files.path, files.size, " +
@@ -68,7 +68,7 @@ public class Rygel.LMS.AllMusic : Rygel.LMS.CategoryContainer {
         "ON audios.album_id = audio_albums.id " +
         "LEFT JOIN audio_genres " +
         "ON audios.genre_id = audio_genres.id " +
-        "WHERE files.id = ? AND audios.id = files.id;";
+        "WHERE dtime = 0 AND files.id = ? AND audios.id = files.id;";
 
     protected override string get_sql_all_with_filter (string filter) {
         if (filter.length == 0) {
diff --git a/src/plugins/lms/rygel-lms-all-videos.vala b/src/plugins/lms/rygel-lms-all-videos.vala
index 7f23be5..76084ae 100644
--- a/src/plugins/lms/rygel-lms-all-videos.vala
+++ b/src/plugins/lms/rygel-lms-all-videos.vala
@@ -27,18 +27,18 @@ public class Rygel.LMS.AllVideos : Rygel.LMS.CategoryContainer {
     private static const string SQL_ALL =
         "SELECT videos.id, title, artist, length, path, mtime, size, dlna_profile, dlna_mime " +
         "FROM videos, files " +
-        "WHERE videos.id = files.id " +
+        "WHERE dtime = 0 AND videos.id = files.id " +
         "LIMIT ? OFFSET ?;";
 
    private static const string SQL_COUNT =
         "SELECT count(videos.id) " +
         "FROM videos, files " +
-        "WHERE videos.id = files.id;";
+        "WHERE dtime = 0 AND videos.id = files.id;";
 
     private static const string SQL_FIND_OBJECT =
         "SELECT videos.id, title, artist, length, path, mtime, size, dlna_profile, dlna_mime " +
         "FROM videos, files " +
-        "WHERE files.id = ? AND videos.id = files.id;";
+        "WHERE dtime = 0 AND files.id = ? AND videos.id = files.id;";
 
     protected override MediaObject? object_from_statement (Statement statement) {
         var id = statement.column_int(0);
diff --git a/src/plugins/lms/rygel-lms-image-year.vala b/src/plugins/lms/rygel-lms-image-year.vala
index baa0f76..b08cacd 100644
--- a/src/plugins/lms/rygel-lms-image-year.vala
+++ b/src/plugins/lms/rygel-lms-image-year.vala
@@ -27,18 +27,18 @@ public class Rygel.LMS.ImageYear : Rygel.LMS.CategoryContainer {
     private static const string SQL_ALL_TEMPLATE =
         "SELECT images.id, title, artist, date, width, height, path, size, dlna_profile, dlna_mime, 
strftime('%Y', date, 'unixepoch') as year " +
         "FROM images, files " +
-        "WHERE images.id = files.id AND year = '%s' " +
+        "WHERE dtime = 0 AND images.id = files.id AND year = '%s' " +
         "LIMIT ? OFFSET ?;";
 
     private static const string SQL_COUNT_TEMPLATE =
         "SELECT count(images.id), strftime('%Y', date, 'unixepoch') as year " +
         "FROM images, files " +
-        "WHERE images.id = files.id AND year = '%s';";
+        "WHERE dtime = 0 AND images.id = files.id AND year = '%s';";
 
     private static const string SQL_FIND_OBJECT_TEMPLATE =
         "SELECT images.id, title, artist, date, width, height, path, size, dlna_profile, dlna_mime, 
strftime('%Y', date, 'unixepoch') as year " +
         "FROM images, files " +
-        "WHERE files.id = ? AND images.id = files.id AND year = '%s';";
+        "WHERE dtime = 0 AND files.id = ? AND images.id = files.id AND year = '%s';";
 
     protected override MediaObject? object_from_statement (Statement statement) {
         var id = statement.column_int(0);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]