feat(server): split generated content into a separate folder (#2047)

* feat: organize media folders

* fix: tests
This commit is contained in:
Jason Rasmussen
2023-03-25 10:50:57 -04:00
committed by GitHub
parent b862c20e8e
commit 2400004f41
19 changed files with 113 additions and 91 deletions

View File

@@ -1,2 +1,3 @@
export * from './storage.core';
export * from './storage.repository';
export * from './storage.service';

View File

@@ -0,0 +1,16 @@
import { join } from 'node:path';
import { APP_MEDIA_LOCATION } from '../domain.constant';
export enum StorageFolder {
ENCODED_VIDEO = 'encoded-video',
LIBRARY = 'library',
UPLOAD = 'upload',
PROFILE = 'profile',
THUMBNAILS = 'thumbs',
}
export class StorageCore {
getFolderLocation(folder: StorageFolder, userId: string) {
return join(APP_MEDIA_LOCATION, folder, userId);
}
}