@christianriedl/media 1.0.150 → 1.0.151
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/dist/mediaService.d.ts +6 -6
- package/dist/mediaService.js +13 -13
- package/package.json +1 -1
package/dist/mediaService.d.ts
CHANGED
|
@@ -3,14 +3,14 @@ import { ILogger, Dictionary, InjectionKey, IStatistics, IStatisticsValue } from
|
|
|
3
3
|
import { IMediaItem, IMediaFolder, IMediaListEntry, IMediaService, IPhotoSelection, IPictureFile, IAudioFile, EMediaType, IMediaInfo } from "./iMedia";
|
|
4
4
|
export declare const getMediaSymbol: InjectionKey<() => MediaService>;
|
|
5
5
|
export interface IVirtualMediaFolder extends IMediaItem {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
childCount: number;
|
|
7
|
+
files: string[];
|
|
8
8
|
}
|
|
9
9
|
export interface IRealFilesResult {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
folder: IMediaFolder;
|
|
11
|
+
privateCreatorIdx: number;
|
|
12
|
+
lists: IMediaListEntry[];
|
|
13
|
+
status: string;
|
|
14
14
|
}
|
|
15
15
|
export declare class MediaService implements IMediaService {
|
|
16
16
|
rest: IRest;
|
package/dist/mediaService.js
CHANGED
|
@@ -263,13 +263,13 @@ export class MediaService {
|
|
|
263
263
|
if (newFolder) {
|
|
264
264
|
const refs = await this.browseReferences(folder.dlnaid);
|
|
265
265
|
this.referenceDict.clear();
|
|
266
|
-
for (var i = 0; i < refs.
|
|
267
|
-
this.referenceDict.add(refs.
|
|
266
|
+
for (var i = 0; i < refs.files.length; i++) {
|
|
267
|
+
this.referenceDict.add(refs.files[i]);
|
|
268
268
|
}
|
|
269
269
|
this.realFolderId = folder.dlnaid;
|
|
270
270
|
var idx = this.realFolderId.indexOf('|');
|
|
271
271
|
this.realFolderId = 'ph.all.ye' + this.realFolderId.substr(idx);
|
|
272
|
-
this.log.trace(`getPhotos virtual ${refs.
|
|
272
|
+
this.log.trace(`getPhotos virtual ${refs.files.length} ${this.realFolderId}`);
|
|
273
273
|
}
|
|
274
274
|
realPhotos = this.realPictureAlbums[this.realFolderId];
|
|
275
275
|
if (!realPhotos) {
|
|
@@ -461,20 +461,20 @@ export class MediaService {
|
|
|
461
461
|
const query = { dlnaid: dlnaid, realFolderPrefix: realFolderPrefix, listMediaType: listMediaType };
|
|
462
462
|
const res = await this.rest.getData('apimedia/browserealfiles', query);
|
|
463
463
|
const result = res.result;
|
|
464
|
-
if (result.
|
|
465
|
-
this.buildStatistics(result.
|
|
466
|
-
if (listMediaType && result.
|
|
467
|
-
this.initializeLists(listMediaType, result.
|
|
464
|
+
if (result.folder)
|
|
465
|
+
this.buildStatistics(result.folder);
|
|
466
|
+
if (listMediaType && result.lists) {
|
|
467
|
+
this.initializeLists(listMediaType, result.lists, result.privateCreatorIdx);
|
|
468
468
|
}
|
|
469
469
|
return result;
|
|
470
470
|
}
|
|
471
471
|
async getPhotoService(id) {
|
|
472
472
|
const res = await this.rest.getData('apimedia/photoservice', { id: id });
|
|
473
473
|
const result = res.result;
|
|
474
|
-
if (result.
|
|
475
|
-
this.buildStatistics(result.
|
|
476
|
-
if (result.
|
|
477
|
-
this.initializeLists(EMediaType.Picture, result.
|
|
474
|
+
if (result.folder)
|
|
475
|
+
this.buildStatistics(result.folder);
|
|
476
|
+
if (result.lists) {
|
|
477
|
+
this.initializeLists(EMediaType.Picture, result.lists, result.privateCreatorIdx);
|
|
478
478
|
}
|
|
479
479
|
return result;
|
|
480
480
|
}
|
|
@@ -497,8 +497,8 @@ export class MediaService {
|
|
|
497
497
|
async browseReferences(id) {
|
|
498
498
|
const ref = await this.rest.getData('apimedia/browse', { id: id, depth: 1, onlyFolder: false, onlyReal: false });
|
|
499
499
|
const folders = ref.result;
|
|
500
|
-
if (folders.
|
|
501
|
-
this.statistics.increment(this.countReferences, folders.
|
|
500
|
+
if (folders.files)
|
|
501
|
+
this.statistics.increment(this.countReferences, folders.files.length);
|
|
502
502
|
return folders;
|
|
503
503
|
}
|
|
504
504
|
async getExifInfo(folderId, mediaId) {
|