diff options
author | Kjetil Ørbekk <orbekk@pvv.ntnu.no> | 2008-08-13 20:22:02 +0200 |
---|---|---|
committer | Kjetil Ørbekk <orbekk@pvv.ntnu.no> | 2008-08-13 20:22:02 +0200 |
commit | 62bfd37585fb26c5bfcd9da02a0b6fd6f268b118 (patch) | |
tree | d596a960e28e63f250d9f298a9ccfe11acb2fc6b | |
parent | cb917dfb18fbc76e1d25cc3e3fcee511a5d40f91 (diff) |
- Adding track number on Artist browsing
(Too much SQL magic!)
-rw-r--r-- | src/mp3_subr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mp3_subr.c b/src/mp3_subr.c index 80186c0..2e6ad7a 100644 --- a/src/mp3_subr.c +++ b/src/mp3_subr.c @@ -434,7 +434,8 @@ mp3_file_data_for_path(const char *path, void *data) { } lh = mp3_lookup_start(0, fd, mp3_lookup_open, "SELECT filepath FROM song WHERE artistname LIKE ? AND " - "album LIKE ? AND (title||'.'||extension) LIKE ?"); + "album LIKE ? AND " + "(LTRIM(track||' ')||title||'.'||extension) LIKE ?"); if (lh == NULL) return (-EIO); mp3_lookup_insert(lh, artist, LIST_DATATYPE_STRING); @@ -586,7 +587,8 @@ mp3_lookup_artist(const char *path, struct filler_data *fd) if (album == NULL) break; lh = mp3_lookup_start(0, fd, mp3_lookup_list, - "SELECT title ||'.'|| extension FROM song, artist " + "SELECT LTRIM(track||' ')||title||'.'||extension " + "FROM song, artist " "WHERE song.artistname = artist.name AND artist.name " "LIKE ? AND song.album LIKE ?"); mp3_lookup_insert(lh, name, LIST_DATATYPE_STRING); |