@christianriedl/media 1.0.45 → 1.0.47

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.45",
3
+ "version": "1.0.47",
4
4
  "description": "RIC media interfaces",
5
5
 
6
6
  "main": "dist/index.js",
@@ -18,7 +18,7 @@
18
18
  "author": "Christian Riedl",
19
19
  "license": "ISC",
20
20
  "dependencies": {
21
- "@christianriedl/utils": "^1.0.74",
21
+ "@christianriedl/utils": "^1.0.75",
22
22
  "@christianriedl/rest": "^1.0.47",
23
23
  "@christianriedl/epg": "^1.0.26"
24
24
  },
@@ -25,6 +25,7 @@
25
25
  const cycle = ref(false);
26
26
  const interval = ref(8000);
27
27
  const hasCoordinates = ref(false);
28
+ let origUrl = "";
28
29
  let gpsLng: number[];
29
30
  let gpsLat: number[];
30
31
 
@@ -181,6 +182,7 @@
181
182
  return `${item.Width}/${item.Height}`;
182
183
  }
183
184
  function setMetaData(exif: Dictionary<any>, file: IPictureFile) {
185
+ origUrl = mediaService.getPhotoUrl(url.value, file.Url, '0x0x0');
184
186
  metadata['Name'] = file.Name;
185
187
  if (exif) {
186
188
  if (exif.Model)
@@ -266,6 +268,10 @@
266
268
  else
267
269
  delete metadata['Personen'];
268
270
  }
271
+ function onDownload() {
272
+ window.open(origUrl);
273
+ infoDialog.value = false;
274
+ }
269
275
  </script>
270
276
 
271
277
  <template>
@@ -295,6 +301,9 @@
295
301
  <v-btn v-if="hasCoordinates" @click="showMap">
296
302
  <v-icon large icon="$gps" />
297
303
  </v-btn>
304
+ <v-btn @click="onDownload">
305
+ <v-icon large icon="$download" />
306
+ </v-btn>
298
307
  </v-card-actions>
299
308
  </v-card>
300
309
  </v-dialog>
@@ -29,6 +29,7 @@
29
29
  const downloadFolder = ref<IMediaFolder | null>(null);
30
30
  const selectedYear = ref<number | undefined>(undefined);
31
31
  const selectedName = ref<string | undefined>(undefined);
32
+ const scrollElement = ref<any | null>(null);
32
33
 
33
34
  window.addEventListener('popstate', onPopState);
34
35
  function onPopState(event: any) {
@@ -57,7 +58,15 @@
57
58
  selectedYear.value = selected.selectedAlbum.Year;
58
59
  const expanded = selected.criteria == 'ye' || root.ItemType == EItemType.PictureCategory;
59
60
  setGrouped(folders, expanded, selectedYear.value);
60
- mediaService.log.trace('Photos start with ' + selected.selected.DLNAID);
61
+ const scrollTop = appState.scrollPosition.value;
62
+ if (scrollTop > 0 && scrollElement.value) {
63
+ nextTick(() => {
64
+ // Scoll to this position
65
+ const el = scrollElement.value?._?.vnode?.el;
66
+ el?.scrollTo(0, scrollTop);
67
+ });
68
+ }
69
+ mediaService.log.trace(`Photos start with ${selected.selected.DLNAID} scrollTop: ${scrollTop}`);
61
70
  })
62
71
  watch(appState.bodyHeight, () => computeListHeight());
63
72
  function computeListHeight() {
@@ -163,6 +172,10 @@
163
172
  function itemText(item: IMediaFolder) : string {
164
173
  return `${item.Name} (${item.ChildCount})`
165
174
  }
175
+ function onScroll(ev: Event) {
176
+ const scrollTop = (ev.target as Element).scrollTop;
177
+ appState.scrollPosition.value = scrollTop;
178
+ }
166
179
  </script>
167
180
  <template>
168
181
  <v-card ref="listhead" class="bg-media">
@@ -185,7 +198,7 @@
185
198
  </v-card-actions>
186
199
  </v-card>
187
200
  <file-upload v-if="uploadVisible"></file-upload>
188
- <v-card :max-height="listHeight" class="overflow-y-auto">
201
+ <v-card :max-height="listHeight" class="overflow-y-auto" ref="scrollElement" v-scroll.self="onScroll">
189
202
  <v-list v-if="!grouped" class="bg-media">
190
203
  <v-list-item-group v-model="itemIndex" color="primary">
191
204
  <v-list-item v-for="item in items" :key="item.DLNAID" :title="itemText(item)" :value="itemText(item)" density="compact" @click.stop="listItem(item)">