jurialmunkey / plugin.video.themoviedb.helper

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

Fallback player in the event no links are found. #631

Closed TheGuyWhoo closed 2 years ago

TheGuyWhoo commented 2 years ago

I know you've mentioned this would be hard to detect, but what if the user can indicate that no links were found? That way you don't have to detect anything, it can just take a key press or something like that and go to the last used player's fallback.

jurialmunkey commented 2 years ago

How is that any different from simply clicking on a different player?

TheGuyWhoo commented 2 years ago

For autoplay.

TheGuyWhoo commented 2 years ago

Alternatively having shortcuts for each of the players would be super convenient.

jurialmunkey commented 2 years ago

Alternatively having shortcuts for each of the players would be super convenient.

I don't know what this means? Where?

That's what the player dialog is for. If you want to select a different player use the player dialog. There's already a context menu item to do this

TheGuyWhoo commented 2 years ago

Keyshort cuts. I want to assign the players keyboard shortcuts, so I can avoid the context menu. The context menu is great, but having a keyboard shortcut to invoke specific players would be much more convenient imo.

TheGuyWhoo commented 2 years ago

I'm after one click play here. When the default player doesn't come through, I want to be able to invoke other players with one click.

jurialmunkey commented 2 years ago

Keyshort cuts. I want to assign the players keyboard shortcuts, so I can avoid the context menu. The context menu is great, but having a keyboard shortcut to invoke specific players would be much more convenient imo.

Okay now we're getting somewhere. This makes sense and can be done.

Please test latest git version (v4.5.6). It adds a script function that you can bind to a keymap:

Runscript(plugin.video.themoviedb.helper,play_using=youtube.json)

Replace youtube.json with the player file that you want to use. Optionally can add mode=search to use the search_episode / search_movie functions of the player file instead of the play_episode / play_movie ones.

Note that it will only work if the active item in Kodi is a TMDbHelper item. It won't work on other items or strm files added to the library (but I will add something like this eventually - just want to make sure this works first).

You can add a keyboard shortcuts in Kodi using the keymap editor addon or by manually editing keymaps: https://kodi.wiki/view/Keymap

TheGuyWhoo commented 2 years ago

Absolute legend, thank you! I will test this out asap.

And sorry for being super vague at first, I see I wasn't very clear now.

TheGuyWhoo commented 2 years ago

Sorry, accidentally hit close issue. It works perfectly on my end, I'm looking forward to being able to use it in my library!

jurialmunkey commented 2 years ago

Ok 4.5.7 should also allow play_using on any movie or episode listitem. If it is a library .strm from tmdbhelper, then it will retrieve the details from the strm file. If it's an item from somewhere else (e.g. normal video in library or another plugin) then tmdbhelper will try to lookup the tmdb id using the item details and then play.

You can also do manual searches e.g.

Runscript(plugin.video.themoviedb.helper,play_using=youtube.json,tmdb_type=tv,query=QI,season=19,episode=9)
TheGuyWhoo commented 2 years ago

Nice, works very well! Thank you.

TheGuyWhoo commented 2 years ago

Hi! Is there a way to force it to also match date and not only title or is that a player specific issue?

TheGuyWhoo commented 2 years ago

(For searches, I mean)

jurialmunkey commented 2 years ago

In combo with query? Yeah it should take year= or episode_year=

Use year if you have the tvshow first aired year, as it will give better matches. The episode year is a fuzzier match (finds first match where tvyear<=episode_year) because episode year might be later than the tv year and the ID search is for the show not episode.

TheGuyWhoo commented 2 years ago

Sorry forgot to say this is in regards to movies, and what I'm try to do is play from an item in an addon.

jurialmunkey commented 2 years ago

Year param works for any type in the manual method. The automatic method already retrieves year if available from the listitem

TheGuyWhoo commented 2 years ago

Well take a movie like Fall 2022. On my plex (through composite) it takes an incredibly long time. There are A LOT of movies with the word fall in it. And also sometimes it'll play a movie called No Limits when I want it to play No Limit as an example. Any ideas on how to approach these issues? Player I'm using:

{
    "name": "Composite",
    "plugin": "plugin.video.composite_for_plex",
    "priority": 2005,
    "assert": {
        "play_movie": [
            "title",
            "year"
        ],
        "play_episode": [
            "title",
            "showname",
            "season",
            "episode"
        ],
        "search_movie": [
            "title"
        ],
        "search_episode": [
            "title"
        ]
    },
    "fallback": {
        "play_movie": "composite_for_plex.json search_movie",
        "play_episode": "composite_for_plex.json search_episode"
    },
    "play_movie": [
        "plugin://plugin.video.composite_for_plex/?mode=32&video_type=movie&query={title}",
        {
            "title": "{title}",
            "year": "{year}"
        }
    ],
    "play_episode": [
        "plugin://plugin.video.composite_for_plex/?mode=32&video_type=episode&query={title}",
        {
            "showtitle": "{showname}",
            "season": "{season}",
            "episode": "{episode}"
        }
    ],
    "search_movie": [
        "plugin://plugin.video.composite_for_plex/?mode=32&video_type=movie&query={title}",
        {
            "dialog": "auto"
        }
    ],
    "search_episode": [
        "plugin://plugin.video.composite_for_plex/?mode=32&video_type=episode&query={title}",
        {
            "dialog": "auto"
        }
    ],
    "disabled": "false"
}