This commit is contained in:
Pitu 2020-06-25 02:05:48 +09:00
parent a9fe08f9e5
commit f189ddf9e6
3 changed files with 3 additions and 18 deletions

View File

@ -19,9 +19,6 @@ class albumsGET extends Route {
for (const album of albums) { for (const album of albums) {
// TODO: Optimize the shit out of this. Ideally a JOIN that grabs all the needed stuff in 1 query instead of 3 // TODO: Optimize the shit out of this. Ideally a JOIN that grabs all the needed stuff in 1 query instead of 3
// Fetch every public link the album has
// const links = await db.table('links').where('albumId', album.id); // eslint-disable-line no-await-in-loop
// Fetch the total amount of files each album has. // Fetch the total amount of files each album has.
const fileCount = await db.table('albumsFiles') // eslint-disable-line no-await-in-loop const fileCount = await db.table('albumsFiles') // eslint-disable-line no-await-in-loop
.where('albumId', album.id) .where('albumId', album.id)

View File

@ -40,7 +40,6 @@ const db = require('knex')({
}); });
const moment = require('moment'); const moment = require('moment');
const log = require('../utils/Log'); const log = require('../utils/Log');
const bcrypt = require('bcrypt');
class Route { class Route {
constructor(path, method, options) { constructor(path, method, options) {

View File

@ -1,7 +1,5 @@
<style lang="scss" scoped> <style lang="scss" scoped>
@import '~/assets/styles/_colors.scss'; @import '~/assets/styles/_colors.scss';
section { background-color: $backgroundLight1 !important; }
section.hero div.hero-body.align-top { section.hero div.hero-body.align-top {
align-items: baseline; align-items: baseline;
flex-grow: 0; flex-grow: 0;
@ -77,16 +75,7 @@ export default {
}; };
} catch (err) { } catch (err) {
console.log('Error when retrieving album', err); console.log('Error when retrieving album', err);
/* error({ statusCode: 404, message: 'Album not found' });
return {
name: null,
downloadEnabled: false,
files: [],
downloadLink: null,
error: error.response.status
};
*/
error({ statusCode: 404, message: 'Post not found' });
} }
}, },
metaInfo() { metaInfo() {
@ -101,7 +90,7 @@ export default {
{ vmid: 'twitter:image', name: 'twitter:image', content: `${this.files.length > 0 ? this.files[0].thumbSquare : '/public/images/share.jpg'}` }, { vmid: 'twitter:image', name: 'twitter:image', content: `${this.files.length > 0 ? this.files[0].thumbSquare : '/public/images/share.jpg'}` },
{ vmid: 'twitter:image:src', name: 'twitter:image:src', value: `${this.files.length > 0 ? this.files[0].thumbSquare : '/public/images/share.jpg'}` }, { vmid: 'twitter:image:src', name: 'twitter:image:src', value: `${this.files.length > 0 ? this.files[0].thumbSquare : '/public/images/share.jpg'}` },
{ vmid: 'og:url', property: 'og:url', content: `${config.URL}/a/${this.$route.params.identifier}` }, { vmid: 'og:url', property: 'og:url', content: `${this.config.URL}/a/${this.$route.params.identifier}` },
{ vmid: 'og:title', property: 'og:title', content: `Album: ${this.name} | Files: ${this.files.length}` }, { vmid: 'og:title', property: 'og:title', content: `Album: ${this.name} | Files: ${this.files.length}` },
{ vmid: 'og:description', property: 'og:description', content: 'A modern and self-hosted file upload service that can handle anything you throw at it. Fast uploads, file manager and sharing capabilities all crafted with a beautiful user experience in mind.' }, { vmid: 'og:description', property: 'og:description', content: 'A modern and self-hosted file upload service that can handle anything you throw at it. Fast uploads, file manager and sharing capabilities all crafted with a beautiful user experience in mind.' },
{ vmid: 'og:image', property: 'og:image', content: `${this.files.length > 0 ? this.files[0].thumbSquare : '/public/images/share.jpg'}` }, { vmid: 'og:image', property: 'og:image', content: `${this.files.length > 0 ? this.files[0].thumbSquare : '/public/images/share.jpg'}` },
@ -116,7 +105,7 @@ export default {
{ vmid: 'twitter:card', name: 'twitter:card', content: 'summary' }, { vmid: 'twitter:card', name: 'twitter:card', content: 'summary' },
{ vmid: 'twitter:title', name: 'twitter:title', content: 'lolisafe' }, { vmid: 'twitter:title', name: 'twitter:title', content: 'lolisafe' },
{ vmid: 'twitter:description', name: 'twitter:description', content: 'A modern and self-hosted file upload service that can handle anything you throw at it. Fast uploads, file manager and sharing capabilities all crafted with a beautiful user experience in mind.' }, { vmid: 'twitter:description', name: 'twitter:description', content: 'A modern and self-hosted file upload service that can handle anything you throw at it. Fast uploads, file manager and sharing capabilities all crafted with a beautiful user experience in mind.' },
{ vmid: 'og:url', property: 'og:url', content: `${config.URL}/a/${this.$route.params.identifier}` }, { vmid: 'og:url', property: 'og:url', content: `${this.config.URL}/a/${this.$route.params.identifier}` },
{ vmid: 'og:title', property: 'og:title', content: 'lolisafe' }, { vmid: 'og:title', property: 'og:title', content: 'lolisafe' },
{ vmid: 'og:description', property: 'og:description', content: 'A modern and self-hosted file upload service that can handle anything you throw at it. Fast uploads, file manager and sharing capabilities all crafted with a beautiful user experience in mind.' } { vmid: 'og:description', property: 'og:description', content: 'A modern and self-hosted file upload service that can handle anything you throw at it. Fast uploads, file manager and sharing capabilities all crafted with a beautiful user experience in mind.' }
] ]