слегка проебался

This commit is contained in:
mrilyew 2024-10-24 17:24:11 +03:00
parent 3aafae1af3
commit 9c92fe4901
8 changed files with 20 additions and 40 deletions

View file

@ -587,20 +587,7 @@ final class Audio extends VKAPIRequestHandler
$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();

View file

@ -251,19 +251,7 @@ class Audios
"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 @@ class Audios
$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]);

View file

@ -109,8 +109,8 @@ final class AudioPresenter extends OpenVKPresenter
$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);
}

View file

@ -18,7 +18,7 @@
<div class="trackPanel">
<div class="trackInfo">
<div class="trackName">
<b>{_track_unknown}</b> —
<a>{_track_unknown}</a> —
<span>{_track_noname}</span>
</div>

View file

@ -1,11 +1,10 @@
<div class='verticalGrayTabsWrapper'>
<div class="verticalGrayTabs">
<div class='with_padding'>
<a n:attr="id => $mode === 'list' && $isMy ? 'used' : 'ki'" href="/audios{$thisUser->getId()}" n:if="isset($thisUser)">{_my_music}</a>
<a href="/player/upload{if $isMyClub}?gid={abs($ownerId)}{/if}" n:if="isset($thisUser)">{_upload_audio}</a>
<a n:attr="id => $mode === 'new' ? 'used' : 'ki'" href="/audios/new">{_audio_new}</a>
<a n:attr="id => $mode === 'popular' ? 'used' : 'ki'" href="/audios/popular">{_audio_popular}</a>
<a href="/search?section=audios" n:if="isset($thisUser)">{_audio_search}</a>
<a n:if="isset($thisUser)" n:attr="id => $mode === 'list' && $isMy ? 'used' : 'ki'" href="/audios{$thisUser->getId()}">{_my_music}</a>
<a n:if="isset($thisUser)" href="/player/upload{if $isMyClub}?gid={abs($ownerId)}{/if}">{_upload_audio}</a>
<a n:if="isset($thisUser)" n:attr="id => $mode === 'new' ? 'used' : 'ki'" href="/search?section=audios">{_audio_new}</a>
<a n:if="isset($thisUser)" n:attr="id => $mode === 'popular' ? 'used' : 'ki'" href="/search?section=audios&order=listens">{_audio_popular}</a>
<hr n:if="isset($thisUser)">

View file

@ -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 {

View file

@ -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;

View file

@ -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=&section=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