@christianriedl/media 1.0.81 → 1.0.82

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.81",
3
+ "version": "1.0.82",
4
4
  "description": "RIC media interfaces",
5
5
 
6
6
  "main": "dist/index.js",
@@ -84,7 +84,7 @@
84
84
  function stars() {
85
85
  return selected.rating ? (selected.rating == 1 ? '*' : '**') : 'all';
86
86
  }
87
- function listItem(folder: IMediaFolder) {
87
+ function showFolder(folder: IMediaFolder) {
88
88
  const folders = setSelected(folder);
89
89
  setGrouped(folders, true);
90
90
  computeListHeight();
@@ -93,12 +93,7 @@
93
93
  if (folder.Year && folder.Year > 0)
94
94
  selectedYear.value = folder.Year;
95
95
  }
96
- /*
97
- function onOpen(arg: unknown) {
98
- console.log('onOpen');
99
- }
100
- */
101
- function listSubItem(folder: IMediaFolder) {
96
+ function showPictures(folder: IMediaFolder) {
102
97
  selected.selectedAlbum = folder;
103
98
  router.push({ path: 'photoalbum', query: { id: folder.DLNAID } });
104
99
  }
@@ -110,21 +105,21 @@
110
105
  itemIndex.value = index;
111
106
  setGrouped(folders, false);
112
107
  }
113
- function onLightbox(item: IMediaFolder) {
114
- selected.selectedAlbum = item;
115
- router.push({ path: 'photothumbnails', query: { id: item.DLNAID } });
108
+ function onLightbox(folder: IMediaFolder) {
109
+ selected.selectedAlbum = folder;
110
+ router.push({ path: 'photothumbnails', query: { id: folder.DLNAID } });
116
111
 
117
112
  }
118
- function onDownload(item: IMediaFolder) {
119
- downloadFolder.value = item;
113
+ function onDownload(folder: IMediaFolder) {
114
+ downloadFolder.value = folder;
120
115
  showDownload.value = true;
121
116
  }
122
- async function onShare(item: IMediaFolder) {
117
+ async function onShare(folder: IMediaFolder) {
123
118
  const guid = Helper.generateUUID();
124
119
  const url = `https://www.christian-riedl.com/photos?id=${guid}`;
125
120
  try {
126
121
  await window.navigator.clipboard.writeText(url);
127
- const id = await mediaService.addPhotoService(guid, appConfig.user, item.DLNAID, mediaAppConfig.linkDaysValid);
122
+ const id = await mediaService.addPhotoService(guid, appConfig.user, folder.DLNAID, mediaAppConfig.linkDaysValid);
128
123
  if (id)
129
124
  window.alert(`Created and Pasted - id : ${id} !`);
130
125
  else
@@ -188,12 +183,6 @@
188
183
  }
189
184
  items.splice(0, items.length, ...folders);
190
185
  }
191
- /*
192
- function itemText(item: IMediaItem): string {
193
- const folder = item as IMediaFolder;
194
- return `${folder.Name} (${folder.ChildCount})`
195
- }
196
- */
197
186
  function onScroll(ev: Event) {
198
187
  const scrollTop = (ev.target as Element).scrollTop;
199
188
  appState.scrollPosition.value = scrollTop;
@@ -222,19 +211,19 @@
222
211
  <file-upload v-if="uploadVisible"></file-upload>
223
212
  <v-card :max-height="listHeight" class="overflow-y-auto bg-media" ref="scrollElement" v-scroll.self="onScroll">
224
213
  <v-list v-if="!grouped">
225
- <v-list-item v-for="item in items" :key="item.DLNAID" :title="item.info" density="compact" @click.stop="listItem(item)">
214
+ <v-list-item v-for="item in items" :key="item.DLNAID" :title="item.info" density="compact" @click.stop="showFolder(item)">
226
215
  </v-list-item>
227
216
  </v-list>
228
217
  <v-list v-else v-model:opened="open">
229
- <v-list-group v-for="item in items" :key="item.DLNAID" :value="item.info" @click.stop="listExpand(item)">
218
+ <v-list-group v-for="item in items" :key="item.DLNAID" :value="item.Name" @click.stop="listExpand(item)">
230
219
  <template v-slot:activator="{ props }">
231
220
  <v-list-item v-bind="props" :title="item.info" :value="item.info" density="compact"></v-list-item>
232
221
  </template>
233
- <v-list-item v-for="subItem in item.Folders" :key="subItem.DLNAID" :title="subItem.info" density="compact" @click.stop="listSubItem(subItem)" v-once>
222
+ <v-list-item v-for="subItem in item.Folders" :key="subItem.DLNAID" :title="subItem.info" density="compact" @click.stop="showPictures(subItem)">
234
223
  <template v-slot:append>
235
- <v-btn v-once color="grey" variant="tonal" icon="$share" @click.stop.prevent="onShare(subItem)"></v-btn>
236
- <v-btn v-once color="grey" variant="tonal" icon="$download" @click.stop.prevent="onDownload(subItem)"></v-btn>
237
- <v-btn v-once color="grey" variant="tonal" icon="$grid" @click.stop.prevent="onLightbox(subItem)"></v-btn>
224
+ <v-btn color="grey" variant="tonal" icon="$share" @click.stop.prevent="onShare(subItem)"></v-btn>
225
+ <v-btn color="grey" variant="tonal" icon="$download" @click.stop.prevent="onDownload(subItem)"></v-btn>
226
+ <v-btn color="grey" variant="tonal" icon="$grid" @click.stop.prevent="onLightbox(subItem)"></v-btn>
238
227
  </template>
239
228
  </v-list-item>
240
229
  </v-list-group>