aboutsummaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
Diffstat (limited to 'c')
-rw-r--r--c/episodelistview.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/c/episodelistview.c b/c/episodelistview.c
index 1afee3e..843ef78 100644
--- a/c/episodelistview.c
+++ b/c/episodelistview.c
@@ -164,12 +164,20 @@ ElvSelectRecent()
P("track_episodes","most_recently_watched",1,t) goto s;
GI(t,&iEpisode) return;
- i = 0;
lvfi.flags = LVFI_PARAM;
lvfi.lParam = iEpisode;
+ i = 0;
while ((iItem = ListView_FindItem(HElv, -1, &lvfi)) == -1 && i++ < 100)
lvfi.lParam = ++iEpisode;
- if (iItem == -1) return;
+ if (iItem != -1) goto s;
+
+ iEpisode -= 100;
+ lvfi.lParam = iEpisode;
+ i = 0;
+ while ((iItem = ListView_FindItem(HElv, -1, &lvfi)) == -1 && i++ < 100)
+ lvfi.lParam = --iEpisode;
+ if (iItem != -1) goto s;
+ return;
s: ListView_SetItemState(HElv, -1, LVIF_STATE, LVIS_SELECTED);
ElvSetTop(iItem > 5? iItem-5: 0);