mirror of
https://github.com/SickGear/SickGear.git
synced 2025-12-04 16:14:36 +00:00
Merge branch 'feature/AddSortShowListByLastEpisode' into dev
Some checks are pending
Python Unit Tests / windows (windows-latest, 3.10) (push) Waiting to run
Python Unit Tests / windows (windows-latest, 3.11) (push) Waiting to run
Python Unit Tests / windows (windows-latest, 3.12) (push) Waiting to run
Python Unit Tests / windows (windows-latest, 3.13) (push) Waiting to run
Python Unit Tests / windows (windows-latest, 3.9) (push) Waiting to run
Python Unit Tests / linux (ubuntu-latest, 3.10) (push) Waiting to run
Python Unit Tests / linux (ubuntu-latest, 3.11) (push) Waiting to run
Python Unit Tests / linux (ubuntu-latest, 3.12) (push) Waiting to run
Python Unit Tests / linux (ubuntu-latest, 3.13) (push) Waiting to run
Python Unit Tests / linux (ubuntu-latest, 3.9) (push) Waiting to run
Python Unit Tests / macos (macos-latest, 3.10) (push) Waiting to run
Python Unit Tests / macos (macos-latest, 3.11) (push) Waiting to run
Python Unit Tests / macos (macos-latest, 3.12) (push) Waiting to run
Python Unit Tests / macos (macos-latest, 3.13) (push) Waiting to run
Python Unit Tests / macos (macos-latest, 3.9) (push) Waiting to run
Some checks are pending
Python Unit Tests / windows (windows-latest, 3.10) (push) Waiting to run
Python Unit Tests / windows (windows-latest, 3.11) (push) Waiting to run
Python Unit Tests / windows (windows-latest, 3.12) (push) Waiting to run
Python Unit Tests / windows (windows-latest, 3.13) (push) Waiting to run
Python Unit Tests / windows (windows-latest, 3.9) (push) Waiting to run
Python Unit Tests / linux (ubuntu-latest, 3.10) (push) Waiting to run
Python Unit Tests / linux (ubuntu-latest, 3.11) (push) Waiting to run
Python Unit Tests / linux (ubuntu-latest, 3.12) (push) Waiting to run
Python Unit Tests / linux (ubuntu-latest, 3.13) (push) Waiting to run
Python Unit Tests / linux (ubuntu-latest, 3.9) (push) Waiting to run
Python Unit Tests / macos (macos-latest, 3.10) (push) Waiting to run
Python Unit Tests / macos (macos-latest, 3.11) (push) Waiting to run
Python Unit Tests / macos (macos-latest, 3.12) (push) Waiting to run
Python Unit Tests / macos (macos-latest, 3.13) (push) Waiting to run
Python Unit Tests / macos (macos-latest, 3.9) (push) Waiting to run
This commit is contained in:
commit
882ab067af
4 changed files with 62 additions and 10 deletions
|
|
@ -30,6 +30,7 @@
|
|||
* Remove notifier Boxcar2
|
||||
* Change incorrect case of recommended RapidFuzz
|
||||
* Change improve success rate of Flaresolver requests
|
||||
* Add "Last Episode" to "Sort By" on the "Poster" layout in the "Show List" view
|
||||
|
||||
|
||||
[develop changelog]
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
<select id="postersort" class="form-control form-control-inline input-sm" tabindex="$tab#set $tab += 1#">
|
||||
<option value="name" data-sort="$sg_root/set_poster_sortby/?sort=name"#echo $selected if 'name' == $sg_str('POSTER_SORTBY', 'name') else ''#>Name</option>
|
||||
<option value="date" data-sort="$sg_root/set_poster_sortby/?sort=date"#echo $selected if 'date' == $sg_str('POSTER_SORTBY') else ''#>Next Episode</option>
|
||||
<option value="lastdate" data-sort="$sg_root/set_poster_sortby/?sort=lastdate"#echo $selected if 'lastdate' == $sg_str('POSTER_SORTBY') else ''#>Last Episode</option>
|
||||
<option value="network" data-sort="$sg_root/set_poster_sortby/?sort=network"#echo $selected if 'network' == $sg_str('POSTER_SORTBY') else ''#>Network</option>
|
||||
<option value="progress" data-sort="$sg_root/set_poster_sortby/?sort=progress"#echo $selected if 'progress' == $sg_str('POSTER_SORTBY') else ''#>Progress</option>
|
||||
<option value="quality" data-sort="$sg_root/set_poster_sortby/?sort=quality"#echo $selected if 'quality' == $sg_str('POSTER_SORTBY') else ''#>Quality</option>
|
||||
|
|
@ -123,6 +124,7 @@
|
|||
#for $cur_show_obj in $showlist
|
||||
##
|
||||
#set $cur_airs_next = ''
|
||||
#set $cur_airs_last = ''
|
||||
#set $cur_snatched = 0
|
||||
#set $cur_downloaded = 0
|
||||
#set $cur_total = 0
|
||||
|
|
@ -142,6 +144,11 @@
|
|||
#if $cur_show_obj.tvid_prodid in $show_stat
|
||||
#set $cur_airs_next = $show_stat[$cur_show_obj.tvid_prodid]['ep_airs_next']
|
||||
##
|
||||
#set $cur_airs_last = $show_stat[$cur_show_obj.tvid_prodid]['ep_airs_last']
|
||||
#if not $cur_airs_last
|
||||
#set $cur_airs_last = ''
|
||||
#end if
|
||||
##
|
||||
#set $cur_snatched = $show_stat[$cur_show_obj.tvid_prodid]['ep_snatched']
|
||||
#if not $cur_snatched
|
||||
#set $cur_snatched = 0
|
||||
|
|
@ -193,7 +200,12 @@
|
|||
#end if
|
||||
#end if
|
||||
##
|
||||
<div id="show$cur_show_obj.tvid_prodid" class="show-card" data-name="$show_name" data-date="$data_date" data-network="$cur_show_obj.network">
|
||||
#set $data_lastdate = '000000000000'
|
||||
#if $cur_airs_last
|
||||
#set $data_lastdate = $SGDatetime.convert_to_setting($network_timezones.parse_date_time($cur_airs_last, $cur_show_obj.airs, $cur_show_obj.network)).strftime('%Y%m%d%H%M')
|
||||
#end if
|
||||
##
|
||||
<div id="show$cur_show_obj.tvid_prodid" class="show-card" data-name="$show_name" data-date="$data_date" data-lastdate="$data_lastdate" data-network="$cur_show_obj.network">
|
||||
<div class="show-card-top">
|
||||
<div class="show-image">
|
||||
<a href="$sg_root/home/view-show?tvid_prodid=$cur_show_obj.tvid_prodid">
|
||||
|
|
@ -213,20 +225,30 @@
|
|||
</div>
|
||||
|
||||
<div class="show-date">
|
||||
#set $data_lastdate = '?'
|
||||
#if $cur_airs_last
|
||||
#set $ldatetime = $SGDatetime.convert_to_setting($network_timezones.parse_date_time($cur_airs_last,$cur_show_obj.airs,$cur_show_obj.network))
|
||||
#set $data_lastdate = $SGDatetime.sbfdate($ldatetime)
|
||||
#end if
|
||||
#if $cur_airs_next
|
||||
#set $ldatetime = $SGDatetime.convert_to_setting($network_timezones.parse_date_time($cur_airs_next,$cur_show_obj.airs,$cur_show_obj.network))
|
||||
<span class="$fuzzydate">$SGDatetime.sbfdate($ldatetime)</span>
|
||||
#set $data_date = $SGDatetime.sbfdate($ldatetime)
|
||||
#else
|
||||
#set $output_html = '?'
|
||||
#set $data_date = '?'
|
||||
#if None is not $display_status
|
||||
#if 'nded' not in $display_status and 1 == int($cur_show_obj.paused)
|
||||
#set $output_html = 'Paused'
|
||||
#set $data_date = 'Paused'
|
||||
#else if $display_status
|
||||
#set $output_html = $display_status
|
||||
#set $data_date = $display_status
|
||||
#end if
|
||||
#end if
|
||||
$output_html
|
||||
#end if
|
||||
#if 'lastdate' == $sg_str('POSTER_SORTBY')
|
||||
#set $output_date = $data_lastdate
|
||||
#else
|
||||
#set $output_date = $data_date
|
||||
#end if
|
||||
<span class="$fuzzydate" data-date="$data_date" data-lastdate="$data_lastdate">$output_date</span>
|
||||
</div><!-- /show-date -->
|
||||
|
||||
<table width="100%" border="0">
|
||||
|
|
@ -321,6 +343,7 @@
|
|||
#for $cur_show_obj in $showlist
|
||||
##
|
||||
#set $cur_airs_next = ''
|
||||
#set $cur_airs_last = ''
|
||||
#set $cur_snatched = 0
|
||||
#set $cur_downloaded = 0
|
||||
#set $cur_total = 0
|
||||
|
|
@ -332,6 +355,10 @@
|
|||
#if $cur_show_obj.tvid_prodid in $show_stat
|
||||
#set $cur_airs_next = $show_stat[$cur_show_obj.tvid_prodid]['ep_airs_next']
|
||||
##
|
||||
#if 'ep_airs_last' in $show_stat[$cur_show_obj.tvid_prodid]
|
||||
#set $cur_airs_last = $show_stat[$cur_show_obj.tvid_prodid]['ep_airs_last']
|
||||
#end if
|
||||
##
|
||||
#set $cur_snatched = $show_stat[$cur_show_obj.tvid_prodid]['ep_snatched']
|
||||
#if not $cur_snatched
|
||||
#set $cur_snatched = 0
|
||||
|
|
@ -374,7 +401,10 @@
|
|||
#end if
|
||||
##
|
||||
<tr>
|
||||
#if $cur_airs_next
|
||||
#if 'lastdate' == $sg_str('POSTER_SORTBY') and $cur_airs_last
|
||||
#set $ldatetime = $SGDatetime.convert_to_setting($network_timezones.parse_date_time($cur_airs_last, $cur_show_obj.airs, $cur_show_obj.network))
|
||||
<td class="text-nowrap"><div class="$fuzzydate">$SGDatetime.sbfdate($ldatetime)</div><span class="sort-data">$ldatetime.strftime('%Y%m%d%H%M')</span></td>
|
||||
#elif $cur_airs_next
|
||||
#set $ldatetime = $SGDatetime.convert_to_setting($network_timezones.parse_date_time($cur_airs_next, $cur_show_obj.airs, $cur_show_obj.network))
|
||||
<td class="text-nowrap"><div class="$fuzzydate">$SGDatetime.sbfdate($ldatetime)</div><span class="sort-data">$ldatetime.strftime('%Y%m%d%H%M')</span></td>
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -99,6 +99,9 @@ $(document).ready(function () {
|
|||
case 'date':
|
||||
sortCriteria = ['date', 'name', 'network', 'progress'];
|
||||
break;
|
||||
case 'lastdate':
|
||||
sortCriteria = ['lastdate', 'name', 'network', 'progress'];
|
||||
break;
|
||||
case 'network':
|
||||
sortCriteria = ['network', 'name', 'date', 'progress'];
|
||||
break;
|
||||
|
|
@ -133,6 +136,10 @@ $(document).ready(function () {
|
|||
var date = $(itemElem).attr('data-date');
|
||||
return date.length && parseInt(date, 10) || Number.POSITIVE_INFINITY;
|
||||
},
|
||||
lastdate: function (itemElem) {
|
||||
var lastdate = $(itemElem).attr('data-lastdate');
|
||||
return lastdate.length && parseInt(lastdate, 10) || Number.NEGATIVE_INFINITY;
|
||||
},
|
||||
network: function (itemElem) {
|
||||
return $(itemElem).attr('data-network').toLowerCase()
|
||||
.replace(/^(.*?)\W*[(]\w{2,3}[)]|1$/i, '$1') || '';
|
||||
|
|
@ -149,6 +156,15 @@ $(document).ready(function () {
|
|||
|
||||
$('#postersort').on('change', function () {
|
||||
var sortValue = this.value;
|
||||
$(config.fuzzydate).each(function() {
|
||||
var $fd = $(this);
|
||||
// Use the correct data attribute based on sort
|
||||
if (sortValue === 'lastdate') {
|
||||
$fd.text($fd.attr('data-lastdate') || '');
|
||||
} else {
|
||||
$fd.text($fd.attr('data-date') || '');
|
||||
}
|
||||
});
|
||||
$(obj).one('layoutComplete', llUpdate);
|
||||
$(obj).isotope({sortBy: sortValue});
|
||||
$.get(this.options[this.selectedIndex].getAttribute('data-sort'));
|
||||
|
|
|
|||
|
|
@ -1132,7 +1132,7 @@ class MainHandler(WebHandler):
|
|||
@staticmethod
|
||||
def set_poster_sortby(sort):
|
||||
|
||||
if sort not in ('name', 'date', 'network', 'progress', 'quality'):
|
||||
if sort not in ('name', 'date', 'lastdate', 'network', 'progress', 'quality'):
|
||||
sort = 'name'
|
||||
|
||||
sickgear.POSTER_SORTBY = sort
|
||||
|
|
@ -1740,10 +1740,15 @@ class Home(MainHandler):
|
|||
' (SELECT airdate FROM tv_episodes'
|
||||
' WHERE indexer = tv_eps.indexer AND showid = tv_eps.showid'
|
||||
' AND airdate >= %s AND (status = %s OR status = %s)'
|
||||
' ORDER BY airdate ASC LIMIT 1) AS ep_airs_next'
|
||||
' ORDER BY airdate ASC LIMIT 1) AS ep_airs_next,'
|
||||
' (SELECT airdate FROM tv_episodes' # get last airdate of regular episode for today
|
||||
' WHERE indexer = tv_eps.indexer AND showid = tv_eps.showid'
|
||||
' AND airdate <= %s AND season > 0'
|
||||
' ORDER BY airdate DESC LIMIT 1) AS ep_airs_last'
|
||||
' FROM tv_episodes tv_eps GROUP BY indexer, showid'
|
||||
% (status_quality, status_download, today, status_total,
|
||||
status_quality, status_download, today, UNAIRED, WANTED))
|
||||
status_quality, status_download, today, UNAIRED, WANTED,
|
||||
today))
|
||||
|
||||
t.show_stat = {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue