diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lang/english.lang | 15 | ||||
-rw-r--r-- | apps/tagtree.c | 18 |
2 files changed, 30 insertions, 3 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 2589576c14..2eadfc4d1a 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -11512,4 +11512,17 @@ | |||
11512 | ipodvideo: "Treble Cutoff" | 11512 | ipodvideo: "Treble Cutoff" |
11513 | </voice> | 11513 | </voice> |
11514 | </phrase> | 11514 | </phrase> |
11515 | 11515 | <phrase> | |
11516 | id: LANG_TAGNAVI_RANDOM | ||
11517 | desc: "<Random>" entry in tag browser | ||
11518 | user: | ||
11519 | <source> | ||
11520 | *: "<Random>" | ||
11521 | </source> | ||
11522 | <dest> | ||
11523 | *: "<Random>" | ||
11524 | </dest> | ||
11525 | <voice> | ||
11526 | *: "Random" | ||
11527 | </voice> | ||
11528 | </phrase> | ||
diff --git a/apps/tagtree.c b/apps/tagtree.c index 8298fe24ae..d394491960 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c | |||
@@ -1136,7 +1136,15 @@ static int retrieve_entries(struct tree_context *c, struct tagcache_search *tcs, | |||
1136 | dptr++; | 1136 | dptr++; |
1137 | current_entry_count++; | 1137 | current_entry_count++; |
1138 | } | 1138 | } |
1139 | special_entry_count++; | 1139 | if (offset <= 1) |
1140 | { | ||
1141 | dptr->newtable = navibrowse; | ||
1142 | dptr->name = str(LANG_TAGNAVI_RANDOM); | ||
1143 | dptr->extraseek = -1; | ||
1144 | dptr++; | ||
1145 | current_entry_count++; | ||
1146 | } | ||
1147 | special_entry_count+=2; | ||
1140 | } | 1148 | } |
1141 | 1149 | ||
1142 | total_count += special_entry_count; | 1150 | total_count += special_entry_count; |
@@ -1374,8 +1382,14 @@ int tagtree_enter(struct tree_context* c) | |||
1374 | dptr = tagtree_get_entry(c, c->selected_item); | 1382 | dptr = tagtree_get_entry(c, c->selected_item); |
1375 | 1383 | ||
1376 | c->dirfull = false; | 1384 | c->dirfull = false; |
1385 | seek = dptr->extraseek; | ||
1386 | if (seek == -1) | ||
1387 | { | ||
1388 | srand(current_tick); | ||
1389 | dptr = (tagtree_get_entry(c, 2+(rand() % (c->filesindir-2)))); | ||
1390 | seek = dptr->extraseek; | ||
1391 | } | ||
1377 | newextra = dptr->newtable; | 1392 | newextra = dptr->newtable; |
1378 | seek = dptr->extraseek; | ||
1379 | 1393 | ||
1380 | if (c->dirlevel >= MAX_DIR_LEVELS) | 1394 | if (c->dirlevel >= MAX_DIR_LEVELS) |
1381 | return 0; | 1395 | return 0; |