From f4a790edd8d1a102023cfd847367aa2e2be53aee Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 2 Oct 2023 11:12:54 +0300 Subject: [PATCH] fix this https://rdrama.net/post/208130/updated-episode-of-the-podcast-where/5083191#context --- files/assets/js/core.js | 17 ++++++----------- files/templates/root.html | 1 + 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/files/assets/js/core.js b/files/assets/js/core.js index 304060a916..e4c485af46 100644 --- a/files/assets/js/core.js +++ b/files/assets/js/core.js @@ -452,17 +452,12 @@ function insertText(input, text) { let oldfiles = {}; -let MAX_IMAGE_AUDIO_SIZE_MB -let MAX_IMAGE_AUDIO_SIZE_MB_PATRON -let MAX_VIDEO_SIZE_MB -let MAX_VIDEO_SIZE_MB_PATRON -if (document.getElementById("MAX_IMAGE_AUDIO_SIZE_MB")) { - MAX_IMAGE_AUDIO_SIZE_MB = parseInt(document.getElementById("MAX_IMAGE_AUDIO_SIZE_MB").value) - MAX_IMAGE_AUDIO_SIZE_MB_PATRON = parseInt(document.getElementById("MAX_IMAGE_AUDIO_SIZE_MB_PATRON").value) - MAX_VIDEO_SIZE_MB = parseInt(document.getElementById("MAX_VIDEO_SIZE_MB").value) - MAX_VIDEO_SIZE_MB_PATRON = parseInt(document.getElementById("MAX_VIDEO_SIZE_MB_PATRON").value) -} +const MAX_IMAGE_AUDIO_SIZE_MB = parseInt(document.getElementById("MAX_IMAGE_AUDIO_SIZE_MB").value) +const MAX_IMAGE_AUDIO_SIZE_MB_PATRON = parseInt(document.getElementById("MAX_IMAGE_AUDIO_SIZE_MB_PATRON").value) +const MAX_VIDEO_SIZE_MB = parseInt(document.getElementById("MAX_VIDEO_SIZE_MB").value) +const MAX_VIDEO_SIZE_MB_PATRON = parseInt(document.getElementById("MAX_VIDEO_SIZE_MB_PATRON").value) +const vpatron = parseInt(document.getElementById("vpatron").value) let patron if (location.host == 'rdrama.net') patron = 'paypig' @@ -490,7 +485,7 @@ function handle_files(input, newfiles) { type = 'image/audio' } - if (file.size > max_size * 1024 * 1024) { + if (file.size > max_size_patron * 1024 * 1024 || (!vpatron && file.size > max_size * 1024 * 1024)) { const msg = `Max ${type} size is ${max_size} MB (${max_size_patron} MB for ${patron}s)` showToast(false, msg); input.value = null; diff --git a/files/templates/root.html b/files/templates/root.html index 2e388d2085..2f6dff6e3d 100644 --- a/files/templates/root.html +++ b/files/templates/root.html @@ -50,6 +50,7 @@ + {% endif %}