move aliases to file storage

This commit is contained in:
Jurgis Sakalauskas
2023-10-30 11:30:16 +02:00
parent 1d7072aee0
commit e707fa838b
15 changed files with 135 additions and 37 deletions
+1 -1
View File
@@ -8,8 +8,8 @@ import { RecentSearchesConfig } from './recent-searches.config';
env.config();
export class ConfigService {
private typeOrmConfig: TypeOrmConfig = new TypeOrmConfig(this);
private pathsConfig: PathsConfig = new PathsConfig(this);
private typeOrmConfig: TypeOrmConfig = new TypeOrmConfig(this);
private videoFilesConfig: VideoFilesConfig = new VideoFilesConfig(this);
private recentSearches: RecentSearchesConfig = new RecentSearchesConfig(this);
+4
View File
@@ -23,6 +23,10 @@ export class PathsConfig {
return this.getPath(relPath);
}
public getDbFolderPath(): string {
return '/srv/data/db';
}
private getPath(relPath: string) {
if (relPath[0] === '/') {
//this is an absolute path
+4 -1
View File
@@ -9,7 +9,10 @@ import { join } from 'path';
export class TypeOrmConfig {
constructor(configService: ConfigService) {
this.type = 'sqlite';
this.database = join('/srv/data/db', configService.getEnv('DB_FILENAME'));
this.database = join(
configService.getPaths().getDbFolderPath(),
configService.getEnv('DB_FILENAME'),
);
this.entities = [LrtCategory, TitleEntity, FileEntity, TorrentEntity];
}
type: 'sqlite';