jurialmunkey / plugin.video.themoviedb.helper

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

[Feature] Filters for lists #844

Closed matke-84 closed 2 years ago

matke-84 commented 2 years ago

Describe the feature that you'd like

There are a few things I'd like to see in tmdb heller but I'm not sure if they're possible.

  1. I would like it to be possible to filter the content of the list so that it doesn't show me movies that are currently in the cinema, that is, that don't exist in digital form. For example, in collection list, Avatar, it's nice that it shows me that it will have five sequels in the future, but there is only one currently. For example, a filter could be set as in the discover function, realise type (digital, physical, tv).
  2. I'm not sure if it already exists, but is there a way to somehow filter only the content that is in my local library. For example, I use the similar and recommended lists, and of course it throws out a random list with movies that are not even in my library. It would be really nice if it only returned results with local content, of course, if local content exists, if it doesn't exist, then the content from tmdb. A lot of people use a local library and don't use streaming.

Thanks in advance. ;-)

Why is this feature needed? What problem does it solve?

/

Steps to reproduce.

/

Screenshots and Additional Info

/

Checklist

jurialmunkey commented 2 years ago

4.11.6 should give you some tools for these types of filtering. You might need to refresh item details to see changes -- either individually or by deleting the item details cache.

(1) Release Types

New properties added:

Using discover will still be the best method for filtering by release type. However, if you need to use it on other lists you will now be able to combine these properties with filter params to get the desired effect.

For example: plugin://plugin.video.themoviedb.helper/?info=popular&tmdb_type=movie&filter_key=available_releases&filter_value=Digital&exclude_key=available_releases&exclude_value=is_empty ^^^ Gets first page of popular movies where a digital release is available

(2) Library Filtering

You should be able to filter lists by DBID now as long as you have the setting enabled to add Kodi library details

For example: plugin://plugin.video.themoviedb.helper/?info=popular&tmdb_type=movie&exclude_key=dbid&exclude_value=is_empty ^^^ Gets first page of popular movies list where movies are also in your library

Note: Obviously the TMDb server has no way to know what is in your library. Since results are pre-paginated from the server you could get anywhere from 0 to 20 matching items using this method.

Unless you have a massive library, you will only get at best a handful of hits using this method. Using online lists for local recommendations is not a great approach overall. It should really be handled by a separate plugin with its own recommendations algorithm for local data -- e.g. Embruary Helper has a "similar" list for library items but it is fairly simplistic. It just picks two random genres from the item and finds other library items with the same genres.

matke-84 commented 2 years ago

Wow. This was fast. Can I combine the filter like in the discover function? e.g. Theatrical+Digital+Physical+TV? I recalculated a bit how this function works. I thought that if I filtered digital realise, it would throw out everything available digitally. However, for example, matrix doesn't have a digital or physical version of movie in tmdb database, and then they release only the last sequel in collection. That's why I have to add on Theatrical. But it also does the job because it annoys me a little that it throws out movies that won't appear for a long time. Regarding the local library, also a good filter. I'll put it in the skin option, whoever has a larger database of movies can turn on this filter and that way it only throws out movies from his database.

jurialmunkey commented 2 years ago

Can I combine the filter like in the discover function? e.g. Theatrical+Digital+Physical+TV?

Latest commit should allow you to pipe separate exclude/filter values e.g.

filter_key=available_releases&filter_value=Theatrical|Digital|Physical|TV

Been meaning to add that for a while, so this was a good prompt. PS will also treat / as | so you can use it with things like $INFO[ListItem.Genre]

I recalculated a bit how this function works. I thought that if I filtered digital realise, it would throw out everything available digitally. However, for example, matrix doesn't have a digital or physical version of movie in tmdb database, and then they release only the last sequel in collection.

Yeah the release type data is bit spottier than I thought too - even for really big movies like Avatar or Matrix there's only theatrical for most countries

Maybe a possible different approach is to check for providers. If there's a provider then we can assume that there's a digital release of some sort. e.g.

&exclude_key=providers&exclude_value=is_empty

That should do the trick in terms of only including items that have a provider. Also has the benefit that it only needs exclude. So it leaves filter available for other things like genres or directors.

matke-84 commented 2 years ago

Hmmm. Something is wrong. For example for the avatar now that I use plugin://plugin.video.themoviedb.helper?info=collection&type=movie&query=$INFO[ListItem.Set]&filter_key=available_releases&filter_value=Theatrical|Digital|Physical|TV it doesn't filter anything. I deleted cache.

matke-84 commented 2 years ago

Sorry this is the full code. plugin://plugin.video.themoviedb.helper?info=collection&type=movie&query=$INFO[ListItem.Set]&filter_key=available_releases&filter_value=Theatrical|Digital|Physical|TV&exclude_key=available_releases&exclude_value=is_empty

matke-84 commented 2 years ago

Yeah the release type data is bit spottier than I thought too - even for really big movies like Avatar or Matrix there's only theatrical for most countries

Maybe a possible different approach is to check for providers. If there's a provider then we can assume that there's a digital release of some sort. e.g.

&exclude_key=providers&exclude_value=is_empty

That should do the trick in terms of only including items that have a provider. Also has the benefit that it only needs exclude. So it leaves filter available for other things like genres or directors.

This is very interesting. I really need this for genres. Only if you can explain to me what it actually filters. Only what is on streaming services? What happens to the content that is shown on TV or to the content that is only on physical media that is not in digital form? My idea is that the skin only displays content that can be played via Kodi. That's why I need these filters.

jurialmunkey commented 2 years ago

The providers data comes from JustWatch. https://www.justwatch.com/

It's basically a website that lists all the digital content providers in the region that have the item available. e.g. It will have streamers like Netflix but it will also have stores like Amazon, Microsoft, and Google Play where you can rent or buy single digital items and also TV network streaming services (e.g. in Australia it lists all the catch-up tv type streaming platforms for our free-to-air channels). It also has some more niche services like Curiosity Stream and Plex etc.

It isn't going to be perfect but considering how much of a wide range of services it covers, generally if something has been released digital then it will have a provider. It's probably going to be a better indicator that something is watchable on Kodi rather than relying on TMDb release data.

jurialmunkey commented 2 years ago

plugin://plugin.video.themoviedb.helper?info=collection&type=movie&query=$INFO[ListItem.Set]&filter_key=available_releases&filter_value=Theatrical|Digital|Physical|TV&exclude_key=available_releases&exclude_value=is_empty

query= is wrong. You need to pass a movie name not a set name.

matke-84 commented 2 years ago

query= is wrong. You need to pass a movie name not a set name.

But I actually need it for sets in this line.

jurialmunkey commented 2 years ago

query= is wrong. You need to pass a movie name not a set name.

But I actually need it for sets in this line.

Yeah sorry. Missed that it was for the collections path.

Just tested and that path is working fine for me. Make sure you are on latest master version of git. I didn't make a release zip of that change -- I'll add one soon - it's just that release tags are linked to my repo update automation and I don't like to make too many releases in one day since it triggers my repo to rebuild.

matke-84 commented 2 years ago

Checked and downloaded zip twice. Deleted cache. I don't know why it doesn't work for me. bug

matke-84 commented 2 years ago

I've tried everything. It definitely doesn't work when I put more than one filter. In which scenario it works for you. I'm trying this in the dialog video info.

matke-84 commented 2 years ago

I think I know why it works for you. Because your option "hide unaired movies" is on. In fact, new line doesn't filter anything but the old option, which I honestly completely forgot about. Check if it is turned on, if so, turn it off and then try it.

matke-84 commented 2 years ago

These &exclude_key=providers&exclude_value=is_empty don't go well with this. &nextpage=false&fanarttv=false&cacheonly=true In fact, I think there is some conflict with cacheonly. It manifests itself by showing only a couple of movies and others it doesn't show, are well-known titles and they are available in digital form and https://www.justwatch.com/.

jurialmunkey commented 2 years ago

cacheonly=true forces skipping the detailed item lookup from TMDb and will only retrieve details if already previously cached to disk from a different list. It forces the plugin to rely on the basic details that come directly with the list.

If you are using this param then none of these filters will work as expected because you are not downloading this information you are filtering against.

matke-84 commented 2 years ago

I think I know why it works for you. Because your option "hide unaired movies" is on. In fact, new line doesn't filter anything but the old option, which I honestly completely forgot about. Check if it is turned on, if so, turn it off and then try it.

Did you check this? I didn't use cacheonly here, but combination of filters with "|" still doesn't work.

jurialmunkey commented 2 years ago

Fix incoming soon. I see what the issue is.

jurialmunkey commented 2 years ago

^^^ Okay that should fix it pretty sure.

Also I realised the pipe messes with things depending on how the path is passed -- which I think might've been why I was seeing different results even with after disabling hide unaired. So I've removed the pipe separator. Just use the standard / separator instead (make sure it has a space on either side)

plugin://plugin.video.themoviedb.helper?info=collection&type=movie&query=$INFO[ListItem.Set]&filter_key=available_releases&filter_value=Theatrical / Digital / Physical / TV&exclude_key=available_releases&exclude_value=is_empty

^^^ This worked for me properly with hide unaired off. Let me know if the latest version fixes things for you.

matke-84 commented 2 years ago

It works now. Thanks. :-) I often get this error. I know that with a free omdb api key, daily limit is only 1000. But it seems to me that even if I don't start using kodi, I get this error and so on several times a day. Is it a problem with the server due to too many requests or something else. I didn't have this problem with the skin helper service. Can we somehow turn off this annoying message?

2022-09-04 12:46:33.977 T:9624     INFO <general>: [plugin.video.themoviedb.helper]
                                                   ConnectionTimeOut: HTTPSConnectionPool(host='www.omdbapi.com', port=443): Read timed out. (read timeout=15)
matke-84 commented 2 years ago

It works now. Thanks. :-) I often get this error. I know that with a free omdb api key, daily limit is only 1000. But it seems to me that even if I don't start using kodi, I get this error and so on several times a day. Is it a problem with the server due to too many requests or something else. I didn't have this problem with the skin helper service. Can we somehow turn off this annoying message?

2022-09-04 12:46:33.977 T:9624     INFO <general>: [plugin.video.themoviedb.helper]
                                                   ConnectionTimeOut: HTTPSConnectionPool(host='www.omdbapi.com', port=443): Read timed out. (read timeout=15)

Should i open a new issue for this? Is there any way I can get rid of this annoying message.