(files, type = '')
| 695 | } |
| 696 | |
| 697 | function _validate(files, type = '') |
| 698 | { |
| 699 | const correct = []; |
| 700 | const corruptedZstd = []; |
| 701 | const corruptedJson = []; |
| 702 | const readError = []; |
| 703 | const notInCache = []; |
| 704 | |
| 705 | for(let i = 0, len = files.length; i < len; i++) |
| 706 | { |
| 707 | const file = files[i]; |
| 708 | const path = (type == 'servers' ? serverClient.fixPath(file.path) : file.path); |
| 709 | const sha = sha1(path); |
| 710 | const name = (type == 'servers' ? 'server-files-'+sha+'.json' : 'compressed-files-'+sha+'.json'); |
| 711 | |
| 712 | const status = validateJson(name); |
| 713 | |
| 714 | if(status == 'correct') |
| 715 | correct.push(path); |
| 716 | else if(status == 'corruptedZstd') |
| 717 | corruptedZstd.push(path); |
| 718 | else if(status == 'corruptedJson') |
| 719 | corruptedJson.push(path); |
| 720 | else if(status == 'readError') |
| 721 | readError.push(path); |
| 722 | else if(status == 'notInCache') |
| 723 | notInCache.push(path); |
| 724 | } |
| 725 | |
| 726 | console.log('Correct: '+correct.length+'\nCorrupted Zstd: '+corruptedZstd.length+'\nCorrupted Json: '+corruptedJson.length+'\nRead Error: '+readError.length+'\nNot in Cache: '+notInCache.length); |
| 727 | console.log({ |
| 728 | correct: correct, |
| 729 | corruptedZstd: corruptedZstd, |
| 730 | corruptedJson: corruptedJson, |
| 731 | readError: readError, |
| 732 | notInCache: notInCache, |
| 733 | }); |
| 734 | console.log(' '); |
| 735 | } |
| 736 | |
| 737 | function validateThumbnails(images, type = '') |
| 738 | { |
no test coverage detected