pigallery2-extension-kit 3.0.1 → 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 +3 -0
- package/lib/backend/model/extension/ExtensionRepository.d.ts +1 -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/PrivateConfigClass.d.ts +2 -0
- package/lib/common/config/private/PrivateConfigClass.js +7 -0
- package/lib/common/config/public/ClientConfig.d.ts +12 -5
- package/lib/common/config/public/ClientConfig.js +95 -27
- package/lib/common/entities/ContentWrapper.d.ts +38 -10
- package/lib/common/entities/ContentWrapper.js +171 -62
- 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/package.json +1 -1
|
@@ -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;
|
|
@@ -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
|
};
|
|
@@ -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
|
}
|
|
@@ -11,6 +11,7 @@ import { BsDropdownDirective } from 'ngx-bootstrap/dropdown';
|
|
|
11
11
|
import { LanguageComponent } from '../language/language.component';
|
|
12
12
|
import { ThemeService } from '../../model/theme.service';
|
|
13
13
|
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
14
|
+
import { GalleryService } from '../gallery/gallery.service';
|
|
14
15
|
export declare class FrameComponent {
|
|
15
16
|
private authService;
|
|
16
17
|
notificationService: NotificationService;
|
|
@@ -18,6 +19,7 @@ export declare class FrameComponent {
|
|
|
18
19
|
private router;
|
|
19
20
|
themeService: ThemeService;
|
|
20
21
|
private deviceService;
|
|
22
|
+
galleryService: GalleryService;
|
|
21
23
|
showSearch: boolean;
|
|
22
24
|
showShare: boolean;
|
|
23
25
|
readonly user: BehaviorSubject<UserDTO>;
|
|
@@ -42,7 +44,7 @@ export declare class FrameComponent {
|
|
|
42
44
|
languageSelector: LanguageComponent;
|
|
43
45
|
ThemeModes: typeof ThemeModes;
|
|
44
46
|
readonly enableScrollUpButton: boolean;
|
|
45
|
-
constructor(authService: AuthenticationService, notificationService: NotificationService, queryService: QueryService, router: Router, themeService: ThemeService, deviceService: DeviceDetectorService);
|
|
47
|
+
constructor(authService: AuthenticationService, notificationService: NotificationService, queryService: QueryService, router: Router, themeService: ThemeService, deviceService: DeviceDetectorService, galleryService: GalleryService);
|
|
46
48
|
isAdmin(): boolean;
|
|
47
49
|
isFacesAvailable(): boolean;
|
|
48
50
|
isCustomLinksAvailable(): boolean;
|
|
@@ -3,7 +3,7 @@ import { MediaDTO } from '../../../../common/entities/MediaDTO';
|
|
|
3
3
|
import { GroupingMethod, SortingMethod } from '../../../../common/entities/SortingMethods';
|
|
4
4
|
import { VersionService } from '../../model/version.service';
|
|
5
5
|
import { SearchQueryDTO, SearchQueryTypes } from '../../../../common/entities/SearchQueryDTO';
|
|
6
|
-
import { ContentWrapper, ContentWrapperWithError } from '../../../../common/entities/ContentWrapper';
|
|
6
|
+
import { ContentWrapper, ContentWrapperWithError, PackedContentWrapperWithError } from '../../../../common/entities/ContentWrapper';
|
|
7
7
|
import { ThemeModes } from '../../../../common/config/public/ClientConfig';
|
|
8
8
|
import { GridSizes } from '../../../../common/entities/GridSizes';
|
|
9
9
|
export declare class GalleryCacheService {
|
|
@@ -36,18 +36,16 @@ export declare class GalleryCacheService {
|
|
|
36
36
|
setGridSize(cw: ContentWrapperWithError, gs: GridSizes): void;
|
|
37
37
|
getAutoComplete(text: string, type: SearchQueryTypes): IAutoCompleteItem[];
|
|
38
38
|
setAutoComplete(text: string, type: SearchQueryTypes, items: Array<IAutoCompleteItem>): void;
|
|
39
|
-
getSearch(query: SearchQueryDTO):
|
|
40
|
-
setSearch(cw:
|
|
41
|
-
getDirectory(directoryName: string):
|
|
42
|
-
setDirectory(cw:
|
|
39
|
+
getSearch(query: SearchQueryDTO): PackedContentWrapperWithError;
|
|
40
|
+
setSearch(cw: PackedContentWrapperWithError): void;
|
|
41
|
+
getDirectory(directoryName: string): PackedContentWrapperWithError;
|
|
42
|
+
setDirectory(cw: PackedContentWrapperWithError): void;
|
|
43
43
|
/**
|
|
44
44
|
* Update media state at cache too (Eg.: thumbnail rendered)
|
|
45
45
|
* @param media: MediaBaseDTO
|
|
46
46
|
*/
|
|
47
47
|
mediaUpdated(media: MediaDTO): void;
|
|
48
48
|
private reset;
|
|
49
|
-
getSlideshowSpeed(): number;
|
|
50
|
-
setSlideshowSpeed(speed: number): void;
|
|
51
49
|
getThemeMode(): ThemeModes;
|
|
52
50
|
setThemeMode(mode: ThemeModes): void;
|
|
53
51
|
}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
1
2
|
import { NetworkService } from '../../model/network/network.service';
|
|
2
3
|
import { ContentWrapperWithError } from '../../../../common/entities/ContentWrapper';
|
|
3
4
|
import { SubDirectoryDTO } from '../../../../common/entities/DirectoryDTO';
|
|
4
5
|
import { GalleryCacheService } from './cache.gallery.service';
|
|
5
6
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
6
7
|
import { ShareService } from './share.service';
|
|
7
|
-
import { NavigationService } from '../../model/navigation.service';
|
|
8
8
|
import { MediaDTO } from '../../../../common/entities/MediaDTO';
|
|
9
9
|
import { FileDTO } from '../../../../common/entities/FileDTO';
|
|
10
|
-
|
|
10
|
+
import { GalleryService } from './gallery.service';
|
|
11
|
+
export declare class ContentLoaderService implements OnDestroy {
|
|
11
12
|
private networkService;
|
|
12
13
|
private galleryCacheService;
|
|
13
14
|
private shareService;
|
|
14
|
-
private
|
|
15
|
+
private galleryService;
|
|
15
16
|
content: BehaviorSubject<ContentWrapperWithError>;
|
|
16
17
|
originalContent: Observable<DirectoryContent>;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
private
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
private ongoingContentRequest;
|
|
19
|
+
private lastContentRequest;
|
|
20
|
+
private pollingTimerRestart;
|
|
21
|
+
private pollingSub;
|
|
22
|
+
constructor(networkService: NetworkService, galleryCacheService: GalleryCacheService, shareService: ShareService, galleryService: GalleryService);
|
|
23
|
+
ngOnDestroy(): void;
|
|
24
|
+
setupAutoUpdate(): void;
|
|
24
25
|
setContent(content: ContentWrapperWithError): void;
|
|
25
26
|
loadDirectory(directoryName: string, forceReload?: boolean): Promise<void>;
|
|
26
27
|
search(query: string, forceReload?: boolean): Promise<void>;
|
|
27
28
|
isSearchResult(): boolean;
|
|
28
29
|
reloadCurrentContent(): Promise<void>;
|
|
30
|
+
private unSubPolling;
|
|
29
31
|
}
|
|
30
32
|
export interface DirectoryContent {
|
|
31
33
|
directories: SubDirectoryDTO[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
export declare class GalleryService {
|
|
4
|
+
private route;
|
|
5
|
+
private router;
|
|
6
|
+
autoPollIntervalS: BehaviorSubject<number>;
|
|
7
|
+
private subscription;
|
|
8
|
+
constructor(route: ActivatedRoute, router: Router);
|
|
9
|
+
get autoPollInterval(): number;
|
|
10
|
+
set autoPollInterval(value: number);
|
|
11
|
+
ngOnDestroy(): void;
|
|
12
|
+
private updateQuery;
|
|
13
|
+
}
|
|
@@ -23,6 +23,7 @@ export declare class GalleryGridComponent implements OnInit, OnChanges, AfterVie
|
|
|
23
23
|
mediaGroups: MediaGroup[];
|
|
24
24
|
mediaToRender: GridMediaGroup[];
|
|
25
25
|
containerWidth: number;
|
|
26
|
+
containerMinHeight: number;
|
|
26
27
|
screenHeight: number;
|
|
27
28
|
isAfterViewInit: boolean;
|
|
28
29
|
subscriptions: {
|
package/lib/frontend/app/ui/gallery/lightbox/controls/controls.lightbox.gallery.component.d.ts
CHANGED
|
@@ -1,31 +1,27 @@
|
|
|
1
|
-
import { ElementRef, EventEmitter, OnChanges, OnDestroy
|
|
1
|
+
import { ElementRef, EventEmitter, OnChanges, OnDestroy } from '@angular/core';
|
|
2
2
|
import { FullScreenService } from '../../fullscreen.service';
|
|
3
3
|
import { GalleryPhotoComponent } from '../../grid/photo/photo.grid.gallery.component';
|
|
4
4
|
import { GalleryLightboxMediaComponent } from '../media/media.lightbox.gallery.component';
|
|
5
5
|
import { SearchQueryTypes } from '../../../../../../common/entities/SearchQueryDTO';
|
|
6
6
|
import { AuthenticationService } from '../../../../model/network/authentication.service';
|
|
7
7
|
import { LightboxService } from '../lightbox.service';
|
|
8
|
-
import { GalleryCacheService } from '../../cache.gallery.service';
|
|
9
8
|
import { FileSizePipe } from '../../../../pipes/FileSizePipe';
|
|
10
9
|
import { DatePipe } from '@angular/common';
|
|
11
10
|
import { LightBoxTitleTexts } from '../../../../../../common/config/public/ClientConfig';
|
|
12
|
-
export declare class ControlsLightboxComponent implements OnDestroy,
|
|
11
|
+
export declare class ControlsLightboxComponent implements OnDestroy, OnChanges {
|
|
13
12
|
lightboxService: LightboxService;
|
|
14
13
|
fullScreenService: FullScreenService;
|
|
15
14
|
private authService;
|
|
16
|
-
private cacheService;
|
|
17
15
|
private fileSizePipe;
|
|
18
16
|
private datePipe;
|
|
19
17
|
readonly MAX_ZOOM = 10;
|
|
20
18
|
canvas: ElementRef<HTMLCanvasElement>;
|
|
21
|
-
private ctx;
|
|
22
19
|
root: ElementRef;
|
|
23
20
|
closed: EventEmitter<any>;
|
|
24
21
|
toggleInfoPanel: EventEmitter<any>;
|
|
25
22
|
toggleFullScreen: EventEmitter<any>;
|
|
26
23
|
nextPhoto: EventEmitter<any>;
|
|
27
24
|
previousPhoto: EventEmitter<any>;
|
|
28
|
-
togglePlayback: EventEmitter<boolean>;
|
|
29
25
|
navigation: {
|
|
30
26
|
hasPrev: boolean;
|
|
31
27
|
hasNext: boolean;
|
|
@@ -41,7 +37,6 @@ export declare class ControlsLightboxComponent implements OnDestroy, OnInit, OnC
|
|
|
41
37
|
readonly facesEnabled: boolean;
|
|
42
38
|
zoom: number;
|
|
43
39
|
playBackDurations: number[];
|
|
44
|
-
selectedSlideshowSpeed: number;
|
|
45
40
|
controllersDimmed: boolean;
|
|
46
41
|
controllersVisible: boolean;
|
|
47
42
|
drag: {
|
|
@@ -54,15 +49,19 @@ export declare class ControlsLightboxComponent implements OnDestroy, OnInit, OnC
|
|
|
54
49
|
height: number;
|
|
55
50
|
};
|
|
56
51
|
searchEnabled: boolean;
|
|
52
|
+
private ctx;
|
|
57
53
|
private visibilityTimer;
|
|
58
54
|
private timerSub;
|
|
59
55
|
private prevDrag;
|
|
60
56
|
private prevZoom;
|
|
61
|
-
constructor(lightboxService: LightboxService, fullScreenService: FullScreenService, authService: AuthenticationService,
|
|
57
|
+
constructor(lightboxService: LightboxService, fullScreenService: FullScreenService, authService: AuthenticationService, fileSizePipe: FileSizePipe, datePipe: DatePipe);
|
|
62
58
|
get Zoom(): number;
|
|
63
59
|
set Zoom(zoom: number);
|
|
60
|
+
get TopLeftTitle(): string;
|
|
61
|
+
get TopLeftSubtitle(): string;
|
|
62
|
+
get BottomLeftTitle(): string;
|
|
63
|
+
get BottomLeftSubtitle(): string;
|
|
64
64
|
containerWidth(): void;
|
|
65
|
-
ngOnInit(): void;
|
|
66
65
|
ngOnDestroy(): void;
|
|
67
66
|
ngOnChanges(): void;
|
|
68
67
|
pan($event: {
|
|
@@ -84,11 +83,7 @@ export declare class ControlsLightboxComponent implements OnDestroy, OnInit, OnC
|
|
|
84
83
|
zoomIn(): void;
|
|
85
84
|
zoomOut(): void;
|
|
86
85
|
onKeyPress(event: KeyboardEvent): void;
|
|
87
|
-
private showNextMedia;
|
|
88
|
-
private drawSliderProgress;
|
|
89
|
-
private resetSlideshowTimer;
|
|
90
86
|
runSlideShow(): void;
|
|
91
|
-
slideshowSpeedChanged(): void;
|
|
92
87
|
onMouseMove(): void;
|
|
93
88
|
stopSlideShow(): void;
|
|
94
89
|
playClicked(): void;
|
|
@@ -97,14 +92,13 @@ export declare class ControlsLightboxComponent implements OnDestroy, OnInit, OnC
|
|
|
97
92
|
onResize(): void;
|
|
98
93
|
closeLightbox(): void;
|
|
99
94
|
getPersonSearchQuery(name: string): string;
|
|
95
|
+
nextMediaManuallyTriggered(): void;
|
|
96
|
+
getText(type: LightBoxTitleTexts[]): string;
|
|
97
|
+
private showNextMedia;
|
|
98
|
+
private drawSliderProgress;
|
|
99
|
+
private resetSlideshowTimer;
|
|
100
100
|
private checkZoomAndDrag;
|
|
101
101
|
private showControls;
|
|
102
102
|
private hideControls;
|
|
103
103
|
private updateFaceContainerDim;
|
|
104
|
-
nextMediaManuallyTriggered(): void;
|
|
105
|
-
getText(type: LightBoxTitleTexts): string;
|
|
106
|
-
get TopLeftTitle(): string;
|
|
107
|
-
get TopLeftSubtitle(): string;
|
|
108
|
-
get BottomLeftTitle(): string;
|
|
109
|
-
get BottomLeftSubtitle(): string;
|
|
110
104
|
}
|
|
@@ -66,7 +66,6 @@ export declare class GalleryLightboxComponent implements OnDestroy, OnInit {
|
|
|
66
66
|
toggleFullscreen(): void;
|
|
67
67
|
ngOnInit(): void;
|
|
68
68
|
ngOnDestroy(): void;
|
|
69
|
-
onNavigateTo(photoStringId: string): string;
|
|
70
69
|
setGridPhotoQL(value: QueryList<GalleryPhotoComponent>): void;
|
|
71
70
|
onResize(): void;
|
|
72
71
|
nextImage(): void;
|
|
@@ -82,7 +81,7 @@ export declare class GalleryLightboxComponent implements OnDestroy, OnInit {
|
|
|
82
81
|
isVisible(): boolean;
|
|
83
82
|
isOpen(): boolean;
|
|
84
83
|
onVideoSourceError(): void;
|
|
85
|
-
|
|
84
|
+
private onNavigateTo;
|
|
86
85
|
private updateInfoPanelWidth;
|
|
87
86
|
private runSlideShow;
|
|
88
87
|
private stopSlideShow;
|