@christianriedl/media 1.0.149 → 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.
@@ -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
- ChildCount: number;
7
- Files: string[];
6
+ childCount: number;
7
+ files: string[];
8
8
  }
9
9
  export interface IRealFilesResult {
10
- Folder: IMediaFolder;
11
- PrivateCreatorIdx: number;
12
- Lists: IMediaListEntry[];
13
- Status: string;
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;
@@ -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.Files.length; i++) {
267
- this.referenceDict.add(refs.Files[i]);
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.Files.length} ${this.realFolderId}`);
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.Folder)
465
- this.buildStatistics(result.Folder);
466
- if (listMediaType && result.Lists) {
467
- this.initializeLists(listMediaType, result.Lists, result.PrivateCreatorIdx);
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.Folder)
475
- this.buildStatistics(result.Folder);
476
- if (result.Lists) {
477
- this.initializeLists(EMediaType.Picture, result.Lists, result.PrivateCreatorIdx);
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.Files)
501
- this.statistics.increment(this.countReferences, folders.Files.length);
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@christianriedl/media",
3
- "version": "1.0.149",
3
+ "version": "1.0.151",
4
4
  "description": "RIC media interfaces",
5
5
 
6
6
  "main": "dist/index.js",
@@ -23,7 +23,7 @@
23
23
  const playerNames = reactive<string[]>(['Local']);
24
24
  const currentPlayer = ref('Local');
25
25
  const items: IMediaItem[] = reactive([]);
26
- const selected = ref<IMediaItem>({ Name: 'Root', ItemType: EItemType.Root } as IMediaFolder);
26
+ const selected = ref<IMediaItem>({ name: 'Root', itemType: EItemType.Root } as IMediaFolder);
27
27
  const playingTrackUrl = ref("");
28
28
  const playingTrack = ref<IAudioFile | null>(null);
29
29
  const playItems: IAudioFile[] = [];
@@ -18,7 +18,7 @@
18
18
  const items: IMediaItem[] = reactive([]);
19
19
  const itemIndex = ref(0);
20
20
  const playIndex = ref(-1);
21
- const selected = ref<IMediaItem>({ Name: 'Root', ItemType: EItemType.Root } as IMediaFolder);
21
+ const selected = ref<IMediaItem>({ name: 'Root', itemType: EItemType.Root } as IMediaFolder);
22
22
  const listHeight = ref(0);
23
23
  const listhead = ref<ComponentPublicInstance|null>(null);
24
24
 
@@ -19,7 +19,7 @@
19
19
 
20
20
  const items: IMediaItem[] = reactive([]);
21
21
  const itemIndex = ref(0);
22
- const selected = ref<IMediaItem>({ Name: 'Root', ItemType: EItemType.Root } as IMediaFolder);
22
+ const selected = ref<IMediaItem>({ name: 'Root', itemType: EItemType.Root } as IMediaFolder);
23
23
  const listHeight = ref(0);
24
24
  const listhead = ref<ComponentPublicInstance | null>(null);
25
25
  const audioStreams: IValueText[] = reactive([]);
@@ -67,7 +67,7 @@
67
67
  url += `&width=${params.width}&height=${params.height}&videoBitRate=${params.videoBitRate}&audioBitRate=${params.audioBitRate}`;
68
68
  }
69
69
  else {
70
- url = await epgCache.epg.requestChannelStream(selected.value.Name, 'mp4', undefined, params.videoBitRate, params.scaleFactor);
70
+ url = await epgCache.epg.requestChannelStream(selected.value.name, 'mp4', undefined, params.videoBitRate, params.scaleFactor);
71
71
  url = buildServerUrl(url, 'video/mp4');
72
72
  }
73
73
  if (url)
@@ -86,7 +86,7 @@
86
86
  }
87
87
  function getClass(folder: IMediaFolder): string[] {
88
88
  let classes: string[] = [];
89
- if (folder.CreatorIdx >= 0) {
89
+ if (folder.creatorIdx >= 0) {
90
90
  const pictureLocations = mediaService.pictureLocation;
91
91
  if (folder.altColor) {
92
92
  if (appConfig.theme !== 'light')
@@ -98,7 +98,7 @@
98
98
  classes.push('italic');
99
99
  classes.push('bold');
100
100
  }
101
- else if (pictureLocations.parents![folder.CreatorIdx] < 0) {
101
+ else if (pictureLocations.parents![folder.creatorIdx] < 0) {
102
102
  classes.push('bold');
103
103
  }
104
104
  }
@@ -123,7 +123,7 @@
123
123
  if (folder.year && folder.year > 0)
124
124
  selectedYear.value = folder.year;
125
125
  selectedName.value = folder.name;
126
- if (folder.CreatorIdx >= 0 && !folder.populated) {
126
+ if (folder.creatorIdx >= 0 && !folder.populated) {
127
127
  LocationHelper.populateParentFolder(mediaService, folder, mediaAppConfig.pictureParentLimit);
128
128
  }
129
129
  backVisible.value = selected.selected.itemType != EItemType.PictureGenreType;
@@ -114,7 +114,7 @@
114
114
  }
115
115
  }
116
116
  function listBack() {
117
- const parent = mediaService.getFolder(selected.selected.DLNAParentID);
117
+ const parent = mediaService.getFolder(selected.selected.dlnaParentId);
118
118
  const index = parent.folders.indexOf(selected.selected);
119
119
  const folders = setSelected(parent);
120
120
  if (index)
@@ -18,7 +18,7 @@
18
18
 
19
19
  const items: IMediaItem[] = reactive([]);
20
20
  const itemIndex = ref(0);
21
- const selected = ref<IMediaItem>({ Name: 'Root', ItemType: EItemType.Root } as IMediaFolder);
21
+ const selected = ref<IMediaItem>({ name: 'Root', itemType: EItemType.Root } as IMediaFolder);
22
22
  const listHeight = ref(0);
23
23
  const listhead = ref<ComponentPublicInstance|null>(null);
24
24
  const audioStreams: IValueText[] = reactive([]);
@@ -84,9 +84,9 @@
84
84
  showDownload.value = false;
85
85
  }
86
86
  function getThumbnailUrl(image: IPictureFile) : string {
87
- let url = `https://www.christian-riedl.com/media/apiimage/Thumbnail?image=${folder.value!.Url}${image.Url}&tresX=${image.thumbWidth}&tresY=${image.thumbHeight}`;
87
+ let url = `https://www.christian-riedl.com/media/apiimage/Thumbnail?image=${folder.value!.url}${image.url}&tresX=${image.thumbWidth}&tresY=${image.thumbHeight}`;
88
88
  if (image.orientation && (image.orientation === EOrientation.BottomLeft || image.orientation === EOrientation.TopRight))
89
- url += '&orientation=' + Number(image.Orientation);
89
+ url += '&orientation=' + Number(image.orientation);
90
90
  return encodeURI(url);
91
91
  }
92
92
  </script>
@@ -28,7 +28,7 @@
28
28
 
29
29
  const items: IMediaItem[] = reactive([]);
30
30
  const itemIndex = ref(0);
31
- const selected = ref<IMediaItem>({ Name: 'Root', ItemType: EItemType.Root } as IMediaFolder);
31
+ const selected = ref<IMediaItem>({ name: 'Root', itemType: EItemType.Root } as IMediaFolder);
32
32
  const listHeight = ref(0);
33
33
  const listhead = ref<any>(null);
34
34
  const dialog = ref(false);
@@ -139,7 +139,7 @@
139
139
  mediaService.getVideos(folder)
140
140
  .then((videos) => {
141
141
  selected.value = videos;
142
- items.splice(0, items.length, ...videos.Files);
142
+ items.splice(0, items.length, ...videos.files);
143
143
  window.history.pushState({ noBackExitsApp: true }, '')
144
144
  computeListHeight();
145
145
  });
@@ -179,14 +179,14 @@
179
179
  return "";
180
180
  }
181
181
  function getCreator(item: IVideoFile): string {
182
- if (item.CreatorIdx >= 0) {
183
- return mediaService.getListEntry("Video.Director", item.CreatorIdx);
182
+ if (item.creatorIdx >= 0) {
183
+ return mediaService.getListEntry("Video.Director", item.creatorIdx);
184
184
  }
185
185
  return "";
186
186
  }
187
187
  function getGenre(item: IVideoFile): string {
188
- if (item.GenreIdx >= 0) {
189
- return mediaService.getListEntry("Video.Genre", item.GenreIdx);
188
+ if (item.genreIdx >= 0) {
189
+ return mediaService.getListEntry("Video.Genre", item.genreIdx);
190
190
  }
191
191
  return "";
192
192
  }