(files, file, animation, path, keepScroll, mainPath, _indexLabel)
| 349 | } |
| 350 | |
| 351 | async function loadFilesIndexPage(files, file, animation, path, keepScroll, mainPath, _indexLabel) |
| 352 | { |
| 353 | threads.clean('folderThumbnails'); |
| 354 | |
| 355 | let pathFiles = []; |
| 356 | let thumbnails = []; |
| 357 | |
| 358 | // Get comic reading progress image |
| 359 | let _readingProgress = relative.get('readingProgress'); |
| 360 | |
| 361 | let readingProgress = _readingProgress[mainPath]?.path ? _readingProgress[mainPath] : false; |
| 362 | let readingProgressCurrentPath = (mainPath != path) ? (_readingProgress[path]?.path ? _readingProgress[path] : false) : false; |
| 363 | |
| 364 | if(files) |
| 365 | { |
| 366 | const viewModuleSize = handlebarsContext.page.viewModuleSize || 150; |
| 367 | let images = []; |
| 368 | |
| 369 | for(let i = 0, len = files.length; i < len; i++) |
| 370 | { |
| 371 | const file = files[i]; |
| 372 | |
| 373 | if(compatible.image(file.path)) |
| 374 | { |
| 375 | file.forceSize = viewModuleSize; |
| 376 | file.sha = cache.imageSizeSha(file); |
| 377 | images.push(file); |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | if(readingProgress) |
| 382 | { |
| 383 | let path = readingProgress.path; |
| 384 | let sha = sha1(path); |
| 385 | |
| 386 | images.push({path: path, sha: sha}); |
| 387 | |
| 388 | readingProgress.sha = sha; |
| 389 | } |
| 390 | |
| 391 | if(readingProgressCurrentPath) |
| 392 | { |
| 393 | let path = readingProgressCurrentPath.path; |
| 394 | let sha = sha1(path); |
| 395 | |
| 396 | images.push({path: path, sha: sha}); |
| 397 | |
| 398 | readingProgressCurrentPath.sha = sha; |
| 399 | } |
| 400 | |
| 401 | thumbnails = cache.returnThumbnailsImages(images, function(data){ |
| 402 | |
| 403 | addImageToDom(data.sha, data.path); |
| 404 | |
| 405 | }, file); |
| 406 | |
| 407 | let visibleItems = calculateVisibleItems(config.view, keepScroll); |
| 408 |
no test coverage detected