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

    import sickrage
    import sickrage.subtitles
    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
14
    from sickrage.indexers import IndexerApi
15
%>
16

17 18 19 20 21 22 23 24
<%namespace file="../includes/modals.mako" import="displayShowModals"/>
<%namespace file="../includes/quality_defaults.mako" import="renderQualityPill"/>

<%block name="modals">
    ${displayShowModals()}
</%block>

<%block name="content">
25
    <div class="row">
26 27 28 29 30 31 32 33
        <div class="col-lg-12 mx-auto">
            <div class="row">
                <!-- 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>
34
                    </div>
35
                % endif
36

37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
                <div class="col-lg-10 mx-auto">
                    <div class="input-group mx-auto" style="width: 30%">
                        <div class="input-group-prepend">
                            <button id="prevShow" class="btn fas fa-arrow-left"></button>
                        </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">
                            <button id="nextShow" class="btn fas fa-arrow-right"></button>
                        </div>
58
                    </div>
59 60
                    <br/>
                    <div class="row" id="showtitle" data-showname="${show.name}">
echel0n's avatar
echel0n committed
61
                        <div class="col">
62 63 64 65
                            <h1>
                                ${show.name}
                            </h1>
                        </div>
echel0n's avatar
echel0n committed
66
                        <div class="col">
67
                            % if seasonResults:
echel0n's avatar
echel0n committed
68
                            % if int(seasonResults[0]) == 0:
69 70 71
                                <% season_special = 1 %>
                            % else:
                                <% season_special = 0 %>
72
                            % endif
73 74
                            % if not sickrage.app.config.display_show_specials and season_special:
                                <% lastSeason = seasonResults.pop(-1) %>
75
                            % endif
echel0n's avatar
echel0n committed
76
                                <div class="float-right text-left">
77 78 79 80 81 82 83
                                    % 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
echel0n's avatar
echel0n committed
84
                                    <br/>
85 86 87 88 89 90 91 92 93 94 95
                                    % 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:')}
96
                                        % for seasonNum in seasonResults:
97 98 99 100 101 102 103 104
                                            % 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
105
                                        % endfor
106 107 108 109
                                    % endif
                                </div>
                            % endif
                        </div>
110
                    </div>
echel0n's avatar
echel0n committed
111
                    <hr class="bg-light mt-0"/>
echel0n's avatar
echel0n committed
112 113
                </div>
            </div>
114

echel0n's avatar
echel0n committed
115
            <div class="row">
116 117
                <div class="col-lg-10 mx-auto">
                    <div class="row mb-1">
118 119
                        <div class="col-auto d-none d-lg-block">
                            <img class="shadow-lg rounded" style="margin-bottom: -400px"
120
                                 src="${srWebRoot}${showImage(show.indexerid, 'poster_thumb').url}"/>
echel0n's avatar
echel0n committed
121
                        </div>
122 123 124 125 126 127 128 129 130 131
                        <div class="col">
                            <div class="row">
                                <div class="col-auto">
                                    % if show.imdb_info and 'imdbRating' in show.imdb_info:
                                    <% rating_tip = str(show.imdb_info['imdbRating']) + " / 10" + " Stars and " + str(show.imdb_info['imdbVotes']) + " Votes" %>
                                        <span id="imdbstars"
                                              data-imdb-rating="${show.imdb_info['imdbRating']}"
                                              title="${rating_tip}"></span>
                                    % endif
                                </div>
echel0n's avatar
echel0n committed
132

133 134
                                <div class="col-auto">
                                    (<span>${show.startyear}</span>) -
echel0n's avatar
echel0n committed
135

136 137 138 139 140 141 142
                                    <span>
                                        % if show.runtime:
                                            ${show.runtime} ${_('minutes')}
                                        % else:
                                            <span style="color: red;"><b>${_('UNKNOWN')}</b></span>
                                        % endif
                                    </span>
echel0n's avatar
echel0n committed
143

144 145 146 147 148 149 150 151 152
                                    % 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}">
                                            <i class="sickrage-core sickrage-core-imdb"
                                               style="margin-top: -1px; vertical-align:middle;"></i>
                                        </a>
                                    % endif
echel0n's avatar
echel0n committed
153

154 155 156 157 158 159 160 161 162
                                    % 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}">
                                            <i class="sickrage-core sickrage-core-xem"
                                               style="margin-top: -1px; vertical-align:middle;"></i>
                                        </a>
                                    % endif
echel0n's avatar
echel0n committed
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
                                    <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>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col">
                                    <ul class="list-group d-inline">
                                        % if not show.imdbid and show.genre:
                                            % for genre in show.genre.split(','):
                                                <a href="${anon_url('http://trakt.tv/shows/popular/?genres=', genre.lower())}"
                                                   target="_blank"
                                                   title="View other popular ${genre} shows on trakt.tv.">
                                                    <li class="fas fa-tag fa-1x badge badge-primary p-2"> ${genre}</li>
                                                </a>
                                            % endfor
                                        % endif
                                        % if show.imdb_info and '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="fas fa-tag fa-1x badge badge-primary p-2"> ${imdbgenre}</li>
                                                </a>
                                            % endfor
                                        % endif
                                    </ul>
                                </div>
                            </div>
echel0n's avatar
echel0n committed
196
                        </div>
197 198 199
                        <div class="col-auto d-lg-none d-xl-flex">
                            <img class="rounded shadow-lg img-banner"
                                 src="${srWebRoot}${showImage(show.indexerid, 'banner').url}"/>
echel0n's avatar
echel0n committed
200 201 202 203 204
                        </div>
                    </div>
                </div>
            </div>

205
            <div class="row bg-dark border border-white pt-5 pb-5">
206
                <div class="col-lg-6 col-xl-7 offset-0 offset-lg-5 offset-xl-4 offset-xxxl-3">
207
                    <div class="row">
echel0n's avatar
echel0n committed
208
                        <div class="col">
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
                            <div>
                                <i>${show.overview}</i>
                            </div>
                            <br/>
                            <table>
                                <tr>
                                    <td class="show-legend">${_('Quality:')}</td>
                                    <td>
                                        <% anyQualities, bestQualities = Quality.splitQuality(int(show.quality)) %>
                                        % if show.quality in qualityPresets:
                                            ${renderQualityPill(show.quality)}
                                        % else:
                                            % 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
                                        % endif
                                    </td>
                                </tr>
230

231 232 233 234
                                <tr>
                                    <td class="show-legend">${_('Show Status:')}</td>
                                    <td>${show.status}</td>
                                </tr>
235

236 237 238 239 240 241 242 243 244 245 246 247 248 249
                                % if show.network and show.airs:
                                    <tr>
                                        <td class="show-legend">${_('Originally Airs:')}</td>
                                        <td>${show.airs} ${("<span style='color: red;'><b>(invalid Timeformat)</b></span> ", "")[sickrage.app.tz_updater.test_timeformat(show.airs)]}
                                            on ${show.network}</td>
                                    </tr>
                                % elif show.network:
                                    <tr>
                                        <td class="show-legend">${_('Originally Airs:')}</td>
                                        <td>${show.network}</td>
                                    </tr>
                                % elif show.airs:
                                    <tr>
                                        <td class="show-legend">${_('Originally Airs:')}</td>
250

251 252 253
                                        <td>${show.airs} ${("<span style='color: red;'><b>(invalid Timeformat)</b></span>", "")[sickrage.app.tz_updater.test_timeformat(show.airs)]}</td>
                                    </tr>
                                % endif
254

255 256 257 258
                                <tr>
                                    <td class="show-legend">${_('Default EP Status:')}</td>
                                    <td>${statusStrings[show.default_ep_status]}</td>
                                </tr>
259

260 261 262 263 264 265 266 267
                                <tr>
                                    <td class="show-legend">${_('Location:')}</td>
                                    % if os.path.isdir(showLoc):
                                        <td>${showLoc}</td>
                                    % else:
                                        <td><span style="color: red;">${showLoc}</span> (${_('Missing')})</td>
                                    % endif
                                </tr>
268

269 270 271 272
                                <tr>
                                    <td class="show-legend">${_('Size:')}</td>
                                    <td>${pretty_filesize(show.show_size)}</td>
                                </tr>
echel0n's avatar
echel0n committed
273

274 275 276 277
                                <tr>
                                    <td class="show-legend">${_('Scene Name:')}</td>
                                    <td>${(show.name, " | ".join(show.exceptions))[show.exceptions != 0]}</td>
                                </tr>
echel0n's avatar
echel0n committed
278

279 280 281 282
                                <tr>
                                    <td class="show-legend">${_('Search Delay:')}</td>
                                    <td>${show.search_delay} day(s)</td>
                                </tr>
echel0n's avatar
echel0n committed
283

284 285 286 287 288 289
                                % if show.rls_require_words:
                                    <tr>
                                        <td class="show-legend">${_('Required Words:')}</td>
                                        <td>${show.rls_require_words}</td>
                                    </tr>
                                % endif
echel0n's avatar
echel0n committed
290

291 292 293 294 295 296
                                % if show.rls_ignore_words:
                                    <tr>
                                        <td class="show-legend">${_('Ignored Words:')}</td>
                                        <td>${show.rls_ignore_words}</td>
                                    </tr>
                                % endif
echel0n's avatar
echel0n committed
297

298 299 300 301 302 303 304 305
                                % if bwl and bwl.whitelist:
                                    <tr>
                                        <td class="show-legend">${_('Wanted Group')}${("", "s")[len(bwl.whitelist) > 1]}
                                            :
                                        </td>
                                        <td>${', '.join(bwl.whitelist)}</td>
                                    </tr>
                                % endif
echel0n's avatar
echel0n committed
306

307 308 309 310 311 312 313 314 315 316
                                % if bwl and bwl.blacklist:
                                    <tr>
                                        <td class="show-legend">${_('Unwanted Group')}${("", "s")[len(bwl.blacklist) > 1]}
                                            :
                                        </td>
                                        <td>${', '.join(bwl.blacklist)}</td>
                                    </tr>
                                % endif
                            </table>
                        </div>
echel0n's avatar
echel0n committed
317

318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 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 385 386 387 388 389
                        <div class="col-auto">
                            <table>
                                <% info_flag = sickrage.subtitles.code_from_code(show.lang) if show.lang else '' %>
                                <tr>
                                    <td class="show-legend">${_('Info Language:')}</td>
                                    <td>
                                        <i class="sickrage-flags sickrage-flags-${info_flag}"></i>
                                    </td>
                                </tr>
                                % if sickrage.app.config.use_subtitles:
                                    <tr>
                                        <td class="show-legend">${_('Subtitles:')}</td>
                                        <td>
                                            <i class="fa ${("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>
                                    </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>
                                    </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>
                                    </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>
                                    </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>
                                    </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>
                                    </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>
                                    </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>
                                    </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>
                                    </td>
                                </tr>
                            </table>
390
                        </div>
391
                    </div>
392 393
                </div>
            </div>
394 395
        </div>
    </div>
396

397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
    <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>
415
                        </div>
416 417 418 419 420 421 422
                    </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">
echel0n's avatar
echel0n committed
423 424 425 426
                                    <span class="badge missed">
                                        <input type="checkbox" id="missed" checked/>
                                        ${_('Missed:')} <b>${epCounts[Overview.MISSED]}</b>
                                    </span>
427
                            <span class="badge wanted">
echel0n's avatar
echel0n committed
428
                                        <input type="checkbox" id="wanted" checked/>
429
                                ${_('Wanted:')} <b>${epCounts[Overview.WANTED]}</b>
echel0n's avatar
echel0n committed
430
                                    </span>
431
                            <span class="badge qual">
echel0n's avatar
echel0n committed
432
                                        <input type="checkbox" id="qual" checked/>
433
                                ${_('Low Quality:')} <b>${epCounts[Overview.QUAL]}</b>
echel0n's avatar
echel0n committed
434
                                    </span>
435
                            <span class="badge good">
echel0n's avatar
echel0n committed
436
                                        <input type="checkbox" id="good" checked/>
437
                                ${_('Downloaded:')} <b>${epCounts[Overview.GOOD]}</b>
echel0n's avatar
echel0n committed
438
                                    </span>
439
                            <span class="badge skipped">
echel0n's avatar
echel0n committed
440
                                        <input type="checkbox" id="skipped" checked/>
441
                                ${_('Skipped:')} <b>${epCounts[Overview.SKIPPED]}</b>
echel0n's avatar
echel0n committed
442
                                    </span>
443
                            <span class="badge snatched">
echel0n's avatar
echel0n committed
444
                                        <input type="checkbox" id="snatched" checked/>
445 446
                                <% total_snatched = epCounts[Overview.SNATCHED] + epCounts[Overview.SNATCHED_PROPER] + epCounts[Overview.SNATCHED_BEST] %>
                                ${_('Snatched:')} <b>${total_snatched}</b>
echel0n's avatar
echel0n committed
447
                                    </span>
448 449 450 451 452 453 454 455 456 457 458
                        </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>
459
                        </div>
460
                    </div>
461
                </div>
462
            </div>
463
        </div>
464
    </div>
465 466
    </div>
    </div>
467

468 469
    <div class="row">
    <div class="col-lg-10 mx-auto">
470 471 472 473 474 475 476 477
    <div class="row">
    <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:
echel0n's avatar
echel0n committed
478
                    next
479

480
                if not sickrage.app.config.display_show_specials and int(epResult["season"]) == 0:
echel0n's avatar
echel0n committed
481
                    next
482

483 484 485
                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:
486
                                scene = True
487
                elif not show.air_by_date and not show.is_sports and show.is_anime and show.is_scene:
488 489
                                scene_anime = True

490 491
                (dfltSeas, dfltEpis, dfltAbsolute) = (0, 0, 0)
                if (epResult["season"], epResult["episode"]) in xem_numbering:
492 493
                                (dfltSeas, dfltEpis) = xem_numbering[(epResult["season"], epResult["episode"])]

494
                if epResult["absolute_number"] in xem_absolute_numbering:
495 496
                                dfltAbsolute = xem_absolute_numbering[epResult["absolute_number"]]

497
                if epResult["absolute_number"] in scene_absolute_numbering:
498 499
                                scAbsolute = scene_absolute_numbering[epResult["absolute_number"]]
                                dfltAbsNumbering = False
500
                else:
501 502 503
                                scAbsolute = dfltAbsolute
                                dfltAbsNumbering = True

504
                if (epResult["season"], epResult["episode"]) in scene_numbering:
505 506
                                (scSeas, scEpis) = scene_numbering[(epResult["season"], epResult["episode"])]
                                dfltEpNumbering = False
507
                else:
508 509 510
                                (scSeas, scEpis) = (dfltSeas, dfltEpis)
                                dfltEpNumbering = True

511 512
                epLoc = epResult["location"]
                if epLoc and show._location and epLoc.lower().startswith(show._location.lower()):
513
                                epLoc = epLoc[len(show._location)+1:]
514
            %>
515

516 517 518 519 520 521 522 523 524
            % if int(epResult["season"]) != curSeason:
            <% curSeason = int(epResult["season"]) %>
            % if epResult["season"] != episodeResults[0]["season"]:
                </tbody>
                </table>
            </div>
            </div>
            </div>
            % endif
525 526

                <div class="row">
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543
                    <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:
                                <button id="showseason-${epResult['season']}" type="button"
                                        class="btn btn-xs 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"
                                        data-toggle="collapse"
                                        data-target="#collapseSeason-${epResult['season']}">${_('Show Episodes')}</button>
                            %endif
544
                        % endif
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567
                    </div>
                </div>
            <div class="row">
            <div class="col-md-12">
            <div class="table-responsive">
            <table id="${("showTable", "animeTable")[bool(show.is_anime)]}" class="table displayShowTable">
                <thead class="thead-dark">
                <tr class="seasoncols">
                    <th data-sorter="false" data-priority="critical" class="col-checkbox">
                        <input type="checkbox" class="seasonCheck" id="${epResult["season"]}"/>
                    </th>
                    <th data-sorter="false" class="col-metadata">${_('NFO')}</th>
                    <th data-sorter="false" class="col-metadata">${_('TBN')}</th>
                    <th data-sorter="false" class="col-ep episode">${_('Episode')}</th>
                    <th data-sorter="false" ${("class=\"col-ep columnSelector-false\"", "class=\"col-ep\"")[bool(show.is_anime)]}>${_('Absolute')}</th>
                    <th data-sorter="false" ${("class=\"col-ep columnSelector-false\"", "class=\"col-ep\"")[bool(scene)]}>${_('Scene')}</th>
                    <th data-sorter="false" ${("class=\"col-ep columnSelector-false\"", "class=\"col-ep\"")[bool(scene_anime)]}>${_('Scene Absolute')}</th>
                    <th data-sorter="false" class="col-name">${_('Name')}</th>
                    <th data-sorter="false" class="col-ep columnSelector-false size">${_('Size')}</th>
                    <th data-sorter="false" class="col-airdate">${_('Airdate')}</th>
                    <th data-sorter="false" ${("class=\"col-ep columnSelector-false\"", "class=\"col-ep\"")[bool(sickrage.app.config.download_url)]}>${_('Download')}</th>
                    <th data-sorter="false" ${("class=\"col-ep columnSelector-false\"", "class=\"col-ep\"")[bool(sickrage.app.config.use_subtitles)]}>${_('Subtitles')}</th>
                    <th data-sorter="false" class="col-status">${_('Status')}</th>
568 569 570
                    % if len(sickrage.app.search_providers.enabled()):
                        <th data-sorter="false" class="col-search">${_('Search')}</th>
                    % endif
571 572
                </tr>
                </thead>
573

574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590
            <tbody
                % if sickrage.app.config.display_all_seasons == False:
                    class="collapse${("", " in")[curSeason == -1]}"
                    id="collapseSeason-${epResult['season']}"
                % endif
            >
            % endif
            <tr class="${Overview.overviewStrings[epCats[epStr]]} season-${curSeason} seasonstyle font-weight-bold text-dark"
                id="S${str(epResult["season"])}E${str(epResult["episode"])}">

                <td class="table-fit 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>
591

592 593 594
                <td class="table-fit">
                    <i class="fas ${("fa-times", "fa-check")[epResult["hasnfo"]]}"></i>
                </td>
595

596 597 598 599 600 601 602 603
                <td class="table-fit">
                    <i class="fas ${("fa-times", "fa-check")[epResult["hastbn"]]}"></i>
                </td>

                <td class="table-fit">
                    <%
                        text = str(epResult['episode'])
                        if epLoc != '' and epLoc is not None:
604
                                    text = '<span title="' + epLoc + '" class="badge badge-dark">' + text + "</span>"
605
                    %>
606
                        ${text}
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622
                </td>

                <td class="table-fit">${epResult["absolute_number"]}</td>

                <td class="table-fit">
                    <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)}"
623
                        % endif
624 625 626 627 628 629 630 631 632 633 634
                           style="padding: 0; text-align: center; max-width: 60px;"/>
                </td>

                <td class="table-fit">
                    <input placeholder="${str(dfltAbsolute)}" size="6" maxlength="8"
                           class="sceneAbsolute form-control d-inline 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=""
635
                        % else:
636
                           value="${str(scAbsolute)}"
637
                        % endif
638 639
                           style="padding: 0; text-align: center; max-width: 60px;"/>
                </td>
640

641 642 643 644 645 646 647 648 649 650 651 652 653
                <td class="col-name">
                    <i id="plot_info_${str(show.indexerid)}_${str(epResult["season"])}_${str(epResult["episode"])}"
                       class="fas fa-info-circle" title="${epResult["description"]}"></i>
                    ${epResult["name"]}
                </td>

                <td class="table-fit text-nowrap col-ep">
                    ${pretty_filesize(epResult["file_size"])}
                </td>

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

655
                    % if airDate.year >= 1970 or show.network:
656
                        <% airDate = srdatetime.srDateTime(sickrage.app.tz_updater.parse_date_time(epResult['airdate'], show.airs, show.network), convert=True).dt %>
657 658 659 660
                    % endif
                        <time datetime="${airDate.isoformat()}" class="date text-nowrap">
                            ${srdatetime.srDateTime(airDate).srfdatetime()}
                        </time>
661
                    % else:
662
                        ${_('Never')}
663
                    % endif
664
                </td>
665

666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684
                <td class="table-fit">
                    % if sickrage.app.config.download_url and epResult['location']:
                    <%
                        filename = epResult['location']
                        for rootDir in sickrage.app.config.root_dirs.split('|'):
                                                if rootDir.startswith('/'):
                                                    filename = filename.replace(rootDir, "")
                        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="table-fit col-subtitles">
                    % for flag in (epResult["subtitles"] or '').split(','):
                        % if sickrage.subtitles.name_from_code(flag).lower() != 'undetermined':
                            % if flag.strip() != 'und':
685
                                <i class="sickrage-flags sickrage-flags-${flag}"
686
                                   title="${sickrage.subtitles.name_from_code(flag)}"></i>
687
                            % else:
688
                                <i class="sickrage-flags sickrage-flags-${flag}"
689
                                   title="${sickrage.subtitles.name_from_code(flag)}"></i>
690
                            % endif
691 692
                        % else:
                            <i class="sickrage-flags sickrage-flags-unknown" title="${_('Unknown')}"></i>
693
                        % endif
694 695 696 697 698 699 700 701 702 703
                    % endfor
                </td>

                <% curStatus, curQuality = Quality.splitCompositeStatus(int(epResult["status"])) %>
                % if curQuality != Quality.NONE:
                    <td class="table-fit text-nowrap col-status">${statusStrings[curStatus]} ${renderQualityPill(curQuality)}</td>
                % else:
                    <td class="table-fit text-nowrap col-status">${statusStrings[curStatus]}</td>
                % endif

704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726
                % if len(sickrage.app.search_providers.enabled()):
                    <td class="table-fit col-search">
                        % 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"]}">
                                    <i class="fas fa-sync" title="${_('Retry Download')}"></i>
                                </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"]}">
                                    <i class="fas fa-search" title="${_('Manual Search')}"></i>
                                </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"]}">
                                <i class="fas fa-comment" title="${_('Subtitles Search')}"></i>
727
                            </a>
728
                        % endif
729 730
                    </td>
                % endif
731 732 733 734 735 736 737 738
            </tr>
        % endfor
    </tbody>
    </table>
    </div>
    </div>
    </div>
    </div>
739
    </div>
740
</%block>