Fix media code, clean up old types

This commit is contained in:
Jesse Wierzbinski 2024-03-10 13:57:26 -10:00
parent 852efaea50
commit 0e4d6b401c
No known key found for this signature in database
34 changed files with 137 additions and 1204 deletions

View file

@ -4,8 +4,8 @@ import { MediaBackend, MediaBackendType, MediaHasher } from "..";
import type { ConfigType } from "config-manager";
export class LocalMediaBackend extends MediaBackend {
constructor(private config: ConfigType) {
super(MediaBackendType.LOCAL);
constructor(config: ConfigType) {
super(config, MediaBackendType.LOCAL);
}
public async addFile(file: File) {

View file

@ -6,7 +6,7 @@ import type { ConfigType } from "config-manager";
export class S3MediaBackend extends MediaBackend {
constructor(
private config: ConfigType,
config: ConfigType,
private s3Client = new S3Client({
endPoint: config.s3.endpoint,
useSSL: true,
@ -16,7 +16,7 @@ export class S3MediaBackend extends MediaBackend {
secretKey: config.s3.secret_access_key,
})
) {
super(MediaBackendType.S3);
super(config, MediaBackendType.S3);
}
public async addFile(file: File) {