display_show.mako 37.7 KB
Newer Older
echel0n's avatar
echel0n committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<%inherit file="../layouts/main.mako"/>
<%!
    import os
    import datetime
    import urllib
    import ntpath

    import sickrage
    import sickrage.subtitles
    from sickrage.core.updaters import tz_updater
    from sickrage.core.common import SKIPPED, WANTED, UNAIRED, ARCHIVED, IGNORED, FAILED, DOWNLOADED
    from sickrage.core.common import Quality, qualityPresets, statusStrings, Overview
    from sickrage.core.helpers import anon_url, srdatetime, pretty_filesize, get_size
    from sickrage.core.media.util import showImage
15
    from sickrage.indexers import IndexerApi
echel0n's avatar
echel0n committed
16
17
18
19
%>
<%block name="content">
    <%namespace file="../includes/quality_defaults.mako" import="renderQualityPill"/>
    <%namespace file="../includes/modals.mako" import="displayShowModals"/>
echel0n's avatar
echel0n committed
20
21
22
23
24
25
26
27
28
29
30

    <div class="row mt-3">
        <!-- Alert -->
        % if show_message:
            <div class="col-md-12 p-0">
                <div class="alert alert-info rounded-0 text-center">
                    <strong>${show_message}</strong>
                </div>
            </div>
        % endif

31
32
33
        <div class="col">
            <div class="input-group w-50 mx-auto text-center">
                <div class="input-group-prepend">
echel0n's avatar
echel0n committed
34
                    <button id="prevShow" class="btn fas fa-arrow-left"></button>
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
                </div>
                <select class="form-control" id="pickShow" title="Change Show">
                    % for curShowList in sortedShowLists:
                        % if len(sortedShowLists) > 1:
                            <optgroup label="${curShowList[0]}">
                        % endif
                        % for curShow in curShowList[1]:
                            <option value="${curShow.indexerid}" ${('', 'selected')[curShow == show]}>${curShow.name}</option>
                        % endfor
                        % if len(sortedShowLists) > 1:
                            </optgroup>
                        % endif
                    % endfor
                </select>
                <div class="input-group-append">
echel0n's avatar
echel0n committed
50
                    <button id="nextShow" class="btn fas fa-arrow-right"></button>
echel0n's avatar
echel0n committed
51
52
                </div>
            </div>
53
            <br/>
echel0n's avatar
echel0n committed
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
            <div class="row" id="showtitle" data-showname="${show.name}">
                <div class="col-6">
                    <h1>
                        ${show.name}
                    </h1>
                </div>
                <div class="col-6">
                    % if seasonResults:
                    % if int(seasonResults[-1]) == 0:
                        <% season_special = 1 %>
                    % else:
                        <% season_special = 0 %>
                    % endif
                    % if not sickrage.app.config.display_show_specials and season_special:
                        <% lastSeason = seasonResults.pop(-1) %>
                    % endif
                        <div class="text-right mt-3">
                            % if season_special:
                            ${_('Display Specials:')}
                                <a class="inner" href="${srWebRoot}/toggleDisplayShowSpecials/?show=${show.indexerid}">
                                    ${('Show', 'Hide')[bool(sickrage.app.config.display_show_specials)]}
                                </a>
                            % endif
                            % if (len(seasonResults) > 14):
                                <select id="seasonJump" class="form-control input-sm" title="Jump to Season"
                                        style="position: relative; top: -4px;">
                                    <option value="jump">Jump to Season</option>
                                    % for seasonNum in seasonResults:
                                        <option value="#season-${seasonNum}"
                                                data-season="${seasonNum}">${('Specials', 'Season ' + str(seasonNum))[int(seasonNum) > 0]}</option>
                                    % endfor
                                </select>
                            % else:
                                ${_('Season:')}
                                % for seasonNum in seasonResults:
                                    % if int(seasonNum) == 0:
                                        <a href="#season-${seasonNum}">Specials</a>
                                    % else:
                                        <a href="#season-${seasonNum}">${str(seasonNum)}</a>
                                    % endif
                                    % if seasonNum != seasonResults[-1]:
                                        <span>|</span>
                                    % endif
                                % endfor
                            % endif
                        </div>
                    % endif
                </div>
            </div>
            <hr class="bg-light"/>
104
105
        </div>
    </div>
echel0n's avatar
echel0n committed
106

107
108
    <div class="row">
        <div class="col-md-12">
echel0n's avatar
echel0n committed
109

110
111
        </div>
    </div>
echel0n's avatar
echel0n committed
112

113
114
    <div class="row">
        <div class="col">
echel0n's avatar
echel0n committed
115
            <div class="card bg-transparent font-weight-bold"
116
117
118
                 style="background-image:linear-gradient(to bottom, rgba(0,0,0,0.6) 0%,rgba(0,0,0,0.6) 100%),
                         url(${srWebRoot}${showImage(show.indexerid, 'banner').url});
                         background-size: 100% 100%;">
119
                % if show.overview:
echel0n's avatar
echel0n committed
120
                    <div class="card-header bg-transparent">
121
122
123
                        <i>${show.overview}</i>
                    </div>
                % endif
124
                <div class="card-body">
125
126
                    <div class="card-text">
                        <table class="float-md-left">
127
128
129
130
131
                            <tr>
                                <td class="showLegend">${_('Rating:')}</td>
                                <td>
                                    % if show.imdb_info and 'imdbRating' in show.imdb_info:
                                    <% rating_tip = str(show.imdb_info['imdbRating']) + " / 10" + " Stars" + "<br />" + str(show.imdb_info['imdbVotes']) + " Votes" %>
132
133
                                        <span id="imdbstars" class="text-warning fas fa-star"
                                              title="${rating_tip}">
134
135
                                            ${show.imdb_info['imdbRating']}
                                        </span>
echel0n's avatar
echel0n committed
136
                                    % endif
137
138
139
140
141
142
143
144
145
                                </td>
                            </tr>

                            <tr>
                                <td class="showLegend">${_('Quality:')}</td>
                                <td>
                                    <% anyQualities, bestQualities = Quality.splitQuality(int(show.quality)) %>
                                    % if show.quality in qualityPresets:
                                        ${renderQualityPill(show.quality)}
echel0n's avatar
echel0n committed
146
                                    % else:
147
148
149
150
151
152
                                        % if anyQualities:
                                            <i>Allowed:</i> ${", ".join([capture(renderQualityPill, x) for x in sorted(anyQualities)])}${("", "<br>")[bool(bestQualities)]}
                                        % endif
                                        % if bestQualities:
                                            <i>Preferred:</i> ${", ".join([capture(renderQualityPill, x) for x in sorted(bestQualities)])}
                                        % endif
echel0n's avatar
echel0n committed
153
                                    % endif
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
                                </td>
                            </tr>

                            <tr>
                                <td class="showLegend">${_('Show Status:')}</td>
                                <td>${show.status}</td>
                            </tr>

                            % if show.network and show.airs:
                                <tr>
                                    <td class="showLegend">${_('Originally Airs:')}</td>
                                    <td>${show.airs} ${("<span style='color: red;'><b>(invalid Timeformat)</b></span> ", "")[tz_updater.test_timeformat(show.airs)]}
                                        on ${show.network}</td>
                                </tr>
                            % elif show.network:
                                <tr>
                                    <td class="showLegend">${_('Originally Airs:')}</td>
                                    <td>${show.network}</td>
                                </tr>
                            % elif show.airs:
                                <tr>
                                    <td class="showLegend">${_('Originally Airs:')}</td>
                                    <td>${show.airs} ${("<span style='color: red;'><b>(invalid Timeformat)</b></span>", "")[tz_updater.test_timeformat(show.airs)]}</td>
                                </tr>
                            % endif

                            <tr>
                                <td class="showLegend">${_('Start Year:')}</td>
                                <td>
                                    <span>${show.startyear}</span>
                                </td>
                            </tr>

                            <tr>
                                <td class="showLegend">${_('Runtime:')}</td>
                                <td>
                                    <span>
                                        % if show.runtime:
                                            ${show.runtime} ${_('minutes')}
                                        % else:
                                            <span style="color: red;"><b>${_('UNKNOWN')}</b></span>
                                        % endif
                                    </span>
                                </td>
                            </tr>

                            <tr>
                                <td class="showLegend">${_('Info Sites:')}</td>
                                <td>
                                    % if show.imdbid:
                                        <a href="${anon_url('http://www.imdb.com/title/', show.imdbid)}"
                                           rel="noreferrer"
                                           onclick="window.open(this.href, '_blank'); return false;"
                                           title="http://www.imdb.com/title/${show.imdbid}">
echel0n's avatar
echel0n committed
208
209
                                            <i class="sickrage-core sickrage-core-imdb"
                                               style="margin-top: -1px; vertical-align:middle;"></i>
210
                                        </a>
echel0n's avatar
echel0n committed
211
                                    % endif
echel0n's avatar
echel0n committed
212

213
214
215
216
217
                                    % if xem_numbering or xem_absolute_numbering:
                                        <a href="${anon_url('http://thexem.de/search?q=', show.name)}"
                                           rel="noreferrer"
                                           onclick="window.open(this.href, '_blank'); return false;"
                                           title="http://thexem.de/search?q-${show.name}">
echel0n's avatar
echel0n committed
218
219
220
                                            <i class="sickrage-core sickrage-core-xem"
                                               style="margin-top: -1px; vertical-align:middle;"></i>
                                        </a>
echel0n's avatar
echel0n committed
221
                                    % endif
echel0n's avatar
echel0n committed
222
223
224
225
226
227
228

                                    <a href="${anon_url(IndexerApi(show.indexer).config['show_url'], show.indexerid)}"
                                       onclick="window.open(this.href, '_blank'); return false;"
                                       title="<% IndexerApi(show.indexer).config["show_url"] + str(show.indexerid) %>">
                                        <i class="sickrage-core sickrage-core-${IndexerApi(show.indexer).name.lower()}"
                                           style="margin-top: -1px; vertical-align:middle;"></i>
                                    </a>
229
230
231
232
233
234
                                </td>
                            </tr>

                            <tr>
                                <td class="showLegend">${_('Genre:')}</td>
                                <td>
235
                                    <ul class="list-group d-inline">
236
237
238
239
240
                                        % if not show.imdbid and show.genre:
                                            % for genre in show.genre[1:-1].split(','):
                                                <a href="${anon_url('http://trakt.tv/shows/popular/?genres=', genre.lower())}"
                                                   target="_blank"
                                                   title="View other popular ${genre} shows on trakt.tv.">
241
                                                    <li class="list-group-item badge badge-primary">${genre}</li>
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
                                                </a>
                                            % endfor
                                        % endif
                                        % if 'Year' in show.imdb_info:
                                            % for imdbgenre in show.imdb_info['Genre'].replace('Sci-Fi','Science-Fiction').split(','):
                                                <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="list-inline-item badge badge-primary">${imdbgenre}</li>
                                                </a>
                                            % endfor
                                        % endif
                                    </ul>
                                </td>
                            </tr>

                            <tr>
                                <td class="showLegend">${_('Default EP Status:')}</td>
                                <td>${statusStrings[show.default_ep_status]}</td>
                            </tr>

                            <td class="showLegend">${_('Location:')}</td>
                            % if os.path.isdir(showLoc):
                                <td>${showLoc}</td>
                            % else:
                                <td><span style="color: red;">${showLoc}</span> (${_('Missing')})</td>
                            % endif
                            % if os.path.isdir(showLoc):
                                <tr>
                                    <td class="showLegend">${_('Size:')}</td>
                                    <td>${pretty_filesize(get_size(showLoc.encode('utf-8')))}</td>
                                </tr>
                            % endif
                            <tr>
                                <td class="showLegend">${_('Scene Name:')}</td>
                                <td>${(show.name, " | ".join(show.exceptions))[show.exceptions != 0]}</td>
                            </tr>
                            <tr>
                                <td class="showLegend">${_('Search Delay:')}</td>
                                <td>${show.search_delay} day(s)</td>
                            </tr>
                            % if show.rls_require_words:
                                <tr>
                                    <td class="showLegend">${_('Required Words:')}</td>
                                    <td>${show.rls_require_words}</td>
                                </tr>
                            % endif
                            % if show.rls_ignore_words:
                                <tr>
                                    <td class="showLegend">${_('Ignored Words:')}</td>
                                    <td>${show.rls_ignore_words}</td>
                                </tr>
                            % endif
                            % if bwl and bwl.whitelist:
                                <tr>
                                    <td class="showLegend">${_('Wanted Group')}${("", "s")[len(bwl.whitelist) > 1]}
                                        :
                                    </td>
                                    <td>${', '.join(bwl.whitelist)}</td>
                                </tr>
                            % endif
                            % if bwl and bwl.blacklist:
                                <tr>
                                    <td class="showLegend">${_('Unwanted Group')}${("", "s")[len(bwl.blacklist) > 1]}
                                        :
                                    </td>
                                    <td>${', '.join(bwl.blacklist)}</td>
                                </tr>
                            % endif
                        </table>

313
314
315
316
                        <table class="float-md-right">
                            <% info_flag = sickrage.subtitles.code_from_code(show.lang) if show.lang else '' %>
                            <tr>
                                <td class="showLegend">${_('Info Language:')}</td>
echel0n's avatar
echel0n committed
317
                                <td>
echel0n's avatar
echel0n committed
318
                                    <i class="sickrage-flags sickrage-flags-${info_flag}"></i>
319
320
321
322
323
324
325
326
327
328
                                </td>
                            </tr>
                            % if sickrage.app.config.use_subtitles:
                                <tr>
                                    <td class="showLegend">${_('Subtitles:')}</td>
                                    <td>
                                        <i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.subtitles)]}"></i>
                                    </td>
                                </tr>
                            % endif
329
                            <tr>
330
                                <td class="showLegend">${_('Subtitles Metadata:')}</td>
331
                                <td>
332
                                    <i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.subtitles_sr_metadata)]}"></i>
333
334
                                </td>
                            </tr>
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
                            <tr>
                                <td class="showLegend">${_('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>
                                </td>
                            </tr>
                            <tr>
                                <td class="showLegend">${_('Paused:')}</td>
                                <td>
                                    <i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.paused)]}"></i>
                                </td>
                            </tr>
                            <tr>
                                <td class="showLegend">${_('Air-by-Date:')}</td>
                                <td>
                                    <i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.air_by_date)]}"></i>
                                </td>
                            </tr>
                            <tr>
                                <td class="showLegend">${_('Sports:')}</td>
                                <td>
                                    <i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.is_sports)]}"></i>
                                </td>
                            </tr>
                            <tr>
                                <td class="showLegend">${_('Anime:')}</td>
                                <td>
                                    <i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.is_anime)]}"></i>
                                </td>
                            </tr>
                            <tr>
                                <td class="showLegend">${_('DVD Order:')}</td>
                                <td>
                                    <i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.dvdorder)]}"></i>
                                </td>
                            </tr>
                            <tr>
                                <td class="showLegend">${_('Scene Numbering:')}</td>
                                <td>
                                    <i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.scene)]}"></i>
                                </td>
                            </tr>
                            <tr>
                                <td class="showLegend">${_('Skip Downloaded:')}</td>
                                <td>
                                    <i class="fa ${("fa-times text-danger", "fa-check text-success")[bool(show.skip_downloaded)]}"></i>
                                </td>
                            </tr>
                        </table>
                    </div>
echel0n's avatar
echel0n committed
385
386
                </div>
            </div>
387
388
        </div>
    </div>
echel0n's avatar
echel0n committed
389

390
    <div class="row mt-1">
391
        <div class="col text-left">
392
393
394
395
396
397
398
399
400
401
402
403
404
            <div class="input-group">
                <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">
echel0n's avatar
echel0n committed
405
                    <button id="changeStatus" class="btn fas fa-play"></button>
406
407
408
409
410
411
                </div>
            </div>
            <input type="hidden" id="showID" value="${show.indexerid}"/>
            <input type="hidden" id="indexer" value="${show.indexer}"/>
        </div>
        <div class="col">
echel0n's avatar
echel0n committed
412
            <div class="row">
413
414
415
416
417
418
                <div class="col text-right">
                    <div id="checkboxControls">
                    <span class="badge missed">
                        <input type="checkbox" id="missed" checked/>
                        ${_('Missed:')} <b>${epCounts[Overview.MISSED]}</b>
                    </span>
419
                        <span class="badge wanted">
420
                        <input type="checkbox" id="wanted" checked/>
421
                            ${_('Wanted:')} <b>${epCounts[Overview.WANTED]}</b>
422
                    </span>
423
                        <span class="badge qual">
424
                        <input type="checkbox" id="qual" checked/>
425
                            ${_('Low Quality:')} <b>${epCounts[Overview.QUAL]}</b>
426
                    </span>
427
                        <span class="badge good">
428
                        <input type="checkbox" id="good" checked/>
429
                            ${_('Downloaded:')} <b>${epCounts[Overview.GOOD]}</b>
430
                    </span>
431
                        <span class="badge skipped">
432
                        <input type="checkbox" id="skipped" checked/>
433
                            ${_('Skipped:')} <b>${epCounts[Overview.SKIPPED]}</b>
434
                    </span>
435
                        <span class="badge snatched">
436
                        <input type="checkbox" id="snatched" checked/>
437
438
                            <% total_snatched = epCounts[Overview.SNATCHED] + epCounts[Overview.SNATCHED_PROPER] + epCounts[Overview.SNATCHED_BEST] %>
                            ${_('Snatched:')} <b>${total_snatched}</b>
439
                    </span>
echel0n's avatar
echel0n committed
440
441
                    </div>
                </div>
442
443
444
            </div>
            <div class="row">
                <div class="col text-right">
echel0n's avatar
echel0n committed
445
                    <button class="btn mt-1 mb-1 seriesCheck">
446
447
                        ${_('Select Filtered Episodes')}
                    </button>
echel0n's avatar
echel0n committed
448
                    <button class="btn mt-1 mb-1 clearAll">
449
450
                        ${_('Clear All')}
                    </button>
echel0n's avatar
echel0n committed
451
                    <button class="btn mt-1 mb-1" id="popover" type="button">
452
453
                        ${_('Select Columns')} <b class="caret"></b>
                    </button>
echel0n's avatar
echel0n committed
454
455
456
457
458
459
                </div>
            </div>
        </div>
    </div>

    <div class="row">
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
    <div class="col-md-12">
    <% curSeason = -1 %>
    <% odd = 0 %>
    % for epResult in episodeResults:
        <%
            epStr = str(epResult["season"]) + "x" + str(epResult["episode"])
            if not epStr in epCats:
                        next

            if not sickrage.app.config.display_show_specials and int(epResult["season"]) == 0:
                        next

            scene = False
            scene_anime = False
            if not show.air_by_date and not show.is_sports and not show.is_anime and show.is_scene:
echel0n's avatar
echel0n committed
475
                        scene = True
476
            elif not show.air_by_date and not show.is_sports and show.is_anime and show.is_scene:
echel0n's avatar
echel0n committed
477
478
                        scene_anime = True

479
480
            (dfltSeas, dfltEpis, dfltAbsolute) = (0, 0, 0)
            if (epResult["season"], epResult["episode"]) in xem_numbering:
echel0n's avatar
echel0n committed
481
482
                        (dfltSeas, dfltEpis) = xem_numbering[(epResult["season"], epResult["episode"])]

483
            if epResult["absolute_number"] in xem_absolute_numbering:
echel0n's avatar
echel0n committed
484
485
                        dfltAbsolute = xem_absolute_numbering[epResult["absolute_number"]]

486
            if epResult["absolute_number"] in scene_absolute_numbering:
echel0n's avatar
echel0n committed
487
488
                        scAbsolute = scene_absolute_numbering[epResult["absolute_number"]]
                        dfltAbsNumbering = False
489
            else:
echel0n's avatar
echel0n committed
490
491
492
                        scAbsolute = dfltAbsolute
                        dfltAbsNumbering = True

493
            if (epResult["season"], epResult["episode"]) in scene_numbering:
echel0n's avatar
echel0n committed
494
495
                        (scSeas, scEpis) = scene_numbering[(epResult["season"], epResult["episode"])]
                        dfltEpNumbering = False
496
            else:
echel0n's avatar
echel0n committed
497
498
499
                        (scSeas, scEpis) = (dfltSeas, dfltEpis)
                        dfltEpNumbering = True

500
501
502
503
            epLoc = epResult["location"]
            if epLoc and show._location and epLoc.lower().startswith(show._location.lower()):
                        epLoc = epLoc[len(show._location)+1:]
        %>
echel0n's avatar
echel0n committed
504

505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
        % if int(epResult["season"]) != curSeason:
        <% curSeason = int(epResult["season"]) %>
        % if epResult["season"] != episodeResults[0]["season"]:
            </tbody>
            </table>
        </div>
        </div>
        </div>
        % endif

        <div class="row">
            <div class="col-md-12">
                <br/>
                <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:
523
                        <button id="showseason-${epResult['season']}" type="button" class="btn btn-xs text-right"
524
525
526
                                data-toggle="collapse" data-target="#collapseSeason-${epResult['season']}"
                                aria-expanded="true">${_('Hide Episodes')}</button>
                    %else:
527
                        <button id="showseason-${epResult['season']}" type="button" class="btn btn-xs text-right"
528
529
530
531
532
533
534
535
                                data-toggle="collapse"
                                data-target="#collapseSeason-${epResult['season']}">${_('Show Episodes')}</button>
                    %endif
                % endif
            </div>
        </div>
        <div class="row">
        <div class="col-md-12">
echel0n's avatar
echel0n committed
536
        <div class="table-responsive">
537
        <table id="${("showTable", "animeTable")[bool(show.is_anime)]}"
echel0n's avatar
echel0n committed
538
               class="table display_show"
539
               style="opacity: .80" cellspacing="0" border="0" cellpadding="0">
540
541
            <thead>
            <tr class="seasoncols">
542
                <th data-sorter="false" data-priority="critical" class="table-fit col-checkbox">
543
544
                    <input type="checkbox" class="seasonCheck" id="${epResult["season"]}"/>
                </th>
545
546
547
548
549
550
                <th data-sorter="false" class="table-fit col-metadata">${_('NFO')}</th>
                <th data-sorter="false" class="table-fit col-metadata">${_('TBN')}</th>
                <th data-sorter="false" class="table-fit col-ep episode">${_('Episode')}</th>
                <th data-sorter="false" ${("class=\"table-fit col-ep columnSelector-false\"", "class=\"table-fit col-ep\"")[bool(show.is_anime)]}>${_('Absolute')}</th>
                <th data-sorter="false" ${("class=\"table-fit col-ep columnSelector-false\"", "class=\"table-fit col-ep\"")[bool(scene)]}>${_('Scene')}</th>
                <th data-sorter="false" ${("class=\"table-fit col-ep columnSelector-false\"", "class=\"table-fit col-ep\"")[bool(scene_anime)]}>${_('Scene Absolute')}</th>
551
                <th data-sorter="false" class="col-name">${_('Name')}</th>
552
553
554
555
556
557
                <th data-sorter="false" class="table-fit col-ep columnSelector-false size">${_('Size')}</th>
                <th data-sorter="false" class="table-fit col-airdate">${_('Airdate')}</th>
                <th data-sorter="false" ${("class=\"table-fit col-ep columnSelector-false\"", "class=\"table-fit col-ep\"")[bool(sickrage.app.config.download_url)]}>${_('Download')}</th>
                <th data-sorter="false" ${("class=\"table-fit col-ep columnSelector-false\"", "class=\"table-fit col-ep\"")[bool(sickrage.app.config.use_subtitles)]}>${_('Subtitles')}</th>
                <th data-sorter="false" class="table-fit col-status">${_('Status')}</th>
                <th data-sorter="false" class="table-fit col-search">${_('Search')}</th>
558
559
560
561
562
563
564
            </tr>
            </thead>

        <tbody
            % if sickrage.app.config.display_all_seasons == False:
                class="collapse${("", " in")[curSeason == -1]}"
                id="collapseSeason-${epResult['season']}"
echel0n's avatar
echel0n committed
565
            % endif
566
567
        >
        % endif
568
        <tr class="${Overview.overviewStrings[epCats[epStr]]} season-${curSeason} seasonstyle font-weight-bold text-dark"
569
570
571
572
573
574
575
576
577
578
579
            id="S${str(epResult["season"])}E${str(epResult["episode"])}">

            <td class="col-checkbox">
                % if int(epResult["status"]) != UNAIRED:
                    <input type="checkbox" class="epCheck"
                           id="${str(epResult["season"])}x${str(epResult["episode"])}"
                           name="${str(epResult["season"])}x${str(epResult["episode"])}" title=""/>
                % endif
            </td>

            <td align="center">
echel0n's avatar
echel0n committed
580
                <i class="fas ${("fa-times", "fa-check")[epResult["hasnfo"]]}"></i>
581
582
583
            </td>

            <td align="center">
echel0n's avatar
echel0n committed
584
                <i class="fas ${("fa-times", "fa-check")[epResult["hastbn"]]}"></i>
585
586
587
588
589
590
            </td>

            <td align="center">
                <%
                    text = str(epResult['episode'])
                    if epLoc != '' and epLoc is not None:
echel0n's avatar
echel0n committed
591
                            text = '<span title="' + epLoc + '" class="badge badge-dark">' + text + "</span>"
592
                %>
echel0n's avatar
echel0n committed
593
                ${text}
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
            </td>

            <td align="center">${epResult["absolute_number"]}</td>

            <td align="center">
                <input placeholder="${str(dfltSeas)}x${str(dfltEpis)}" size="6"
                       maxlength="8"
                       class="sceneSeasonXEpisode form-control input-scene"
                       data-for-season="${epResult["season"]}"
                       data-for-episode="${epResult["episode"]}"
                       id="sceneSeasonXEpisode_${show.indexerid}_${str(epResult["season"])}_${str(epResult["episode"])}"
                       title="Change the value here if scene numbering differs from the indexer episode numbering"
                    % if dfltEpNumbering:
                       value=""
                    % else:
                       value="${str(scSeas)}x${str(scEpis)}"
echel0n's avatar
echel0n committed
610
                    % endif
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
                       style="padding: 0; text-align: center; max-width: 60px;"/>
            </td>

            <td align="center">
                <input placeholder="${str(dfltAbsolute)}" size="6" maxlength="8"
                       class="sceneAbsolute form-control input-scene"
                       data-for-absolute="${epResult["absolute_number"]}"
                       id="sceneAbsolute_${show.indexerid}_${str(epResult["absolute_number"])}"
                       title="Change the value here if scene absolute numbering differs from the indexer absolute numbering"
                    % if dfltAbsNumbering:
                       value=""
                    % else:
                       value="${str(scAbsolute)}"
                    % endif
                       style="padding: 0; text-align: center; max-width: 60px;"/>
            </td>

            <td class="col-name">
echel0n's avatar
echel0n committed
629
630
                <i id="plot_info_${str(show.indexerid)}_${str(epResult["season"])}_${str(epResult["episode"])}"
                   class="fas fa-info-circle" title="${epResult["description"]}"></i>
631
632
633
                ${epResult["name"]}
            </td>

634
            <td class="text-nowrap col-ep">
635
                % if epResult["file_size"]:
echel0n's avatar
echel0n committed
636
                                <% file_size = pretty_filesize(epResult["file_size"]) %>
637
638
639
640
641
642
643
644
645
                ${file_size}
                % endif
            </td>

            <td class="col-airdate">
                % if int(epResult['airdate']) != 1:
                <% airDate = datetime.datetime.fromordinal(epResult['airdate']) %>

                % if airDate.year >= 1970 or show.network:
echel0n's avatar
echel0n committed
646
                    <% airDate = srdatetime.srDateTime(tz_updater.parse_date_time(epResult['airdate'], show.airs, show.network), convert=True).dt %>
647
648
                % endif
                    <time datetime="${airDate.isoformat()}"
649
                          class="date text-nowrap">${srdatetime.srDateTime(airDate).srfdatetime()}</time>
650
651
652
653
654
655
656
657
658
659
                % else:
                    ${_('Never')}
                % endif
            </td>

            <td>
                % if sickrage.app.config.download_url and epResult['location']:
                <%
                    filename = epResult['location']
                    for rootDir in sickrage.app.config.root_dirs.split('|'):
echel0n's avatar
echel0n committed
660
661
                                        if rootDir.startswith('/'):
                                            filename = filename.replace(rootDir, "")
662
663
664
665
666
667
668
669
                    filename = sickrage.app.config.download_url + urllib.quote(filename.encode('utf8'))
                %>
                    <div style="text-align: center;"><a href="${filename}">${_('Download')}</a></div>
                % endif
            </td>

            <td class="col-subtitles" align="center">
                % for flag in (epResult["subtitles"] or '').split(','):
echel0n's avatar
echel0n committed
670
671
672
673
674
675
676
677
                    % if sickrage.subtitles.name_from_code(flag).lower() != 'undetermined':
                        % if flag.strip() != 'und':
                            <i class="sickrage-flags sickrage-flag-${flag}"
                               title="${sickrage.subtitles.name_from_code(flag)}"></i>
                        % else:
                            <i class="sickrage-flags sickrage-flag-${flag}"
                               title="${sickrage.subtitles.name_from_code(flag)}"></i>
                        % endif
678
                    % else:
echel0n's avatar
echel0n committed
679
                        <i class="sickrage-flags sickrage-flags-unknown" title="${_('Unknown')}"></i>
680
681
682
683
684
685
                    % endif
                % endfor
            </td>

            <% curStatus, curQuality = Quality.splitCompositeStatus(int(epResult["status"])) %>
            % if curQuality != Quality.NONE:
686
                <td class="text-nowrap col-status">${statusStrings[curStatus]} ${renderQualityPill(curQuality)}</td>
687
            % else:
688
                <td class="text-nowrap col-status">${statusStrings[curStatus]}</td>
689
            % endif
echel0n's avatar
echel0n committed
690

691
            <td class="text-center col-search">
692
693
694
695
696
697
                % if int(epResult["season"]) != 0:
                    % if ( int(epResult["status"]) in Quality.SNATCHED + Quality.DOWNLOADED ):
                        <a class="epRetry"
                           id="${str(show.indexerid)}x${str(epResult["season"])}x${str(epResult["episode"])}"
                           name="${str(show.indexerid)}x${str(epResult["season"])}x${str(epResult["episode"])}"
                           href="retryEpisode?show=${show.indexerid}&amp;season=${epResult["season"]}&amp;episode=${epResult["episode"]}">
698
                            <i class="fas fa-sync" title="${_('Retry Download')}"></i>
699
700
701
702
703
704
                        </a>
                    % else:
                        <a class="epSearch"
                           id="${str(show.indexerid)}x${str(epResult["season"])}x${str(epResult["episode"])}"
                           name="${str(show.indexerid)}x${str(epResult["season"])}x${str(epResult["episode"])}"
                           href="searchEpisode?show=${show.indexerid}&amp;season=${epResult["season"]}&amp;episode=${epResult["episode"]}">
705
                            <i class="fas fa-search" title="${_('Manual Search')}"></i>
706
707
708
709
710
711
                        </a>
                    % endif
                % endif
                % if sickrage.app.config.use_subtitles and show.subtitles and epResult["location"] and frozenset(sickrage.subtitles.wanted_languages()).difference(epResult["subtitles"].split(',')):
                    <a class="epSubtitlesSearch"
                       href="searchEpisodeSubtitles?show=${show.indexerid}&amp;season=${epResult["season"]}&amp;episode=${epResult["episode"]}">
712
                        <i class="fas fa-comment" title="${_('Subtitles Search')}"></i>
713
714
715
716
717
718
719
720
721
                    </a>
                % endif
            </td>
        </tr>
    % endfor
    </tbody>
    </table>
    </div>
    </div>
echel0n's avatar
echel0n committed
722
723
724
    </div>
    ${displayShowModals()}
</%block>