add `PUBLIC_HOST_URL` config key

pull/430/head
vaaski 2024-05-02 12:56:52 +02:00
parent 637f456de3
commit e89da396cd
No known key found for this signature in database
GPG Key ID: A588737BA9EB4320
2 changed files with 2 additions and 1 deletions

View File

@ -24,6 +24,7 @@ class Config:
'DELETE_FILE_ON_TRASHCAN': 'false', 'DELETE_FILE_ON_TRASHCAN': 'false',
'STATE_DIR': '.', 'STATE_DIR': '.',
'URL_PREFIX': '', 'URL_PREFIX': '',
'PUBLIC_HOST_URL': 'download/',
'OUTPUT_TEMPLATE': '%(title)s.%(ext)s', 'OUTPUT_TEMPLATE': '%(title)s.%(ext)s',
'OUTPUT_TEMPLATE_CHAPTER': '%(title)s - %(section_number)s %(section_title)s.%(ext)s', 'OUTPUT_TEMPLATE_CHAPTER': '%(title)s - %(section_number)s %(section_title)s.%(ext)s',
'YTDL_OPTIONS': '{}', 'YTDL_OPTIONS': '{}',

View File

@ -233,7 +233,7 @@ export class AppComponent implements AfterViewInit {
} }
buildDownloadLink(download: Download) { buildDownloadLink(download: Download) {
let baseDir = 'download/'; let baseDir = this.downloads.configuration["PUBLIC_HOST_URL"] ?? 'download/';
if (download.quality == 'audio' || download.filename.endsWith('.mp3')) { if (download.quality == 'audio' || download.filename.endsWith('.mp3')) {
baseDir = 'audio_download/'; baseDir = 'audio_download/';
} }