From 9c92fe4901f89617a9198f9f7b4e84d269895818 Mon Sep 17 00:00:00 2001 From: mrilyew <99399973+mrilyew@users.noreply.github.com> Date: Thu, 24 Oct 2024 17:24:11 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=BB=D0=B5=D0=B3=D0=BA=D0=B0=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=B5=D0=B1=D0=B0=D0=BB=D1=81=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VKAPI/Handlers/Audio.php | 15 +-------------- Web/Models/Repositories/Audios.php | 16 ++-------------- Web/Presenters/AudioPresenter.php | 4 ++-- Web/Presenters/templates/Audio/bigplayer.xml | 2 +- Web/Presenters/templates/Audio/tabs.xml | 9 ++++----- Web/static/css/audios.css | 9 +++++++-- Web/static/css/main.css | 2 +- Web/static/js/al_music.js | 3 ++- 8 files changed, 20 insertions(+), 40 deletions(-) diff --git a/VKAPI/Handlers/Audio.php b/VKAPI/Handlers/Audio.php index 90d060fb9..e0991af92 100644 --- a/VKAPI/Handlers/Audio.php +++ b/VKAPI/Handlers/Audio.php @@ -587,20 +587,7 @@ function searchAlbums(string $query = '', int $offset = 0, int $limit = 25, int $playlists = []; $params = []; - $order_str = 'id'; - switch($order) { - default: - case 0: - $order_str = 'id'; - break; - case 1: - $order_str = 'length'; - break; - case 2: - $order_str = 'listens'; - break; - } - + $order_str = (['id', 'length', 'listens'][$order] ?? 'id'); if($from_me === 1) $params['from_me'] = $this->getUser()->getId(); diff --git a/Web/Models/Repositories/Audios.php b/Web/Models/Repositories/Audios.php index 7ff00a1dc..73f5ac293 100644 --- a/Web/Models/Repositories/Audios.php +++ b/Web/Models/Repositories/Audios.php @@ -251,19 +251,7 @@ function find(string $query, array $params = [], array $order = ['type' => 'id', "unlisted" => 0, "deleted" => 0, ]); - $order_str = 'id'; - - switch($order['type']) { - case 'id': - $order_str = 'id ' . ($order['invert'] ? 'ASC' : 'DESC'); - break; - case 'length': - $order_str = 'length ' . ($order['invert'] ? 'ASC' : 'DESC'); - break; - case 'listens': - $order_str = 'listens ' . ($order['invert'] ? 'ASC' : 'DESC'); - break; - } + $order_str = (in_array($order['type'], ['id', 'length', 'listens']) ? $order['type'] : 'id') . ' ' . ($order['invert'] ? 'ASC' : 'DESC');; if($params["only_performers"] == "1") { $result->where("performer LIKE ?", $query); @@ -304,7 +292,7 @@ function findPlaylists(string $query, array $params = [], array $order = ['type' $result = $this->playlists->where([ "deleted" => 0, ])->where("CONCAT_WS(' ', name, description) LIKE ?", $query); - $order_str = (['id', 'length', 'listens'][$order['type']] ?? 'id') . ' ' . ($order['invert'] ? 'ASC' : 'DESC'); + $order_str = (in_array($order['type'], ['id', 'length', 'listens']) ? $order['type'] : 'id') . ' ' . ($order['invert'] ? 'ASC' : 'DESC'); if(is_null($params['from_me']) || empty($params['from_me'])) $result->where(["unlisted" => 0]); diff --git a/Web/Presenters/AudioPresenter.php b/Web/Presenters/AudioPresenter.php index b47ba0f0e..7e2825c13 100644 --- a/Web/Presenters/AudioPresenter.php +++ b/Web/Presenters/AudioPresenter.php @@ -109,8 +109,8 @@ function renderList(?int $owner = NULL, ?string $mode = "list"): void $this->template->mode = $mode; $this->template->page = $page; - - if(in_array($mode, ["list", "new", "popular"]) && $this->user->identity) + + if(in_array($mode, ["list", "new", "popular"]) && $this->user->identity && $page < 2) $this->template->friendsAudios = $this->user->identity->getBroadcastList("all", true); } diff --git a/Web/Presenters/templates/Audio/bigplayer.xml b/Web/Presenters/templates/Audio/bigplayer.xml index 4baa9dbd6..6ae6326df 100644 --- a/Web/Presenters/templates/Audio/bigplayer.xml +++ b/Web/Presenters/templates/Audio/bigplayer.xml @@ -18,7 +18,7 @@
- {_track_unknown} — + {_track_unknown}{_track_noname}
diff --git a/Web/Presenters/templates/Audio/tabs.xml b/Web/Presenters/templates/Audio/tabs.xml index 13ca9e7aa..c8a4cef0c 100644 --- a/Web/Presenters/templates/Audio/tabs.xml +++ b/Web/Presenters/templates/Audio/tabs.xml @@ -1,11 +1,10 @@
- {_my_music} - {_upload_audio} - {_audio_new} - {_audio_popular} - {_audio_search} + {_my_music} + {_upload_audio} + {_audio_new} + {_audio_popular}
diff --git a/Web/static/css/audios.css b/Web/static/css/audios.css index 4ac39091b..634639f2a 100644 --- a/Web/static/css/audios.css +++ b/Web/static/css/audios.css @@ -191,7 +191,12 @@ font-size: 10px; } -.bigPlayer .paddingLayer .trackInfo b:hover { +.bigPlayer .paddingLayer .trackInfo a { + font-weight: bold; + color: black; +} + +.bigPlayer .paddingLayer .trackInfo a:hover { text-decoration: underline; cursor: pointer; } @@ -346,7 +351,7 @@ .overflowedName { position: absolute; z-index: 99; - width: 85% !important; + width: 80% !important; } .audioEntry .status strong { diff --git a/Web/static/css/main.css b/Web/static/css/main.css index 54951da3b..cb633d0a5 100644 --- a/Web/static/css/main.css +++ b/Web/static/css/main.css @@ -2700,7 +2700,7 @@ a.poll-retract-vote { } .verticalGrayTabsWrapper { - width: 25.5%; + width: 158px; border-top: 1px solid #E5E7E6; border-left: 1px solid #d8d8d8; scrollbar-width: none; diff --git a/Web/static/js/al_music.js b/Web/static/js/al_music.js index c792926e2..7ee1f0358 100644 --- a/Web/static/js/al_music.js +++ b/Web/static/js/al_music.js @@ -544,7 +544,8 @@ class bigPlayer { } this.nodes["thisPlayer"].querySelector(".trackInfo span").innerHTML = escapeHtml(obj.name) - this.nodes["thisPlayer"].querySelector(".trackInfo b").innerHTML = escapeHtml(obj.performer) + this.nodes["thisPlayer"].querySelector(".trackInfo a").innerHTML = escapeHtml(obj.performer) + this.nodes["thisPlayer"].querySelector(".trackInfo a").href = `/search?query=§ion=audios&order=listens&only_performers=on&q=${encodeURIComponent(obj.performer.escapeHtml())}` this.nodes["thisPlayer"].querySelector(".trackInfo .time").innerHTML = fmtTime(obj.length) this.tracks["currentTrack"] = obj