henryjfry / repository.thenewdiamond

9 stars 4 forks source link

Default TV Show Fancy GUI #19

Closed nebulous42069 closed 1 year ago

nebulous42069 commented 1 year ago

Wondering if you would agree with this. When you open the "All TV Shows" fancy GUI, the default listing is Popular TV shows, but all of them seem to be foreign. If you select the sideblade/Filters and choose English it shows more relevant shows (I would think to most people). Would it make sense to show that as default?

henryjfry commented 1 year ago

I just added this in version 7.71

You can setup a set of filters in the plugin URL:

I’ve added something to the addon that you can add a custom filter to the plugin url and it will setup the filter?

So I will push this to the addon soon but the way it works, ive setup this path “url_encode_test”:


kodi-send --action='RunScript(script.extendedinfo,info=url_encode_test)'

Which you can use to get your filter parameters in the correct format, so in the code it does:

                from urllib.parse import quote

                meta_filters = "{'filters' : {'sort': 'desc', 'sort_string': 'popularity', 'without_genres': ['horror','reality','documentary'], 'genre_mode': 'OR', 'with_original_language': 'en' } }"

                meta_filters = quote(meta_filters)

                xbmc.log(str(meta_filters)+'===>META_FILTERS', level=xbmc.LOGINFO)

Which outputs the URL encoded filter parameters or you can go here:

https://www.urlencoder.org/

And it produces for the above:

%7B%27filters%27%20%3A%20%7B%27sort%27%3A%20%27desc%27%2C%20%27sort_string%27%3A%20%27popularity%27%2C%20%27without_genres%27%3A%20%5B%27horror%27%2C%27reality%27%2C%27documentary%27%5D%2C%20%27genre_mode%27%3A%20%27OR%27%2C%20%27with_original_language%27%3A%20%27en%27%20%7D%20%7D

Then if you setup a favourite:


<favourite name="All Movies" thumb="special://home/addons/script.extendedinfo/resources/skins/Default/media/tmdb/thumb.png">RunScript(script.extendedinfo,info=allmovies,meta_filter=%7B%27filters%27%20%3A%20%7B%27sort%27%3A%20%27desc%27%2C%20%27sort_string%27%3A%20%27popularity%27%2C%20%27without_genres%27%3A%20%5B%27horror%27%2C%27reality%27%2C%27documentary%27%5D%2C%20%27genre_mode%27%3A%20%27OR%27%2C%20%27with_original_language%27%3A%20%27en%27%20%7D%20%7D)</favourite>

Ie:


RunScript(script.extendedinfo,info=allmovies,meta_filter=%7B%27filters%27%20%3A%20%7B%27sort%27%3A%20%27desc%27%2C%20%27sort_string%27%3A%20%27popularity%27%2C%20%27without_genres%27%3A%20%5B%27horror%27%2C%27reality%27%2C%27documentary%27%5D%2C%20%27genre_mode%27%3A%20%27OR%27%2C%20%27with_original_language%27%3A%20%27en%27%20%7D%20%7D)

It will run with the designated filters.

So an example with the full list of filters available:


meta_filter = {'filters' : 
{'sort': 'desc', 
'sort_string': 'revenue', 
'with_genres': ['action','comedy'], 
'genre_mode': 'OR', 
'without_genres': ['horror','reality','documentary'], 'with_original_language': 'en', 
'vote_count.gte': '10', 
'vote_count.lte': '10 000 000', 
'with_original_language': 'en',
'lower_year': '1990', 
'upper_year': '1999' 
} 
}

sort => asc/desc


SORTS = {

    'movie': { ['popularity', 'vote_average', 'vote_count', 'release_date', 'revenue' , 'original_title']},

    'tv': {['popularity', 'vote_average', 'vote_count','first_air_date']},

        }

LANGUAGES = [

   {'id': 'bg', 'name': 'Bulgarian'},

    {'id': 'cs', 'name': 'Czech'},

    {'id': 'da', 'name': 'Danish'},

    {'id': 'de', 'name': 'German'},

    {'id': 'el', 'name': 'Greek'},

    {'id': 'en', 'name': 'English'},

    {'id': 'es', 'name': 'Spanish'},

    {'id': 'fi', 'name': 'Finnish'},

    {'id': 'fr', 'name': 'French'},

    {'id': 'he', 'name': 'Hebrew'},

    {'id': 'hi', 'name': 'Hindi'},

    {'id': 'hr', 'name': 'Croatian'},

    {'id': 'hu', 'name': 'Hungarian'},

    {'id': 'it', 'name': 'Italian'},

    {'id': 'ja', 'name': 'Japanese'},

    {'id': 'ko', 'name': 'Korean'},

    {'id': 'nl', 'name': 'Dutch'},

    {'id': 'no', 'name': 'Norwegian'},

    {'id': 'pl', 'name': 'Polish'},

    {'id': 'pt', 'name': 'Portuguese'},

    {'id': 'ru', 'name': 'Russian'},

    {'id': 'sl', 'name': 'Slovenian'},

    {'id': 'sv', 'name': 'Swedish'},

    {'id': 'tr', 'name': 'Turkish'},

    {'id': 'zh', 'name': 'Chinese'}

]
henryjfry commented 1 year ago

So a favourite for all TV shows in English:

<favourite name="All TV Shows English" thumb="special://home/addons/script.extendedinfo/resources/skins/Default/media/tmdb/thumb.png">RunScript(script.extendedinfo,info=alltvshows,meta_filter=%7B%27filters%27%20%3A%20%7B%20%27with_original_language%27%3A%20%27en%27%7D%20%7D%0A)</favourite>
{'filters' : { 'with_original_language': 'en'} }
nebulous42069 commented 1 year ago

So a favourite for all TV shows in English:

<favourite name="All TV Shows English" thumb="special://home/addons/script.extendedinfo/resources/skins/Default/media/tmdb/thumb.png">RunScript(script.extendedinfo,info=alltvshows,meta_filter=%7B%27filters%27%20%3A%20%7B%20%27with_original_language%27%3A%20%27en%27%7D%20%7D%0A)</favourite>
{'filters' : { 'with_original_language': 'en'} }

Thank you! That works well. Ill save that shortcut. Thanks for the help!

nebulous42069 commented 1 year ago

BTW, the URL encoder had me thinking. Have you ever looked into making players for TMDBH? I know so many of the current players have some kind of issue and seems to have a lack of support.

henryjfry commented 1 year ago

I've fixed or otherwise modified player files myself but only for add-ons that I use. But if a player stops working it'll be due to addon changes so you kind of need to know what those are to be able to fix them. The tmdbhelper side of things likely hasn't changed much or at all for many versions.

It's normally not too hard to fix a player if it stops working but you do need the add-on installed.

And I don't particularly have much appetite to install add-ons I don't use just to fix player files.