Commit 0928a295 authored by echel0n's avatar echel0n

Merge branch 'release-v9.4.156'

parents fad38e02 7d7e6e5b
# Changelog
- * 7fce35662 - 2019-07-22: Resolved issues with marking failed snatches and retrying snatches.
- * 7cea63c5e - 2019-07-22: Pre-Release v9.4.156.dev1
- * 56ddaf165 - 2019-07-22: Release v9.4.155
- * 22a6e77bb - 2019-07-22: Resolved issues with sending Telegram notifications.
- * 19624f654 - 2019-07-22: Updated copyright notices.
- * a70aaea6b - 2019-07-22: Pre-Release v9.4.155.dev1
......
......@@ -206,7 +206,7 @@ class History:
status, quality = Quality.split_composite_status(episode_object.status)
action = Quality.composite_status(FAILED, quality)
History._log_history_item(action, show_id, season, episode, quality, release, provider)
History._log_history_item(action, show_id, season, episode, quality, release, provider, session=session)
class FailedHistory(object):
......@@ -243,9 +243,8 @@ class FailedHistory(object):
sickrage.app.log.warning("However, they're all the same size. Continuing with found size.")
size = dbData[0].size
else:
sickrage.app.log.warning("They also vary in size. Deleting the logged snatches and recording this "
"release with no size/provider")
[FailedHistory.delete_logged_snatch(result.release, result.size, result.provider) for result in dbData]
sickrage.app.log.warning("They also vary in size. Deleting the logged snatches and recording this release with no size/provider")
[FailedHistory.delete_logged_snatch(result.release, result.size, result.provider, session=session) for result in dbData]
if len(set(x.provider for x in dbData)) == 1:
sickrage.app.log.info("They're also from the same provider. Using it as well.")
......@@ -254,10 +253,10 @@ class FailedHistory(object):
size = dbData[0].size
provider = dbData[0].provider
if not FailedHistory.has_failed(release, size, provider):
if not FailedHistory.has_failed(release, size, provider, session=session):
session.add(MainDB.FailedSnatch(**{'release': release, 'size': size, 'provider': provider}))
FailedHistory.delete_logged_snatch(release, size, provider)
FailedHistory.delete_logged_snatch(release, size, provider, session=session)
return log_str
......
......@@ -743,17 +743,11 @@ class FailedDownloadsHandler(BaseHandler, ABC):
@authenticated
def get(self, *args, **kwargs):
limit = self.get_argument('limit', None) or 100
to_remove = self.get_argument('toRemove', None)
if int(limit) == 0:
dbData = self.db_session.query(MainDB.FailedSnatch).all()
else:
dbData = self.db_session.query(MainDB.FailedSnatch).limit(int(limit))
to_remove = to_remove.split("|") if to_remove is not None else []
if to_remove:
self.db_session.query(MainDB.FailedSnatch).filter(MainDB.FailedSnatch.release.in_(to_remove)).delete()
return self.redirect('/manage/failedDownloads/')
dbData = self.db_session.query(MainDB.FailedSnatch).limit(int(limit)).all()
return self.render(
"/manage/failed_downloads.mako",
......@@ -765,3 +759,11 @@ class FailedDownloadsHandler(BaseHandler, ABC):
controller='manage',
action='failed_downloads'
)
@authenticated
def post(self, *args, **kwargs):
to_remove = self.get_argument('toRemove', None)
if to_remove:
to_remove = to_remove.split("|")
self.db_session.query(MainDB.FailedSnatch).filter(MainDB.FailedSnatch.release.in_(to_remove)).delete(synchronize_session=False)
return self.redirect('/manage/failedDownloads/')
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -41,7 +41,6 @@
</thead>
<tbody>
% for hItem in failedResults:
<% curRemove = "<input type=\"checkbox\" class=\"removeCheck\" id=\"remove-"+hItem.release+"\" />" %>
<tr>
<td class="text-nowrap">${hItem.release}</td>
<td class="table-fit">
......@@ -64,15 +63,14 @@
% endif
</td>
<td class="table-fit">
${curRemove}
<input type="checkbox" class="removeCheck" id="remove-${hItem.release}"/>
</td>
</tr>
% endfor
</tbody>
</table>
</div>
<input type="button" class="btn" value="${_('Clear')}"
id="submitMassRemove">
<input type="button" class="btn" value="${_('Clear')}" id="submitMassRemove">
</div>
</div>
</div>
......
9.4.155
\ No newline at end of file
9.4.156
\ No newline at end of file
......@@ -771,11 +771,11 @@ $(document).ready(function ($) {
});
$('#manualSearchModalFailed .btn').click(function () {
SICKRAGE.ajax_search.failedDownload = ($(this).text().toLowerCase() === 'yes');
SICKRAGE.ajax_search.failedDownload = (this.classList.contains('btn-success'));
});
$('#manualSearchModalQuality .btn').click(function () {
SICKRAGE.ajax_search.qualityDownload = ($(this).text().toLowerCase() === 'yes');
SICKRAGE.ajax_search.qualityDownload = (this.classList.contains('btn-success'));
SICKRAGE.ajax_search.manualSearch(options);
});
},
......@@ -5461,15 +5461,15 @@ $(document).ready(function ($) {
headers: {3: {sorter: false}}
});
$('#limit').change(function () {
window.location.href = SICKRAGE.srWebRoot + '/manage/failedDownloads/?limit=' + $(this).val();
$('#limit').change(function (event) {
window.location.href = SICKRAGE.srWebRoot + '/manage/failedDownloads/?limit=' + $(event.currentTarget).val();
});
$('#submitMassRemove').on('click', function () {
var removeArr = [];
const removeArr = [];
$('.removeCheck').each(function () {
if ($(this).prop('checked')) {
if (this.checked === true) {
removeArr.push($(this).attr('id').split('-')[1]);
}
});
......@@ -5478,7 +5478,9 @@ $(document).ready(function ($) {
return false;
}
window.location.href = SICKRAGE.srWebRoot + '/manage/failedDownloads?toRemove=' + removeArr.join('|');
$.post(SICKRAGE.srWebRoot + '/manage/failedDownloads', 'toRemove=' + removeArr.join('|'), function () {
location.reload(true);
});
});
$('.bulkCheck').on('click', function () {
......@@ -5490,32 +5492,32 @@ $(document).ready(function ($) {
});
});
if ($('.removeCheck').length) {
$('.removeCheck').each(function (name) {
var lastCheck = null;
$(name).on('click', function (event) {
if (!lastCheck || !event.shiftKey) {
lastCheck = this;
return;
}
var check = this;
var found = 0;
$(name + ':visible').each(function () {
if (found === 2) {
return false;
}
if (found === 1) {
this.checked = lastCheck.checked;
}
if (this === check || this === lastCheck) {
found++;
}
});
});
});
}
// if ($('.removeCheck').length) {
// $('.removeCheck').each(function (name) {
// let lastCheck = null;
// $(name).on('click', function (event) {
// if (!lastCheck || !event.shiftKey) {
// lastCheck = this;
// return;
// }
//
// const check = this;
// let found = 0;
//
// $(name + ':visible').each(function () {
// if (found === 2) {
// return false;
// }
// if (found === 1) {
// this.checked = lastCheck.checked;
// }
// if (this === check || this === lastCheck) {
// found++;
// }
// });
// });
// });
// }
},
subtitles_missed: function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment