diff --git a/frontend/src/views/files/Preview.vue b/frontend/src/views/files/Preview.vue
index 74afe9f3..863a0468 100644
--- a/frontend/src/views/files/Preview.vue
+++ b/frontend/src/views/files/Preview.vue
@@ -137,8 +137,8 @@
>
chevron_right
-
-
+
+
@@ -173,10 +173,8 @@ export default {
navTimeout: null,
hoverNav: false,
autoPlay: false,
- routeDataP: "",
- routeDataN: "",
- rawP: "",
- rawN: "",
+ previousRaw: "",
+ nextRaw: "",
};
},
computed: {
@@ -307,31 +305,14 @@ export default {
for (let j = i - 1; j >= 0; j--) {
if (mediaTypes.includes(this.listing[j].type)) {
this.previousLink = this.listing[j].url;
- const key = Date.parse(this.listing[j].modified);
- if (this.listing[j].type === "image" && !this.fullSize) {
- this.routeDataP = `${baseURL}/api/preview/big${this.previousLink.slice(6)}?k=${key}`;
- } else if (this.listing[j].type === "image" ) {
- this.routeDataP = `${baseURL}/api/raw${this.previousLink.slice(6)}?k=${key}`;
- } else {
- this.routeDataP = "";
- }
- this.rawP=`${this.routeDataP}&inline=true`;
+ this.previousRaw=`${this.prefetchUrl(this.listing[j],this.previousLink)}&inline=true`;
break;
}
}
-
for (let j = i + 1; j < this.listing.length; j++) {
if (mediaTypes.includes(this.listing[j].type)) {
this.nextLink = this.listing[j].url;
- const key = Date.parse(this.listing[j].modified);
- if (this.listing[j].type === "image" && !this.fullSize) {
- this.routeDataN = `${baseURL}/api/preview/big${this.nextLink.slice(6)}?k=${key}`;
- } else if (this.listing[j].type === "image" ) {
- this.routeDataN = `${baseURL}/api/raw${this.nextLink.slice(6)}?k=${key}`;
- } else {
- this.routeDataN = "";
- }
- this.rawN=`${this.routeDataN}&inline=true`;
+ this.nextRaw=`${this.prefetchUrl(this.listing[j],this.nextLink)}&inline=true`;
break;
}
}
@@ -339,6 +320,14 @@ export default {
return;
}
},
+ prefetchUrl: function(item,link) {
+ const key = Date.parse(item.modified);
+ if (item.type === "image" && !this.fullSize) {
+ return `${baseURL}/api/preview/big${link.slice(6)}?k=${key}`;
+ } else {
+ return `${baseURL}/api/raw${link.slice(6)}?k=${key}`;
+ }
+ },
openMore() {
this.$store.commit("showHover", "more");
},