Some more switches to webservice, away from plugin playback

This commit is contained in:
croneter 2019-04-14 16:24:08 +02:00
parent 95b37b51f5
commit c63d9ad4d6
2 changed files with 12 additions and 9 deletions

View file

@ -61,7 +61,8 @@ def get_playlist(path=None, kodi_hash=None, plex_id=None):
def _m3u_iterator(text): def _m3u_iterator(text):
""" """
Yields e.g. plugin://plugin.video.plexkodiconnect.movies/?plex_id=xxx Yields e.g.
http://127.0.0.1:<port>/plex/kodi/movies/file.strm?plex_id=...
""" """
lines = iter(text.split('\n')) lines = iter(text.split('\n'))
for line in lines: for line in lines:

View file

@ -133,12 +133,14 @@ class API(object):
# Set plugin path and media flags using real filename # Set plugin path and media flags using real filename
if self.plex_type() == v.PLEX_TYPE_EPISODE: if self.plex_type() == v.PLEX_TYPE_EPISODE:
# need to include the plex show id in the path # need to include the plex show id in the path
path = ('plugin://plugin.video.plexkodiconnect.tvshows/%s/' path = ('http://127.0.0.1:%s/plex/kodi/shows/%s'
% self.grandparent_id()) % (v.WEBSERVICE_PORT, self.grandparent_id()))
else: elif self.plex_type() in (v.PLEX_TYPE_MOVIE, v.PLEX_TYPE_CLIP):
path = 'plugin://%s/' % v.ADDON_TYPE[self.plex_type()] path = 'http://127.0.0.1:%s/plex/kodi/movies' % v.WEBSERVICE_PORT
path = ('%s?plex_id=%s&plex_type=%s&mode=play&filename=%s' elif self.plex_type() == v.PLEX_TYPE_SONG:
% (path, self.plex_id(), self.plex_type(), filename)) path = 'http://127.0.0.1:%s/plex/kodi/music' % v.WEBSERVICE_PORT
path = '{0}/{1}/file.strm?plex_id={1}&plex_type={2}'.format(
path, self.plex_id(), self.plex_type())
else: else:
# Direct paths is set the Kodi way # Direct paths is set the Kodi way
path = self.validate_playurl(filename, path = self.validate_playurl(filename,
@ -810,8 +812,8 @@ class API(object):
elif not url: elif not url:
url = extra.get('ratingKey') url = extra.get('ratingKey')
if url: if url:
url = ('plugin://%s.movies/?plex_id=%s&plex_type=%s&mode=play' url = 'http://127.0.0.1:{0}/plex/kodi/movies/{1}/file.strm?plex_id={1}&plex_type={2}'.format(
% (v.ADDON_ID, url, v.PLEX_TYPE_CLIP)) v.WEBSERVICE_PORT, url, v.PLEX_TYPE_CLIP)
return url return url
def mediastreams(self): def mediastreams(self):