Fixed issue with download filename

This commit is contained in:
Pablo Ferreiro 2022-10-24 20:53:59 +02:00
parent 6fafcdcd11
commit 23583ef7ab
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
5 changed files with 12 additions and 12 deletions

View file

@ -6,9 +6,9 @@ class UrlBuilder {
return Misc::url('/stream?url=' . urlencode($url));
}
static public function download(string $url, string $username, bool $watermark): string {
static public function download(string $url, string $username, string $id, bool $watermark): string {
// {path('/download?url=' . urlencode($playAddr) . '&id=' . $id . '&user=' . $uniqueId) . '&watermark=1'}
$down_url = Misc::url('/download?url=' . urlencode($url) . '&user=' . $username);
$down_url = Misc::url('/download?url=' . urlencode($url) . '&id=' . $id . '&user=' . $username);
if ($watermark) $down_url .= '&watermark=1';
return $down_url;
}

View file

@ -43,8 +43,8 @@ class Wrappers {
$latte->addFunction('url_video_external', function (string $username, string $id): string {
return UrlBuilder::video_external($username, $id);
});
$latte->addFunction('url_download', function (string $url, string $username, bool $watermark): string {
return UrlBuilder::download($url, $username, $watermark);
$latte->addFunction('url_download', function (string $url, string $username, string $id, bool $watermark): string {
return UrlBuilder::download($url, $username, $id, $watermark);
});
// https://stackoverflow.com/a/36365553
$latte->addFunction('number', function (float $x) {