mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-18 17:21:33 +00:00
Fixes to albums
* It will now properly create "editedAt" and "zipGeneratedAt" columns into "albums" table, which will then be used for the "Download Album" feature. Previously, due to the lack of those columns, people could not download albums. Existing installation will have to do some manual patches, which I will describe further in the commit's comments. * Thumbnail-less files will properly show the extensions in albums. Previously it would have two dots.
This commit is contained in:
parent
73f1d40077
commit
677d8717e7
@ -64,7 +64,9 @@ albumsController.create = async (req, res, next) => {
|
||||
enabled: 1,
|
||||
userid: user.id,
|
||||
identifier: randomstring.generate(8),
|
||||
timestamp: Math.floor(Date.now() / 1000)
|
||||
timestamp: Math.floor(Date.now() / 1000),
|
||||
editedAt: 0,
|
||||
zipGeneratedAt: 0
|
||||
})
|
||||
|
||||
return res.json({ success: true })
|
||||
|
@ -7,6 +7,8 @@ let init = function (db) {
|
||||
table.string('identifier')
|
||||
table.integer('enabled')
|
||||
table.integer('timestamp')
|
||||
table.integer('editedAt').defaultTo(0)
|
||||
table.integer('zipGeneratedAt').defaultTo(0)
|
||||
}).then(() => {})
|
||||
|
||||
db.schema.createTableIfNotExists('files', function (table) {
|
||||
|
@ -34,7 +34,7 @@ routes.get('/a/:identifier', async (req, res, next) => {
|
||||
|
||||
file.thumb = `<img src="${file.thumb}"/>`
|
||||
} else {
|
||||
file.thumb = `<h1 class="title">.${ext}</h1>`
|
||||
file.thumb = `<h1 class="title">${ext}</h1>`
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user