mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-10 01:53:08 +02:00
feat(server): store mime type of webpublic
This commit is contained in:
parent
8b5a1faaa4
commit
53937e09a0
3 changed files with 20 additions and 0 deletions
|
@ -0,0 +1,13 @@
|
|||
const { MigrationInterface, QueryRunner } = require("typeorm");
|
||||
|
||||
module.exports = class driveFileWebpublicType1642613870898 {
|
||||
name = 'driveFileWebpublicType1642613870898'
|
||||
|
||||
async up(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "drive_file" ADD "webpublicType" character varying(128)`);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "webpublicType"`);
|
||||
}
|
||||
}
|
|
@ -101,6 +101,11 @@ export class DriveFile {
|
|||
})
|
||||
public webpublicUrl: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 128, nullable: true,
|
||||
})
|
||||
public webpublicType: string | null;
|
||||
|
||||
@Index({ unique: true })
|
||||
@Column('varchar', {
|
||||
length: 256, nullable: true,
|
||||
|
|
|
@ -101,6 +101,7 @@ async function save(file: DriveFile, path: string, name: string, type: string, h
|
|||
file.accessKey = key;
|
||||
file.thumbnailAccessKey = thumbnailKey;
|
||||
file.webpublicAccessKey = webpublicKey;
|
||||
file.webpublicType = alts.webpublic?.type ?? null;
|
||||
file.name = name;
|
||||
file.type = type;
|
||||
file.md5 = hash;
|
||||
|
@ -135,6 +136,7 @@ async function save(file: DriveFile, path: string, name: string, type: string, h
|
|||
file.accessKey = accessKey;
|
||||
file.thumbnailAccessKey = thumbnailAccessKey;
|
||||
file.webpublicAccessKey = webpublicAccessKey;
|
||||
file.webpublicType = alts.webpublic?.type ?? null;
|
||||
file.name = name;
|
||||
file.type = type;
|
||||
file.md5 = hash;
|
||||
|
|
Loading…
Reference in a new issue