You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bazarr/views/historyseries.html

131 lines
6.2 KiB

5 years ago
{% extends '_main.html' %}
5 years ago
{% block title %}History (Series) - Bazarr{% endblock %}
5 years ago
{% block bcleft %}
5 years ago
5 years ago
{% endblock bcleft %}
5 years ago
{% block bcright %}
5 years ago
5 years ago
{% endblock bcright %}
5 years ago
{% block body %}
5 years ago
<table id="history_series" class="table table-striped" style="width:100%">
<thead>
5 years ago
<tr>
<th>Action</th>
<th>Name</th>
<th>Episode</th>
<th>Episode Title</th>
<th>Date</th>
5 years ago
<th style="max-width: 40%;">Description</th>
<th>Actions</th>
5 years ago
</tr>
5 years ago
</thead>
</table>
5 years ago
{% endblock body %}
5 years ago
{% block tail %}
5 years ago
<script>
$(document).ready(function () {
var table = $('#history_series').DataTable({
5 years ago
processing: true,
serverSide: true,
5 years ago
language: {
zeroRecords: 'Nothing Found In Series History',
processing: "Loading Series History..."
},
5 years ago
searching: false,
ordering: false,
lengthChange: false,
responsive: true,
pageLength: {{ settings.general.page_size }},
ajax: "{{ url_for('api.historyseries') }}",
columns: [
{
data: "action",
render: function (data) {
5 years ago
if (data === 0) {
return "<i class='fas fa-trash' title='Subtitle file has been erased.' data-toggle='tooltip' data-placement='right'></i>";
} else if (data === 1) {
return "<i class='fas fa-download' title='Subtitle file has been downloaded.' data-toggle='tooltip' data-placement='right'></i>";
} else if (data === 2) {
return "<i class='fas fa-user' title='Subtitle file has been manually downloaded.' data-toggle='tooltip' data-placement='right'></i>";
} else if (data === 3) {
return "<i class='fas fa-recycle' title='Subtitle file has been upgraded.' data-toggle='tooltip' data-placement='right'></i>";
} else if (data === 4) {
return "<i class='fas fa-cloud-upload-alt' title='Subtitle file has been manually uploaded.' data-toggle='tooltip' data-placement='right'></i>";
} else if (data === 5) {
return "<i class='fas fa-clock' title='Subtitle file has been synced.' data-toggle='tooltip' data-placement='right'></i>";
5 years ago
}
}
},
5 years ago
{
data: null,
render: function (data) {
5 years ago
return '<a href="' + "{{ url_for( 'episodes', no='tempvalue' ) }}".replace("tempvalue", data.sonarrSeriesId) + '">' + data.seriesTitle + '</a>';
}
},
5 years ago
{data: "episode_number"},
{data: "episodeTitle"},
{data: "timestamp"},
{
data: null,
render: function (data) {
5 years ago
if (data.upgradable) {
return "<i class='fas fa-recycle' title='This Subtitles File Is Eligible For An Upgrade.' style='color: green;' data-toggle='tooltip' data-placement='right'></i> " + data.description;
} else {
return data.description;
}
}
},
{
data: null,
render: function (data) {
if (data.subs_id && data.subtitles_path && !data.blacklisted) {
return '<a href="" class="blacklist_subtitles badge badge-secondary" data-toggle="tooltip" data-placement="right" title="Blacklist this subtitles" data-sonarrSeriesId="' + data.sonarrSeriesId + '" data-sonarrEpisodeId="' + data.sonarrEpisodeId + '" data-language="' + data.language.code2 + '" data-forced="' + data.language.forced + '" data-provider="' + data.provider + '" data-subs_id="' + data.subs_id + '" data-video_path="' + data.path + '" data-subtitles_path="' + data.mapped_subtitles_path + '"><i class="far fa-file-excel"></i></a>';
} else {
return null;
}
}
5 years ago
}
5 years ago
]
});
5 years ago
$('#history_series').on('click', '.blacklist_subtitles', function (e) {
$(this).tooltip('dispose');
e.preventDefault();
const values = {
sonarr_series_id: $(this).attr('data-sonarrseriesid'),
sonarr_episode_id: $(this).attr('data-sonarrepisodeid'),
provider: $(this).attr('data-provider'),
subs_id: $(this).attr('data-subs_id'),
language: $(this).attr('data-language'),
forced: $(this).attr('data-forced'),
video_path: $(this).attr('data-video_path'),
subtitles_path: $(this).attr('data-subtitles_path')
};
var cell = $(this).parent();
$.ajax({
url: "{{ url_for('api.blacklistepisodesubtitlesadd') }}",
type: "POST",
dataType: "json",
data: values,
beforeSend: function () {
cell.html('<div class="spinner-border spinner-border-sm" role="status"><span class="sr-only">Loading...</span></div>');
}
});
});
5 years ago
events.on('event', function (event) {
5 years ago
var event_json = JSON.parse(event);
if (event_json.type === 'episodeHistory' || event_json.type === 'episodeBlacklist') {
5 years ago
$('#history_series').DataTable().ajax.reload(resetPaging = false);
5 years ago
$('[data-toggle="tooltip"]').tooltip({html: true});
}
});
5 years ago
});
5 years ago
</script>
5 years ago
{% endblock tail %}