Skip to content

Commit a677a7c

Browse files
authored
Merge pull request #90 from mediathekview/develop
Improvements after Kodi-PR-Review
2 parents 6eb8f07 + c108c7c commit a677a7c

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

addon.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,8 @@ def run( self ):
258258
Downloader( self ).download_episode( filmid, quality )
259259
elif mode == 'playwithsrt':
260260
filmid = self.get_arg( 'id', 0 )
261-
external = self.get_arg( 'external', 'False' ) == 'True'
262-
Downloader( self ).play_movie_with_subs( filmid, external )
263-
# elif mode == 'enqueue':
264-
# self.enqueue_film( self.get_arg( 'id', 0 ) )
261+
only_sru = self.get_arg( 'only_set_resolved_url', 'False' ) == 'True'
262+
Downloader( self ).play_movie_with_subs( filmid, only_sru )
265263

266264
# cleanup saved searches
267265
if mode is None or mode != 'search':

resources/language/resource.language.it_it/strings.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ msgstr "Preferisci alta definizione"
3636

3737
msgctxt "#30111"
3838
msgid "Autoplay Subtitles"
39-
msgstr "Mostra Sottotitoli"
39+
msgstr "Riproduci sempre con sottotitoli"
4040

4141
msgctxt "#30112"
4242
msgid "No future videos (usually trailers)"

resources/lib/downloader.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,24 @@ def __init__( self, plugin ):
3434
self.settings = plugin.settings
3535
self.notifier = plugin.notifier
3636

37-
def play_movie_with_subs( self, filmid, external ):
37+
def play_movie_with_subs( self, filmid, only_set_resolved_url ):
3838
film = self.database.RetrieveFilmInfo( filmid )
3939
if film is None:
4040
self.notifier.ShowError( 30990, self.plugin.language( 30991 ) )
4141
return
42-
ttmname = self.plugin.datapath + '/subtitle.ttml'
43-
srtname = self.plugin.datapath + '/subtitle.srt'
42+
ttmname = os.path.join( self.plugin.datapath, 'subtitle.ttml' )
43+
srtname = os.path.join( self.plugin.datapath, 'subtitle.srt' )
4444
subs = []
4545
if self.download_subtitle( film, ttmname, srtname, 'subtitle' ):
4646
subs.append( srtname )
4747
( videourl, listitem ) = FilmUI( self.plugin ).get_list_item( None, film )
4848
if listitem:
4949
if subs:
5050
listitem.setSubtitles( subs )
51-
if external:
52-
xbmc.Player().play( videourl, listitem )
53-
else:
51+
if only_set_resolved_url:
5452
self.plugin.setResolvedUrl( True, listitem )
53+
else:
54+
xbmc.Player().play( videourl, listitem )
5555

5656
def download_subtitle( self, film, ttmname, srtname, filename ):
5757
ret = False

resources/lib/filmui.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# pylint: disable=mixed-indentation, bad-whitespace, bad-continuation, missing-docstring
1010

1111
# -- Imports ------------------------------------------------
12+
import os
13+
1214
import xbmcgui
1315
import xbmcplugin
1416

@@ -52,7 +54,7 @@ def Add( self, alttitle = None, totalItems = None ):
5254
self.plugin.build_url( {
5355
'mode': "playwithsrt",
5456
'id': self.id,
55-
'external': True
57+
'only_set_resolved_url': False
5658
} )
5759
)
5860
) )
@@ -110,7 +112,7 @@ def Add( self, alttitle = None, totalItems = None ):
110112
videourl = self.plugin.build_url( {
111113
'mode': "playwithsrt",
112114
'id': self.id,
113-
'external': False
115+
'only_set_resolved_url': True
114116
} )
115117

116118
if totalItems is not None:
@@ -172,7 +174,7 @@ def get_list_item( self, alttitle, film = None ):
172174
info_labels['aired'] = airedstring
173175
info_labels['dateadded'] = airedstring
174176

175-
icon = 'special://home/addons/' + self.plugin.addon_id + '/resources/icons/' + film.channel.lower() + '-m.png'
177+
icon = os.path.join( self.plugin.addon.getAddonInfo( 'path' ), 'resources', 'icons', film.channel.lower() + '-m.png' )
176178

177179
listitem = xbmcgui.ListItem( resultingtitle, path = videourl )
178180
listitem.setInfo( type = 'video', infoLabels = info_labels )

0 commit comments

Comments
 (0)