jurialmunkey / plugin.video.themoviedb.helper

GNU General Public License v3.0
204 stars 96 forks source link

[Feature] MDBList support #741

Closed linaspurinis closed 5 months ago

linaspurinis commented 2 years ago

Hi, Since Trakt.tv is planning on enforcing personal list limits (https://github.com/trakt/api-help/discussions/350), would it be possible to add support for mdblist.com lists as an alternative for Trakt.tv personal lists?

To access the lists info, no API is needed, every list can be opened as a json file, for example: GUI version: https://mdblist.com/lists/linaspurinis/top-watched-movies-of-the-week-for-kids/ JSON version: https://mdblist.com/lists/linaspurinis/top-watched-movies-of-the-week-for-kids/json/

If some more info is needed within json file, it can be added, also MDBList can provide additional data inserted into json (if needed) or via API, to provide info as an alternative to OMDb.

Please let me know if you are interested.

dairefagan commented 2 years ago

I would love to see this feature implemented on TMBH and I am happy to help test or debug etc. MDBList is a really great platform and works so much quicker than Trakt when browsing lists etc.

jurialmunkey commented 2 years ago

If there's no api, how do you discover / navigate the lists? That is, how do you get a list of available lists and how do you search?

Without some way to navigate to the list, it isn't useful for a 10ft interface where you might not be able to access a Web browser or have a keyboard to type in addresses manually

drinfernoo commented 2 years ago

I did find this, but I don't know that it'll be super useful: https://mdblist.com/api/

Keywords seem nice, but it doesn't look like you can get a list of lists.

jurialmunkey commented 2 years ago

I did find this, but I don't know that it'll be super useful: https://mdblist.com/api/

Keywords seem nice, but it doesn't look like you can get a list of lists.

Yeah I saw that. Only searches for individual items and not lists so not much use, especially since the free tier is limited to 100 daily requests per key.

linaspurinis commented 2 years ago

Hi, free tier is 1000 requests per day, it was bumped some time ago. And I can add API for listing lists (this would not count towards requests limit). Just let me know what API calls you want.

jurialmunkey commented 2 years ago

Hi, free tier is 1000 requests per day, it was bumped some time ago. And I can add API for listing lists (this would not count towards requests limit). Just let me know what API calls you want.

Ah I didn't realise that you were the author! That's awesome. Yes some way to get lists of lists and to search lists would go a long way to making it easy to navigate from the couch.

Basically a way to get "lists by user", "top lists" and "search by name" would be the essentials. Very happy to add support if we can get those!

BTW - Just so that you are aware of the type of added usage we're talking about - My TMDB api key hits between 85,000 to 110,000 daily unique users (Mon to Thu it averages closer to 85k and then peaks around 110k Fri through Sun) with around 3 million daily requests.

linaspurinis commented 2 years ago

I'm not ready to challenge TMDb :) They should stay the main movie source, but lists integration would allow MDBLists users to integrate lists directly.

Following API endpoints were added:

/api/lists/user/ Provides list of API owner lists

/api/lists/user/id/ List of User Lists, by user_id

/api/lists/id/ List information by list_id

/api/lists/id/items/ List items by list_id

/api/lists/top TOP lists

/api/lists/search List search by name, parameter s=list_name

jurialmunkey commented 2 years ago

Awesome, I'm going to knock something together in the next few days.

I'm not ready to challenge TMDb :) They should stay the main movie source, but lists integration would allow MDBLists users to integrate lists directly.

Oh no definitely main info still from TMDb! I was more saying that with 85k+ daily users, 1000 free requests are not going to go far. Unless your API keys are actually individual client user ids that aren't meant to be linked to specific projects?

jurialmunkey commented 2 years ago

Okay basic browsing support added (v4.8.0) and appears to be working well.

I'm assuming api keys are actually client id keys and each user is expected to get their own. Users can add their personal api key in settings: TMDbHelper Settings > API Keys > MDbList API key

Adds an extra folder in the basedir called "MDbList" which has options for browsing "Top Lists", "User Lists", and "Search Lists".

I'll work on integrating the lists into the library update function soon.

linaspurinis commented 2 years ago

Thank you. Yes, the keys are client ids and would benefit users who create dynamic lists on the MDBList website and want to integrate them directly.

ambulancePilot commented 2 years ago

Does this mean that when I create a dynamic list on mdblist, I don't need to have the list added to Trakt? The list can just live on mdblist and TMDbH will grab it from there without hitting Trakt?

linaspurinis commented 2 years ago

Exactly, with new Trakt List limits, you will be able to use MDBLists directly.

adamosborne83 commented 2 years ago

This is BLOODY brilliant, as soon as it is linked into library I will be a happy happy man haha

adamosborne83 commented 2 years ago

Just added my mdblist API and all my lists are showing and working fab

adamosborne83 commented 2 years ago

OK, one thing I have noticed, it that it only shows as page 1 of 3, regardless to the amount of movies I may have ie, one list has over 4000

dairefagan commented 2 years ago

OK, one thing I have noticed, it that it only shows as page 1 of 3, regardless to the amount of movies I may have ie, one list has over 4000

Not sure if related to the exact issue you are experiencing but TMDBH has its own list limits so not too much pressure is put on services with API requests for metadata.

I will see if I can reproduce with lists within the limits.

linaspurinis commented 2 years ago

MDBList API currently does not support pagination and displays the full list in one request, if this is the issue and pagination is needed, I can add this to API.

adamosborne83 commented 2 years ago

MDBList API currently does not support pagination and displays the full list in one request, if this is the issue and pagination is needed, I can add this to API.

Just odd that on my movie lists there is over 4000 movies, but tmdb only shows 20 per page (expected) but only shows I have 3 pages..... BUT if I keep clicking next page it does carry on.

dairefagan commented 2 years ago

The limits I mentioned apply to library synced lists and not regular browsing of a non synced list as far as I know. Exactly what skin and view mode are your using? I tried a few options using Auramod and they do not display the page number at all, which I'm guessing is normal, otherwise it seems to work great.

jurialmunkey commented 2 years ago

OK, one thing I have noticed, it that it only shows as page 1 of 3, regardless to the amount of movies I may have ie, one list has over 4000

Kodi issue with what it considers a page.

To kodi, a "page" is the visible items on screen - so if a list has 21 items loaded and the skin displays 7 items on screen at a time then Kodi reports to the skin that there are three "pages" because it would take three presses on the scrollbar (or "pagedown" key) to reach the end of the visible items.

Each tmdbhelper "page" is actually an entirely separate plugin instance because Kodi does not have support for a rolling loading approach. Instead it requires all items to load at once, which if it were 4000 would take forever. To avoid that scenario, tmdbhelper caches the raw list data and splits into pages.

When you click on "next page" you're actually opening a subfolder in a separate plugin instance where the page parameter has been incremented by 1. Basically its like how you have a season folder inside a tvshow folder - but every page is a new nested subfolder. When you press back you're navigating back up the directory tree which gives you the previous "page" folder. So "next page" would be more accurately described as "next folder containing next 20 items from this list".

adamosborne83 commented 2 years ago

OK, one thing I have noticed, it that it only shows as page 1 of 3, regardless to the amount of movies I may have ie, one list has over 4000

Kodi issue with what it considers a page.

To kodi, a "page" is the visible items on screen - so if a list has 21 items loaded and the skin displays 7 items on screen at a time then Kodi reports to the skin that there are three "pages" because it would take three presses on the scrollbar (or "pagedown" key) to reach the end of the visible items.

Each tmdbhelper "page" is actually an entirely separate plugin instance because Kodi does not have support for a rolling loading approach. Instead it requires all items to load at once, which if it were 4000 would take forever. To avoid that scenario, tmdbhelper caches the raw list data and splits into pages.

When you click on "next page" you're actually opening a subfolder in a separate plugin instance where the page parameter has been incremented by 1. Basically its like how you have a season folder inside a tvshow folder - but every page is a new nested subfolder. When you press back you're navigating back up the directory tree which gives you the previous "page" folder. So "next page" would be more accurately described as "next folder containing next 20 items from this list".

OK, I'll shut up haha, as that makes perfect sense:-)

Hopefully you figure how to make it so you can add to library via mdblist with automatic updates etc

xyzfre commented 2 years ago

Just added my mdblist API and all my lists are showing and working fab

Is there a guide or a video anybody recommends on how to make a API for MDblist I tried Google and YouTube but couldn't find nothing to guide me the right way really appreciate any feedback and my apologies for asking in this thread I know it's meant for issues

dairefagan commented 2 years ago

Just added my mdblist API and all my lists are showing and working fab

Is there a guide or a video anybody recommends on how to make a API for MDblist I tried Google and YouTube but couldn't find nothing to guide me the right way really appreciate any feedback and my apologies for asking in this thread I know it's meant for issues

https://mdblist.com/preferences/

dairefagan commented 2 years ago

is there a way we can force a flush so that newly created personal lists appear other than deleting /database_v5/MDbList.db? I added my API, then created some new lists but I cannot get them to display under my lists on TMDbH. I waited until the lists were populated on MDbList and then I tried closing and re-opening Kodi. I also removed my API key, restarted Kodi, and then re-added the key but that made no difference. I noticed after removing the key before re-adding my lists were still in TMDbH.

jurialmunkey commented 2 years ago

is there a way we can force a flush so that newly created personal lists appear other than deleting /database_v5/MDbList.db? I added my API, then created some new lists but I cannot get them to display under my lists on TMDbH. I waited until the lists were populated on MDbList and then I tried closing and re-opening Kodi. I also removed my API key, restarted Kodi, and then re-added the key but that made no difference. I noticed after removing the key before re-adding my lists were still in TMDbH.

It should be cached daily. I was just worried with having only 1000 daily requests, it could quickly stack up if it was being refreshed everytime you enter -- but I think I'll need to remove the cache on those for this reason!

jurialmunkey commented 2 years ago

@dairefagan - v4.8.6 should deal with the refresh issue. It will force a refresh of the cache when entering page 1.