jurialmunkey / plugin.video.themoviedb.helper

GNU General Public License v3.0
200 stars 95 forks source link

[Feature] GUI for selecting default player for .strm and automated player selection based on watch providers #401

Closed unkn0wn234 closed 1 year ago

unkn0wn234 commented 3 years ago

So I know from earlier conversations with you jurial that I can add "ignore_default=true" to a .strm to make it ignore any default player ive set in TMDB and always open a player dialog. So technically I could just add this to every .strm in question and then choose the other player manually but I was wondering is there a parameter i can add to a tmdb helper .strm to make it default to a specific player? something like "player=whateverplayer.json" ?

For example if i added Mandalorian to my library through TMDBHelper and my default players are Netflix, could i add something to each Mandalorian episode to make only Mandalorian episodes to use Disney player rather than the Play with function/ignore_default and going down and clicking disney? Granted its not a big deal but just a cool idea to help automate things even further. "player=disney.json" would then make mandalorian episodes use Disney at default while unaffecting my default Netflix player, and other shows and movies.

Also these next things are somewhat feature requests/ideas of implementation expanding on this.

Going under the assumption all this is possible/doable Idea 1: When you add a show/movie to a library a dialog would pop up asking if you would like to set a default player for this show/movie and if u choose yes, brings up the player dialog, when you press Netflix, it would add player=netflix.json to the movie.strm/every episode .strm. (This makes it so you wouldnt have to manually add player=netflix.json to each and every episode .strm manually especially useful for shows with many seasons)

Idea 1b: (I just thought that if this was applied to a list it would be very annoying for it to pop up on every show/movie over and over so...) When you add a list to library, the dialog would come up saying would u like to choose default players for content in this list. Then when you press yes "it would show all the movies/show in a text only dialog" So say Movies through 1-10 and Shows 1-10, in the dialog i select Movie 2,3,5 and Show, 1,2,4 and they get highlighted, I would press next and then the Player dialog would show up for Movie 2, i choose player, then Movie 3, 5, Show 1,2,4 and so on as u choose the movies and shows u wanted to select players for. After this it would add all the stuff in the list with only Movie 2,3,5 Show 1,2,4 having players set for them while the rest are unaffected.

Idea 2: For shows/movies maybe you could implement a feature that in the folder for each show/movie where the .nfo would be, something like a config.txt/json with specific settings for that movie/show so others are not affected. So for example back to Mandalorian instead of the popup idea, or manually adding player=disney.json to every .strm. In the folder structure which would be

Tv Shows ---The Mandalorian -----tv show.nfo -----config.txt -------Season 1 -------Season 2

You would add player=disney.json to the config.txt, or ignore_default=true or whatever other parameters specific for that movie or show. And whenever TMDB Helper show/episode is played from the library it would scan the source folder of the show/movie real quick to see if there is a config.txt, and if there is apply the parameters from it, if not then use the default addon settings (default being whatever settings u already have enabled in the addons not the base addon). So with the config.txt saying player=disney.json, it would play with disney, without it it would play with my default netflix player that I set. This would also make it so u wouldnt have to manually add player=disney to each and every .strm for mandalorian or any other show in question

Though again im a noob with this stuff so im just giving ideas/my thoughts if its unrealistic or very difficult then that's fine I am not expecting you to break your break over my feature request haha but a reply on your thoughts, the possibility of this and the parameter i could put in myself if possible would be appreciated.

Would like to hear your thoughts on this :)

jurialmunkey commented 3 years ago

I like this idea and it is similar to a feature I have planned: TMDb very recently (in November) added a watch/providers call to their API which makes it possible to retrieve a list of providers that have the movie/show available to stream/buy in each country. So I'm currently looking at ways to use that info to have TMDbHelper automatically determine which player to use without any prompts at all -- e.g. if you had Netflix and Disney+ installed but not Amazon Prime then TMDbHelper would automatically use Disney+ for Mandolorian and Netflix for Stranger Things but would fallback to default player if you tried to play The Boys.

It has also given me another idea just now to have an optional prompt that asks if you want to set the selected player as default for a tvshow if it finds a match -- e.g. First time you play a tvshow using the player select dialog it would have an additional dialog asking "Set as default player for this show?" with the options "Set Default" (would always play that show using that player from now on), "Remind me Later" (would ask again the next time you play that show), and "Don't Ask Again" (would never ask again for a default player for that show and would always just show the select prompt). Then I would have a GUI dialog in the settings where you would be able to edit/delete existing entries. That way you have a centralised setting that isn't reliant on files being edited and is consistent across the board no matter where you play from.

unkn0wn234 commented 3 years ago

That is dope! Im glad to hear that you like the idea, and that you have already been working on something similar. Few things

  1. Using the GUI dialog would I be able to set players outside of the "watch/providers" for a specific show? Ex: I have Netflix installed and like letting TMDB Helper automatically play all the Netflix shows with Netflix player but for a specific show such as Stranger Things I would like it to play with "Addon 1" rather than Netflix for whatever reason.

  2. Would these features extend to the library content added through TMDBHelper? I wouldnt see why not but just making sure.

  3. This one is adding on to your idea, on top of whenever using a Player select dialog asking if you would want to make this the default for the show/movie. A context menu option would be nice too so u could just go about different shows and quickly set players for them instead of having to go into each one and play them. Maybe a context menu named "Set Default Player" or "Set Default Player for this show/movie" if set default is too vague. I was thinkign "Select Player" originally but there already is a context menu item named that.

I think thats it if I have anythign else to add on ill edit or comment again. But thank you for replying and letting me know your thoughts I am excited to see how this turns out it is a great feature addition!

jurialmunkey commented 3 years ago

Using the GUI dialog would I be able to set players outside of the "watch/providers" for a specific show? Ex: I have Netflix installed and like letting TMDB Helper automatically play all the Netflix shows with Netflix player but for a specific show such as Stranger Things I would like it to play with "Addon 1" rather than Netflix for whatever reason.

This is a good point that I didn't think of but would fit in easily with the approach I'm thinking of using.

Basically the GUI would just be a front end for a json file containing the settings. In the file it would be a list of TMDb IDs for shows with the default player specified e.g. it would have entries like "82856": {"name": "The Mandalorian", "default_player": "disney-plus.json"}. It would be as trivial as adding an extra entry to the settings file such as "66732": {"name": "Stranger Things", "default_player": "addon-1.json"}.

Being a text file makes it possible to either do this manually by editing the file itself or use the GUI to add an entry (which I'd then have various prompts to select the player and lookup the ID and so on).

Would these features extend to the library content added through TMDBHelper? I wouldnt see why not but just making sure.

Yes definitely! One of the main points would be to have a consistent experience no matter whether it was played from library strm, the TMDbHelper plugin itself, or from the context menu addon.

The only caveat would be if a strm file had the ignore_default flag set, in which case it would override and always prompt the player select dialog.

This one is adding on to your idea, on top of whenever using a Player select dialog asking if you would want to make this the default for the show/movie. A context menu option would be nice too so u could just go about different shows and quickly set players for them instead of having to go into each one and play them. Maybe a context menu named "Set Default Player" or "Set Default Player for this show/movie" if set default is too vague. I was thinkign "Select Player" originally but there already is a context menu item named that.

Good idea. That might actually be preferable over the prompt in the select dialog anyway because it will stop random players from being set as default from accidental clicks. I can just imagine other people in my house ending up setting something really weird as the default because they didn't bother to read the dialog and just clicked OK -- having it in the context menu would avoid those types of scenarios.

unkn0wn234 commented 3 years ago

Great! This is all good stuff I’m really looking forward to this :D

jurialmunkey commented 2 years ago

Pinning this to keep discussion to one thread.

Now that I've finally got around to adding support for adding &player=player.json&mode=play to .strm files, it's time I actually get to implementing this GUI feature!

jurialmunkey commented 2 years ago

Also relevant: https://github.com/jurialmunkey/plugin.video.themoviedb.helper/issues/625

nroets1 commented 2 years ago

Awesome new features ahead!! Looking forward!

One more request (not that urgent). I have several kodi installs with one central install for the mariadb library. It would be great if there was an option to specify a custom folder for the players. You may then put the players in a smb shared folder accessible by all kodi installs.

jurialmunkey commented 2 years ago

First step towards this feature: https://github.com/jurialmunkey/plugin.video.themoviedb.helper/commit/440e9fdfd766b4f0077a1044228c5ea9ebf221a1

There is a now a "provider" field available for players. If the provider name of the player matches one of the available providers for the item then the player priority is overridden so that it will appear at the top of the player selection dialog.

See Netflix player for implementation. Examples of available provider names are in this list of provider names.

I've implemented for all the bundled players: Netflix, Amazon Prime, BiNGE, ABC iView, SBS, ShowMax, Hulu. Should be relatively straightforward to implement for other players.

unkn0wn234 commented 2 years ago

First step towards this feature: 440e9fd

There is a now a "provider" field available for players. If the provider name of the player matches one of the available providers for the item then the player priority is overridden so that it will appear at the top of the player selection dialog.

See Netflix player for implementation. Examples of available provider names are in this list of provider names.

I've implemented for all the bundled players: Netflix, Amazon Prime, BiNGE, ABC iView, SBS, ShowMax, Hulu. Should be relatively straightforward to implement for other players.

Testing this feature now works perfectly :) Thanks for the all the work you put into the Kodi community jurial it's well appreciated. Tested on Netflix and Disney Plus.

unkn0wn234 commented 2 years ago

Would you consider adding the Providers section as its own section in Discover or TV Shows/Movies as well?

jurialmunkey commented 2 years ago

Would you consider adding the Providers section as its own section in Discover or TV Shows/Movies as well?

Literally was just working on this very idea! Added in 4.6.57 as its own section under Movies/TV (next to Genres).

Trying to figure out if there's a way to get a higher quality logo for the providers because as you'll see the logo dimensions are fairly small by default and look pretty low quality.

I'll get an option working under discover soon. It's only worthwhile getting providers on a region basis since there's so much difference between what each service has in each country - so I need to implement a separate method in discover which will lookup providers for the region and add both region and provider value to the path together.

jurialmunkey commented 2 years ago

@unkn0wn234 - Now watch providers also added to discover section as a rule option.

jurialmunkey commented 2 years ago

Some more headway with this feature. Now there is an option to automatically play using a provider addon if available.

jurialmunkey commented 2 years ago

All that is left now for this feature is an option to set providers manually for a show to override the data from TMDb/JustWatch.

jurialmunkey commented 1 year ago

It's been a long time coming but this feature is now implemented as of 5.0.30

There is now a context menu option "Choose default player" which will allow for setting a default player at tvshow, season, or episode level.

It saves to .kodi/userdata/addon_data/plugin.video.themoviedb.helper/pickle/player_defaults The file is a standard json textfile which can be opened in any text editor to edit manually if preferred.

Example

{
    "my_object": {
        "movie": {
            "10585": {
                "name": "Child's Play",
                "file": "youtube.json",
                "mode": "play_movie"
            }
        },
        "tv": {
            "90462": {
                "name": "Chucky",
                "file": "youtube.json",
                "mode": "play_episode",
                "season": {
                    "1": {
                        "file": "youtube.json",
                        "mode": "play_episode",
                        "episode": {
                            "1": {
                                "file": "youtube.json",
                                "mode": "play_episode"
                            }
                        }
                    }
                }
            }
        }
    },
    "expires": ""
}

Set file and mode at the level you want it to apply -- e.g. file and mode of a single episode will override the settings for season which in turn overrides settings for the tvshow. You don't need to set it for every level -- only the ones where you want it to apply.

Quihico commented 1 year ago

Firstly: Thanks for implementing this function! For me it was THE missing piece for a unified mediacentre: one device to watch em all.

But, even though it works beautifully, the GUI part seems to need a little work: I could only get the "select player" entry in context menu to show up on episode level and even at episode level it did not seem to generate the "default_players" file even though it did offer a selection dialog to select a player. So... using your example as a base I made the default_players-file myself and after configuring the players_default-file in the pickle-folder, the function did work perfectly.

As for the "providers" function also seems to work nicely but I noticed the "NPO Start" missing in the list of providers available from the addon even though it is listed @ a couple of comments above here