summaryrefslogtreecommitdiffstats
path: root/binding
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-03-29 09:50:28 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-03-29 09:56:47 -0700
commit97f5b41e5cc778239ab1b4d7a20ae3c47a80bbb0 (patch)
tree95199cb93d31a443f4013a5ee03956a69fe82e72 /binding
parent1f8bc6cca7ca402e2359627d880be3df67bc28cb (diff)
binding: mediascanner: optimize audio sql query
Convert query to use INNER JOIN for the audios table Change-Id: I9c0b91ef4289ca66322aa805198873e4043f8f92 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding')
-rw-r--r--binding/media-manager.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/binding/media-manager.h b/binding/media-manager.h
index 200b43d..4b381dc 100644
--- a/binding/media-manager.h
+++ b/binding/media-manager.h
@@ -77,15 +77,15 @@ void DebugTraceSendMsg(int level, gchar* message);
#define AUDIO_SQL_QUERY \
"SELECT files.path, audios.title, audio_artists.name, " \
"audio_albums.name, audio_genres.name, audios.length " \
- "FROM files LEFT JOIN audios " \
+ "FROM files INNER JOIN audios " \
+ "ON files.id = audios.id " \
"LEFT JOIN audio_artists " \
"ON audio_artists.id = audios.artist_id " \
"LEFT JOIN audio_albums " \
"ON audio_albums.id = audios.album_id " \
"LEFT JOIN audio_genres " \
"ON audio_genres.id = audios.genre_id " \
- "WHERE audios.id = files.id " \
- "AND files.path LIKE '%s/%%' " \
+ "WHERE files.path LIKE '%s/%%' " \
"ORDER BY " \
"audios.artist_id, audios.album_id, audios.trackno"