Skip to content

Commit

Permalink
5.0.12 - compare season and episode and display only matching results
Browse files Browse the repository at this point in the history
  • Loading branch information
amet committed Apr 19, 2015
1 parent 96039e3 commit cb16773
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion service.subtitles.opensubtitles/addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="service.subtitles.opensubtitles"
name="OpenSubtitles.org"
version="5.0.11"
version="5.0.12"
provider-name="amet">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
Expand Down
3 changes: 3 additions & 0 deletions service.subtitles.opensubtitles/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
5.0.12
- compare season and episode and display only matching results

5.0.11
- fix: search issues
- cosmetics
Expand Down
37 changes: 21 additions & 16 deletions service.subtitles.opensubtitles/service.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,27 @@ def Search( item ):
## hack to work around issue where Brazilian is not found as language in XBMC
if item_data["LanguageName"] == "Brazilian":
item_data["LanguageName"] = "Portuguese (Brazil)"
listitem = xbmcgui.ListItem(label = item_data["LanguageName"],
label2 = item_data["SubFileName"],
iconImage = str(int(round(float(item_data["SubRating"])/2))),
thumbnailImage = item_data["ISO639"]
)

listitem.setProperty( "sync", ("false", "true")[str(item_data["MatchedBy"]) == "moviehash"] )
listitem.setProperty( "hearing_imp", ("false", "true")[int(item_data["SubHearingImpaired"]) != 0] )
url = "plugin://%s/?action=download&link=%s&ID=%s&filename=%s&format=%s" % (__scriptid__,
item_data["ZipDownloadLink"],
item_data["IDSubtitleFile"],
item_data["SubFileName"],
item_data["SubFormat"]
)

xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=listitem,isFolder=False)

if ((item['season'] == item_data['SeriesSeason'] and
item['episode'] == item_data['SeriesEpisode']) or
(item['season'] == "" and item['episode'] == "") ## for file search, season and episode == ""
):
listitem = xbmcgui.ListItem(label = item_data["LanguageName"],
label2 = item_data["SubFileName"],
iconImage = str(int(round(float(item_data["SubRating"])/2))),
thumbnailImage = item_data["ISO639"]
)

listitem.setProperty( "sync", ("false", "true")[str(item_data["MatchedBy"]) == "moviehash"] )
listitem.setProperty( "hearing_imp", ("false", "true")[int(item_data["SubHearingImpaired"]) != 0] )
url = "plugin://%s/?action=download&link=%s&ID=%s&filename=%s&format=%s" % (__scriptid__,
item_data["ZipDownloadLink"],
item_data["IDSubtitleFile"],
item_data["SubFileName"],
item_data["SubFormat"]
)

xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=listitem,isFolder=False)


def Download(id,url,format,stack=False):
Expand Down

0 comments on commit cb16773

Please sign in to comment.