Compare commits

..

No commits in common. "1ec2be59259baadfeeba24a52be7de7668ec66b1" and "29b429e2396d78cb8dcd8d5b977e9e0f0cfe5966" have entirely different histories.

2 changed files with 3 additions and 21 deletions

View File

@ -200,19 +200,6 @@ if (!isset($_POST['submit'])) {
return response;
}
function validateFileType(file) {
if (file.type && (file.type.startsWith('image/') || file.type.startsWith('video/'))) {
return true;
}
const parts = file.name.split('.');
const extension = parts.length > 0 ? parts[parts.length-1] : '';
if (['jpg', 'jpeg', 'png', 'heic', 'heif', 'mov', 'mp4', 'mkv'].includes(extension)) {
return true;
}
console.warn('Invalid file type', extension);
return false;
}
albumInput.addEventListener('change', (event) => {
console.log(event);
albumAnchor.href = `https://photos.phlaym.net${albumInput.selectedOptions[0].dataset.url}`;
@ -285,10 +272,8 @@ if (!isset($_POST['submit'])) {
sizeInMb,
'MB big, which is over the limit of',
maxFileSize);
} else if(validateFileType(file)) {
fileList.push(file);
}
fileList.push(file);
}
}
totalProgress.max = fileList.length;
@ -311,12 +296,9 @@ if (!isset($_POST['submit'])) {
? 'Die folgenden Dateien sind'
: 'Die folgende Datei ist';
errorDiv.innerHTML += ```
${pluralizedMessage} zu groß und wird beim Upload ignoriert: ${names}.
${pluralizedMessage} zu groß: ${names}.
Jede Datei darf max. ${maxFileSize} MB groß sein.```;
}
if (!fileList.length) {
submitButton.disabled = true;
errorDiv.innerHTML += 'Keine gültigen Bilder oder Videos gefunden';
}
});
</script>

View File

@ -155,7 +155,7 @@ class PhotoPrism
}
$output = curl_exec($ch);
// $request = curl_getinfo($ch, CURLINFO_HEADER_OUT);
$request = curl_getinfo($ch, CURLINFO_HEADER_OUT);
$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($output === false) {