1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

Add more file sizes for groupping #706

This commit is contained in:
Patrik J. Braun 2023-09-03 15:20:24 +02:00
parent d0364cba43
commit 5a852dc443

View File

@ -255,7 +255,7 @@ export class GallerySortingService {
groupFN = (m: MediaDTO) => ((m as PhotoDTO).metadata.rating || 0).toString(); groupFN = (m: MediaDTO) => ((m as PhotoDTO).metadata.rating || 0).toString();
break; break;
case SortByTypes.FileSize: { case SortByTypes.FileSize: {
const groups = [0.5, 1, 2, 5, 10, 15, 20, 30, 50]; // MBs const groups = [0.5, 1, 2, 5, 10, 15, 20, 30, 50, 100, 200, 500, 1000]; // MBs
groupFN = (m: MediaDTO) => { groupFN = (m: MediaDTO) => {
const mbites = ((m as PhotoDTO).metadata.fileSize || 0) / 1024 / 1024; const mbites = ((m as PhotoDTO).metadata.fileSize || 0) / 1024 / 1024;
const i = groups.findIndex((s) => s > mbites); const i = groups.findIndex((s) => s > mbites);