summaryrefslogtreecommitdiff
path: root/apps/tagtree.c
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-08-25 21:13:49 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-08-25 21:13:49 +0000
commit93bbd44ccc869f683772f1da65a9a27f51751ff5 (patch)
tree6ec6075e99bbe0ca0270495d4483a19742386577 /apps/tagtree.c
parent231adb4f7749d50e598ed70c38d742f62826107d (diff)
downloadrockbox-93bbd44ccc869f683772f1da65a9a27f51751ff5.zip
rockbox-93bbd44ccc869f683772f1da65a9a27f51751ff5.tar.gz
rockbox-93bbd44ccc869f683772f1da65a9a27f51751ff5.tar.bz2
rockbox-93bbd44ccc869f683772f1da65a9a27f51751ff5.tar.xz
Browse by year (now numeric tags are fully supported too).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10750 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tagtree.c')
-rw-r--r--apps/tagtree.c38
1 files changed, 28 insertions, 10 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c
index 70c8a3e..8b7182c 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -546,7 +546,7 @@ int retrieve_entries(struct tree_context *c, struct tagcache_search *tcs,
int namebufused = 0;
int total_count = 0;
int special_entry_count = 0;
- int extra = c->currextra;
+ int level = c->currextra;
int tag;
bool sort = false;
@@ -564,10 +564,10 @@ int retrieve_entries(struct tree_context *c, struct tagcache_search *tcs,
if (c->currtable == allsubentries)
{
tag = tag_title;
- extra--;
+ level--;
}
else
- tag = csi->tagorder[extra];
+ tag = csi->tagorder[level];
if (!tagcache_search(tcs, tag))
return -1;
@@ -575,13 +575,30 @@ int retrieve_entries(struct tree_context *c, struct tagcache_search *tcs,
/* Prevent duplicate entries in the search list. */
tagcache_search_set_uniqbuf(tcs, uniqbuf, UNIQBUF_SIZE);
- if (extra || csi->clause_count[0])
+ if (level || csi->clause_count[0] || tagcache_is_numeric_tag(tag))
sort = true;
- for (i = 0; i < extra; i++)
- tagcache_search_add_filter(tcs, csi->tagorder[i], csi->result_seek[i]);
-
- for (i = 0; i <= extra; i++)
+ for (i = 0; i < level; i++)
+ {
+ if (tagcache_is_numeric_tag(csi->tagorder[i]))
+ {
+ static struct tagcache_search_clause cc;
+
+ memset(&cc, 0, sizeof(struct tagcache_search_clause));
+ cc.tag = csi->tagorder[i];
+ cc.type = clause_is;
+ cc.numeric = true;
+ cc.numeric_data = csi->result_seek[i];
+ tagcache_search_add_clause(tcs, &cc);
+ }
+ else
+ {
+ tagcache_search_add_filter(tcs, csi->tagorder[i],
+ csi->result_seek[i]);
+ }
+ }
+
+ for (i = 0; i <= level; i++)
{
int j;
@@ -609,7 +626,7 @@ int retrieve_entries(struct tree_context *c, struct tagcache_search *tcs,
while (tagcache_get_next(tcs))
{
- struct display_format *fmt = &csi->format[extra];
+ struct display_format *fmt = &csi->format[level];
if (total_count++ < offset)
continue;
@@ -619,7 +636,8 @@ int retrieve_entries(struct tree_context *c, struct tagcache_search *tcs,
if (tag == tag_title || tag == tag_filename)
dptr->newtable = playtrack;
- if (!tcs->ramsearch || fmt->valid)
+ if (!tcs->ramsearch || fmt->valid
+ || tagcache_is_numeric_tag(tag))
{
char buf[MAX_PATH];
int buf_pos = 0;