Commit 76c2230c authored by echel0n's avatar echel0n

Refactored display show view.

Fixed issue with gktorrent.
Fixed issue with newpct.
parent e54f2cc2
......@@ -35,17 +35,17 @@ module.exports = function (grunt) {
},
exec: {
// Translations
'crowdin_upload_sources': {cmd: 'venv\\Scripts\\crowdin-cli-py upload sources'},
'crowdin_upload_translations': {cmd: 'venv\\Scripts\\crowdin-cli-py upload translations'},
'crowdin_download_translations': {cmd: 'venv\\Scripts\\crowdin-cli-py download'},
'babel_extract': {cmd: 'venv\\Scripts\\python setup.py extract_messages'},
'babel_update': {cmd: 'venv\\Scripts\\python setup.py update_catalog'},
'babel_compile': {cmd: 'venv\\Scripts\\python setup.py compile_catalog'},
'crowdin_upload_sources': {cmd: 'crowdin-cli-py upload sources'},
'crowdin_upload_translations': {cmd: 'crowdin-cli-py upload translations'},
'crowdin_download_translations': {cmd: 'crowdin-cli-py download'},
'babel_extract': {cmd: 'python setup.py extract_messages'},
'babel_update': {cmd: 'python setup.py update_catalog'},
'babel_compile': {cmd: 'python setup.py compile_catalog'},
// PyPi Commands
'pypi_create': {cmd: 'venv\\Scripts\\python setup.py sdist bdist_wheel'},
'pypi_upload': {cmd: 'venv\\Scripts\\twine upload dist/*'},
'pypi_cleanup': {cmd: 'venv\\Scripts\\python setup.py clean'},
'pypi_create': {cmd: 'python setup.py sdist bdist_wheel'},
'pypi_upload': {cmd: 'twine upload dist/*'},
'pypi_cleanup': {cmd: 'python setup.py clean'},
// Git Commands
'git': {
......
# Changelog
- * 9409223 - 2018-12-10: Release v9.4.53
- * 8ec11a1 - 2018-12-16: Refactored display show view. Fixed issue with gktorrent. Fixed issue with newpct.
- * 91bc24c - 2018-12-10: Release v9.4.53
- * 7dd5263 - 2018-12-09: Release v9.4.52
- * c65074d - 2018-12-09: Fixed issues with display show poster positioning
- * 65486af - 2018-12-09: Release v9.4.51
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -23,7 +23,7 @@
<%block name="content">
<div class="row">
<div class="col-lg-12 mx-auto">
<div class="col mx-auto">
<div class="row">
<!-- Alert -->
% if show_message:
......@@ -115,11 +115,7 @@
<div class="row">
<div class="col-lg-10 mx-auto">
<div class="row mb-1">
<div class="col-auto d-none d-lg-block">
<img class="shadow-lg rounded" style="margin-bottom: -400px"
src="${srWebRoot}${showImage(show.indexerid, 'poster_thumb').url}"/>
</div>
<div class="col">
<div class="col my-auto">
<div class="row">
<div class="col-auto">
% if show.imdb_info and 'imdbRating' in show.imdb_info:
......@@ -186,7 +182,7 @@
<a href="${anon_url('http://trakt.tv/shows/popular/?genres=', imdbgenre.lower())}"
target="_blank"
title="View other popular ${imdbgenre} shows on trakt.tv.">
<li class="fas fa-tag fa-1x badge badge-primary p-2"> ${imdbgenre}</li>
<li class="fas fa-tag badge badge-primary p-1"> ${imdbgenre}</li>
</a>
% endfor
% endif
......@@ -194,7 +190,7 @@
</div>
</div>
</div>
<div class="col-auto d-lg-none d-xl-flex">
<div class="col-auto my-auto d-lg-none d-xl-flex">
<img class="rounded shadow-lg img-banner"
src="${srWebRoot}${showImage(show.indexerid, 'banner').url}"/>
</div>
......@@ -202,14 +198,19 @@
</div>
</div>
<div class="row bg-dark border border-white">
<div class="col-lg-6 col-xl-7 offset-0 offset-lg-5 offset-xl-4 offset-xxxl-3">
<div class="row" style="margin-bottom: 100px">
<div class="row bg-dark border-top border-bottom border-white pt-2 pb-2">
<div class="col-lg-10 mx-auto">
<div class="row">
<div class="col-auto d-none d-lg-block">
<img class="shadow-lg rounded"
src="${srWebRoot}${showImage(show.indexerid, 'poster_thumb').url}"/>
</div>
<div class="col">
<div>
<i>${show.overview}</i>
</div>
<br/>
<p class="text-viewer">
${show.overview}
</p>
<table>
<tr>
<td class="show-legend">${_('Quality:')}</td>
......@@ -328,62 +329,62 @@
<tr>
<td class="show-legend">${_('Subtitles:')}</td>
<td>
<i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.subtitles)]}"></i>
<i class="fas ${("fa-times text-danger", "fa-check text-success")[bool(show.subtitles)]}"></i>
</td>
</tr>
% endif
<tr>
<td class="show-legend">${_('Subtitles Metadata:')}</td>
<td>
<i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.subtitles_sr_metadata)]}"></i>
<i class="fas ${("fa-times text-danger", "fa-check text-success")[bool(show.subtitles_sr_metadata)]}"></i>
</td>
</tr>
<tr>
<td class="show-legend">${_('Season Folders:')}</td>
<td>
<i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(not show.flatten_folders or sickrage.app.config.naming_force_folders)]}"></i>
<i class="fas ${("fa-times text-danger", "fa-check text-success")[bool(not show.flatten_folders or sickrage.app.config.naming_force_folders)]}"></i>
</td>
</tr>
<tr>
<td class="show-legend">${_('Paused:')}</td>
<td>
<i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.paused)]}"></i>
<i class="fas ${("fa-times text-danger", "fa-check text-success")[bool(show.paused)]}"></i>
</td>
</tr>
<tr>
<td class="show-legend">${_('Air-by-Date:')}</td>
<td>
<i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.air_by_date)]}"></i>
<i class="fas ${("fa-times text-danger", "fa-check text-success")[bool(show.air_by_date)]}"></i>
</td>
</tr>
<tr>
<td class="show-legend">${_('Sports:')}</td>
<td>
<i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.is_sports)]}"></i>
<i class="fas ${("fa-times text-danger", "fa-check text-success")[bool(show.is_sports)]}"></i>
</td>
</tr>
<tr>
<td class="show-legend">${_('Anime:')}</td>
<td>
<i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.is_anime)]}"></i>
<i class="fas ${("fa-times text-danger", "fa-check text-success")[bool(show.is_anime)]}"></i>
</td>
</tr>
<tr>
<td class="show-legend">${_('DVD Order:')}</td>
<td>
<i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.dvdorder)]}"></i>
<i class="fas ${("fa-times text-danger", "fa-check text-success")[bool(show.dvdorder)]}"></i>
</td>
</tr>
<tr>
<td class="show-legend">${_('Scene Numbering:')}</td>
<td>
<i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.scene)]}"></i>
<i class="fas ${("fa-times text-danger", "fa-check text-success")[bool(show.scene)]}"></i>
</td>
</tr>
<tr>
<td class="show-legend">${_('Skip Downloaded:')}</td>
<td>
<i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.skip_downloaded)]}"></i>
<i class="fas ${("fa-times text-danger", "fa-check text-success")[bool(show.skip_downloaded)]}"></i>
</td>
</tr>
</table>
......@@ -391,79 +392,79 @@
</div>
</div>
</div>
</div>
</div>
<div class="row bg-dark border border-white">
<div class="col-lg-10 mx-auto m-1">
<div class="row">
<div class="col-md-auto my-auto">
<div class="input-group float-md-left">
<select id="statusSelect" title="Change selected episode statuses" class="form-control">
<% availableStatus = [WANTED, SKIPPED, IGNORED, FAILED] %>
% if sickrage.app.developer:
<% availableStatus.append(UNAIRED) %>
% endif
% for curStatus in availableStatus + sorted(Quality.DOWNLOADED) + sorted(Quality.ARCHIVED):
% if curStatus not in [DOWNLOADED, ARCHIVED]:
<option value="${curStatus}">${statusStrings[curStatus]}</option>
% endif
% endfor
</select>
<div class="input-group-append">
<button id="changeStatus" class="btn fas fa-play"></button>
</div>
</div>
<input type="hidden" id="showID" value="${show.indexerid}"/>
<input type="hidden" id="indexer" value="${show.indexer}"/>
</div>
<div class="col">
<div class="d-inline-flex float-md-right">
<h5 class="my-auto mr-2">
<div class="row bg-dark border-top border-bottom border-white p-1">
<div class="col-lg-10 mx-auto">
<div class="row">
<div class="col">
<div class="d-inline-flex" id="checkboxControls">
<h5 class="my-auto">
<span class="badge missed">
<input type="checkbox" id="missed" checked/>
${_('Missed:')} <b>${epCounts[Overview.MISSED]}</b>
</span>
<span class="badge wanted">
<span class="badge wanted">
<input type="checkbox" id="wanted" checked/>
${_('Wanted:')} <b>${epCounts[Overview.WANTED]}</b>
${_('Wanted:')} <b>${epCounts[Overview.WANTED]}</b>
</span>
<span class="badge qual">
<span class="badge qual">
<input type="checkbox" id="qual" checked/>
${_('Low Quality:')} <b>${epCounts[Overview.QUAL]}</b>
${_('Low Quality:')} <b>${epCounts[Overview.QUAL]}</b>
</span>
<span class="badge good">
<span class="badge good">
<input type="checkbox" id="good" checked/>
${_('Downloaded:')} <b>${epCounts[Overview.GOOD]}</b>
${_('Downloaded:')} <b>${epCounts[Overview.GOOD]}</b>
</span>
<span class="badge skipped">
<span class="badge skipped">
<input type="checkbox" id="skipped" checked/>
${_('Skipped:')} <b>${epCounts[Overview.SKIPPED]}</b>
${_('Skipped:')} <b>${epCounts[Overview.SKIPPED]}</b>
</span>
<span class="badge snatched">
<span class="badge snatched">
<input type="checkbox" id="snatched" checked/>
<% total_snatched = epCounts[Overview.SNATCHED] + epCounts[Overview.SNATCHED_PROPER] + epCounts[Overview.SNATCHED_BEST] %>
${_('Snatched:')} <b>${total_snatched}</b>
<% total_snatched = epCounts[Overview.SNATCHED] + epCounts[Overview.SNATCHED_PROPER] + epCounts[Overview.SNATCHED_BEST] %>
${_('Snatched:')} <b>${total_snatched}</b>
</span>
</h5>
<div class="btn-group-md d-sm-inline-flex d-md-inline-block my-auto">
<button class="btn" id="popover">
${_('Columns')} <b class="fas fa-caret-down"></b>
</button>
<button class="btn seriesCheck">
${_('Select Episodes')}
</button>
<button class="btn clearAll">
${_('Clear All')}
</button>
</h5>
</div>
</div>
<div class="col-auto my-auto">
<div class="btn-group-sm">
<button class="btn seriesCheck">
${_('Select Episodes')}
</button>
<button class="btn clearAll">
${_('Clear All')}
</button>
</div>
</div>
<div class="col-auto my-auto">
<div class="input-group input-group-sm">
<select id="statusSelect" title="Change selected episode statuses"
class="form-control">
<% availableStatus = [WANTED, SKIPPED, IGNORED, FAILED] %>
% if sickrage.app.developer:
<% availableStatus.append(UNAIRED) %>
% endif
% for curStatus in availableStatus + sorted(Quality.DOWNLOADED) + sorted(Quality.ARCHIVED):
% if curStatus not in [DOWNLOADED, ARCHIVED]:
<option value="${curStatus}">${statusStrings[curStatus]}</option>
% endif
% endfor
</select>
<div class="input-group-append">
<button id="changeStatus" class="btn fas fa-play"></button>
</div>
</div>
<input type="hidden" id="showID" value="${show.indexerid}"/>
<input type="hidden" id="indexer" value="${show.indexer}"/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-10 mx-auto">
......@@ -524,26 +525,31 @@
% endif
<div class="row">
<div class="col-md-12">
<div class="col">
<br/>
<h3 style="display: inline;"><a
name="season-${epResult["season"]}"></a>${(_("Specials"), _("Season") + ' ' + str(epResult["season"]))[int
(epResult["season"]) > 0]}</h3>
<h3 style="display: inline;">
<a name="season-${epResult["season"]}"></a>
${(_("Specials"), _("Season") + ' ' + str(epResult["season"]))[int (epResult["season"]) > 0]}
</h3>
% if not sickrage.app.config.display_all_seasons:
% if curSeason == -1:
<button id="showseason-${epResult['season']}" type="button"
class="btn btn-xs text-right"
class="btn btn-sm text-right"
data-toggle="collapse" data-target="#collapseSeason-${epResult['season']}"
aria-expanded="true">${_('Hide Episodes')}</button>
%else:
<button id="showseason-${epResult['season']}" type="button"
class="btn btn-xs text-right"
class="btn btn-sm text-right"
data-toggle="collapse"
data-target="#collapseSeason-${epResult['season']}">${_('Show Episodes')}</button>
%endif
% endif
<button class="btn btn-sm float-right" id="popover">
${_('Columns')} <b class="fas fa-caret-down"></b>
</button>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
......
......@@ -98,9 +98,12 @@
<nav class="navbar navbar-expand-lg navbar-dark navbar-default py-0">
<div class="container-fluid">
<a class="navbar-brand" href="${srWebRoot}/home/">
<a class="navbar-brand d-none d-xl-block" href="${srWebRoot}/home/">
<img alt="SiCKRAGE" src="${srWebRoot}/images/logo.png" style="width: 400px;height: 50px;"/>
</a>
<a class="navbar-brand d-xl-none" href="${srWebRoot}/home/">
<img alt="SiCKRAGE" src="${srWebRoot}/images/logo-badge.png" style="width: 50px;height: 50px;"/>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false"
......
......@@ -141,11 +141,12 @@ class GKTorrentProvider(TorrentProvider):
with bs4_parser(data) as html:
downloads = html.find('div', {'class': 'download'})
for download in downloads.findAll('a'):
link = download['href']
if link.startswith("magnet"):
links["magnet"] = link
else:
links["torrent"] = urljoin(self.urls['base_url'], link)
if downloads:
for download in downloads.findAll('a'):
link = download['href']
if link.startswith("magnet"):
links["magnet"] = link
else:
links["torrent"] = urljoin(self.urls['base_url'], link)
return links[download_type]
......@@ -141,8 +141,11 @@ class NewpctProvider(TorrentProvider):
if not link:
return results
title = unidecode(html.find('h1').get_text().split('/')[1])
title = self._process_title(title, link['href'])
try:
title = unidecode(html.find('h1').get_text().split('/')[1])
title = self._process_title(title, link['href'])
except Exception:
title = None
try:
download_url = self.urls['download'] % re.search(
......
......@@ -53,6 +53,31 @@ $(document).ready(function ($) {
};
},
text_viewer: function () {
var minimized_elements = $('p.text-viewer');
minimized_elements.each(function(){
var t = $(this).text();
if(t.length < 500) return;
$(this).html(
t.slice(0,500)+'<span>... </span><a href="#" class="read-more"> Read More</a>'+
'<span style="display:none;">'+ t.slice(500,t.length)+' <a href="#" class="read-less"> Read Less </a></span>'
);
});
$('a.read-more', minimized_elements).click(function(event){
event.preventDefault();
$(this).hide().prev().hide();
$(this).next().show();
});
$('a.read-less', minimized_elements).click(function(event){
event.preventDefault();
$(this).parent().hide().prev().show().prev().show();
});
},
notify: function (type, title, message) {
PNotify.modules.Desktop.permission();
new PNotify({
......@@ -513,6 +538,8 @@ $(document).ready(function ($) {
$("#changelogModal").find('.modal-body').load(SICKRAGE.srWebRoot + '/changes');
$("#changelogModal").modal();
});
SICKRAGE.text_viewer();
}
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment