fix(video api): fix items bug

This commit is contained in:
mrilyew 2025-05-23 21:28:01 +03:00 committed by Alexander Minkin
parent ecdbc2ef1c
commit b2d389a7b8

View file

@ -20,12 +20,18 @@ final class Video extends VKAPIRequestHandler
$this->requireUser(); $this->requireUser();
if (!empty($videos)) { if (!empty($videos)) {
$vids = explode(',', $videos); $vids = array_unique(explode(',', $videos));
if (sizeof($vids) > 100) {
$this->fail(15, "Too many ids given");
}
$profiles = []; $profiles = [];
$groups = []; $groups = [];
$items = [];
foreach ($vids as $vid) { foreach ($vids as $vid) {
$id = explode("_", $vid); $id = explode("_", $vid);
$items = [];
$video = (new VideosRepo())->getByOwnerAndVID(intval($id[0]), intval($id[1])); $video = (new VideosRepo())->getByOwnerAndVID(intval($id[0]), intval($id[1]));
if ($video && !$video->isDeleted()) { if ($video && !$video->isDeleted()) {