From 933c4ee45a882da22cf74a356d377612d66396c6 Mon Sep 17 00:00:00 2001 From: mrilyew <99399973+mrilyew@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:00:04 +0300 Subject: [PATCH] add audio download button, simplify css --- Web/Models/Entities/Audio.php | 5 ++++ Web/Presenters/templates/Audio/player.xml | 3 ++- Web/static/css/audios.css | 28 +++++++++++++--------- Web/static/img/audios_controls.png | Bin 4128 -> 4259 bytes Web/static/js/al_music.js | 7 ++++-- 5 files changed, 29 insertions(+), 14 deletions(-) diff --git a/Web/Models/Entities/Audio.php b/Web/Models/Entities/Audio.php index 6be207dd..3b998f32 100644 --- a/Web/Models/Entities/Audio.php +++ b/Web/Models/Entities/Audio.php @@ -152,6 +152,11 @@ class Audio extends Media return $this->getPerformer() . " — " . $this->getTitle(); } + function getDownloadName(): string + { + return preg_replace('/[\\/:*?"<>|]/', '_', str_replace(' ', '_', $this->getName())); + } + function getGenre(): ?string { return $this->getRecord()->genre; diff --git a/Web/Presenters/templates/Audio/player.xml b/Web/Presenters/templates/Audio/player.xml index 28eb00b7..f235dc93 100644 --- a/Web/Presenters/templates/Audio/player.xml +++ b/Web/Presenters/templates/Audio/player.xml @@ -28,7 +28,7 @@