adds manual movie collection edit

This commit is contained in:
TheBeastLT
2020-02-24 00:37:16 +01:00
parent 0f91c98b84
commit 78691c2ae9
3 changed files with 37 additions and 4 deletions

View File

@@ -93,6 +93,14 @@ function getFiles(torrent) {
return File.findAll({ where: { infoHash: torrent.infoHash } });
}
function getFilesBasedOnTitle(titleQuery) {
return File.findAll({ where: { title: { [Op.iLike]: `%${titleQuery}%` } } });
}
function deleteFile(file) {
return File.destroy({ where: { id: file.id } })
}
function getSkipTorrent(torrent) {
return SkipTorrent.findByPk(torrent.infoHash)
.then((result) => {
@@ -129,6 +137,8 @@ module.exports = {
createTorrent,
createFile,
getFiles,
getFilesBasedOnTitle,
deleteFile,
getSkipTorrent,
createSkipTorrent,
createFailedImdbTorrent

View File

@@ -97,12 +97,13 @@ async function filesFromTorrentStream(torrent) {
setTimeout(() => {
engine.destroy();
rejected(new Error('No available connections for torrent!'));
}, 30000);
}, 60000);
});
}
function isVideo(title) {
return EXTENSIONS.includes(title.path.match(/\.(\w{2,4})$/)[1]);
const match = title.path.match(/\.(\w{2,4})$/);
return match && EXTENSIONS.includes(match[1]);
}
function dynamicTimeout(torrent) {