@christianriedl/media 1.0.135 → 1.0.136

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@christianriedl/media",
3
- "version": "1.0.135",
3
+ "version": "1.0.136",
4
4
  "description": "RIC media interfaces",
5
5
 
6
6
  "main": "dist/index.js",
@@ -168,7 +168,7 @@
168
168
  let nameLength = 9;
169
169
  if (folder) {
170
170
  const dlnaid = folder.DLNAID;
171
- if (dlnaid.endsWith('|'))
171
+ if (dlnaid.endsWith('ye|'))
172
172
  nameLength = 9; // Year
173
173
  else if (dlnaid.endsWith(".ev"))
174
174
  nameLength = 18; // Event
@@ -178,8 +178,11 @@
178
178
  nameLength = 12; // Person
179
179
  else {
180
180
  //nameLength = 32; // Album
181
- showAlbums.value = true;
182
- return 12;
181
+ if (folder.Folders && folder.Folders[0].ItemType == EItemType.PictureAlbum) {
182
+ showAlbums.value = true;
183
+ return 12;
184
+ }
185
+ nameLength = 9; // Year ?
183
186
  }
184
187
  }
185
188
  let numColumns = appState.pageWidth.value / (nameLength * 10);
@@ -6,6 +6,7 @@
6
6
  import { EItemType, EMediaType, IMediaFolder, IMediaItem, IPhotoSelection, MediaService, IMediaService, getMediaSymbol, getMediaBinSymbol, IMediaAppConfig } from '@christianriedl/media';
7
7
  import FileUpload from '../components/FileUpload.vue';
8
8
  import PhotoDownload from '../components/PhotoDownload.vue';
9
+ import { isTSMappedType } from '@babel/types';
9
10
 
10
11
  const appState = inject(appStateSymbol)!;
11
12
  const appConfig = inject(appConfigSymbol)!;
@@ -95,12 +96,22 @@
95
96
  computeListHeight();
96
97
  }
97
98
  function listExpand(folder: IMediaFolder) {
98
- if (folder.Year && folder.Year > 0)
99
+ if (folder.Folders && folder.Folders[0].ItemType == EItemType.PictureYear) {
100
+ showFolder(folder);
101
+ }
102
+ else {
103
+ if (folder.Year && folder.Year > 0)
99
104
  selectedYear.value = folder.Year;
105
+ }
100
106
  }
101
107
  function showPictures(folder: IMediaFolder) {
102
- selected.selectedAlbum = folder;
103
- router.push({ path: 'photoalbum', query: { id: folder.DLNAID } });
108
+ if (folder.Files) {
109
+ selected.selectedAlbum = folder;
110
+ router.push({ path: 'photoalbum', query: { id: folder.DLNAID } });
111
+ }
112
+ else {
113
+ showFolder(folder);
114
+ }
104
115
  }
105
116
  function listBack() {
106
117
  const parent = mediaService.getFolder(selected.selected.DLNAParentID);
@@ -177,6 +188,7 @@
177
188
  return folder.Folders;
178
189
  }
179
190
  function setGrouped(folders: IMediaFolder[], group: boolean, year?: number) {
191
+ group = true; // all is grouped
180
192
  grouped.value = group;
181
193
  // const grouped = (group && folders.length <= 6); ???
182
194
  for (let i = 0; i < folders.length; i++) {
@@ -228,7 +240,7 @@
228
240
  <v-list-item v-bind="props" :title="item.info" :value="item.info" density="compact"></v-list-item>
229
241
  </template>
230
242
  <v-list-item v-if="open.includes(item.Name)" v-for="subItem in item.Folders" :key="subItem.DLNAID" :title="subItem.info" density="compact" @click.stop="showPictures(subItem)">
231
- <template v-slot:append>
243
+ <template v-if="subItem.ItemType == EItemType.PictureAlbum" v-slot:append>
232
244
  <v-btn color="grey" variant="tonal" icon="$share" @click.stop.prevent="onShare(subItem)"></v-btn>
233
245
  <v-btn color="grey" variant="tonal" icon="$download" @click.stop.prevent="onDownload(subItem)"></v-btn>
234
246
  <v-btn color="grey" variant="tonal" icon="$grid" @click.stop.prevent="onLightbox(subItem)"></v-btn>