pigallery2-extension-kit 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/REPOSITORY.md +1 -1
- package/lib/backend/Logger.d.ts +1 -1
- package/lib/backend/ProjectPath.js +1 -1
- package/lib/backend/middlewares/VersionMWs.d.ts +4 -0
- package/lib/backend/model/database/AlbumManager.d.ts +1 -1
- package/lib/backend/model/database/CoverManager.d.ts +1 -1
- package/lib/backend/model/database/IndexingManager.d.ts +1 -0
- package/lib/backend/model/database/ProjectedCacheManager.d.ts +8 -0
- package/lib/backend/model/database/UserManager.d.ts +1 -0
- package/lib/backend/model/diagnostics/ConfigDiagnostics.d.ts +1 -0
- package/lib/backend/model/extension/ExtensionRepository.d.ts +1 -0
- package/lib/backend/model/extension/IExtension.d.ts +21 -0
- package/lib/backend/model/jobs/JobManager.d.ts +1 -1
- package/lib/backend/model/jobs/jobs/AlbumCoverFillingJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/AlbumCoverResetJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/AlbumResetJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/FileJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/GPXCompressionJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/GPXCompressionResetJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/GalleryResetJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/IndexingJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/Job.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/JobProgress.d.ts +2 -1
- package/lib/backend/model/jobs/jobs/PhotoConvertingJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/TempFolderCleaningJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/TopPickSendJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/VideoConvertingJob.d.ts +1 -0
- package/lib/common/CustomHeaders.d.ts +1 -0
- package/lib/common/DataStructureVersion.d.ts +1 -1
- package/lib/common/QueryParams.d.ts +10 -1
- package/lib/common/config/private/Config.js +1 -0
- package/lib/common/config/private/PrivateConfig.js +8 -1
- package/lib/common/config/private/PrivateConfigClass.d.ts +2 -0
- package/lib/common/config/private/PrivateConfigClass.js +7 -0
- package/lib/common/config/public/ClientConfig.d.ts +13 -5
- package/lib/common/config/public/ClientConfig.js +107 -27
- package/lib/common/entities/ContentWrapper.d.ts +38 -10
- package/lib/common/entities/ContentWrapper.js +171 -62
- package/lib/common/entities/Error.d.ts +1 -0
- package/lib/common/entities/Error.js +1 -0
- package/lib/common/entities/MediaDTO.d.ts +1 -0
- package/lib/common/entities/MediaDTO.js +6 -1
- package/lib/frontend/app/model/query.service.d.ts +0 -1
- package/lib/frontend/app/model/version.service.d.ts +5 -1
- package/lib/frontend/app/ui/frame/frame.component.d.ts +3 -1
- package/lib/frontend/app/ui/gallery/cache.gallery.service.d.ts +5 -7
- package/lib/frontend/app/ui/gallery/contentLoader.service.d.ts +12 -10
- package/lib/frontend/app/ui/gallery/gallery.service.d.ts +13 -0
- package/lib/frontend/app/ui/gallery/grid/grid.gallery.component.d.ts +1 -0
- package/lib/frontend/app/ui/gallery/lightbox/controls/controls.lightbox.gallery.component.d.ts +13 -19
- package/lib/frontend/app/ui/gallery/lightbox/lightbox.gallery.component.d.ts +1 -2
- package/lib/frontend/app/ui/gallery/lightbox/lightbox.service.d.ts +25 -4
- package/lib/frontend/app/ui/gallery/navigator/navigator.service.d.ts +1 -0
- package/lib/frontend/app/ui/gallery/photo-frame-builder/photo-frame-builder.gallery.component.d.ts +31 -0
- package/lib/frontend/app/ui/settings/template/settings-entry/sorting-method/sorting-method.settings-entry.component.d.ts +5 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ClientConfig = exports.ClientExtensionsConfig = exports.ClientUserConfig = exports.ClientServiceConfig = exports.ClientFacesConfig = exports.ClientMetaFileConfig = exports.ClientMediaConfig = exports.ClientGPXCompressingConfig = exports.ClientPhotoConfig = exports.ClientVideoConfig = exports.ClientGalleryConfig = exports.ThemesConfig = exports.ThemeConfig = exports.ClientLightboxConfig = exports.ClientLightboxTitleConfig = exports.NavBarConfig = exports.NavBarSortingAndGroupingConfig = exports.ClientGroupingConfig = exports.ClientSortingConfig = exports.NavigationLinkConfig = exports.NavigationLinkTypes = exports.ClientMapConfig = exports.MapPathGroupConfig = exports.MapPathGroupThemeConfig = exports.PathThemeConfig = exports.SVGIconConfig = exports.MapLayers = exports.ClientRandomPhotoConfig = exports.ClientSharingConfig = exports.ClientAlbumConfig = exports.ClientSearchConfig = exports.AutoCompleteConfig = exports.AutoCompleteItemsPerCategoryConfig = exports.LightBoxTitleTexts = exports.ScrollUpModes = exports.ThemeModes = exports.ConfigPriority = exports.MapProviders = void 0;
|
|
3
|
+
exports.ClientConfig = exports.ClientExtensionsConfig = exports.ClientUserConfig = exports.ClientServiceConfig = exports.ClientFacesConfig = exports.ClientMetaFileConfig = exports.ClientMediaConfig = exports.ClientGPXCompressingConfig = exports.ClientPhotoConfig = exports.ClientVideoConfig = exports.ClientGalleryConfig = exports.ThemesConfig = exports.ThemeConfig = exports.ClientLightboxConfig = exports.AutoUpdateConfig = exports.ClientLightboxTitleConfig = exports.NavBarConfig = exports.NavBarSortingAndGroupingConfig = exports.ClientGroupingConfig = exports.ClientSortingConfig = exports.NavigationLinkConfig = exports.NavigationLinkTypes = exports.ClientMapConfig = exports.MapPathGroupConfig = exports.MapPathGroupThemeConfig = exports.PathThemeConfig = exports.SVGIconConfig = exports.MapLayers = exports.ClientRandomPhotoConfig = exports.ClientSharingConfig = exports.ClientAlbumConfig = exports.ClientSearchConfig = exports.AutoCompleteConfig = exports.AutoCompleteItemsPerCategoryConfig = exports.LightBoxTitleTexts = exports.ScrollUpModes = exports.ThemeModes = exports.ConfigPriority = exports.MapProviders = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-inferrable-types */
|
|
6
6
|
require("reflect-metadata");
|
|
@@ -314,6 +314,7 @@ let ClientSharingConfig = class ClientSharingConfig {
|
|
|
314
314
|
constructor() {
|
|
315
315
|
this.enabled = true;
|
|
316
316
|
this.passwordRequired = false;
|
|
317
|
+
this.sharingKeyLength = 8;
|
|
317
318
|
}
|
|
318
319
|
};
|
|
319
320
|
exports.ClientSharingConfig = ClientSharingConfig;
|
|
@@ -337,6 +338,17 @@ tslib_1.__decorate([
|
|
|
337
338
|
}),
|
|
338
339
|
tslib_1.__metadata("design:type", Boolean)
|
|
339
340
|
], ClientSharingConfig.prototype, "passwordRequired", void 0);
|
|
341
|
+
tslib_1.__decorate([
|
|
342
|
+
(0, common_1.ConfigProperty)({
|
|
343
|
+
type: 'unsignedInt', min: 8, max: 64,
|
|
344
|
+
tags: {
|
|
345
|
+
name: $localize `Sharing key length`,
|
|
346
|
+
priority: ConfigPriority.underTheHood
|
|
347
|
+
},
|
|
348
|
+
description: $localize `The longer the keys are, the harder they are to guess. Changing this number won't invalidate existing sharing.`,
|
|
349
|
+
}),
|
|
350
|
+
tslib_1.__metadata("design:type", Number)
|
|
351
|
+
], ClientSharingConfig.prototype, "sharingKeyLength", void 0);
|
|
340
352
|
exports.ClientSharingConfig = ClientSharingConfig = tslib_1.__decorate([
|
|
341
353
|
(0, common_1.SubConfigClass)({ tags: { client: true }, softReadonly: true })
|
|
342
354
|
], ClientSharingConfig);
|
|
@@ -432,10 +444,10 @@ exports.SVGIconConfig = SVGIconConfig = tslib_1.__decorate([
|
|
|
432
444
|
tslib_1.__metadata("design:paramtypes", [String, String])
|
|
433
445
|
], SVGIconConfig);
|
|
434
446
|
let PathThemeConfig = class PathThemeConfig {
|
|
435
|
-
constructor(color = '', dashArray = '', svgIcon = new SVGIconConfig()) {
|
|
447
|
+
constructor(color = '', dashArray = '', svgIcon = new SVGIconConfig('', '')) {
|
|
436
448
|
this.color = '';
|
|
437
449
|
this.dashArray = '';
|
|
438
|
-
this.svgIcon = new SVGIconConfig();
|
|
450
|
+
this.svgIcon = new SVGIconConfig('', '');
|
|
439
451
|
this.color = color;
|
|
440
452
|
this.dashArray = dashArray;
|
|
441
453
|
this.svgIcon = svgIcon;
|
|
@@ -653,7 +665,7 @@ tslib_1.__decorate([
|
|
|
653
665
|
name: $localize `Bend long path trigger`,
|
|
654
666
|
priority: ConfigPriority.underTheHood
|
|
655
667
|
},
|
|
656
|
-
description: $localize `Map will bend the path if two points are this far apart on
|
|
668
|
+
description: $localize `Map will bend the path if two points are this far apart on latitude axes. This intended to bend flight if only the end and the start points are given.`,
|
|
657
669
|
}),
|
|
658
670
|
tslib_1.__metadata("design:type", Number)
|
|
659
671
|
], ClientMapConfig.prototype, "bendLongPathsTrigger", void 0);
|
|
@@ -966,59 +978,92 @@ exports.NavBarConfig = NavBarConfig = tslib_1.__decorate([
|
|
|
966
978
|
], NavBarConfig);
|
|
967
979
|
let ClientLightboxTitleConfig = class ClientLightboxTitleConfig {
|
|
968
980
|
constructor() {
|
|
969
|
-
this.topLeftTitle = LightBoxTitleTexts.title;
|
|
970
|
-
this.topLeftSubtitle = LightBoxTitleTexts.caption;
|
|
971
|
-
this.bottomLeftTitle = LightBoxTitleTexts.location;
|
|
972
|
-
this.bottomLeftSubtitle = LightBoxTitleTexts.persons;
|
|
981
|
+
this.topLeftTitle = [LightBoxTitleTexts.title];
|
|
982
|
+
this.topLeftSubtitle = [LightBoxTitleTexts.caption];
|
|
983
|
+
this.bottomLeftTitle = [LightBoxTitleTexts.date, LightBoxTitleTexts.location];
|
|
984
|
+
this.bottomLeftSubtitle = [LightBoxTitleTexts.persons];
|
|
973
985
|
}
|
|
974
986
|
};
|
|
975
987
|
exports.ClientLightboxTitleConfig = ClientLightboxTitleConfig;
|
|
976
988
|
tslib_1.__decorate([
|
|
977
989
|
(0, common_1.ConfigProperty)({
|
|
978
|
-
|
|
990
|
+
arrayType: LightBoxTitleTexts,
|
|
979
991
|
tags: {
|
|
980
|
-
name: $localize `Top left
|
|
992
|
+
name: $localize `Top left titles`,
|
|
981
993
|
priority: ConfigPriority.advanced
|
|
982
994
|
},
|
|
983
995
|
}),
|
|
984
|
-
tslib_1.__metadata("design:type",
|
|
996
|
+
tslib_1.__metadata("design:type", Array)
|
|
985
997
|
], ClientLightboxTitleConfig.prototype, "topLeftTitle", void 0);
|
|
986
998
|
tslib_1.__decorate([
|
|
987
999
|
(0, common_1.ConfigProperty)({
|
|
988
|
-
|
|
1000
|
+
arrayType: LightBoxTitleTexts,
|
|
989
1001
|
tags: {
|
|
990
|
-
name: $localize `Top left
|
|
1002
|
+
name: $localize `Top left subtitles`,
|
|
991
1003
|
priority: ConfigPriority.advanced
|
|
992
1004
|
},
|
|
993
1005
|
}),
|
|
994
|
-
tslib_1.__metadata("design:type",
|
|
1006
|
+
tslib_1.__metadata("design:type", Array)
|
|
995
1007
|
], ClientLightboxTitleConfig.prototype, "topLeftSubtitle", void 0);
|
|
996
1008
|
tslib_1.__decorate([
|
|
997
1009
|
(0, common_1.ConfigProperty)({
|
|
998
|
-
|
|
1010
|
+
arrayType: LightBoxTitleTexts,
|
|
999
1011
|
tags: {
|
|
1000
|
-
name: $localize `Bottom left
|
|
1012
|
+
name: $localize `Bottom left titles`,
|
|
1001
1013
|
priority: ConfigPriority.advanced
|
|
1002
1014
|
},
|
|
1003
1015
|
}),
|
|
1004
|
-
tslib_1.__metadata("design:type",
|
|
1016
|
+
tslib_1.__metadata("design:type", Array)
|
|
1005
1017
|
], ClientLightboxTitleConfig.prototype, "bottomLeftTitle", void 0);
|
|
1006
1018
|
tslib_1.__decorate([
|
|
1007
1019
|
(0, common_1.ConfigProperty)({
|
|
1008
|
-
|
|
1020
|
+
arrayType: LightBoxTitleTexts,
|
|
1009
1021
|
tags: {
|
|
1010
|
-
name: $localize `Bottom
|
|
1022
|
+
name: $localize `Bottom left subtitles`,
|
|
1011
1023
|
priority: ConfigPriority.advanced
|
|
1012
1024
|
},
|
|
1013
1025
|
}),
|
|
1014
|
-
tslib_1.__metadata("design:type",
|
|
1026
|
+
tslib_1.__metadata("design:type", Array)
|
|
1015
1027
|
], ClientLightboxTitleConfig.prototype, "bottomLeftSubtitle", void 0);
|
|
1016
1028
|
exports.ClientLightboxTitleConfig = ClientLightboxTitleConfig = tslib_1.__decorate([
|
|
1017
1029
|
(0, common_1.SubConfigClass)({ tags: { client: true }, softReadonly: true })
|
|
1018
1030
|
], ClientLightboxTitleConfig);
|
|
1031
|
+
let AutoUpdateConfig = class AutoUpdateConfig {
|
|
1032
|
+
constructor() {
|
|
1033
|
+
this.enable = false;
|
|
1034
|
+
this.interval = 60;
|
|
1035
|
+
}
|
|
1036
|
+
};
|
|
1037
|
+
exports.AutoUpdateConfig = AutoUpdateConfig;
|
|
1038
|
+
tslib_1.__decorate([
|
|
1039
|
+
(0, common_1.ConfigProperty)({
|
|
1040
|
+
tags: {
|
|
1041
|
+
name: $localize `Enable auto update`,
|
|
1042
|
+
priority: ConfigPriority.advanced,
|
|
1043
|
+
experimental: true,
|
|
1044
|
+
},
|
|
1045
|
+
description: $localize `Enable auto polling for new photos and videos in the gallery.`
|
|
1046
|
+
}),
|
|
1047
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
1048
|
+
], AutoUpdateConfig.prototype, "enable", void 0);
|
|
1049
|
+
tslib_1.__decorate([
|
|
1050
|
+
(0, common_1.ConfigProperty)({
|
|
1051
|
+
tags: {
|
|
1052
|
+
name: $localize `Interval`,
|
|
1053
|
+
priority: ConfigPriority.advanced,
|
|
1054
|
+
githubIssue: 1062,
|
|
1055
|
+
unit: 's'
|
|
1056
|
+
},
|
|
1057
|
+
description: $localize `Frequency of the auto polling in seconds.`
|
|
1058
|
+
}),
|
|
1059
|
+
tslib_1.__metadata("design:type", Number)
|
|
1060
|
+
], AutoUpdateConfig.prototype, "interval", void 0);
|
|
1061
|
+
exports.AutoUpdateConfig = AutoUpdateConfig = tslib_1.__decorate([
|
|
1062
|
+
(0, common_1.SubConfigClass)({ tags: { client: true }, softReadonly: true })
|
|
1063
|
+
], AutoUpdateConfig);
|
|
1019
1064
|
let ClientLightboxConfig = class ClientLightboxConfig {
|
|
1020
1065
|
constructor() {
|
|
1021
|
-
this.
|
|
1066
|
+
this.slideshowSpeed = 5;
|
|
1022
1067
|
this.captionAlwaysOn = false;
|
|
1023
1068
|
this.facesAlwaysOn = false;
|
|
1024
1069
|
this.loopVideos = false;
|
|
@@ -1040,7 +1085,7 @@ tslib_1.__decorate([
|
|
|
1040
1085
|
description: $localize `Default time interval for displaying a photo in the slide show.`
|
|
1041
1086
|
}),
|
|
1042
1087
|
tslib_1.__metadata("design:type", Number)
|
|
1043
|
-
], ClientLightboxConfig.prototype, "
|
|
1088
|
+
], ClientLightboxConfig.prototype, "slideshowSpeed", void 0);
|
|
1044
1089
|
tslib_1.__decorate([
|
|
1045
1090
|
(0, common_1.ConfigProperty)({
|
|
1046
1091
|
tags: {
|
|
@@ -1087,7 +1132,7 @@ tslib_1.__decorate([
|
|
|
1087
1132
|
name: $localize `Load full resolution image on zoom.`,
|
|
1088
1133
|
priority: ConfigPriority.advanced
|
|
1089
1134
|
},
|
|
1090
|
-
description: $localize `Enables loading the full resolution image on zoom in the
|
|
1135
|
+
description: $localize `Enables loading the full resolution image on zoom in the lightbox (preview).`,
|
|
1091
1136
|
}),
|
|
1092
1137
|
tslib_1.__metadata("design:type", Boolean)
|
|
1093
1138
|
], ClientLightboxConfig.prototype, "loadFullImageOnZoom", void 0);
|
|
@@ -1225,6 +1270,7 @@ let ClientGalleryConfig = class ClientGalleryConfig {
|
|
|
1225
1270
|
this.Themes = new ThemesConfig();
|
|
1226
1271
|
this.InlineBlogStartsOpen = false;
|
|
1227
1272
|
this.TopBlogStartsOpen = false;
|
|
1273
|
+
this.AutoUpdate = new AutoUpdateConfig();
|
|
1228
1274
|
}
|
|
1229
1275
|
};
|
|
1230
1276
|
exports.ClientGalleryConfig = ClientGalleryConfig;
|
|
@@ -1267,7 +1313,7 @@ tslib_1.__decorate([
|
|
|
1267
1313
|
description: $localize `If enabled, timestamp offsets are ignored, meaning that the local times of pictures are used for searching, sorting and grouping. If disabled, global time is used and pictures with no timestamp are assumed to be in UTC (offset +00:00).`
|
|
1268
1314
|
})
|
|
1269
1315
|
//DEVELOPER NOTE: The Database model stores the timestamp (creationDate) as milliseconds since 1970-01-01 UTC (global time). And stores and offset (creationDateOffset) as minutes.
|
|
1270
|
-
//Ignoring timestamp for the user is the opposite for the database. If the user wants to ignore the offset, we have to add the offset to the creationDate to give the user the right experience.
|
|
1316
|
+
//Ignoring the timestamp for the user is the opposite for the database. If the user wants to ignore the offset, we have to add the offset to the creationDate to give the user the right experience.
|
|
1271
1317
|
,
|
|
1272
1318
|
tslib_1.__metadata("design:type", Boolean)
|
|
1273
1319
|
], ClientGalleryConfig.prototype, "ignoreTimestampOffset", void 0);
|
|
@@ -1345,6 +1391,16 @@ tslib_1.__decorate([
|
|
|
1345
1391
|
}),
|
|
1346
1392
|
tslib_1.__metadata("design:type", Boolean)
|
|
1347
1393
|
], ClientGalleryConfig.prototype, "TopBlogStartsOpen", void 0);
|
|
1394
|
+
tslib_1.__decorate([
|
|
1395
|
+
(0, common_1.ConfigProperty)({
|
|
1396
|
+
tags: {
|
|
1397
|
+
name: $localize `Auto update`,
|
|
1398
|
+
priority: ConfigPriority.advanced,
|
|
1399
|
+
},
|
|
1400
|
+
description: $localize `makes the gallery poll the backend for new photos in the given directory or search`
|
|
1401
|
+
}),
|
|
1402
|
+
tslib_1.__metadata("design:type", AutoUpdateConfig)
|
|
1403
|
+
], ClientGalleryConfig.prototype, "AutoUpdate", void 0);
|
|
1348
1404
|
exports.ClientGalleryConfig = ClientGalleryConfig = tslib_1.__decorate([
|
|
1349
1405
|
(0, common_1.SubConfigClass)({ tags: { client: true }, softReadonly: true })
|
|
1350
1406
|
], ClientGalleryConfig);
|
|
@@ -1352,8 +1408,8 @@ let ClientVideoConfig = class ClientVideoConfig {
|
|
|
1352
1408
|
constructor() {
|
|
1353
1409
|
this.enabled = true;
|
|
1354
1410
|
this.supportedFormatsWithTranscoding = ['avi', 'mkv', 'mov', 'wmv', 'flv', 'mts', 'm2ts', 'mpg', '3gp', 'm4v', 'mpeg', 'vob', 'divx', 'xvid', 'ts'];
|
|
1355
|
-
// Browser
|
|
1356
|
-
// Read more:
|
|
1411
|
+
// Browser-supported video formats
|
|
1412
|
+
// Read more: https://www.w3schools.com/html/html5_video.asp
|
|
1357
1413
|
this.supportedFormats = ['mp4', 'webm', 'ogv', 'ogg'];
|
|
1358
1414
|
}
|
|
1359
1415
|
};
|
|
@@ -1403,6 +1459,7 @@ let ClientPhotoConfig = class ClientPhotoConfig {
|
|
|
1403
1459
|
this.personThumbnailSize = 200;
|
|
1404
1460
|
this.thumbnailSizes = [320, 540, 1080, 2160];
|
|
1405
1461
|
this.concurrentThumbnailGenerations = 1;
|
|
1462
|
+
this.concurrentThumbnailGenerationsLimit = 0;
|
|
1406
1463
|
this.supportedFormats = ['gif', 'jpeg', 'jpg', 'jpe', 'png', 'webp', 'svg', 'avif', 'heic', 'dng', 'arw', 'tiff'];
|
|
1407
1464
|
}
|
|
1408
1465
|
/**
|
|
@@ -1460,10 +1517,21 @@ tslib_1.__decorate([
|
|
|
1460
1517
|
tslib_1.__decorate([
|
|
1461
1518
|
(0, common_1.ConfigProperty)({
|
|
1462
1519
|
volatile: true,
|
|
1463
|
-
description: 'Updated to match
|
|
1520
|
+
description: 'Updated to match the number of CPUs. This manny thumbnail will be concurrently generated.',
|
|
1464
1521
|
}),
|
|
1465
1522
|
tslib_1.__metadata("design:type", Number)
|
|
1466
1523
|
], ClientPhotoConfig.prototype, "concurrentThumbnailGenerations", void 0);
|
|
1524
|
+
tslib_1.__decorate([
|
|
1525
|
+
(0, common_1.ConfigProperty)({
|
|
1526
|
+
tags: {
|
|
1527
|
+
name: $localize `Concurrent photo generation limit`,
|
|
1528
|
+
priority: ConfigPriority.underTheHood,
|
|
1529
|
+
uiResetNeeded: { server: true }
|
|
1530
|
+
},
|
|
1531
|
+
description: 'By default the app uses the number of cpus -1 concurrent threads to generate thumbnails. Set this number higher than 0 to limit the number of concurrent threads.',
|
|
1532
|
+
}),
|
|
1533
|
+
tslib_1.__metadata("design:type", Number)
|
|
1534
|
+
], ClientPhotoConfig.prototype, "concurrentThumbnailGenerationsLimit", void 0);
|
|
1467
1535
|
tslib_1.__decorate([
|
|
1468
1536
|
(0, common_1.ConfigProperty)({
|
|
1469
1537
|
arrayType: 'string',
|
|
@@ -1658,6 +1726,7 @@ let ClientServiceConfig = class ClientServiceConfig {
|
|
|
1658
1726
|
this.apiPath = '/pgapi';
|
|
1659
1727
|
this.customHTMLHead = '';
|
|
1660
1728
|
this.svgIcon = new SVGIconConfig(`0 0 512 512`, '<path d="m185.92 0.042372c-3.1045 0.19567-6.2676 1.0899-9.1546 3.163-16.085-8.0588-25.565 1.6894-23.504 14.76-5.3047 4.0078-10.768 7.8463-6.3153 20.688-4.8283 4.5113-5.2702 11.17-1.2227 20.894-4.5731 7.1343-3.0927 13.944 1.4676 20.445-5.0506 10.26 3.7514 20.507 6.2389 23.943-0.99909 6.6761-0.49742 13.458 11.016 21.392-1.2207 10.005 5.7492 14.415 12.419 19.045 12.567 8.1824 17.213 7.2406 27.088 10.328l-0.13366-1.1862c-15.833 3e-3 -31.017 6.2997-42.211 17.506l-24.715 24.736c-11.194 11.206-26.378 17.503-42.211 17.506h-34.984c-32.972 3.6e-4 -59.702 26.751-59.701 59.749v179.24c3.6312e-4 32.997 26.729 59.746 59.701 59.747h358.21c32.972-3.6e-4 59.7-26.75 59.701-59.747v-179.24c-0.0162-23.02-13.245-43.983-34.008-53.889 3.0728-1.7781 5.0617-4.3071 6.7327-7.0379 4.1124-1.032 17.438-3.2179 20.159-14.327 7.7661-2.0112 13.273-6.2767 14.255-14.719 9.3465-4.8456 13.285-10.23 12.484-16.792 11.694-7.0704 9.9759-13.526 8.4511-19.912 9.9742-8.687 8.874-22.288-8.6236-26.461-3.1292-12.25-18.501-15.32-20.733-16.133-1.3931-4.0275-3.7026-7.9496-14.353-10.399-4.4451-8.3291-12.211-9.9464-20.904-9.9225-6.4476-10.379-14.548-6.8393-22.216-7.2124-9.6958-7.4917-13.951-3.6525-20.032-3.5572-11.02-6.8739-16.687-2.7782-24.497 0.86675l-6.6602-2.5355c-21.868 3.9146-38.57 22.031-45.765 31.84 0.78895-12.143-0.36806-36.764-14.606-53.831l-6.7327-2.3414c-3.6422-7.8167-5.3526-14.6-18.209-16.423-4.7287-3.9225-5.388-9.6636-17.627-10.162-3.9701-2.9861-7.0841-7.4205-11.972-9.091-2.5588-0.82206-5.6927-0.97346-9.6817 0.32356-6.6078-5.7069-13.63-9.3648-22.385-5.8437-9.7319-4.9749-14.082-3.5883-17.674-1.2668-1.3952-0.50821-7.2885-3.6439-14.018-4.1239-1.0094-0.071996-2.0376-0.084841-3.0724-0.019609zm1.017 13.578c10.104 0.93027 18.591 7.2129 24.705 11.86 3.989-1.297 1.8817-5.4748-0.67601-9.9264 7.4731 3.9321 13.922 8.2611 19.542 13.058 4.4921-1.7738-6e-3 -6.9333-1.6283-10.934 11.32 6.6532 15.299 11.732 19.277 16.811 4.96-2.1534 2.5609-6.4373 1.1326-10.368 7.9224 6.6257 11.087 12.731 14.482 18.808 2.4625-1.6331 5.6853-2.3301 4.5577-8.9008 5.1605 6.0597 8.5191 12.233 10.344 18.398 4.8979-1.076 4.6167-5.1376 5.7471-8.2459 4.8158 7.9142 7.0028 15.201 10.195 22.743 1.3502-0.38818 3.143-2.596 5.5002-6.3575 10.495 21.313 19.172 68.475-19.542 71.864-19.845-33.079-47.35-62.019-80.099-88.028 39.018 41.712 59.701 71.578 68.828 93.932-5.6123 8.2892-13.186 12.888-21.423 15.182h-31.496c-9.0855-1.8937-17.047-4.8048-21.968-6.9301 3.5034-0.26396 6.761-1.0578 8.553-3.265-2.8932-4.1339-16.942-6.6095-24.423-15.054 3.8384 0.62815 5.771 0.45179 8.3395-1.4727-7.7461-5.9015-16.277-11.759-20.149-18.339 3.0088 1.096 5.5764 2.7998 10.448 1.4943-6.3427-7.0404-13.489-13.382-17.696-22.065 4.1118 1.3877 8.4445 3.0751 10.271 1.9806-5.5926-6.9871-9.844-14.035-12.948-21.216 5.3821 2.7304 8.0206 3.0315 9.7326 2.5551-3.457-7.4192-8.6517-14.592-9.4172-22.461 3.6436 2.9772 7.3478 4.8776 10.904 3.8631-0.36036-4.7513-7.3377-10.044-8.4022-21.322 4.3234 2.0148 8.7693 4.2946 10.093 3.6768 0.9645-8.9987-0.93024-14.97-2.5963-20.967 9.547 3.3675 23.877 8.6978 23.48 7.6733zm202.89 68.954c-1.1657 3.2054-4.0535 6.0044-0.89552 10.015 5.3574-3.5486 11.898-6.1175 19.744-7.4399-5.0841 4.3081-3.1624 6.8795-2.228 9.7499 6.5043-2.4708 12.815-5.0123 23.175-5.0887-3.6187 2.0919-8.2066 3.8292-5.7902 8.6694 6.3098-1.3316 12.62-2.6636 25.565-0.47848-3.8128 2.0212-10.67 3.0443-8.2709 7.3281 7.289-0.095 15.142 0.67658 23.357 2.5689-4.9157 1.7295-9.1161 3.6077-6.8934 7.1673 7.6683 0.37321 18.204 1.0216 26.541 6.8085l-7.9768 3.8043c-0.96209 0.52956 13.473 5.5674 22.914 9.2263-5.2605 3.5839-10.415 6.8757-15.456 14.39 0.61731 1.3249 5.4871 2.4391 10.093 3.6768-8.059 7.9545-16.768 7.4235-20.131 10.928 2.0376 3.1622 6.0354 3.9567 10.836 4.0553-5.7375 5.5002-14.227 7.6885-21.64 11.148 1.0057 1.4663 3.2192 2.9338 9.0958 4.3043-6.9901 3.5039-14.773 6.1675-23.545 7.9223 0.73194 1.9166 5.0978 3.5087 9.1389 5.0907-8.7991 3.945-18.346 4.207-27.726 5.5201 2.9287 4.0367 5.9538 4.4791 8.9626 5.575-7.1926 2.5501-17.455 1.4514-27.215 1.0864 0.46776 2.1663 1.3155 3.4454 2.7961 4.6612h-13.75c-5.1274-1.4192-9.4503-2.9189-11.788-2.2747-0.0214 0.78201 0.12538 1.5366 0.37044 2.2747h-6.1841c-2.2143-0.16717-4.4175-0.45785-6.5995-0.87068-17.23-8.2945-37.615-23.515-35.198-47.897 21.35-11.254 56.342-20.728 113.06-27.679-41.792-1.1427-81.452 3.3317-117.9 15.905-27.674-27.57 9.2662-58.115 30.995-67.691-0.70716 4.3624-0.65582 7.2407 0.12836 8.4067 7.2901-3.7246 13.646-7.8991 22.418-10.864zm-186.04 100.82h69.97c7.9167 2e-3 15.508 3.1505 21.105 8.7538l24.717 24.736c16.798 16.816 39.584 26.262 63.343 26.259h34.984c16.486 1.9e-4 29.85 13.375 29.85 29.873v179.24c-1.9e-4 16.499-13.365 29.873-29.85 29.873h-358.21c-16.486-1.8e-4 -29.85-13.375-29.85-29.873v-179.24c1.88e-4 -16.499 13.365-29.873 29.85-29.873h34.984c23.739-0.0128 46.501-9.4579 63.285-26.259l24.775-24.736c5.582-5.5884 13.149-8.736 21.045-8.7538zm35.016 59.749c-57.625 0.10848-104.28 46.889-104.28 104.56 0 57.669 46.656 104.45 104.28 104.56 57.625-0.10848 104.28-46.889 104.28-104.56 0-57.669-46.656-104.45-104.28-104.56zm-164.18 29.873c-8.2429 9e-5 -14.925 6.6874-14.925 14.937 0.03875 8.2218 6.7096 14.866 14.925 14.866s14.886-6.6446 14.925-14.866c-9.1e-5 -8.2493-6.6823-14.937-14.925-14.937zm164.18 0c41.206 0.0135 74.603 33.447 74.603 74.684 0 41.238-33.397 74.671-74.603 74.684-41.206-0.0135-74.603-33.447-74.603-74.684 0-41.238 33.397-74.671 74.603-74.684z"/>');
|
|
1729
|
+
this.reloadClientOnServerUpdate = true;
|
|
1661
1730
|
}
|
|
1662
1731
|
};
|
|
1663
1732
|
exports.ClientServiceConfig = ClientServiceConfig;
|
|
@@ -1737,6 +1806,17 @@ tslib_1.__decorate([
|
|
|
1737
1806
|
,
|
|
1738
1807
|
tslib_1.__metadata("design:type", SVGIconConfig)
|
|
1739
1808
|
], ClientServiceConfig.prototype, "svgIcon", void 0);
|
|
1809
|
+
tslib_1.__decorate([
|
|
1810
|
+
(0, common_1.ConfigProperty)({
|
|
1811
|
+
tags: {
|
|
1812
|
+
name: $localize `Reload client on server update`,
|
|
1813
|
+
priority: ConfigPriority.underTheHood,
|
|
1814
|
+
githubIssue: 1078
|
|
1815
|
+
},
|
|
1816
|
+
description: $localize `If set the UI will auto reload when client related config changed or the app was restarted (except when the UI shows the settings page).`,
|
|
1817
|
+
}),
|
|
1818
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
1819
|
+
], ClientServiceConfig.prototype, "reloadClientOnServerUpdate", void 0);
|
|
1740
1820
|
exports.ClientServiceConfig = ClientServiceConfig = tslib_1.__decorate([
|
|
1741
1821
|
(0, common_1.SubConfigClass)({ tags: { client: true }, softReadonly: true })
|
|
1742
1822
|
], ClientServiceConfig);
|
|
@@ -1,21 +1,49 @@
|
|
|
1
|
-
import { ParentDirectoryDTO } from './DirectoryDTO';
|
|
1
|
+
import { DirectoryBaseDTO, DirectoryPathDTO, ParentDirectoryDTO } from './DirectoryDTO';
|
|
2
2
|
import { SearchResultDTO } from './SearchResultDTO';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
private reverseMap?;
|
|
3
|
+
import { FileDTO } from './FileDTO';
|
|
4
|
+
export interface ContentWrapper {
|
|
6
5
|
directory: ParentDirectoryDTO;
|
|
7
6
|
searchResult: SearchResultDTO;
|
|
8
7
|
notModified?: boolean;
|
|
9
|
-
|
|
8
|
+
}
|
|
9
|
+
export interface PackedContentWrapper {
|
|
10
|
+
directory: ParentDirectoryDTO;
|
|
11
|
+
searchResult: SearchResultDTO;
|
|
12
|
+
notModified?: boolean;
|
|
13
|
+
map: {
|
|
14
|
+
faces: string[];
|
|
15
|
+
keywords: string[];
|
|
16
|
+
lens: string[];
|
|
17
|
+
camera: string[];
|
|
18
|
+
directories: DirectoryPathDTO[];
|
|
19
|
+
};
|
|
20
|
+
reverseMap?: {
|
|
21
|
+
faces: Map<string, number>;
|
|
22
|
+
keywords: Map<string, number>;
|
|
23
|
+
lens: Map<string, number>;
|
|
24
|
+
camera: Map<string, number>;
|
|
25
|
+
directories: Map<string, number>;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface ContentWrapperWithError extends ContentWrapper {
|
|
29
|
+
error?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface PackedContentWrapperWithError extends PackedContentWrapper {
|
|
32
|
+
error?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare class ContentWrapperUtils {
|
|
35
|
+
static equals(cw1: ContentWrapper, cw2: ContentWrapper): boolean;
|
|
36
|
+
static equalsMedia(d1: FileDTO, d2: FileDTO): boolean;
|
|
37
|
+
static equalsPartialDirectory(d1: DirectoryBaseDTO, d2: DirectoryBaseDTO): boolean;
|
|
38
|
+
static equalsDirectories(d1: DirectoryBaseDTO[], d2: DirectoryBaseDTO[]): boolean;
|
|
39
|
+
static equalsFiles(m1: FileDTO[], m2: FileDTO[]): boolean;
|
|
40
|
+
static pack(cwIn: ContentWrapper): PackedContentWrapper;
|
|
41
|
+
static unpack(cwIn: PackedContentWrapper): ContentWrapper;
|
|
42
|
+
static build(directory?: ParentDirectoryDTO, searchResult?: SearchResultDTO, notModified?: boolean): ContentWrapper;
|
|
10
43
|
private static mapify;
|
|
11
44
|
private static packMedia;
|
|
12
45
|
private static packDirectory;
|
|
13
46
|
private static deMapify;
|
|
14
47
|
private static unPackMedia;
|
|
15
48
|
private static unPackDirectory;
|
|
16
|
-
static pack(cw: ContentWrapper): ContentWrapper;
|
|
17
|
-
static unpack(cw: ContentWrapper): ContentWrapper;
|
|
18
|
-
}
|
|
19
|
-
export declare class ContentWrapperWithError extends ContentWrapper {
|
|
20
|
-
error?: string;
|
|
21
49
|
}
|
|
@@ -1,19 +1,171 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ContentWrapperUtils = void 0;
|
|
4
4
|
const Utils_1 = require("../Utils");
|
|
5
5
|
const MediaDTO_1 = require("./MediaDTO");
|
|
6
|
-
class
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
|
|
6
|
+
class ContentWrapperUtils {
|
|
7
|
+
static equals(cw1, cw2) {
|
|
8
|
+
if (cw1 === cw2) {
|
|
9
|
+
console.log('the same objects');
|
|
10
|
+
return true;
|
|
10
11
|
}
|
|
11
|
-
if (
|
|
12
|
-
|
|
12
|
+
if (!cw1 || !cw2) {
|
|
13
|
+
return false;
|
|
13
14
|
}
|
|
14
|
-
if (notModified) {
|
|
15
|
-
|
|
15
|
+
if (cw1.notModified !== cw2.notModified) {
|
|
16
|
+
return false;
|
|
16
17
|
}
|
|
18
|
+
if (cw1.directory && !ContentWrapperUtils.equalsPartialDirectory(cw1.directory, cw2.directory)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
const c1 = cw1.directory || cw1.searchResult;
|
|
22
|
+
const c2 = cw2.directory || cw2.searchResult;
|
|
23
|
+
if (c1 === c2) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
if (!c1 || !c2) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
if (!this.equalsDirectories(c1.directories, c2.directories)) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
if (!this.equalsFiles(c1.media, c2.media)) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
if (!this.equalsFiles(c1.metaFile, c2.metaFile)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
static equalsMedia(d1, d2) {
|
|
41
|
+
if (d1 === d2) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
if (!d1 || !d2) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
const { directory: m1dir, ...pm1 } = d1;
|
|
48
|
+
const { directory: m2dir, ...pm2 } = d2;
|
|
49
|
+
if (m1dir.name !== m2dir.name || m1dir.path !== m2dir.path) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
if (!Utils_1.Utils.equalsFilter(pm1, pm2)) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
static equalsPartialDirectory(d1, d2) {
|
|
58
|
+
if (d1 === d2) {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
if (!d1 || !d2) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
if (!ContentWrapperUtils.equalsMedia(d1.cache?.cover, d2.cache?.cover)) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
const { cover: d1cover, ...d1c } = d1.cache;
|
|
68
|
+
const { cover: d2cover, ...d2c } = d2.cache;
|
|
69
|
+
if (!Utils_1.Utils.equalsFilter(d1c, d2c)) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
const { parent: d1parent, directories: d1directories, media: d1media, metaFile: d1metaFile, cache: d1cache, ...pd1 } = d1;
|
|
73
|
+
const { parent: d2parent, directories: d2directories, media: d2media, metaFile: d2metaFile, cache: d2cache, ...pd2 } = d2;
|
|
74
|
+
if (!Utils_1.Utils.equalsFilter(pd1, pd2)) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
static equalsDirectories(d1, d2) {
|
|
80
|
+
if (d1 === d2) {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
if (!d1 || !d2) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (d1.length !== d2.length) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
const fullPath = (d) => d.path + '/' + d.name;
|
|
90
|
+
const d1c = d1.slice().sort((a, b) => fullPath(a).localeCompare(fullPath(b)));
|
|
91
|
+
const d2c = d2.slice().sort((a, b) => fullPath(a).localeCompare(fullPath(b)));
|
|
92
|
+
for (let i = 0; i < d1.length; ++i) {
|
|
93
|
+
if (ContentWrapperUtils.equalsPartialDirectory(d1c[i], d2c[i]) === false) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
static equalsFiles(m1, m2) {
|
|
100
|
+
if (m1 === m2) {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
if (!m1 || !m2) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
if (m1.length !== m2.length) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
const fullPath = (m) => m.directory.path + '/' + m.directory.name + '/' + m.name;
|
|
110
|
+
const m1c = m1.slice().sort((a, b) => fullPath(a).localeCompare(fullPath(b)));
|
|
111
|
+
const m2c = m2.slice().sort((a, b) => fullPath(a).localeCompare(fullPath(b)));
|
|
112
|
+
for (let i = 0; i < m1.length; ++i) {
|
|
113
|
+
if (!ContentWrapperUtils.equalsMedia(m1c[i], m2c[i])) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
static pack(cwIn) {
|
|
120
|
+
const cw = {
|
|
121
|
+
map: {
|
|
122
|
+
faces: [], keywords: [], lens: [],
|
|
123
|
+
camera: [], directories: []
|
|
124
|
+
},
|
|
125
|
+
reverseMap: {
|
|
126
|
+
faces: new Map(), keywords: new Map(),
|
|
127
|
+
lens: new Map(), camera: new Map(), directories: new Map()
|
|
128
|
+
},
|
|
129
|
+
...cwIn
|
|
130
|
+
};
|
|
131
|
+
if (cw?.directory) {
|
|
132
|
+
ContentWrapperUtils.packDirectory(cw, cw.directory);
|
|
133
|
+
}
|
|
134
|
+
else if (cw.searchResult) {
|
|
135
|
+
ContentWrapperUtils.packDirectory(cw, cw.searchResult, true);
|
|
136
|
+
}
|
|
137
|
+
// remove empty maps
|
|
138
|
+
for (const k in cw.map) {
|
|
139
|
+
// @ts-ignore
|
|
140
|
+
if (cw.map[k].length === 0) {
|
|
141
|
+
// @ts-ignore
|
|
142
|
+
delete cw.map[k];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
delete cw.reverseMap;
|
|
146
|
+
return cw;
|
|
147
|
+
}
|
|
148
|
+
static unpack(cwIn) {
|
|
149
|
+
const cw = { ...cwIn };
|
|
150
|
+
if (!cw || cw.notModified) {
|
|
151
|
+
return cw;
|
|
152
|
+
}
|
|
153
|
+
if (cw?.directory) {
|
|
154
|
+
ContentWrapperUtils.unPackDirectory(cw, cw.directory);
|
|
155
|
+
}
|
|
156
|
+
else if (cw.searchResult) {
|
|
157
|
+
ContentWrapperUtils.unPackDirectory(cw, cw.searchResult, true);
|
|
158
|
+
}
|
|
159
|
+
delete cw.map;
|
|
160
|
+
return cw;
|
|
161
|
+
}
|
|
162
|
+
static build(directory = null, searchResult = null, notModified) {
|
|
163
|
+
const cw = {
|
|
164
|
+
...(directory && { directory }),
|
|
165
|
+
...(searchResult && { searchResult }),
|
|
166
|
+
...(notModified && { notModified }),
|
|
167
|
+
};
|
|
168
|
+
return cw;
|
|
17
169
|
}
|
|
18
170
|
static mapify(cw, media, isSearchResult) {
|
|
19
171
|
if (isSearchResult) {
|
|
@@ -187,14 +339,14 @@ class ContentWrapper {
|
|
|
187
339
|
delete f.box;
|
|
188
340
|
}
|
|
189
341
|
}
|
|
190
|
-
|
|
342
|
+
ContentWrapperUtils.mapify(cw, m, isSearchResult);
|
|
191
343
|
}
|
|
192
344
|
else if (MediaDTO_1.MediaDTOUtils.isVideo(m)) {
|
|
193
345
|
delete m.metadata.caption;
|
|
194
346
|
delete m.metadata.cameraData;
|
|
195
347
|
delete m.metadata.faces;
|
|
196
348
|
delete m.metadata.positionData;
|
|
197
|
-
|
|
349
|
+
ContentWrapperUtils.mapify(cw, m, isSearchResult);
|
|
198
350
|
}
|
|
199
351
|
Utils_1.Utils.removeNullOrEmptyObj(m);
|
|
200
352
|
}
|
|
@@ -210,7 +362,7 @@ class ContentWrapper {
|
|
|
210
362
|
dir.cache.cover = Utils_1.Utils.clone(dir.cache.cover);
|
|
211
363
|
}
|
|
212
364
|
if (dir.media) {
|
|
213
|
-
|
|
365
|
+
ContentWrapperUtils.packMedia(cw, dir.media, isSearchResult);
|
|
214
366
|
}
|
|
215
367
|
if (dir.metaFile) {
|
|
216
368
|
for (let i = 0; i < dir.metaFile.length; ++i) {
|
|
@@ -221,14 +373,14 @@ class ContentWrapper {
|
|
|
221
373
|
delete dir.metaFile[i].directory;
|
|
222
374
|
}
|
|
223
375
|
delete dir.metaFile[i].id;
|
|
224
|
-
|
|
376
|
+
ContentWrapperUtils.mapify(cw, dir.metaFile[i], isSearchResult);
|
|
225
377
|
}
|
|
226
378
|
}
|
|
227
379
|
if (dir.directories) {
|
|
228
380
|
for (let i = 0; i < dir.directories.length; ++i) {
|
|
229
381
|
// first remove the parent otherwise it will be a infinite recursion
|
|
230
382
|
delete dir.directories[i].parent;
|
|
231
|
-
|
|
383
|
+
ContentWrapperUtils.packDirectory(cw, dir.directories[i]);
|
|
232
384
|
}
|
|
233
385
|
}
|
|
234
386
|
// should not go to the client side
|
|
@@ -429,7 +581,7 @@ class ContentWrapper {
|
|
|
429
581
|
// clean up media
|
|
430
582
|
for (let i = 0; i < media.length; ++i) {
|
|
431
583
|
const m = media[i];
|
|
432
|
-
|
|
584
|
+
ContentWrapperUtils.deMapify(cw, m, isSearchResult);
|
|
433
585
|
if (!isSearchResult) {
|
|
434
586
|
m.directory = dir;
|
|
435
587
|
}
|
|
@@ -437,67 +589,24 @@ class ContentWrapper {
|
|
|
437
589
|
}
|
|
438
590
|
static unPackDirectory(cw, dir, isSearchResult = false) {
|
|
439
591
|
if (dir.media) {
|
|
440
|
-
|
|
592
|
+
ContentWrapperUtils.unPackMedia(cw, dir, dir.media, isSearchResult);
|
|
441
593
|
}
|
|
442
594
|
if (dir.metaFile) {
|
|
443
595
|
for (let i = 0; i < dir.metaFile.length; ++i) {
|
|
444
596
|
if (!isSearchResult) {
|
|
445
597
|
dir.metaFile[i].directory = dir;
|
|
446
598
|
}
|
|
447
|
-
|
|
599
|
+
ContentWrapperUtils.deMapify(cw, dir.metaFile[i], isSearchResult);
|
|
448
600
|
}
|
|
449
601
|
}
|
|
450
602
|
if (dir.directories) {
|
|
451
603
|
for (let i = 0; i < dir.directories.length; ++i) {
|
|
452
|
-
|
|
604
|
+
ContentWrapperUtils.unPackDirectory(cw, dir.directories[i]);
|
|
453
605
|
if (!isSearchResult) {
|
|
454
606
|
dir.directories[i].parent = dir;
|
|
455
607
|
}
|
|
456
608
|
}
|
|
457
609
|
}
|
|
458
610
|
}
|
|
459
|
-
static pack(cw) {
|
|
460
|
-
// init CW for packing
|
|
461
|
-
cw.map = {
|
|
462
|
-
faces: [], keywords: [], lens: [],
|
|
463
|
-
camera: [], directories: []
|
|
464
|
-
};
|
|
465
|
-
cw.reverseMap = {
|
|
466
|
-
faces: new Map(), keywords: new Map(),
|
|
467
|
-
lens: new Map(), camera: new Map(), directories: new Map()
|
|
468
|
-
};
|
|
469
|
-
if (cw?.directory) {
|
|
470
|
-
ContentWrapper.packDirectory(cw, cw.directory);
|
|
471
|
-
}
|
|
472
|
-
else if (cw.searchResult) {
|
|
473
|
-
ContentWrapper.packDirectory(cw, cw.searchResult, true);
|
|
474
|
-
}
|
|
475
|
-
// remove empty maps
|
|
476
|
-
for (const k in cw.map) {
|
|
477
|
-
// @ts-ignore
|
|
478
|
-
if (cw.map[k].length === 0) {
|
|
479
|
-
// @ts-ignore
|
|
480
|
-
delete cw.map[k];
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
delete cw.reverseMap;
|
|
484
|
-
return cw;
|
|
485
|
-
}
|
|
486
|
-
static unpack(cw) {
|
|
487
|
-
if (!cw || cw.notModified) {
|
|
488
|
-
return cw;
|
|
489
|
-
}
|
|
490
|
-
if (cw?.directory) {
|
|
491
|
-
ContentWrapper.unPackDirectory(cw, cw.directory);
|
|
492
|
-
}
|
|
493
|
-
else if (cw.searchResult) {
|
|
494
|
-
ContentWrapper.unPackDirectory(cw, cw.searchResult, true);
|
|
495
|
-
}
|
|
496
|
-
delete cw.map;
|
|
497
|
-
return cw;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
exports.ContentWrapper = ContentWrapper;
|
|
501
|
-
class ContentWrapperWithError extends ContentWrapper {
|
|
502
611
|
}
|
|
503
|
-
exports.
|
|
612
|
+
exports.ContentWrapperUtils = ContentWrapperUtils;
|
|
@@ -17,6 +17,7 @@ var ErrorCodes;
|
|
|
17
17
|
ErrorCodes[ErrorCodes["SERVER_ERROR"] = 36] = "SERVER_ERROR";
|
|
18
18
|
ErrorCodes[ErrorCodes["USER_MANAGEMENT_DISABLED"] = 40] = "USER_MANAGEMENT_DISABLED";
|
|
19
19
|
ErrorCodes[ErrorCodes["INPUT_ERROR"] = 50] = "INPUT_ERROR";
|
|
20
|
+
ErrorCodes[ErrorCodes["PATH_ERROR"] = 51] = "PATH_ERROR";
|
|
20
21
|
ErrorCodes[ErrorCodes["SETTINGS_ERROR"] = 60] = "SETTINGS_ERROR";
|
|
21
22
|
ErrorCodes[ErrorCodes["TASK_ERROR"] = 61] = "TASK_ERROR";
|
|
22
23
|
ErrorCodes[ErrorCodes["JOB_ERROR"] = 62] = "JOB_ERROR";
|