summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2014-03-24 16:08:03 +0200
committerJens Georg <mail@jensge.org>2015-04-19 15:24:08 +0200
commit14cfc390e150144612ce10f23edb75344ed235f7 (patch)
tree224379bbfc9d85d9334dcf5d9250d6c12751f84e
parentce1bb3b6d27de12d705e134fad56ab0e3ec78bfb (diff)
downloadrygel-14cfc390e150144612ce10f23edb75344ed235f7.tar.gz
lms: add dtime=0 condition to all queries involving files table
-rw-r--r--src/plugins/lms/rygel-lms-album.vala8
-rw-r--r--src/plugins/lms/rygel-lms-albums.vala4
-rw-r--r--src/plugins/lms/rygel-lms-all-images.vala6
-rw-r--r--src/plugins/lms/rygel-lms-all-music.vala8
-rw-r--r--src/plugins/lms/rygel-lms-all-videos.vala6
-rw-r--r--src/plugins/lms/rygel-lms-image-year.vala6
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 8bba210f..9594614f 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 5a7bd32c..6810299d 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 d6f2624c..1bf219de 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 532f68b2..e9107eec 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 7f23be55..76084ae1 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 baa0f76c..b08cacd1 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);