Browse Source

Merge branch 'master' into develop

pull/1200/head
JackDandy 6 years ago
parent
commit
ae18ee7ba7
  1. 9
      CHANGES.md
  2. 6
      gui/slick/interfaces/default/home_browseShows.tmpl
  3. 32
      sickbeard/webserve.py

9
CHANGES.md

@ -17,6 +17,15 @@
### 0.18.6 (2018-12-12 19:30:00 UTC)
* Change to public IMDb lists is now handled when adding a list
* Change IMDb cards view to feedback when a list has no TV shows
* Change IMDb cards view to include TV Mini Series
* Change add "list more" to list choices on IMDb cards view
* Change IMDb requests to be https
### 0.18.5 (2018-12-10 12:15:00 UTC)
* Change all nzb provider requests to 60s timeout

6
gui/slick/interfaces/default/home_browseShows.tmpl

@ -181,6 +181,9 @@ $(document).ready(function(){
el$.on('layoutComplete', llUpdate);
el$.isotope({ filter: filterValue });
} else {
if (-1 !== filterValue.indexOf('more_imdb')){
filterValue = $('#showfilter').find('option:not([value="more_imdb"]).selected').val() + '&more=1';
}
#end raw
location = '$sg_root/home/addShows/' + filterValue;
#raw
@ -286,8 +289,9 @@ $(document).ready(function(){
<optgroup label="IMDb Popular">
#for $i, $p in enumerate($periods)
#set $period='%s,%s' % ($p[0], $p[1])
<option value="popular_imdb?period=$period"#echo ('', selected)[('popular-%s' % $period) == $mode]#>#echo '%s - %s' % (($p[1], 'Current')[not $i], $p[0])#</option>
<option value="popular_imdb?period=$period"#echo ('', selected)[('popular-%s' % $period) in $mode]#>#echo '%s - %s' % (($p[1], 'Current')[not $i], $p[0])#</option>
#end for
<option value="more_imdb"#echo ('', selected + ' disabled')[mode.endswith('more')]#>... list more</option>
</optgroup>
#end if
#if not hasattr($sickbeard, 'IMDB_ACCOUNTS')#<optgroup label="Restart SickGear to reveal"><option>new options after restart</option></optgroup>#else#

32
sickbeard/webserve.py

@ -3510,14 +3510,19 @@ class NewHomeAddShows(Home):
return json.dumps({'result': 'Fail: Invalid IMDb ID'})
acc_id = account_id[0]
url = 'http://www.imdb.com/user/ur%s/watchlist' % acc_id + \
'/_ajax?sort=date_added,desc&mode=detail&page=1&title_type=tvSeries%2CtvEpisode&ref_=wl_vm_dtl'
url = 'https://www.imdb.com/user/ur%s/watchlist' % acc_id + \
'?sort=date_added,desc&title_type=tvSeries,tvEpisode,tvMiniSeries&view=detail'
html = helpers.getURL(url, nocache=True)
if not html:
return json.dumps({'result': 'Fail: No list found with id: %s' % acc_id})
if 'id="unavailable"' in html or 'list is not public' in html or 'not enabled public view' in html:
return json.dumps({'result': 'Fail: List is not public with id: %s' % acc_id})
try:
list_name = re.findall('(?i)<h1[^>]+>(.*)\s+Watchlist</h1>', html)[0].replace('\'s', '')
list_name = re.findall('(?i)og:title[^>]+?content[^"]+?"([^"]+?)\s+Watchlist\s*"',
html)[0].replace('\'s', '')
accounts[acc_id] = list_name or 'noname'
except:
except (Exception, BaseException):
return json.dumps({'result': 'Fail: No list found with id: %s' % acc_id})
else:
@ -3621,7 +3626,7 @@ class NewHomeAddShows(Home):
overview='No overview yet' if not overview else self.encode_html(overview[:250:]),
rating=int(helpers.tryFloat(rating) * 10),
title=row.get('primary').get('title'),
url_src_db='http://www.imdb.com/%s/' % row.get('primary').get('href').strip('/'),
url_src_db='https://www.imdb.com/%s/' % row.get('primary').get('href').strip('/'),
votes=helpers.tryInt(voting, 'TBA')))
indexer, indexerid = idx_ids.get(ids['imdb'], (None, None))
@ -3684,7 +3689,7 @@ class NewHomeAddShows(Home):
high = int(max([match.group(9), match.group(11)]))
scaled = [scale(x, high) for x in
[(int(match.group(n)), high)[high == int(match.group(n))] for n in
3, 5, 7, 9, 11]]
(3, 5, 7, 9, 11)]]
parts = [match.group(1), match.group(4), match.group(6), match.group(8), match.group(10),
match.group(12)]
img_uri = img_uri.replace(match.group(), ''.join(
@ -3704,7 +3709,7 @@ class NewHomeAddShows(Home):
overview='No overview yet' if not overview else self.encode_html(overview[:250:]),
rating=0 if not len(rating) else int(helpers.tryFloat(rating) * 10),
title=title.get_text().strip(),
url_src_db='http://www.imdb.com/%s/' % url_path.strip('/'),
url_src_db='https://www.imdb.com/%s/' % url_path.strip('/'),
votes=0 if not len(voting) else helpers.tryInt(voting, 'TBA')))
show = filter(lambda x: x.imdbid == ids['imdb'], sickbeard.showList)[0]
@ -3744,8 +3749,9 @@ class NewHomeAddShows(Home):
list_name += ('\'s', '')['your' == list_name.replace('(Off) ', '').lower()]
url = 'http://www.imdb.com/user/ur%s/watchlist' % acc_id
url_ui = '?mode=detail&page=1&sort=date_added,desc&title_type=tvSeries%2CtvEpisode&ref_=wl_ref_typ'
url = 'https://www.imdb.com/user/ur%s/watchlist' % acc_id
url_ui = '?mode=detail&page=1&sort=date_added,desc&' \
'title_type=tvSeries,tvEpisode,tvMiniSeries&ref_=wl_ref_typ'
html = helpers.getURL(url + url_ui, headers={'Accept-Language': 'en-US'})
if html:
@ -3763,7 +3769,7 @@ class NewHomeAddShows(Home):
footnote = ('Note; Some images on this page may be cropped at source: ' +
'<a target="_blank" href="%s">%s watchlist at IMDb</a>' % (
helpers.anon_url(url + url_ui), list_name))
elif None is not show_list_found:
elif None is not show_list_found or (None is show_list_found and list_name in html):
kwargs['show_header'] = True
kwargs['error_msg'] = 'No TV titles in the <a target="_blank" href="%s">%s watchlist at IMDb</a>' % (
helpers.anon_url(url + url_ui), list_name)
@ -3787,7 +3793,11 @@ class NewHomeAddShows(Home):
mode = 'popular-%s,%s' % (start_year, end_year)
url = 'http://www.imdb.com/search/title?at=0&sort=moviemeter&title_type=tv_series&year=%s,%s' % (start_year, end_year)
page = 'more' in kwargs and '51' or ''
if page:
mode += '-more'
url = 'https://www.imdb.com/search/title?at=0&sort=moviemeter&' \
'title_type=tvSeries,tvEpisode,tvMiniSeries&year=%s,%s&start=%s' % (start_year, end_year, page)
html = helpers.getURL(url, headers={'Accept-Language': 'en-US'})
if html:
show_list_found = None

Loading…
Cancel
Save