mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-21 19:31:59 +00:00
feat: re-introduce partial batches
This commit is contained in:
parent
36df9897cc
commit
89c337fe31
3 changed files with 12 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ui",
|
"name": "ui",
|
||||||
"version": "6.4.72",
|
"version": "6.4.73",
|
||||||
"license": "BUSL-1.1",
|
"license": "BUSL-1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@9.15.5",
|
"packageManager": "pnpm@9.15.5",
|
||||||
|
|
|
||||||
|
|
@ -196,13 +196,17 @@ export const extensions = new class Extensions {
|
||||||
const extopts = get(extensionOptions)
|
const extopts = get(extensionOptions)
|
||||||
const configs = get(saved)
|
const configs = get(saved)
|
||||||
|
|
||||||
|
const checkMovie = !singleEp && movie
|
||||||
|
const checkBatch = !singleEp && !movie
|
||||||
|
|
||||||
for (const [id, worker] of Object.entries(workers)) {
|
for (const [id, worker] of Object.entries(workers)) {
|
||||||
if (!extopts[id]!.enabled) continue
|
if (!extopts[id]!.enabled) continue
|
||||||
if (configs[id]!.type !== 'torrent') continue
|
if (configs[id]!.type !== 'torrent') continue
|
||||||
try {
|
try {
|
||||||
const promises: Array<Promise<TorrentResult[]>> = []
|
const promises: Array<Promise<TorrentResult[]>> = []
|
||||||
promises.push(worker.single(options))
|
promises.push(worker.single(options))
|
||||||
if (!singleEp && (movie || media.status === 'FINISHED')) promises.push(movie ? worker.movie(options) : worker.batch(options))
|
if (checkMovie) promises.push(worker.movie(options))
|
||||||
|
if (checkBatch) promises.push(worker.batch(options))
|
||||||
|
|
||||||
for (const result of await Promise.allSettled(promises)) {
|
for (const result of await Promise.allSettled(promises)) {
|
||||||
if (result.status === 'fulfilled') {
|
if (result.status === 'fulfilled') {
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,12 @@
|
||||||
"typeAcquisition": {
|
"typeAcquisition": {
|
||||||
"enable": false
|
"enable": false
|
||||||
},
|
},
|
||||||
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
".svelte-kit",
|
||||||
|
"build",
|
||||||
|
"public"
|
||||||
|
],
|
||||||
"files": [],
|
"files": [],
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue