Aanok / jftui

Jellyfin Terminal User Interface
The Unlicense
149 stars 7 forks source link

"Next Up" display limited to 15 items? #39

Closed shimeike closed 1 year ago

shimeike commented 1 year ago

Thanks for this SW - it's great and I use it daily!

I think this may be the designed behaviour, but I'm not sure why this is the case. Display of "Next Up" items within jftui seems to be limited to 15 items. This limits the utility of the program, since "Next Up" becomes more useful when I have more TV shows on the go. There is no such limit of displayed items within "User Views", and even "Latest Added" displays 20 items, so I don't believe there should be a technical reason (unless it is server API related).

jftui version 0.6.2

Describe the bug Jellyfin web client contains 18 items in "Next Up" section. jftui only shows 15 items in "Next Up section.

To Reproduce Reach a point in Jellyfin database where there are more than 15 items shown in "Next Up" in the Jellyfin web client. Navigate to

Expected behavior "Next Up" section in jftui should show exactly the same items that are within the "Next Up" section of the Jellyfin web client.

I just checked the source code - it seems the behaviour is a hard-coded number that is easily removed.

diff --git a/src/menu.c b/src/menu.c
index c416202..96d7552 100755
--- a/src/menu.c
+++ b/src/menu.c
@@ -451,7 +451,7 @@ static char *jf_menu_item_get_remote_url(const jf_menu_item *item)
             break;
         case JF_ITEM_TYPE_MENU_NEXT_UP:
             jf_growing_buffer_sprintf(url_buffer, 0,
-                "/shows/nextup?userid=%s&limit=15",
+                "/shows/nextup?userid=%s",
                 g_options.userid);
             break;
         case JF_ITEM_TYPE_MENU_LATEST_ADDED:
Aanok commented 1 year ago

Hi! Glad you're liking jftui : )

You make a valid point: I have no recollection why I chose 15. The web client on my instance has 24 as limit, maybe it used to be different a while back and that's where it came from.

I think it should definitely be at least 24 but there's probably no harm in removing the limit altogether. I'll play with it a bit.

Aanok commented 1 year ago

I've removed the item count limit but I felt that there was still a need for a limitation for usability reasons, so I've replaced it with a filter for stuff you've been watching in the last solar year only.

This is the same filter governed on the Web UI by the Max days in 'Next Up' config under Display. I don't remember if 365 days is the default, but it felt reasonable. It's hardcoded for now, but I might make it configurable one day.