pigallery2-extension-kit 3.0.1 → 3.5.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/README.md +3 -106
- package/REPOSITORY.md +2 -1
- package/lib/backend/Logger.d.ts +1 -1
- package/lib/backend/ProjectPath.js +1 -1
- package/lib/backend/exceptions/FileAlreadyExists.d.ts +4 -0
- package/lib/backend/middlewares/UploadMWs.d.ts +4 -0
- package/lib/backend/middlewares/VersionMWs.d.ts +4 -0
- package/lib/backend/middlewares/user/OIDCAuthService.d.ts +7 -0
- package/lib/backend/model/ObjectManagers.d.ts +6 -2
- package/lib/backend/model/UploadManager.d.ts +9 -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/IObjectManager.d.ts +2 -2
- package/lib/backend/model/database/IndexingManager.d.ts +1 -0
- package/lib/backend/model/database/PersonManager.d.ts +1 -1
- package/lib/backend/model/database/ProjectedCacheManager.d.ts +4 -0
- package/lib/backend/model/database/SearchManager.d.ts +1 -1
- package/lib/backend/model/extension/ExtensionRepository.d.ts +1 -0
- package/lib/backend/model/fileaccess/DiskManager.d.ts +2 -1
- 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/backend/routes/OIDCRouter.d.ts +7 -0
- package/lib/backend/routes/UploadRouter.d.ts +5 -0
- package/lib/common/CustomHeaders.d.ts +1 -0
- package/lib/common/DataStructureVersion.d.ts +1 -1
- package/lib/common/PG2ConfMap.d.ts +1 -0
- package/lib/common/QueryParams.d.ts +19 -1
- package/lib/common/SearchQueryParser.d.ts +11 -10
- package/lib/common/SearchQueryUtils.d.ts +13 -2
- package/lib/common/Utils.d.ts +7 -5
- package/lib/common/Utils.js +55 -19
- package/lib/common/config/private/Config.js +1 -0
- package/lib/common/config/private/PrivateConfig.d.ts +16 -1
- package/lib/common/config/private/PrivateConfig.js +161 -5
- 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 +34 -6
- package/lib/common/config/public/ClientConfig.js +239 -31
- package/lib/common/entities/AutoCompleteItem.d.ts +3 -3
- package/lib/common/entities/AutoCompleteItem.js +3 -3
- package/lib/common/entities/ContentWrapper.d.ts +38 -10
- package/lib/common/entities/ContentWrapper.js +171 -62
- package/lib/common/entities/Error.d.ts +2 -1
- 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/common/entities/SearchQueryDTO.d.ts +24 -41
- package/lib/common/entities/SearchQueryDTO.js +10 -19
- package/lib/common/entities/SortingMethods.d.ts +8 -0
- package/lib/common/entities/SortingMethods.js +10 -1
- package/lib/frontend/app/model/network/network.service.d.ts +4 -1
- package/lib/frontend/app/model/page.helper.d.ts +3 -2
- package/lib/frontend/app/model/query.service.d.ts +1 -1
- package/lib/frontend/app/model/version.service.d.ts +5 -1
- package/lib/frontend/app/ui/faces/faces.component.d.ts +1 -1
- package/lib/frontend/app/ui/faces/faces.service.d.ts +4 -0
- package/lib/frontend/app/ui/faces/navigator/navigator.faces.component.d.ts +15 -0
- package/lib/frontend/app/ui/frame/frame.component.d.ts +7 -2
- package/lib/frontend/app/ui/gallery/blog/blog.service.d.ts +1 -0
- package/lib/frontend/app/ui/gallery/cache.gallery.service.d.ts +5 -7
- package/lib/frontend/app/ui/gallery/contentLoader.service.d.ts +14 -11
- package/lib/frontend/app/ui/gallery/gallery.component.d.ts +12 -4
- package/lib/frontend/app/ui/gallery/gallery.service.d.ts +13 -0
- package/lib/frontend/app/ui/gallery/grid/grid.gallery.component.d.ts +4 -1
- package/lib/frontend/app/ui/gallery/lightbox/controls/controls.lightbox.gallery.component.d.ts +13 -20
- 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 +43 -4
- package/lib/frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.d.ts +5 -2
- package/lib/frontend/app/ui/gallery/map/lightbox/lightbox.map.gallery.component.d.ts +18 -12
- package/lib/frontend/app/ui/gallery/map/map.gallery.component.d.ts +5 -1
- package/lib/frontend/app/ui/gallery/navigator/navigator.service.d.ts +1 -0
- package/lib/frontend/app/ui/gallery/overlay.service.d.ts +2 -2
- package/lib/frontend/app/ui/gallery/photo-frame-builder/photo-frame-builder.gallery.component.d.ts +40 -0
- package/lib/frontend/app/ui/gallery/search/autocomplete.service.d.ts +1 -1
- package/lib/frontend/app/ui/gallery/search/query-enrty/query-entry.search.gallery.component.d.ts +2 -1
- package/lib/frontend/app/ui/gallery/search/search-query-parser.service.d.ts +0 -2
- package/lib/frontend/app/ui/gallery/thumbnailManager.service.d.ts +1 -1
- package/lib/frontend/app/ui/gallery/uploader/uploader.gallery.component.d.ts +15 -0
- package/lib/frontend/app/ui/gallery/uploader/uploader.service.d.ts +36 -0
- package/lib/frontend/app/ui/login/login.component.d.ts +3 -0
- package/lib/frontend/app/ui/settings/template/template.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -23,6 +23,7 @@ var ErrorCodes;
|
|
|
23
23
|
ErrorCodes[ErrorCodes["JOB_ERROR"] = 62] = "JOB_ERROR";
|
|
24
24
|
ErrorCodes[ErrorCodes["LocationLookUp_ERROR"] = 63] = "LocationLookUp_ERROR";
|
|
25
25
|
ErrorCodes[ErrorCodes["ALBUM_ERROR"] = 70] = "ALBUM_ERROR";
|
|
26
|
+
ErrorCodes[ErrorCodes["UPLOAD_ERROR"] = 80] = "UPLOAD_ERROR";
|
|
26
27
|
})(ErrorCodes || (exports.ErrorCodes = ErrorCodes = {}));
|
|
27
28
|
class ErrorDTO {
|
|
28
29
|
constructor(code, message, details, req) {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MediaDTOUtils = void 0;
|
|
4
4
|
const SupportedFormats_1 = require("../SupportedFormats");
|
|
5
|
+
const Utils_1 = require("../Utils");
|
|
5
6
|
exports.MediaDTOUtils = {
|
|
6
7
|
hasPositionData: (media) => {
|
|
7
8
|
return (!!media.metadata.positionData &&
|
|
@@ -43,11 +44,15 @@ exports.MediaDTOUtils = {
|
|
|
43
44
|
return false;
|
|
44
45
|
},
|
|
45
46
|
calcAspectRatio: (photo) => {
|
|
46
|
-
return (photo.metadata.size.width / photo.metadata.size.height) || 1; // NaN should be treated as square photo
|
|
47
|
+
return (photo.metadata.size.width / photo.metadata.size.height) || 1; // NaN should be treated as a square photo
|
|
47
48
|
},
|
|
48
49
|
equals: (a, b) => {
|
|
49
50
|
return a.directory.path === b.directory.path &&
|
|
50
51
|
a.directory.name === b.directory.name &&
|
|
51
52
|
a.name === b.name;
|
|
53
|
+
},
|
|
54
|
+
createdThisYear(media) {
|
|
55
|
+
return (new Date().getFullYear() ===
|
|
56
|
+
Utils_1.Utils.getUTCFullYear(media.metadata.creationDate, media.metadata.creationDateOffset));
|
|
52
57
|
}
|
|
53
58
|
};
|
|
@@ -4,14 +4,10 @@ export declare enum SearchQueryTypes {
|
|
|
4
4
|
OR = 2,
|
|
5
5
|
SOME_OF = 3,
|
|
6
6
|
UNKNOWN_RELATION = 99999,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
min_resolution = 14,
|
|
12
|
-
max_resolution = 15,
|
|
13
|
-
min_person_count = 16,
|
|
14
|
-
max_person_count = 17,
|
|
7
|
+
date = 10,
|
|
8
|
+
rating = 12,
|
|
9
|
+
resolution = 14,
|
|
10
|
+
person_count = 16,
|
|
15
11
|
distance = 50,
|
|
16
12
|
orientation = 51,
|
|
17
13
|
date_pattern = 60,
|
|
@@ -25,8 +21,6 @@ export declare enum SearchQueryTypes {
|
|
|
25
21
|
}
|
|
26
22
|
export declare const ListSearchQueryTypes: SearchQueryTypes[];
|
|
27
23
|
export declare const TextSearchQueryTypes: SearchQueryTypes[];
|
|
28
|
-
export declare const MinRangeSearchQueryTypes: SearchQueryTypes[];
|
|
29
|
-
export declare const MaxRangeSearchQueryTypes: SearchQueryTypes[];
|
|
30
24
|
export declare const RangeSearchQueryTypes: SearchQueryTypes[];
|
|
31
25
|
export declare const MetadataSearchQueryTypes: SearchQueryTypes[];
|
|
32
26
|
export declare enum TextSearchQueryMatchTypes {
|
|
@@ -58,50 +52,39 @@ export interface SomeOfSearchQuery extends SearchQueryDTO, SearchListQuery {
|
|
|
58
52
|
export interface TextSearch extends NegatableSearchQuery {
|
|
59
53
|
type: SearchQueryTypes.any_text | SearchQueryTypes.person | SearchQueryTypes.keyword | SearchQueryTypes.position | SearchQueryTypes.caption | SearchQueryTypes.file_name | SearchQueryTypes.directory;
|
|
60
54
|
matchType?: TextSearchQueryMatchTypes;
|
|
61
|
-
|
|
55
|
+
value: string;
|
|
62
56
|
}
|
|
63
57
|
export interface DistanceSearch extends NegatableSearchQuery {
|
|
64
58
|
type: SearchQueryTypes.distance;
|
|
65
59
|
from: {
|
|
66
|
-
|
|
60
|
+
value?: string;
|
|
67
61
|
GPSData?: GPSMetadata;
|
|
68
62
|
};
|
|
69
63
|
distance: number;
|
|
70
64
|
}
|
|
71
65
|
export interface RangeSearch extends NegatableSearchQuery {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
export interface FromDateSearch extends RangeSearch {
|
|
75
|
-
type: SearchQueryTypes.from_date;
|
|
76
|
-
value: number;
|
|
77
|
-
}
|
|
78
|
-
export interface ToDateSearch extends RangeSearch {
|
|
79
|
-
type: SearchQueryTypes.to_date;
|
|
80
|
-
value: number;
|
|
81
|
-
}
|
|
82
|
-
export interface MinRatingSearch extends RangeSearch {
|
|
83
|
-
type: SearchQueryTypes.min_rating;
|
|
84
|
-
value: number;
|
|
85
|
-
}
|
|
86
|
-
export interface MaxRatingSearch extends RangeSearch {
|
|
87
|
-
type: SearchQueryTypes.max_rating;
|
|
88
|
-
value: number;
|
|
66
|
+
min?: number;
|
|
67
|
+
max?: number;
|
|
89
68
|
}
|
|
90
|
-
export interface
|
|
91
|
-
type: SearchQueryTypes.
|
|
92
|
-
|
|
69
|
+
export interface DateSearch extends RangeSearch {
|
|
70
|
+
type: SearchQueryTypes.date;
|
|
71
|
+
min?: number;
|
|
72
|
+
max?: number;
|
|
93
73
|
}
|
|
94
|
-
export interface
|
|
95
|
-
type: SearchQueryTypes.
|
|
96
|
-
|
|
74
|
+
export interface RatingSearch extends RangeSearch {
|
|
75
|
+
type: SearchQueryTypes.rating;
|
|
76
|
+
min?: number;
|
|
77
|
+
max?: number;
|
|
97
78
|
}
|
|
98
|
-
export interface
|
|
99
|
-
type: SearchQueryTypes.
|
|
100
|
-
|
|
79
|
+
export interface PersonCountSearch extends RangeSearch {
|
|
80
|
+
type: SearchQueryTypes.person_count;
|
|
81
|
+
min?: number;
|
|
82
|
+
max?: number;
|
|
101
83
|
}
|
|
102
|
-
export interface
|
|
103
|
-
type: SearchQueryTypes.
|
|
104
|
-
|
|
84
|
+
export interface ResolutionSearch extends RangeSearch {
|
|
85
|
+
type: SearchQueryTypes.resolution;
|
|
86
|
+
min?: number;
|
|
87
|
+
max?: number;
|
|
105
88
|
}
|
|
106
89
|
export interface OrientationSearch {
|
|
107
90
|
type: SearchQueryTypes.orientation;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DatePatternFrequency = exports.TextSearchQueryMatchTypes = exports.MetadataSearchQueryTypes = exports.RangeSearchQueryTypes = exports.
|
|
3
|
+
exports.DatePatternFrequency = exports.TextSearchQueryMatchTypes = exports.MetadataSearchQueryTypes = exports.RangeSearchQueryTypes = exports.TextSearchQueryTypes = exports.ListSearchQueryTypes = exports.SearchQueryTypes = void 0;
|
|
4
4
|
var SearchQueryTypes;
|
|
5
5
|
(function (SearchQueryTypes) {
|
|
6
6
|
SearchQueryTypes[SearchQueryTypes["AND"] = 1] = "AND";
|
|
@@ -9,14 +9,10 @@ var SearchQueryTypes;
|
|
|
9
9
|
SearchQueryTypes[SearchQueryTypes["UNKNOWN_RELATION"] = 99999] = "UNKNOWN_RELATION";
|
|
10
10
|
// non-text metadata
|
|
11
11
|
// |- range types
|
|
12
|
-
SearchQueryTypes[SearchQueryTypes["
|
|
13
|
-
SearchQueryTypes[SearchQueryTypes["
|
|
14
|
-
SearchQueryTypes[SearchQueryTypes["
|
|
15
|
-
SearchQueryTypes[SearchQueryTypes["
|
|
16
|
-
SearchQueryTypes[SearchQueryTypes["min_resolution"] = 14] = "min_resolution";
|
|
17
|
-
SearchQueryTypes[SearchQueryTypes["max_resolution"] = 15] = "max_resolution";
|
|
18
|
-
SearchQueryTypes[SearchQueryTypes["min_person_count"] = 16] = "min_person_count";
|
|
19
|
-
SearchQueryTypes[SearchQueryTypes["max_person_count"] = 17] = "max_person_count";
|
|
12
|
+
SearchQueryTypes[SearchQueryTypes["date"] = 10] = "date";
|
|
13
|
+
SearchQueryTypes[SearchQueryTypes["rating"] = 12] = "rating";
|
|
14
|
+
SearchQueryTypes[SearchQueryTypes["resolution"] = 14] = "resolution";
|
|
15
|
+
SearchQueryTypes[SearchQueryTypes["person_count"] = 16] = "person_count";
|
|
20
16
|
SearchQueryTypes[SearchQueryTypes["distance"] = 50] = "distance";
|
|
21
17
|
SearchQueryTypes[SearchQueryTypes["orientation"] = 51] = "orientation";
|
|
22
18
|
SearchQueryTypes[SearchQueryTypes["date_pattern"] = 60] = "date_pattern";
|
|
@@ -43,17 +39,12 @@ exports.TextSearchQueryTypes = [
|
|
|
43
39
|
SearchQueryTypes.person,
|
|
44
40
|
SearchQueryTypes.position,
|
|
45
41
|
];
|
|
46
|
-
exports.
|
|
47
|
-
SearchQueryTypes.
|
|
48
|
-
SearchQueryTypes.
|
|
49
|
-
SearchQueryTypes.
|
|
42
|
+
exports.RangeSearchQueryTypes = [
|
|
43
|
+
SearchQueryTypes.date,
|
|
44
|
+
SearchQueryTypes.rating,
|
|
45
|
+
SearchQueryTypes.resolution,
|
|
46
|
+
SearchQueryTypes.person_count,
|
|
50
47
|
];
|
|
51
|
-
exports.MaxRangeSearchQueryTypes = [
|
|
52
|
-
SearchQueryTypes.to_date,
|
|
53
|
-
SearchQueryTypes.max_rating,
|
|
54
|
-
SearchQueryTypes.max_resolution,
|
|
55
|
-
];
|
|
56
|
-
exports.RangeSearchQueryTypes = exports.MinRangeSearchQueryTypes.concat(exports.MaxRangeSearchQueryTypes);
|
|
57
48
|
exports.MetadataSearchQueryTypes = [
|
|
58
49
|
SearchQueryTypes.distance,
|
|
59
50
|
SearchQueryTypes.orientation,
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Warning: Enum Values in this file should be unique within the file!
|
|
3
3
|
* */
|
|
4
|
+
/**
|
|
5
|
+
* FaceSortByTypes is a subset of SortByDirectionalTypes, their values should match.
|
|
6
|
+
* They are not merged programatically due to the ordering issue.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum FaceSortByTypes {
|
|
9
|
+
Name = 10,
|
|
10
|
+
PersonCount = 40
|
|
11
|
+
}
|
|
4
12
|
export declare enum SortByDirectionalTypes {
|
|
5
13
|
Name = 10,
|
|
6
14
|
Date = 20,
|
|
@@ -3,7 +3,16 @@
|
|
|
3
3
|
* Warning: Enum Values in this file should be unique within the file!
|
|
4
4
|
* */
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.GroupSortByTypes = exports.GroupByTypes = exports.SortByTypes = exports.GroupByBasicTypes = exports.SortByBasicTypes = exports.SortByDirectionalTypes = void 0;
|
|
6
|
+
exports.GroupSortByTypes = exports.GroupByTypes = exports.SortByTypes = exports.GroupByBasicTypes = exports.SortByBasicTypes = exports.SortByDirectionalTypes = exports.FaceSortByTypes = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* FaceSortByTypes is a subset of SortByDirectionalTypes, their values should match.
|
|
9
|
+
* They are not merged programatically due to the ordering issue.
|
|
10
|
+
*/
|
|
11
|
+
var FaceSortByTypes;
|
|
12
|
+
(function (FaceSortByTypes) {
|
|
13
|
+
FaceSortByTypes[FaceSortByTypes["Name"] = 10] = "Name";
|
|
14
|
+
FaceSortByTypes[FaceSortByTypes["PersonCount"] = 40] = "PersonCount";
|
|
15
|
+
})(FaceSortByTypes || (exports.FaceSortByTypes = FaceSortByTypes = {}));
|
|
7
16
|
var SortByDirectionalTypes;
|
|
8
17
|
(function (SortByDirectionalTypes) {
|
|
9
18
|
SortByDirectionalTypes[SortByDirectionalTypes["Name"] = 10] = "Name";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
1
|
+
import { HttpClient, HttpEvent } from '@angular/common/http';
|
|
2
|
+
import { Message } from '../../../../common/entities/Message';
|
|
2
3
|
import { LoadingBarService } from '@ngx-loading-bar/core';
|
|
3
4
|
import { ErrorDTO } from '../../../../common/entities/Error';
|
|
4
5
|
import { VersionService } from '../version.service';
|
|
6
|
+
import { Observable } from 'rxjs';
|
|
5
7
|
export declare class NetworkService {
|
|
6
8
|
private http;
|
|
7
9
|
private loadingBarService;
|
|
@@ -15,6 +17,7 @@ export declare class NetworkService {
|
|
|
15
17
|
getXML(url: string): Promise<Document>;
|
|
16
18
|
getText(url: string): Promise<string>;
|
|
17
19
|
postJson<T>(url: string, data?: {}): Promise<T>;
|
|
20
|
+
postFormData<T>(url: string, data: FormData): Observable<HttpEvent<Message<T>>>;
|
|
18
21
|
putJson<T>(url: string, data?: {}): Promise<T>;
|
|
19
22
|
getJson<T>(url: string, query?: {
|
|
20
23
|
[key: string]: any;
|
|
@@ -2,13 +2,14 @@ export declare class PageHelper {
|
|
|
2
2
|
private static readonly body;
|
|
3
3
|
private static readonly supportPageOffset;
|
|
4
4
|
private static readonly isCSS1Compat;
|
|
5
|
+
private static scrollLocks;
|
|
5
6
|
static get ScrollY(): number;
|
|
6
7
|
static set ScrollY(value: number);
|
|
7
8
|
static get OverflowY(): string;
|
|
8
9
|
static set OverflowY(value: string);
|
|
9
10
|
static get MaxScrollY(): number;
|
|
10
11
|
static get ScrollX(): number;
|
|
11
|
-
static showScrollY(): void;
|
|
12
|
+
static showScrollY(requester: string): void;
|
|
12
13
|
static isScrollYVisible(): boolean;
|
|
13
|
-
static hideScrollY(): void;
|
|
14
|
+
static hideScrollY(requester: string): void;
|
|
14
15
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { BehaviorSubject } from 'rxjs';
|
|
2
|
+
import { Router } from '@angular/router';
|
|
2
3
|
export declare class VersionService {
|
|
4
|
+
private router;
|
|
3
5
|
version: BehaviorSubject<string>;
|
|
4
|
-
|
|
6
|
+
appVersion: BehaviorSubject<string>;
|
|
7
|
+
constructor(router: Router);
|
|
5
8
|
onNewVersion(version: string): void;
|
|
9
|
+
onNewAppVersion(version: string): void;
|
|
6
10
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ElementRef, OnInit } from '@angular/core';
|
|
2
2
|
import { FacesService } from './faces.service';
|
|
3
3
|
import { QueryService } from '../../model/query.service';
|
|
4
|
-
import { PersonDTO } from '../../../../common/entities/PersonDTO';
|
|
5
4
|
import { Observable } from 'rxjs';
|
|
5
|
+
import { PersonDTO } from '../../../../common/entities/PersonDTO';
|
|
6
6
|
import { PiTitleService } from '../../model/pi-title.service';
|
|
7
7
|
export declare class FacesComponent implements OnInit {
|
|
8
8
|
facesService: FacesService;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { NetworkService } from '../../model/network/network.service';
|
|
2
2
|
import { BehaviorSubject } from 'rxjs';
|
|
3
3
|
import { PersonDTO } from '../../../../common/entities/PersonDTO';
|
|
4
|
+
import { SortingMethod } from '../../../../common/entities/SortingMethods';
|
|
4
5
|
export declare class FacesService {
|
|
5
6
|
private networkService;
|
|
6
7
|
persons: BehaviorSubject<PersonDTO[]>;
|
|
8
|
+
sorting: BehaviorSubject<SortingMethod>;
|
|
7
9
|
constructor(networkService: NetworkService);
|
|
10
|
+
isDefaultSorting(): boolean;
|
|
8
11
|
setFavourite(person: PersonDTO, isFavourite: boolean): Promise<void>;
|
|
9
12
|
getPersons(): Promise<void>;
|
|
13
|
+
setSorting(sorting: SortingMethod): void;
|
|
10
14
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FacesService } from '../faces.service';
|
|
2
|
+
export declare class FacesNavigatorComponent {
|
|
3
|
+
facesService: FacesService;
|
|
4
|
+
readonly sortingByTypes: {
|
|
5
|
+
key: number;
|
|
6
|
+
value: string;
|
|
7
|
+
}[];
|
|
8
|
+
readonly config: import("typeconfig").IWebConfigClass<{
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}> & import("../../../../../common/config/public/Config").ClientClass;
|
|
11
|
+
constructor(facesService: FacesService);
|
|
12
|
+
isDefaultSorting(): boolean;
|
|
13
|
+
setSortingBy(sorting: number): void;
|
|
14
|
+
setSortingAscending(asc: boolean): void;
|
|
15
|
+
}
|