Compare commits
No commits in common. "127d3fd830f7df1f28206a7568090071c20505d2" and "3d8e81560c24b11d21f42e7ab61c523d687f72f3" have entirely different histories.
127d3fd830
...
3d8e81560c
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "multi-hoster-uploader",
|
"name": "multi-hoster-uploader",
|
||||||
"version": "2.0.2",
|
"version": "2.0.1",
|
||||||
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -880,18 +880,15 @@ function _onQueueScroll() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const _collatorDE = new Intl.Collator('de', { sensitivity: 'base', numeric: true });
|
|
||||||
const _collatorSimple = new Intl.Collator('de');
|
|
||||||
|
|
||||||
function sortQueueJobs(jobs) {
|
function sortQueueJobs(jobs) {
|
||||||
const { key, direction } = queueSortState;
|
const { key, direction } = queueSortState;
|
||||||
const factor = direction === 'asc' ? 1 : -1;
|
const factor = direction === 'asc' ? 1 : -1;
|
||||||
|
|
||||||
return jobs.slice().sort((a, b) => {
|
return jobs.slice().sort((a, b) => {
|
||||||
let cmp = 0;
|
let cmp = 0;
|
||||||
if (key === 'filename') cmp = _collatorDE.compare(a.fileName, b.fileName);
|
if (key === 'filename') cmp = a.fileName.localeCompare(b.fileName, 'de', { sensitivity: 'base', numeric: true });
|
||||||
else if (key === 'size') cmp = (a.bytesTotal || 0) - (b.bytesTotal || 0);
|
else if (key === 'size') cmp = (a.bytesTotal || 0) - (b.bytesTotal || 0);
|
||||||
else if (key === 'host') cmp = _collatorSimple.compare(a.hoster, b.hoster);
|
else if (key === 'host') cmp = a.hoster.localeCompare(b.hoster);
|
||||||
else if (key === 'status') cmp = getStatusOrder(a.status) - getStatusOrder(b.status);
|
else if (key === 'status') cmp = getStatusOrder(a.status) - getStatusOrder(b.status);
|
||||||
else if (key === 'speed') cmp = (a.speedKbs || 0) - (b.speedKbs || 0);
|
else if (key === 'speed') cmp = (a.speedKbs || 0) - (b.speedKbs || 0);
|
||||||
else if (key === 'progress') cmp = (a.progress || 0) - (b.progress || 0);
|
else if (key === 'progress') cmp = (a.progress || 0) - (b.progress || 0);
|
||||||
@ -2656,9 +2653,9 @@ function sortRecentFiles(data) {
|
|||||||
const dir = direction === 'asc' ? 1 : -1;
|
const dir = direction === 'asc' ? 1 : -1;
|
||||||
sorted.sort((a, b) => {
|
sorted.sort((a, b) => {
|
||||||
if (key === 'date') return dir * ((a.dateTs - b.dateTs) || (a.order - b.order));
|
if (key === 'date') return dir * ((a.dateTs - b.dateTs) || (a.order - b.order));
|
||||||
if (key === 'filename') return dir * _collatorDE.compare(a.filename, b.filename);
|
if (key === 'filename') return dir * a.filename.localeCompare(b.filename, 'de', { sensitivity: 'base' });
|
||||||
if (key === 'host') return dir * _collatorDE.compare(a.host, b.host);
|
if (key === 'host') return dir * a.host.localeCompare(b.host, 'de', { sensitivity: 'base' });
|
||||||
if (key === 'link') return dir * _collatorDE.compare(a.link, b.link);
|
if (key === 'link') return dir * a.link.localeCompare(b.link, 'de', { sensitivity: 'base' });
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
return sorted;
|
return sorted;
|
||||||
@ -2786,7 +2783,7 @@ function sortHistoryRows(rows) {
|
|||||||
const { key, direction } = historySortState;
|
const { key, direction } = historySortState;
|
||||||
const factor = direction === 'asc' ? 1 : -1;
|
const factor = direction === 'asc' ? 1 : -1;
|
||||||
return rows.slice().sort((a, b) => {
|
return rows.slice().sort((a, b) => {
|
||||||
let cmp = key === 'date' ? a.dateTs - b.dateTs : _collatorDE.compare(String(a[key] || ''), String(b[key] || ''));
|
let cmp = key === 'date' ? a.dateTs - b.dateTs : String(a[key] || '').localeCompare(String(b[key] || ''), 'de', { sensitivity: 'base', numeric: true });
|
||||||
return (cmp || a.order - b.order) * factor;
|
return (cmp || a.order - b.order) * factor;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -2919,7 +2916,6 @@ function setupListeners() {
|
|||||||
const key = th.dataset.sort;
|
const key = th.dataset.sort;
|
||||||
if (queueSortState.key === key) queueSortState.direction = queueSortState.direction === 'asc' ? 'desc' : 'asc';
|
if (queueSortState.key === key) queueSortState.direction = queueSortState.direction === 'asc' ? 'desc' : 'asc';
|
||||||
else { queueSortState.key = key; queueSortState.direction = 'asc'; }
|
else { queueSortState.key = key; queueSortState.direction = 'asc'; }
|
||||||
_lastVisibleRange = { start: -1, end: -1 }; // force full rebuild after re-sort
|
|
||||||
renderQueueTable();
|
renderQueueTable();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user