mirror of
				https://github.com/janeczku/calibre-web
				synced 2025-10-31 15:23:02 +00:00 
			
		
		
		
	New sort for Comic Reader
This commit is contained in:
		| @@ -180,13 +180,15 @@ function initProgressClick() { | |||||||
|  |  | ||||||
| function loadFromArrayBuffer(ab) { | function loadFromArrayBuffer(ab) { | ||||||
|     var lastCompletion = 0; |     var lastCompletion = 0; | ||||||
|  |     const collator = new Intl.Collator('en', { numeric: true, sensitivity: 'base' }); | ||||||
|     loadArchiveFormats(['rar', 'zip', 'tar'], function() { |     loadArchiveFormats(['rar', 'zip', 'tar'], function() { | ||||||
|         // Open the file as an archive |         // Open the file as an archive | ||||||
|         archiveOpenFile(ab, function (archive) { |         archiveOpenFile(ab, function (archive) { | ||||||
|             if (archive) { |             if (archive) { | ||||||
|                 totalImages = archive.entries.length |                 totalImages = archive.entries.length | ||||||
|                 console.info('Uncompressing ' + archive.archive_type + ' ...'); |                 console.info('Uncompressing ' + archive.archive_type + ' ...'); | ||||||
|                 archive.entries.forEach(function(e, i) { |                 entries = archive.entries.sort((a,b) => collator.compare(a.name, b.name)); | ||||||
|  |                 entries.forEach(function(e, i) { | ||||||
|                     updateProgress( (i + 1)/ totalImages * 100); |                     updateProgress( (i + 1)/ totalImages * 100); | ||||||
|                     if (e.is_file) { |                     if (e.is_file) { | ||||||
|                         e.readData(function(d) { |                         e.readData(function(d) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 GarcaMan
					GarcaMan