Compare commits

...

4 commits

Author SHA1 Message Date
mrilyew
ff5043b31b
Merge 530287feed into c44a4ce988 2024-12-07 00:15:35 +04:00
mrilyew
c44a4ce988 fix(api): remove usless rate limits and fix php8.1 2024-12-06 21:31:05 +03:00
veselcraft
2aedc3e861
fix(video): instead of scailing it down to 4:3 with black bars scale it by 480px 2024-12-04 16:26:03 +03:00
Малушік
7474d46743
fix(locale-ua): fix spelling errors and add new translations (#1159)
* resolve 5c19637715 (locale-uk)

* resolve 73a067a0c5 (locale-uk)

* resolve cf0b4be3fb (locale-uk)

* resolve aff19de2ea (locale-uk)

* fix(locale-uk): fix spelling errors

* fix(locale-uk): fix spelling errors

* fix(locale-uk): fix spelling errors

* fix(locale-uk): fix spelling errors

* fix(locale-uk): fix spelling errors

* resolve 2af8447a0f (locale-uk)

* resolve e4a79a8ffb (locale-uk)

* fix(locale-uk): fix spelling errors

* small typo fix
2024-11-27 13:49:44 +03:00
5 changed files with 269 additions and 248 deletions

View file

@ -287,7 +287,6 @@ final class Board extends VKAPIRequestHandler
{ {
# start_comment_id ne robit # start_comment_id ne robit
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
$topic = (new TopicsRepo)->getTopicById($group_id, $topic_id); $topic = (new TopicsRepo)->getTopicById($group_id, $topic_id);
@ -321,7 +320,6 @@ final class Board extends VKAPIRequestHandler
{ {
# order и extended ничё не делают # order и extended ничё не делают
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
$arr = []; $arr = [];
$club = (new ClubsRepo)->get($group_id); $club = (new ClubsRepo)->get($group_id);
@ -330,7 +328,7 @@ final class Board extends VKAPIRequestHandler
$arr["count"] = (new TopicsRepo)->getClubTopicsCount($club); $arr["count"] = (new TopicsRepo)->getClubTopicsCount($club);
$arr["items"] = []; $arr["items"] = [];
$arr["default_order"] = $order; $arr["default_order"] = $order;
$arr["can_add_topics"] = $club->canBeModifiedBy($this->getUser()) ? true : $club->isEveryoneCanCreateTopics() ? true : false; $arr["can_add_topics"] = $club->canBeModifiedBy($this->getUser()) ? true : ($club->isEveryoneCanCreateTopics() ? true : false);
$arr["profiles"] = []; $arr["profiles"] = [];
if(empty($topic_ids)) { if(empty($topic_ids)) {

View file

@ -288,7 +288,6 @@ final class Photos extends VKAPIRequestHandler
function getAlbums(int $owner_id, string $album_ids = "", int $offset = 0, int $count = 100, bool $need_system = true, bool $need_covers = true, bool $photo_sizes = false) function getAlbums(int $owner_id, string $album_ids = "", int $offset = 0, int $count = 100, bool $need_system = true, bool $need_covers = true, bool $photo_sizes = false)
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
$res = []; $res = [];
@ -360,7 +359,6 @@ final class Photos extends VKAPIRequestHandler
function getAlbumsCount(int $user_id = 0, int $group_id = 0) function getAlbumsCount(int $user_id = 0, int $group_id = 0)
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
if($user_id == 0 && $group_id == 0 || $user_id > 0 && $group_id > 0) if($user_id == 0 && $group_id == 0 || $user_id > 0 && $group_id > 0)
$this->fail(21, "Select user_id or group_id"); $this->fail(21, "Select user_id or group_id");
@ -389,7 +387,6 @@ final class Photos extends VKAPIRequestHandler
function getById(string $photos, bool $extended = false, bool $photo_sizes = false) function getById(string $photos, bool $extended = false, bool $photo_sizes = false)
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
$phts = explode(",", $photos); $phts = explode(",", $photos);
$res = []; $res = [];
@ -413,7 +410,6 @@ final class Photos extends VKAPIRequestHandler
function get(int $owner_id, int $album_id, string $photo_ids = "", bool $extended = false, bool $photo_sizes = false, int $offset = 0, int $count = 10) function get(int $owner_id, int $album_id, string $photo_ids = "", bool $extended = false, bool $photo_sizes = false, int $offset = 0, int $count = 10)
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
$res = []; $res = [];
@ -632,7 +628,6 @@ final class Photos extends VKAPIRequestHandler
function getAll(int $owner_id, bool $extended = false, int $offset = 0, int $count = 100, bool $photo_sizes = false) function getAll(int $owner_id, bool $extended = false, int $offset = 0, int $count = 100, bool $photo_sizes = false)
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
if($owner_id < 0) if($owner_id < 0)
$this->fail(4, "This method doesn't works with clubs"); $this->fail(4, "This method doesn't works with clubs");
@ -661,7 +656,6 @@ final class Photos extends VKAPIRequestHandler
function getComments(int $owner_id, int $photo_id, bool $need_likes = false, int $offset = 0, int $count = 100, bool $extended = false, string $fields = "") function getComments(int $owner_id, int $photo_id, bool $need_likes = false, int $offset = 0, int $count = 100, bool $extended = false, string $fields = "")
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
$photo = (new PhotosRepo)->getByOwnerAndVID($owner_id, $photo_id); $photo = (new PhotosRepo)->getByOwnerAndVID($owner_id, $photo_id);
$comms = array_slice(iterator_to_array($photo->getComments(1, $offset + $count)), $offset); $comms = array_slice(iterator_to_array($photo->getComments(1, $offset + $count)), $offset);

View file

@ -13,7 +13,7 @@ Move-Item $file $temp
# video stub logic was implicitly deprecated, so we start processing at once # video stub logic was implicitly deprecated, so we start processing at once
ffmpeg -i $temp -ss 00:00:01.000 -vframes 1 "$dir$hashT/$hash.gif" ffmpeg -i $temp -ss 00:00:01.000 -vframes 1 "$dir$hashT/$hash.gif"
ffmpeg -i $temp -c:v libx264 -q:v 7 -c:a libmp3lame -q:a 4 -tune zerolatency -vf "scale=640:480:force_original_aspect_ratio=decrease,pad=640:480:(ow-iw)/2:(oh-ih)/2,setsar=1" -y $temp2 ffmpeg -i $temp -c:v libx264 -q:v 7 -c:a libmp3lame -q:a 4 -tune zerolatency -vf "scale=480:-1,setsar=1" -y $temp2
Move-Item $temp2 "$dir$hashT/$hash.mp4" Move-Item $temp2 "$dir$hashT/$hash.mp4"
Remove-Item $temp Remove-Item $temp

View file

@ -3,7 +3,7 @@ tmpfile="$RANDOM-$(date +%s%N)"
cp $2 "/tmp/vid_$tmpfile.bin" cp $2 "/tmp/vid_$tmpfile.bin"
nice ffmpeg -i "/tmp/vid_$tmpfile.bin" -ss 00:00:01.000 -vframes 1 $3${4:0:2}/$4.gif nice ffmpeg -i "/tmp/vid_$tmpfile.bin" -ss 00:00:01.000 -vframes 1 $3${4:0:2}/$4.gif
nice -n 20 ffmpeg -i "/tmp/vid_$tmpfile.bin" -c:v libx264 -q:v 7 -c:a libmp3lame -q:a 4 -tune zerolatency -vf "scale=640:480:force_original_aspect_ratio=decrease,pad=640:480:(ow-iw)/2:(oh-ih)/2,setsar=1" -y "/tmp/ffmOi$tmpfile.mp4" nice -n 20 ffmpeg -i "/tmp/vid_$tmpfile.bin" -c:v libx264 -q:v 7 -c:a libmp3lame -q:a 4 -tune zerolatency -vf "scale=480:-1,setsar=1" -y "/tmp/ffmOi$tmpfile.mp4"
rm -rf $3${4:0:2}/$4.mp4 rm -rf $3${4:0:2}/$4.mp4
mv "/tmp/ffmOi$tmpfile.mp4" $3${4:0:2}/$4.mp4 mv "/tmp/ffmOi$tmpfile.mp4" $3${4:0:2}/$4.mp4

File diff suppressed because it is too large Load diff