(path, forceSize = false, index = 0, start = 0, end = 99999)
| 1510 | } |
| 1511 | |
| 1512 | async function getFolderThumbnails(path, forceSize = false, index = 0, start = 0, end = 99999) |
| 1513 | { |
| 1514 | const getProgress = handlebarsContext.page.fadeCompleted || handlebarsContext.page.progressBar || handlebarsContext.page.progressPages || handlebarsContext.page.progressPercent; |
| 1515 | const folderSha = sha1(path+(forceSize ? '?size='+forceSize : '')); |
| 1516 | |
| 1517 | let poster = {cache: false, path: '', sha: folderSha+'-0'}; |
| 1518 | |
| 1519 | let images = [ |
| 1520 | {cache: false, path: '', sha: folderSha+'-0'}, |
| 1521 | {cache: false, path: '', sha: folderSha+'-1'}, |
| 1522 | {cache: false, path: '', sha: folderSha+'-2'}, |
| 1523 | {cache: false, path: '', sha: folderSha+'-3'}, |
| 1524 | ]; |
| 1525 | |
| 1526 | let progress = false; |
| 1527 | |
| 1528 | let addToQueue = false; |
| 1529 | let addToQueueProgress = false; |
| 1530 | |
| 1531 | if(index >= start && index <= end) |
| 1532 | { |
| 1533 | try |
| 1534 | { |
| 1535 | let file = fileManager.file(path, {fromThumbnailsGeneration: true, subtask: true}); |
| 1536 | file.updateConfig({cacheOnly: true}); |
| 1537 | let _images = await file.images(4, false, true); |
| 1538 | |
| 1539 | _images = await _getFolderThumbnails(file, images, _images, path, folderSha, false, forceSize); |
| 1540 | |
| 1541 | file.destroy(); |
| 1542 | |
| 1543 | poster = _images.poster; |
| 1544 | images = _images.poster ? false : _images.images; |
| 1545 | } |
| 1546 | catch(error) |
| 1547 | { |
| 1548 | if(error.message && /notCacheOnly/.test(error.message)) |
| 1549 | { |
| 1550 | addToQueue = 1; |
| 1551 | } |
| 1552 | else |
| 1553 | { |
| 1554 | console.error(error); |
| 1555 | |
| 1556 | dom.compressedError(error, false); |
| 1557 | fileManager.requestFileAccess.check(path, error); |
| 1558 | } |
| 1559 | } |
| 1560 | |
| 1561 | try |
| 1562 | { |
| 1563 | if(getProgress) |
| 1564 | progress = await reading.progress.get(path, true, true); |
| 1565 | } |
| 1566 | catch(error) |
| 1567 | { |
| 1568 | if(error.message && /notCacheOnly/.test(error.message)) |
| 1569 | addToQueueProgress = 1; |
no test coverage detected