MCPcopy
hub / github.com/ollm/OpenComic / validate

Function validate

scripts/cache.js:774–820  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

772}
773
774function validate()
775{
776 const currentFiles = handlebarsContext.comics;
777
778 const folders = [];
779 const compressed = [];
780 const servers = [];
781 const images = [];
782
783 for(let i = 0, len = currentFiles.length; i < len; i++)
784 {
785 const file = currentFiles[i];
786
787 if(fileManager.isServer(file.path) && file.folder && !file.compressed)
788 servers.push(file);
789 else if(file.compressed)
790 compressed.push(file);
791 else if(file.folder)
792 folders.push(file);
793 else
794 images.push(file);
795 }
796
797 console.log(' ');
798 console.log('Folders: '+folders.length+'\nCompressed files: '+compressed.length+'\nServers: '+servers.length+'\nImages: '+images.length);
799 console.log(' ');
800
801 if(compressed.length)
802 {
803 console.log('Validating cache of compressed files...');
804 _validate(compressed, 'compressed');
805 }
806
807 if(servers.length)
808 {
809 console.log('Validating cache of servers...');
810 _validate(servers, 'servers');
811 }
812
813 if(images.length)
814 {
815 console.log('Validating cache of thumbnail images...');
816 validateThumbnails(images, 'servers');
817 }
818
819 console.log('Done');
820}
821
822module.exports = {
823 folder: cacheFolder,

Callers

nothing calls this directly

Calls 2

_validateFunction · 0.85
validateThumbnailsFunction · 0.85

Tested by

no test coverage detected