From 616ee54ad7bc65120ebf4339762eb85802b3ee09 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 07:21:10 +0300 Subject: [PATCH 001/185] remove deprecated constructions --- README.md | 9 ++------- config/routes.yaml | 3 --- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7843119..ee70ca7 100644 --- a/README.md +++ b/README.md @@ -47,12 +47,6 @@ php bin/console doctrine:migrations:migrate * `* * * * * /crontab/torrent/scrape` - update seeding stats -##### Routing - -YGGtracker uses sub-directory prefix by default, -if your instance running in the document root, please change `prefix` value to `/` in file -`/config/routes.yaml` - ##### App settings Custom settings could be provided in the `/.env.local` file by overwriting default `/.env` values @@ -93,7 +87,8 @@ git checkout -b my-pr-branch-name #### Feedback -[https://github.com/YGGverse/YGGtracker/issues](https://github.com/YGGverse/YGGtracker/issues) +[Issues](https://github.com/YGGverse/YGGtracker/issues) +[Wiki](https://github.com/YGGverse/YGGtracker/wiki) #### Community diff --git a/config/routes.yaml b/config/routes.yaml index 5394777..41ef814 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -3,6 +3,3 @@ controllers: path: ../src/Controller/ namespace: App\Controller type: attribute - # this prefix using in official build URLs. - # replace to / if you hosted YGGtracker instance in the document root - prefix: '/yggtracker' From 4799b0dcd45570c66debd4afefcee7bb642498d6 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 07:31:04 +0300 Subject: [PATCH 002/185] shift version --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 6737c6d..b8b6d8a 100644 --- a/.env +++ b/.env @@ -45,7 +45,7 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 ###< symfony/crowdin-translation-provider ### # YGGtracker -APP_VERSION='2.0.0' +APP_VERSION='2.0.1' APP_NAME=YGGtracker From a930ca4df791e1555bd089f957f09ab2c4e9b8ba Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 07:32:14 +0300 Subject: [PATCH 003/185] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ee70ca7..b6b39e2 100644 --- a/README.md +++ b/README.md @@ -87,8 +87,8 @@ git checkout -b my-pr-branch-name #### Feedback -[Issues](https://github.com/YGGverse/YGGtracker/issues) -[Wiki](https://github.com/YGGverse/YGGtracker/wiki) +* [Issues](https://github.com/YGGverse/YGGtracker/issues) +* [Wiki](https://github.com/YGGverse/YGGtracker/wiki) #### Community From 5fde6c2d1cc789a971ebf943a33b9a8a945cea12 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 07:32:54 +0300 Subject: [PATCH 004/185] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b6b39e2..c2327b5 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ git checkout -b my-pr-branch-name * [Bencode Library](https://github.com/Rhilip/Bencode) * [Identicons](https://github.com/dmester/jdenticon-php) -#### Feedback +#### Support * [Issues](https://github.com/YGGverse/YGGtracker/issues) * [Wiki](https://github.com/YGGverse/YGGtracker/wiki) From e21561c1d04c695b7b05f591ef0e4654b69f5fcd Mon Sep 17 00:00:00 2001 From: d47081 <108541346+d47081@users.noreply.github.com> Date: Sat, 14 Oct 2023 07:46:36 +0300 Subject: [PATCH 005/185] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c2327b5..5f7cf04 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ BitTorrent Registry for Yggdrasil YGGtracker uses [Yggdrasil](https://github.com/yggdrasil-network/yggdrasil-go) IPv6 addresses to identify users without registration. +![Pasted image 1](https://github.com/YGGverse/YGGtracker/assets/108541346/962f7850-01e1-4add-9dbe-c11b80108a75) + + #### Installation ``` @@ -98,4 +101,4 @@ git checkout -b my-pr-branch-name * [YGGo - YGGo! Distributed Web Search Engine ](https://github.com/YGGverse/YGGo) * [YGGwave ~ The Radio Catalog](https://github.com/YGGverse/YGGwave) -* [YGGstate - Yggdrasil Network Explorer](https://github.com/YGGverse/YGGstate) \ No newline at end of file +* [YGGstate - Yggdrasil Network Explorer](https://github.com/YGGverse/YGGstate) From f8de41ffabebc91d4ff57a34a1c81a48ff56efcf Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 07:48:39 +0300 Subject: [PATCH 006/185] update readme --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 5f7cf04..67956e4 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,11 @@ git checkout -b my-pr-branch-name * [Mastodon](https://mastodon.social/@YGGverse) +#### Instances + +* [http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/](http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/) +* [http://[200:e6fd:bb3c:b354:cd3a:f939:753e:cd72]/yggtracker/](http://[200:e6fd:bb3c:b354:cd3a:f939:753e:cd72]/yggtracker/) + #### See also * [YGGo - YGGo! Distributed Web Search Engine ](https://github.com/YGGverse/YGGo) From e0410390aa975eb932da89cc4cc27dd27d1dd608 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 17:01:50 +0300 Subject: [PATCH 007/185] update readme --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 67956e4..c1b0fdb 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,6 @@ git checkout -b my-pr-branch-name #### Instances * [http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/](http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/) -* [http://[200:e6fd:bb3c:b354:cd3a:f939:753e:cd72]/yggtracker/](http://[200:e6fd:bb3c:b354:cd3a:f939:753e:cd72]/yggtracker/) #### See also From 60e8a57dce021e19cb75a39572e04eb9e7762bc6 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 17:13:51 +0300 Subject: [PATCH 008/185] fix scrape wanted condition --- templates/default/torrent/list.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index c74e816..951eade 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -21,7 +21,7 @@ {{ torrent.file.name }} - {% if torrent.scrape.leechers == 0 and torrent.scrape.leechers == 0 %} + {% if torrent.scrape.leechers > 0 and torrent.scrape.seeders == 0 %} {{ 'wanted' | trans }} From 924137f09aacf773a1e153de5cb13e729972048f Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 17:25:50 +0300 Subject: [PATCH 009/185] fix session variables --- src/Controller/TorrentController.php | 5 +---- src/Controller/UserController.php | 6 ++++-- templates/default/torrent/info.html.twig | 2 +- templates/default/user/info.html.twig | 16 ++++++++-------- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index a1ea018..76b09a7 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -109,10 +109,7 @@ class TorrentController extends AbstractController [ 'session' => [ - 'user' => $user - ], - 'user' => - [ + 'user' => $user, 'id' => $user->getId(), 'moderator' => $user->isModerator() ], diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index a11291a..574a1e4 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -210,11 +210,13 @@ class UserController extends AbstractController [ 'session' => [ - 'user' => $user + 'user' => $user, + 'owner' => $user->getId() === $userTarget->getId(), + 'moderator' => $user->isModerator() ], 'user' => [ 'id' => $userTarget->getId(), - 'address' => $userTarget->getId() === $user->getId() ? $userTarget->getAddress() : false, + 'address' => $userTarget->getAddress(), 'moderator' => $userTarget->isModerator(), 'approved' => $userTarget->isApproved(), 'status' => $userTarget->isStatus(), diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index bd09bf9..364ac67 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -73,7 +73,7 @@ - {% if user.moderator %} + {% if session.moderator %} - {% if user.address %} + {% if session.owner or session.moderator %}
diff --git a/templates/default/user/info.html.twig b/templates/default/user/info.html.twig index 4ed5e35..8391fb9 100644 --- a/templates/default/user/info.html.twig +++ b/templates/default/user/info.html.twig @@ -33,7 +33,7 @@
{{ 'Common'|trans }}
{{ 'Address' | trans }} @@ -68,7 +68,7 @@ {% if user.status %} {{ 'Active' | trans }} - {% if user.moderator %} + {% if session.moderator %} @@ -77,7 +77,7 @@ {% endif %} {% else %} {{ 'Disabled' | trans }} - {% if user.moderator %} + {% if session.moderator %} @@ -94,7 +94,7 @@ {% if user.approved %} {{ 'Yes'| trans }} - {% if user.moderator %} + {% if session.moderator %} @@ -103,7 +103,7 @@ {% endif %} {% else %} {{ 'No'| trans }} - {% if user.moderator %} + {% if session.moderator %} @@ -118,9 +118,9 @@ {{ 'Moderator' | trans }} - {% if user.moderator %} + {% if session.moderator %} {{ 'Yes'| trans }} - {% if user.moderator %} + {% if session.moderator %} @@ -129,7 +129,7 @@ {% endif %} {% else %} {{ 'No'| trans }} - {% if user.moderator %} + {% if session.moderator %} From 851efe039206d5aa246cc5970b51b0ef04fb8fb0 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 17:59:08 +0300 Subject: [PATCH 010/185] fix variable name --- templates/default/user/info.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/user/info.html.twig b/templates/default/user/info.html.twig index 8391fb9..34ace24 100644 --- a/templates/default/user/info.html.twig +++ b/templates/default/user/info.html.twig @@ -118,7 +118,7 @@ {{ 'Moderator' | trans }} - {% if session.moderator %} + {% if user.moderator %} {{ 'Yes'| trans }} {% if session.moderator %} From d9ecec44c0facc7170502a6c9b93f33e93399e83 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 18:41:23 +0300 Subject: [PATCH 011/185] fix pagination --- src/Controller/SearchController.php | 33 +------------------ src/Controller/TorrentController.php | 24 +++++++++----- templates/default/torrent/list.html.twig | 40 ++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 39 deletions(-) diff --git a/src/Controller/SearchController.php b/src/Controller/SearchController.php index 30b06b6..0bc57fb 100644 --- a/src/Controller/SearchController.php +++ b/src/Controller/SearchController.php @@ -21,39 +21,8 @@ class SearchController extends AbstractController return $this->render( 'default/search/module.html.twig', [ - 'query' => $query, + 'query' => urldecode($query), ] ); } - - private function initUser( - Request $request, - UserService $userService, - ActivityService $activityService - ): ?\App\Entity\User - { - // Init user - if (!$user = $userService->findUserByAddress($request->getClientIp())) - { - $user = $userService->addUser( - $request->getClientIp(), - time(), - $this->getParameter('app.locale'), - explode('|', $this->getParameter('app.locales')), - $activityService->getEventCodes(), - $this->getParameter('app.theme'), - $this->getParameter('app.sensitive'), - $this->getParameter('app.yggdrasil'), - $this->getParameter('app.approved') - ); - - // Add user join event - $activityService->addEventUserAdd( - $user->getId(), - time() - ); - } - - return $user; - } } \ No newline at end of file diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 76b09a7..3b0bd1b 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -221,7 +221,7 @@ class TorrentController extends AbstractController ); // Init request - $query = $request->get('query') ? explode(' ', $request->get('query')) : []; + $query = $request->get('query') ? explode(' ', urldecode($request->get('query'))) : []; $page = $request->get('page') ? (int) $request->get('page') : 1; // Get total torrents @@ -322,8 +322,14 @@ class TorrentController extends AbstractController } return $this->render('default/torrent/list.html.twig', [ - 'query' => $request->query->get('query'), - 'torrents' => $torrents + 'query' => urldecode($request->get('query')), + 'torrents' => $torrents, + 'pagination' => + [ + 'page' => $page, + 'pages' => ceil($total / $this->getParameter('app.pagination')), + 'total' => $total + ] ]); } @@ -379,7 +385,7 @@ class TorrentController extends AbstractController // Generate keywords $keywords = []; - $query = explode(' ', mb_strtolower($request->query->get('query'))); + $query = explode(' ', mb_strtolower(urldecode($request->query->get('query')))); foreach ($torrent->getKeywords() as $keyword) { if (in_array($keyword, $query)) @@ -452,8 +458,13 @@ class TorrentController extends AbstractController } return $this->render('default/torrent/list.html.twig', [ - 'query' => $request->query->get('query'), - 'torrents' => $torrents + 'torrents' => $torrents, + 'pagination' => + [ + 'page' => $page, + 'pages' => ceil($total / $this->getParameter('app.pagination')), + 'total' => $total + ] ]); } @@ -531,7 +542,6 @@ class TorrentController extends AbstractController return $this->render( 'default/torrent/list.rss.twig', [ - 'query' => $request->query->get('query'), 'torrents' => $torrents ], $response diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 951eade..3b2ce7a 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -137,6 +137,46 @@ {% endfor %} + {% if pagination.pages > 1 %} +
+ {{ 'Page' | trans | lower }} {{ pagination.page }} / {{ pagination.pages }} + {% if query %} + {% if pagination.page > 1 %} + {% if pagination.page == 2 %} + + {{ 'Back' | trans | lower }} + + {% else %} + + {{ 'Back' | trans | lower }} + + {% endif %} + {% endif %} + {% if pagination.page < pagination.pages %} + + {{ 'Next' | trans | lower }} + + {% endif %} + {% else %} + {% if pagination.page > 1 %} + {% if pagination.page == 2 %} + + {{ 'Back' | trans | lower }} + + {% else %} + + {{ 'Back' | trans | lower }} + + {% endif %} + {% endif %} + {% if pagination.page < pagination.pages %} + + {{ 'Next' | trans | lower }} + + {% endif %} + {% endif %} +
+ {% endif %} {% else %}
From ef25487854849edb0e10561c3c306b7eb7b5ec23 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 18:57:43 +0300 Subject: [PATCH 012/185] fix search button highlight --- templates/default/search/module.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/search/module.html.twig b/templates/default/search/module.html.twig index b996bf7..6677ce5 100644 --- a/templates/default/search/module.html.twig +++ b/templates/default/search/module.html.twig @@ -1,4 +1,4 @@
- +
\ No newline at end of file From f45bda4e5876e8aa6b042bb08535df55842be208 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 19:30:27 +0300 Subject: [PATCH 013/185] update action paddings --- templates/default/torrent/info.html.twig | 24 +++++------ templates/default/torrent/list.html.twig | 52 ++++++++++++------------ templates/default/user/info.html.twig | 8 ++-- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index 364ac67..add3bad 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -30,46 +30,46 @@ diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 3b2ce7a..bc0f1ce 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -62,78 +62,78 @@ #} - + {{ torrent.file.size | format_bytes }} - + - - + + - + {{ torrent.scrape.seeders }} - + - - + + - + {{ torrent.scrape.peers }} - + - - + + - + {{ torrent.scrape.leechers }} - + {% endfor %} diff --git a/templates/default/user/info.html.twig b/templates/default/user/info.html.twig index 34ace24..9cdef1d 100644 --- a/templates/default/user/info.html.twig +++ b/templates/default/user/info.html.twig @@ -15,18 +15,18 @@
From 60503becdfb5fd8035517c9620b7c21ee1e5fb62 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 19:49:19 +0300 Subject: [PATCH 014/185] add info hash to torrent keywords index --- src/Service/TorrentService.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index d37bedb..0ba4e10 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -154,7 +154,9 @@ class TorrentService { $keywords = []; - foreach ($this->readTorrentFileByFilepath($filepath)->getFileList() as $file) + $file = $this->readTorrentFileByFilepath($filepath); + + foreach ($file->getFileList() as $file) { $words = explode( ' ', @@ -182,6 +184,16 @@ class TorrentService } } + if ($hash = $file->getInfoHashV1(false)) + { + $keywords[] = $hash; + } + + if ($hash = $file->getInfoHashV2(false)) + { + $keywords[] = $hash; + } + $keywords = array_merge($keywords, $words); } From 8b42df40411c90715adb8b1b66628cf181d81faf Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 20:15:05 +0300 Subject: [PATCH 015/185] write errors to file by default --- config/packages/monolog.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/packages/monolog.yaml b/config/packages/monolog.yaml index 8c9efa9..3c0c1c9 100644 --- a/config/packages/monolog.yaml +++ b/config/packages/monolog.yaml @@ -48,7 +48,8 @@ when@prod: buffer_size: 50 # How many messages should be saved? Prevent memory leaks nested: type: stream - path: php://stderr + # path: php://stderr + path: "%kernel.logs_dir%/%kernel.environment%.log" level: debug formatter: monolog.formatter.json console: From e97c4ec27f343b47f9f1c81318140e724fd14b1d Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 20:16:34 +0300 Subject: [PATCH 016/185] set log formatter by default --- config/packages/monolog.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/packages/monolog.yaml b/config/packages/monolog.yaml index 3c0c1c9..2b3726f 100644 --- a/config/packages/monolog.yaml +++ b/config/packages/monolog.yaml @@ -51,7 +51,7 @@ when@prod: # path: php://stderr path: "%kernel.logs_dir%/%kernel.environment%.log" level: debug - formatter: monolog.formatter.json + # formatter: monolog.formatter.json console: type: console process_psr_3_messages: false From 68fbafaefa66fcae953f13c3915c5ef41dcacca0 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 20:50:48 +0300 Subject: [PATCH 017/185] generate keywords on file parsed only --- src/Service/TorrentService.php | 55 +++++++++++++++++----------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index 0ba4e10..c06e25a 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -154,47 +154,48 @@ class TorrentService { $keywords = []; - $file = $this->readTorrentFileByFilepath($filepath); - - foreach ($file->getFileList() as $file) + if ($file = $this->readTorrentFileByFilepath($filepath)) { - $words = explode( - ' ', - preg_replace( - '/[\s]+/', + foreach ($file->getFileList() as $file) + { + $words = explode( ' ', preg_replace( - '/[\W]+/', + '/[\s]+/', ' ', - $file['path'] + preg_replace( + '/[\W]+/', + ' ', + $file['path'] + ) ) - ) - ); + ); - foreach ($words as $key => $value) - { - if (mb_strlen($value) < $minLength) + foreach ($words as $key => $value) { - unset($words[$key]); + if (mb_strlen($value) < $minLength) + { + unset($words[$key]); + } + + else + { + $words[$key] = mb_strtolower($value); + } } - else + if ($hash = $file->getInfoHashV1(false)) { - $words[$key] = mb_strtolower($value); + $keywords[] = $hash; } - } - if ($hash = $file->getInfoHashV1(false)) - { - $keywords[] = $hash; - } + if ($hash = $file->getInfoHashV2(false)) + { + $keywords[] = $hash; + } - if ($hash = $file->getInfoHashV2(false)) - { - $keywords[] = $hash; + $keywords = array_merge($keywords, $words); } - - $keywords = array_merge($keywords, $words); } return array_unique($keywords); From 20dc122ab2555a342a6fb91093d7691185ff24d6 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 21:11:44 +0300 Subject: [PATCH 018/185] call urldecode on request provided only --- src/Controller/SearchController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/SearchController.php b/src/Controller/SearchController.php index 0bc57fb..e515162 100644 --- a/src/Controller/SearchController.php +++ b/src/Controller/SearchController.php @@ -21,7 +21,7 @@ class SearchController extends AbstractController return $this->render( 'default/search/module.html.twig', [ - 'query' => urldecode($query), + 'query' => $query ? urldecode($query) : '', ] ); } From be34befe96af34fc15a14ed0574e48be8d405fca Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 14 Oct 2023 22:01:10 +0300 Subject: [PATCH 019/185] fix errors --- src/Service/TorrentService.php | 73 ++++++++++++++++------------------ 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index c06e25a..044700d 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -45,54 +45,49 @@ class TorrentService if ($torrent = $this->getTorrentScrapeQueue()) { - // Get file - if (!$file = $this->readTorrentFileByTorrentId($torrent->getId())) - { - // @TODO - throw new \Exception( - $translator->trans('File not found') - ); - } - - // Get info hashes - $hashes = []; - - if ($hash = $file->getInfoHashV1(false)) - { - $hashes[] = $hash; - } - - if ($hash = $file->getInfoHashV2(false)) - { - $hashes[] = $hash; - } - // Init default values $seeders = 0; $peers = 0; $leechers = 0; - // Get scrape - if ($hashes && $trackers) + // Get file + if ($file = $this->readTorrentFileByTorrentId($torrent->getId())) { - // Update scrape info - if ($results = $scraper->scrape($hashes, $trackers, null, 1)) + // Get info hashes + $hashes = []; + + if ($hash = $file->getInfoHashV1(false)) { - foreach ($results as $result) + $hashes[] = $hash; + } + + if ($hash = $file->getInfoHashV2(false)) + { + $hashes[] = $hash; + } + + // Get scrape + if ($hashes && $trackers) + { + // Update scrape info + if ($results = $scraper->scrape($hashes, $trackers, null, 1)) { - if (isset($result['seeders'])) + foreach ($results as $result) { - $seeders = $seeders + (int) $result['seeders']; - } + if (isset($result['seeders'])) + { + $seeders = $seeders + (int) $result['seeders']; + } - if (isset($result['completed'])) - { - $peers = $peers + (int) $result['completed']; - } + if (isset($result['completed'])) + { + $peers = $peers + (int) $result['completed']; + } - if (isset($result['leechers'])) - { - $leechers = $leechers + (int) $result['leechers']; + if (isset($result['leechers'])) + { + $leechers = $leechers + (int) $result['leechers']; + } } } } @@ -156,7 +151,7 @@ class TorrentService if ($file = $this->readTorrentFileByFilepath($filepath)) { - foreach ($file->getFileList() as $file) + foreach ($file->getFileList() as $list) { $words = explode( ' ', @@ -166,7 +161,7 @@ class TorrentService preg_replace( '/[\W]+/', ' ', - $file['path'] + $list['path'] ) ) ); From 6a3c810da741402aea2f46159de713a1ad15c325 Mon Sep 17 00:00:00 2001 From: d47081 <108541346+d47081@users.noreply.github.com> Date: Sun, 15 Oct 2023 02:37:12 +0300 Subject: [PATCH 020/185] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c1b0fdb..6a3ee30 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ BitTorrent Registry for Yggdrasil YGGtracker uses [Yggdrasil](https://github.com/yggdrasil-network/yggdrasil-go) IPv6 addresses to identify users without registration. +#### [Showcase](https://github.com/YGGverse/YGGtracker/wiki/Showcase) + ![Pasted image 1](https://github.com/YGGverse/YGGtracker/assets/108541346/962f7850-01e1-4add-9dbe-c11b80108a75) From e5855d06b517c422d85cb302808fa9d1e4fa3414 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 03:20:56 +0300 Subject: [PATCH 021/185] add /tool/torrent/reindex --- src/Controller/TorrentController.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 3b0bd1b..1f38f46 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -1772,6 +1772,24 @@ class TorrentController extends AbstractController return new Response(); // @TODO } + #[Route( + '/tool/torrent/reindex', + methods: + [ + 'GET' + ] + )] + public function reindex( + TorrentService $torrentService + ): Response + { + // Reindex keywords + $torrentService->reindexTorrentKeywordsAll(); + + // Render response + return new Response(); // @TODO + } + private function initUser( Request $request, UserService $userService, From 06dd75eb1ea40a6f1d26bbf25e9b34f7b6a07459 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 03:21:55 +0300 Subject: [PATCH 022/185] fix cyrilic keywords extraction, add reindex all torrents toolkit --- src/Service/TorrentService.php | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index 044700d..0427730 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -134,11 +134,11 @@ class TorrentService } public function readTorrentFileByTorrentId( - int $id + int $torrentId ): ?\Rhilip\Bencode\TorrentFile { return $this->readTorrentFileByFilepath( - $this->getStorageFilepathById($id) + $this->getStorageFilepathByTorrentId($torrentId) ); } @@ -159,7 +159,7 @@ class TorrentService '/[\s]+/', ' ', preg_replace( - '/[\W]+/', + '/[\W_]+/u', ' ', $list['path'] ) @@ -196,12 +196,12 @@ class TorrentService return array_unique($keywords); } - public function getStorageFilepathById(int $id): string + public function getStorageFilepathByTorrentId(int $torrentId): string { return sprintf( '%s/var/torrents/%s.torrent', $this->kernelInterface->getProjectDir(), - implode('/', str_split($id)) + implode('/', str_split($torrentId)) ); } @@ -248,7 +248,7 @@ class TorrentService $filesystem = new Filesystem(); $filesystem->copy( $filepath, - $this->getStorageFilepathById( + $this->getStorageFilepathByTorrentId( $torrent->getId() ) ); @@ -445,6 +445,25 @@ class TorrentService } } + public function reindexTorrentKeywordsAll(): void + { + foreach ($this->entityManagerInterface + ->getRepository(Torrent::class) + ->findAll() as $torrent) + { + $torrent->setKeywords( + $this->generateTorrentKeywordsByTorrentFilepath( + $this->getStorageFilepathByTorrentId( + $torrent->getId() + ) + ) + ); + + $this->entityManagerInterface->persist($torrent); + $this->entityManagerInterface->flush(); + } + } + public function setTorrentApprovedByTorrentId( int $torrentId, bool $value From a285aa315868c39b5ef898faa34ee31421339a8b Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 03:25:23 +0300 Subject: [PATCH 023/185] fix cyrillic tags highlight --- src/Controller/TorrentController.php | 2 +- templates/default/torrent/list.html.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 1f38f46..065aca9 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -254,7 +254,7 @@ class TorrentController extends AbstractController { if (in_array($keyword, $query)) { - $keywords[] = urlencode($keyword); + $keywords[] = $keyword; } } diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index bc0f1ce..729f684 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -45,7 +45,7 @@ {% if torrent.keywords %}
{% for keyword in torrent.keywords %} - + #{{ keyword }} {% endfor %} From d0096cbfe2f51d9406ab9738590f72a569729e33 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 03:28:56 +0300 Subject: [PATCH 024/185] make search keywords case insensitive --- src/Repository/TorrentRepository.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Repository/TorrentRepository.php b/src/Repository/TorrentRepository.php index a8f12f6..67dd457 100644 --- a/src/Repository/TorrentRepository.php +++ b/src/Repository/TorrentRepository.php @@ -76,6 +76,8 @@ class TorrentRepository extends ServiceEntityRepository foreach ($keywords as $i => $keyword) { + $keyword = mb_strtolower($keyword); // all keywords stored in lowercase + $orX->add("t.keywords LIKE :keyword{$i}"); $query->setParameter(":keyword{$i}", "%{$keyword}%"); } From 51682805197d4abb8de93e78e117503998ab372a Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 03:32:07 +0300 Subject: [PATCH 025/185] replace keywords match mode from OR to AND condition --- src/Repository/TorrentRepository.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Repository/TorrentRepository.php b/src/Repository/TorrentRepository.php index 67dd457..035dc3d 100644 --- a/src/Repository/TorrentRepository.php +++ b/src/Repository/TorrentRepository.php @@ -72,21 +72,22 @@ class TorrentRepository extends ServiceEntityRepository if ($keywords) // @TODO ANY or DTS { - $orX = $query->expr()->orX(); + $andX = $query->expr()->andX(); foreach ($keywords as $i => $keyword) { $keyword = mb_strtolower($keyword); // all keywords stored in lowercase - $orX->add("t.keywords LIKE :keyword{$i}"); + $andX->add("t.keywords LIKE :keyword{$i}"); $query->setParameter(":keyword{$i}", "%{$keyword}%"); } - $query->andWhere($orX); + $query->andWhere($andX); } if ($locales) // @TODO ANY or DTS { + //$orX = $query->expr()->orX(); $orX = $query->expr()->orX(); foreach ($locales as $i => $locale) From f5d8759dfe6ec56ea3467cda692880d9c8fc0ac8 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 03:36:18 +0300 Subject: [PATCH 026/185] add filename to keywords index --- src/Service/TorrentService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index 0427730..6c3d2a4 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -189,6 +189,11 @@ class TorrentService $keywords[] = $hash; } + if ($name = $file->getName(false)) + { + $keywords[] = $name; + } + $keywords = array_merge($keywords, $words); } } From 07262f448610d44143e8aa4d31acdb8446e7b8d3 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 04:30:19 +0300 Subject: [PATCH 027/185] require app key on crontab/tool http requests --- .env | 1 + README.md | 2 +- config/services.yaml | 1 + src/Controller/TorrentController.php | 12 +++++++++--- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.env b/.env index b8b6d8a..063fdfd 100644 --- a/.env +++ b/.env @@ -17,6 +17,7 @@ ###> symfony/framework-bundle ### APP_ENV=dev APP_SECRET=EDITME +APP_KEY=EDITME ###< symfony/framework-bundle ### ###> doctrine/doctrine-bundle ### diff --git a/README.md b/README.md index 6a3ee30..a12ecee 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ php bin/console doctrine:migrations:migrate ##### Crontab -* `* * * * * /crontab/torrent/scrape` - update seeding stats +* `* * * * * /crontab/torrent/scrape/{%app.key%}` - update seeding stats ##### App settings diff --git a/config/services.yaml b/config/services.yaml index 4831621..c1ed9ce 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -6,6 +6,7 @@ parameters: app.version: '%env(APP_VERSION)%' app.name: '%env(APP_NAME)%' + app.key: '%env(APP_KEY)%' app.pagination: '%env(APP_PAGINATION)%' app.trackers: '%env(APP_TRACKERS)%' app.locales: '%env(APP_LOCALES)%' diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 065aca9..5bf5dec 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -322,7 +322,7 @@ class TorrentController extends AbstractController } return $this->render('default/torrent/list.html.twig', [ - 'query' => urldecode($request->get('query')), + 'query' => $request->get('query') ? urldecode($request->get('query')) : '', 'torrents' => $torrents, 'pagination' => [ @@ -1752,7 +1752,10 @@ class TorrentController extends AbstractController // Tools #[Route( - '/crontab/torrent/scrape', + '/crontab/torrent/scrape/{key}', + requirements: [ + 'key' => '%app.key%' + ], methods: [ 'GET' @@ -1773,7 +1776,10 @@ class TorrentController extends AbstractController } #[Route( - '/tool/torrent/reindex', + '/tool/torrent/reindex/{key}', + requirements: [ + 'key' => '%app.key%' + ], methods: [ 'GET' From bd7fe4cf049e7c3f05a37b05dd69ed6a29f34278 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 05:39:32 +0300 Subject: [PATCH 028/185] generate keywords based on content extensions --- src/Controller/TorrentController.php | 29 +++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 5bf5dec..cc6bb6a 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -249,6 +249,7 @@ class TorrentController extends AbstractController } // Generate keywords + /* @TODO deprecated, based on active search result $keywords = []; foreach ($torrent->getKeywords() as $keyword) { @@ -257,7 +258,22 @@ class TorrentController extends AbstractController $keywords[] = $keyword; } } + */ + // Generate keywords by extension + $keywords = []; + foreach ($file->getFileList() as $item) + { + if ($keyword = pathinfo($item['path'], PATHINFO_EXTENSION)) + { + $keywords[] = mb_strtolower($keyword); + } + } + $keywords = array_unique($keywords); + + sort($keywords); + + // Push torrent $torrents[] = [ 'id' => $torrent->getId(), @@ -383,17 +399,20 @@ class TorrentController extends AbstractController throw $this->createNotFoundException(); // @TODO exception } - // Generate keywords + // Generate keywords by extension $keywords = []; - $query = explode(' ', mb_strtolower(urldecode($request->query->get('query')))); - foreach ($torrent->getKeywords() as $keyword) + foreach ($file->getFileList() as $item) { - if (in_array($keyword, $query)) + if ($keyword = pathinfo($item['path'], PATHINFO_EXTENSION)) { - $keywords[] = urlencode($keyword); + $keywords[] = mb_strtolower($keyword); } } + $keywords = array_unique($keywords); + sort($keywords); + + // Push torrent $torrents[] = [ 'id' => $torrent->getId(), From 2682666b9446f18c213d571181fda54c3e6b8682 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 05:47:38 +0300 Subject: [PATCH 029/185] decrease listings padding --- templates/default/torrent/list.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 729f684..27dcb2b 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -13,7 +13,7 @@
{% if torrents %} {% for torrent in torrents %} -
+

From 8308ab28f9397616036d2281d4483a16cdde2bfd Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 06:37:22 +0300 Subject: [PATCH 030/185] order keywords by quantity matches in content --- src/Controller/TorrentController.php | 32 +++++++++++++++++++----- templates/default/torrent/list.html.twig | 6 ++--- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index cc6bb6a..078bad9 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -262,16 +262,26 @@ class TorrentController extends AbstractController // Generate keywords by extension $keywords = []; + foreach ($file->getFileList() as $item) { if ($keyword = pathinfo($item['path'], PATHINFO_EXTENSION)) { - $keywords[] = mb_strtolower($keyword); + $keyword = mb_strtolower($keyword); + + if (isset($keywords[$keyword])) + { + $keywords[$keyword]++; + } + + else + { + $keywords[$keyword] = 1; + } } } - $keywords = array_unique($keywords); - sort($keywords); + arsort($keywords); // Push torrent $torrents[] = @@ -401,16 +411,26 @@ class TorrentController extends AbstractController // Generate keywords by extension $keywords = []; + foreach ($file->getFileList() as $item) { if ($keyword = pathinfo($item['path'], PATHINFO_EXTENSION)) { - $keywords[] = mb_strtolower($keyword); + $keyword = mb_strtolower($keyword); + + if (isset($keywords[$keyword])) + { + $keywords[$keyword]++; + } + + else + { + $keywords[$keyword] = 1; + } } } - $keywords = array_unique($keywords); - sort($keywords); + arsort($keywords); // Push torrent $torrents[] = diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 27dcb2b..8c3b35e 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -13,7 +13,7 @@

{% if torrents %} {% for torrent in torrents %} -
+

@@ -44,8 +44,8 @@

{% if torrent.keywords %}
- {% for keyword in torrent.keywords %} - + {% for keyword, quantity in torrent.keywords %} + #{{ keyword }} {% endfor %} From 6ab4dc87c2d354278855390fb0642a232167f7cd Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 06:51:22 +0300 Subject: [PATCH 031/185] add rel/nofollow attributes to the action links --- templates/default/torrent/info.html.twig | 6 +++--- templates/default/torrent/list.html.twig | 6 +++--- templates/default/user/info.html.twig | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index add3bad..a7951b2 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -28,7 +28,7 @@ {#{{ 'Torrent' | trans }} #{{ torrent.id }}#}
- + {% if torrent.download.magnet.exist %} @@ -42,7 +42,7 @@ {{ torrent.download.magnet.total }} - + {% if torrent.download.file.exist %} @@ -56,7 +56,7 @@ {{ torrent.download.file.total }} - + {% if torrent.star.exist %} diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 8c3b35e..8f358df 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -92,7 +92,7 @@ #}
- + {% if user.star.exist %} From 8cf99058464fa0fbbc8d975b250b79b02b2911e0 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 07:03:23 +0300 Subject: [PATCH 032/185] order tags by file size --- src/Controller/TorrentController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 078bad9..a168f85 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -271,12 +271,12 @@ class TorrentController extends AbstractController if (isset($keywords[$keyword])) { - $keywords[$keyword]++; + $keywords[$keyword] = $keywords[$keyword] + (int) $item['size']; } else { - $keywords[$keyword] = 1; + $keywords[$keyword] = 0; } } } @@ -420,12 +420,12 @@ class TorrentController extends AbstractController if (isset($keywords[$keyword])) { - $keywords[$keyword]++; + $keywords[$keyword] = $keywords[$keyword] + (int) $item['size']; } else { - $keywords[$keyword] = 1; + $keywords[$keyword] = 0; } } } From 4c521aef99227b0711ce5f80ae4c37f7e5d0dda5 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 18:47:52 +0300 Subject: [PATCH 033/185] add bittorrent protocol version labels notice --- src/Controller/TorrentController.php | 5 +++++ templates/default/torrent/list.html.twig | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index a168f85..78edd63 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -443,6 +443,11 @@ class TorrentController extends AbstractController [ 'name' => $file->getName(), 'size' => $file->getSize(), + 'hash' => + [ + 'v1' => $file->getInfoHashV1(false), + 'v2' => $file->getInfoHashV2(false) + ], ], 'scrape' => [ diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 8f358df..f4ed3e5 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -28,19 +28,33 @@ {% endif %} {% if torrent.approved == false %} - + {% endif %} {% if torrent.sensitive == true %} - + {% endif %} + {% if torrent.file.hash.v2 %} + + + + + + {% endif %} + {% if torrent.file.hash.v1 and torrent.file.hash.v2 %} + + + + + + {% endif %}
{% if torrent.keywords %}
From b0f7202c8294cfa4bdd28ddf0200d056205549b3 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 21:33:16 +0300 Subject: [PATCH 034/185] add ukrainian translation --- translations/messages+intl-icu.uk.xlf | 590 ++------------------------ 1 file changed, 35 insertions(+), 555 deletions(-) diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 85a8e00..921e622 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -5,665 +5,145 @@ - - File not found - File not found - - - Users - Users - Joined - Joined + Приєднався Approved - Approved - - - Disapproved - Disapproved - - - User statuses - User statuses - - - Enabled - Enabled - - - Disabled - Disabled - - - User moderators - User moderators - - - Added - Added - - - Removed - Removed - - - User stars - User stars - - - Torrents - Torrents - - - Torrent locales - Torrent locales - - - Deleted - Deleted - - - Torrent sensitive - Torrent sensitive - - - Torrent stars - Torrent stars - - - Torrent downloads - Torrent downloads - - - Files - Files - - - Magnet links - Magnet links + Затверджено Access denied - Access denied - - - At least one locale required - At least one locale required + Відмовлено у доступі Torrent file out of size limit - Torrent file out of size limit - - - Torrent file already exists - Torrent file already exists - - - Could not parse torrent file - Could not parse torrent file - - - Torrent file required - Torrent file required - - - B - B - - - Kb - Kb - - - Mb - Mb - - - Gb - Gb - - - Tb - Tb - - - Pb - Pb - - - Eb - Eb - - - Zb - Zb - - - Yb - Yb + Торент-файл поза розміром now - now + щойно year - year + рік month - month + місяць day - day + день hour - hour + година minute - minute + хвилина second - second + секунда years - years + роки months - months + місяці days - days + дні hours - hours + години minutes - minutes + хвилини seconds - seconds + секунди ago - ago - - - Keyword, file, hash... - Keyword, file, hash... + тому Search - Search - - - Recent uploads - Recent uploads - - - Active leechers waiting for seeders - Active leechers waiting for seeders - - - wanted - wanted - - - Waiting for approve - Waiting for approve - - - Content visible for non sensitive users only - Content visible for non sensitive users only - - - Size - Size - - - Seeders - Seeders - - - Peers - Peers - - - Leechers - Leechers - - - Open magnet link - Open magnet link - - - Total - Total - - - Download torrent file - Download torrent file - - - Star - Star - - - Nothing found - Nothing found - - - * share new torrent file to change it - * share new torrent file to change it + Пошук Submit - Submit - - - Submit torrent - Submit torrent + Надіслати Content language - Content language - - - This torrent contains selected languages - This torrent contains selected languages + Мова контенту Sensitive - Sensitive - - - Mark torrent content as sensitive - Mark torrent content as sensitive - - - Edit locales - Edit locales - - - Torrent - Torrent - - - Edit locales for torrent - Edit locales for torrent - - - cancel - cancel - - - by - by + Чутливий вміст identicon - identicon - - - Delete - Delete - - - Disapprove - Disapprove - - - Approve - Approve - - - Edit sensitive status - Edit sensitive status - - - Edit sensitive status for torrent - Edit sensitive status for torrent - - - Page - Page - - - Moderation - Moderation - - - Yes - Yes - - - Toggle - Toggle - - - No - No + піктограма Common - Common - - - ID - ID - - - MD5 - MD5 - - - Info hash v1 - Info hash v1 - - - Info hash v2 - Info hash v2 - - - Created - Created - - - Pieces - Pieces - - - Source - Source - - - Software - Software - - - Comment - Comment - - - Contributors - Contributors - - - Scrape - Scrape - - - Trackers - Trackers - - - Filtered by settings - Filtered by settings - - - Edit - Edit - - - Locales - Locales - - - Recent activity - Recent activity - - - Back - Back - - - Next - Next + Загальні Settings - Settings + Налаштування Interface - Interface - - - Theme - Theme - - - Language - Language - - - Join translation - Join translation - - - Content - Content - - - Activity - Activity - - - Downloads - Downloads - - - Yggdrasil only - Yggdrasil only + Інтерфейс Save - Save + Зберегти Home - Home + Головна Profile - Profile + Профіль User - User - - - Bookmark - Bookmark + Користувач Address - Address + Адреса Address hidden for others - Address hidden for others + Адресу приховано для інших Access - Access + Доступ Status - Status - - - Active - Active + Статус Moderator - Moderator - - - Languages - Languages - - - Events subscribed - Events subscribed - - - undefined event - undefined event - - - have downloaded torrent file - have downloaded torrent file - - - waiting for approve - waiting for approve - - - sensitive - sensitive - - - have downloaded magnet link - have downloaded magnet link - - - have disapproved torrent - have disapproved torrent - - - have approved torrent - have approved torrent - - - have added torrent - have added torrent - - - have deleted locales edition - have deleted locales edition - - - for torrent - for torrent - - - have disapproved locales edition - have disapproved locales edition - - - have approved locales edition - have approved locales edition - - - have added locales edition - have added locales edition - - - have removed star from torrent - have removed star from torrent - - - have added star for torrent - have added star for torrent - - - have deleted sensitive edition - have deleted sensitive edition - - - have disapproved sensitive edition - have disapproved sensitive edition - - - have approved sensitive edition - have approved sensitive edition - - - have added sensitive edition - have added sensitive edition - - - have disabled - have disabled - - - have disabled user - have disabled user - - - have enabled - have enabled - - - have enabled user - have enabled user - - - have disapproved - have disapproved - - - have disapproved user - have disapproved user - - - have approved - have approved - - - have approved user - have approved user - - - have joined - have joined - - - have removed moderator permissions from - have removed moderator permissions from - - - have removed moderator permissions from user - have removed moderator permissions from user - - - have granted moderator permissions to - have granted moderator permissions to - - - have granted moderator permissions to user - have granted moderator permissions to user - - - have removed star from - have removed star from - - - have removed star from user - have removed star from user - - - have added star for - have added star for - - - have added star for user - have added star for user + Модератор From 6bda9c733cb246d9491bf73b8b39cdeb18511b3b Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 21:42:50 +0300 Subject: [PATCH 035/185] update localization strings --- translations/messages+intl-icu.uk.xlf | 532 ++++++++++++++++++++++++++ 1 file changed, 532 insertions(+) diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 921e622..c0a824f 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -145,6 +145,538 @@ Moderator Модератор + + Users + Users + + + Disapproved + Disapproved + + + User statuses + User statuses + + + Enabled + Enabled + + + Disabled + Disabled + + + User moderators + User moderators + + + Added + Added + + + Removed + Removed + + + User stars + User stars + + + Torrents + Torrents + + + Torrent locales + Torrent locales + + + Deleted + Deleted + + + Torrent sensitive + Torrent sensitive + + + Torrent stars + Torrent stars + + + Torrent downloads + Torrent downloads + + + Files + Files + + + Magnet links + Magnet links + + + At least one locale required + At least one locale required + + + Torrent file already exists + Torrent file already exists + + + Could not parse torrent file + Could not parse torrent file + + + Torrent file required + Torrent file required + + + File not found + File not found + + + B + B + + + Kb + Kb + + + Mb + Mb + + + Gb + Gb + + + Tb + Tb + + + Pb + Pb + + + Eb + Eb + + + Zb + Zb + + + Yb + Yb + + + Keyword, file, hash... + Keyword, file, hash... + + + Recent uploads + Recent uploads + + + Active leechers waiting for seeders + Active leechers waiting for seeders + + + wanted + wanted + + + Waiting for approve + Waiting for approve + + + Content visible for non sensitive users only + Content visible for non sensitive users only + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + Contains + Contains + + + Size + Size + + + Seeders + Seeders + + + Peers + Peers + + + Leechers + Leechers + + + Open magnet link + Open magnet link + + + Total + Total + + + Download torrent file + Download torrent file + + + Star + Star + + + Page + Page + + + Back + Back + + + Next + Next + + + Nothing found + Nothing found + + + * share new torrent file to change it + * share new torrent file to change it + + + Submit torrent + Submit torrent + + + This torrent contains selected languages + This torrent contains selected languages + + + Mark torrent content as sensitive + Mark torrent content as sensitive + + + Edit locales + Edit locales + + + Torrent + Torrent + + + Edit locales for torrent + Edit locales for torrent + + + cancel + cancel + + + by + by + + + Delete + Delete + + + Disapprove + Disapprove + + + Approve + Approve + + + Edit sensitive status + Edit sensitive status + + + Edit sensitive status for torrent + Edit sensitive status for torrent + + + Moderation + Moderation + + + Yes + Yes + + + Toggle + Toggle + + + No + No + + + ID + ID + + + MD5 + MD5 + + + Info hash v1 + Info hash v1 + + + Info hash v2 + Info hash v2 + + + Created + Created + + + Pieces + Pieces + + + Source + Source + + + Software + Software + + + Comment + Comment + + + Contributors + Contributors + + + Scrape + Scrape + + + Trackers + Trackers + + + Filtered by settings + Filtered by settings + + + Edit + Edit + + + Locales + Locales + + + Recent activity + Recent activity + + + Theme + Theme + + + Language + Language + + + Join translation + Join translation + + + Content + Content + + + Activity + Activity + + + Downloads + Downloads + + + Yggdrasil only + Yggdrasil only + + + Bookmark + Bookmark + + + Active + Active + + + Languages + Languages + + + Events subscribed + Events subscribed + + + undefined event + undefined event + + + have downloaded torrent file + have downloaded torrent file + + + waiting for approve + waiting for approve + + + sensitive + sensitive + + + have downloaded magnet link + have downloaded magnet link + + + have disapproved torrent + have disapproved torrent + + + have approved torrent + have approved torrent + + + have added torrent + have added torrent + + + have deleted locales edition + have deleted locales edition + + + for torrent + for torrent + + + have disapproved locales edition + have disapproved locales edition + + + have approved locales edition + have approved locales edition + + + have added locales edition + have added locales edition + + + have removed star from torrent + have removed star from torrent + + + have added star for torrent + have added star for torrent + + + have deleted sensitive edition + have deleted sensitive edition + + + have disapproved sensitive edition + have disapproved sensitive edition + + + have approved sensitive edition + have approved sensitive edition + + + have added sensitive edition + have added sensitive edition + + + have disabled + have disabled + + + have disabled user + have disabled user + + + have enabled + have enabled + + + have enabled user + have enabled user + + + have disapproved + have disapproved + + + have disapproved user + have disapproved user + + + have approved + have approved + + + have approved user + have approved user + + + have joined + have joined + + + have removed moderator permissions from + have removed moderator permissions from + + + have removed moderator permissions from user + have removed moderator permissions from user + + + have granted moderator permissions to + have granted moderator permissions to + + + have granted moderator permissions to user + have granted moderator permissions to user + + + have removed star from + have removed star from + + + have removed star from user + have removed star from user + + + have added star for + have added star for + + + have added star for user + have added star for user + From 0923eb22346c00f890d5dc4e72e92c5f4650ff47 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 22:15:09 +0300 Subject: [PATCH 036/185] fix contributors selection --- src/Service/TorrentService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index 6c3d2a4..c34642f 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -214,12 +214,12 @@ class TorrentService { $contributors = []; - foreach ($this->findTorrentLocalesByTorrentId($torrent->getUserId()) as $torrentLocale) + foreach ($this->findTorrentLocalesByTorrentId($torrent->getId()) as $torrentLocale) { $contributors[] = $torrentLocale->getUserId(); } - foreach ($this->findTorrentSensitiveByTorrentId($torrent->getUserId()) as $torrentSensitive) + foreach ($this->findTorrentSensitiveByTorrentId($torrent->getId()) as $torrentSensitive) { $contributors[] = $torrentSensitive->getUserId(); } From 9925d4f57c612be8bc2e23949f226611ac816ecf Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 23:02:28 +0300 Subject: [PATCH 037/185] implement 404, 500 error pages #20 --- .../TwigBundle/Exception/error404.html.twig | 14 ++++++++++++++ .../TwigBundle/Exception/error500.html.twig | 17 +++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 templates/bundles/TwigBundle/Exception/error404.html.twig create mode 100644 templates/bundles/TwigBundle/Exception/error500.html.twig diff --git a/templates/bundles/TwigBundle/Exception/error404.html.twig b/templates/bundles/TwigBundle/Exception/error404.html.twig new file mode 100644 index 0000000..034036c --- /dev/null +++ b/templates/bundles/TwigBundle/Exception/error404.html.twig @@ -0,0 +1,14 @@ +{% extends theme ~ '/layout.html.twig' %} +{% block title %}{{ 'Not found' | trans }} - {{ name }}{% endblock %} +{% block main_content %} +
+
+

+ 404 +

+
+ {{ 'Requested page not found!' | trans }} +
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/bundles/TwigBundle/Exception/error500.html.twig b/templates/bundles/TwigBundle/Exception/error500.html.twig new file mode 100644 index 0000000..8567d21 --- /dev/null +++ b/templates/bundles/TwigBundle/Exception/error500.html.twig @@ -0,0 +1,17 @@ +{% extends theme ~ '/layout.html.twig' %} +{% block title %}{{ 'Error' | trans }} - {{ name }}{% endblock %} +{% block main_content %} +
+ +
+{% endblock %} \ No newline at end of file From dfcd5c438e82230c399ccec80e2ca9f3b5449a4c Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Oct 2023 23:07:53 +0300 Subject: [PATCH 038/185] update 404 message string --- templates/bundles/TwigBundle/Exception/error404.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/bundles/TwigBundle/Exception/error404.html.twig b/templates/bundles/TwigBundle/Exception/error404.html.twig index 034036c..4509a25 100644 --- a/templates/bundles/TwigBundle/Exception/error404.html.twig +++ b/templates/bundles/TwigBundle/Exception/error404.html.twig @@ -7,7 +7,7 @@ 404
- {{ 'Requested page not found!' | trans }} + {{ 'Page not found!' | trans }}
From 69a463f0b0f6fef4df77ee827f08ba811ca272d9 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 00:37:11 +0300 Subject: [PATCH 039/185] complete ukrainian localization --- .../default/activity/event/user/add.html.twig | 2 +- .../default/activity/event/user/add.rss.twig | 2 +- translations/messages+intl-icu.uk.xlf | 824 +++++++++--------- 3 files changed, 408 insertions(+), 420 deletions(-) diff --git a/templates/default/activity/event/user/add.html.twig b/templates/default/activity/event/user/add.html.twig index ad3a920..974a8d1 100644 --- a/templates/default/activity/event/user/add.html.twig +++ b/templates/default/activity/event/user/add.html.twig @@ -5,7 +5,7 @@ {{ 'identicon' | trans }} - {{ 'have joined' | trans }} {{ name }} + {{ 'have joined' | trans }}
diff --git a/templates/default/activity/event/user/add.rss.twig b/templates/default/activity/event/user/add.rss.twig index 9c0a9ea..4f4fdd1 100644 --- a/templates/default/activity/event/user/add.rss.twig +++ b/templates/default/activity/event/user/add.rss.twig @@ -1,5 +1,5 @@ - {{ 'User' | trans }} #{{ user.id }} {{ 'have joined' | trans }} {{ name }} + {{ 'User' | trans }} #{{ user.id }} {{ 'have joined' | trans }} #{{ user.id }} {{ added | date('D, d M Y h:i:s O') }} {{ url('user_info', { userId : user.id }) }}#activity-{{ id }} diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index c0a824f..4130529 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -5,6 +5,14 @@ + + File not found + Файл не знайдений + + + Users + Користувачі + Joined Приєднався @@ -13,14 +21,130 @@ Approved Затверджено + + Disapproved + Відхилено + + + User statuses + Статуси користувача + + + Enabled + Увімкнено + + + Disabled + Вимкнено + + + User moderators + Модератори + + + Added + Додано + + + Removed + Видалено + + + User stars + Зірки користувача + + + Torrents + Торенти + + + Torrent locales + Файли торентів + + + Deleted + Видалено + + + Torrent sensitive + Чутливий вміст + + + Torrent stars + Зірки торенту + + + Torrent downloads + Завантаження торенту + + + Files + Файли + + + Magnet links + Magnet-посилання + Access denied Відмовлено у доступі + + At least one locale required + Необхідна принаймні одна локаль + Torrent file out of size limit Торент-файл поза розміром + + Torrent file already exists + Торент-файл вже існує + + + Could not parse torrent file + Не вдалося проаналізувати торент-файл + + + Torrent file required + Необхідно надати торент файл + + + B + Б + + + Kb + Кб + + + Mb + Мб + + + Gb + Гб + + + Tb + Тб + + + Pb + Пб + + + Eb + Еб + + + Zb + Зб + + + Yb + Іб + now щойно @@ -77,30 +201,238 @@ ago тому + + Keyword, file, hash... + Ключове слово, файл, хеш... + Search Пошук + + Recent uploads + Останні завантаження + + + Active leechers waiting for seeders + Активні лічери очікують сідів + + + wanted + розшукується + + + Waiting for approve + Очікує на підтвердження + + + Content visible for non sensitive users only + Контент видимий лише для нечутливих користувачів + + + Size + Розмір + + + Seeders + Сідери + + + Peers + Піри + + + Leechers + Лічери + + + Open magnet link + Відкрити посилання на magnet + + + Total + Всього + + + Download torrent file + Завантажити торрент файл + + + Star + Зірка + + + Nothing found + Нічого не знайдено + + + * share new torrent file to change it + * поширте новий торент-файл, щоб змінити це + Submit Надіслати + + Submit torrent + Надіслати торент + Content language Мова контенту + + This torrent contains selected languages + Цей торрент містить обрані мови + Sensitive Чутливий вміст + + Mark torrent content as sensitive + Помітити вміст торенту як чутливий + + + Edit locales + Редагувати локалі + + + Torrent + Торент + + + Edit locales for torrent + Редагування локалей для торенту + + + cancel + скасувати + + + by + за участі + identicon піктограма + + Delete + Видалити + + + Disapprove + Відхилити + + + Approve + Затверджено + + + Edit sensitive status + Редагувати статус чутливості + + + Edit sensitive status for torrent + Редагувати статус чутливості для торенту + + + Page + Сторінка + + + Moderation + Модерація + + + Yes + Так + + + Toggle + Перемкнути + + + No + Ні + Common Загальні + + ID + ID + + + MD5 + MD5 + + + Info hash v1 + Інфо-хеш версії 1 + + + Info hash v2 + Інфо-хеш версії 2 + + + Created + Створено + + + Pieces + Частини + + + Source + Джерело + + + Software + Програмне забезпечення + + + Comment + Коментар + + + Contributors + Учасники + + + Scrape + Стан + + + Trackers + Трекери + + + Filtered by settings + Відфільтровано згідно з налаштуваннями + + + Edit + Редагувати + + + Locales + Локалі + + + Recent activity + Остання активність + + + Back + Назад + + + Next + Далі + Settings Налаштування @@ -109,6 +441,34 @@ Interface Інтерфейс + + Theme + Тема + + + Language + Мова + + + Join translation + Приєднатись до перекладу + + + Content + Контент + + + Activity + Активність + + + Downloads + Завантаження + + + Yggdrasil only + Тільки Іґдрасіль + Save Зберегти @@ -125,6 +485,10 @@ User Користувач + + Bookmark + Додати до обраного + Address Адреса @@ -141,541 +505,165 @@ Status Статус + + Active + Активний + Moderator Модератор - - Users - Users - - - Disapproved - Disapproved - - - User statuses - User statuses - - - Enabled - Enabled - - - Disabled - Disabled - - - User moderators - User moderators - - - Added - Added - - - Removed - Removed - - - User stars - User stars - - - Torrents - Torrents - - - Torrent locales - Torrent locales - - - Deleted - Deleted - - - Torrent sensitive - Torrent sensitive - - - Torrent stars - Torrent stars - - - Torrent downloads - Torrent downloads - - - Files - Files - - - Magnet links - Magnet links - - - At least one locale required - At least one locale required - - - Torrent file already exists - Torrent file already exists - - - Could not parse torrent file - Could not parse torrent file - - - Torrent file required - Torrent file required - - - File not found - File not found - - - B - B - - - Kb - Kb - - - Mb - Mb - - - Gb - Gb - - - Tb - Tb - - - Pb - Pb - - - Eb - Eb - - - Zb - Zb - - - Yb - Yb - - - Keyword, file, hash... - Keyword, file, hash... - - - Recent uploads - Recent uploads - - - Active leechers waiting for seeders - Active leechers waiting for seeders - - - wanted - wanted - - - Waiting for approve - Waiting for approve - - - Content visible for non sensitive users only - Content visible for non sensitive users only - - - BitTorrent protocol version 2 - BitTorrent protocol version 2 - - - BitTorrent protocol version 1 - BitTorrent protocol version 1 - - - Contains - Contains - - - Size - Size - - - Seeders - Seeders - - - Peers - Peers - - - Leechers - Leechers - - - Open magnet link - Open magnet link - - - Total - Total - - - Download torrent file - Download torrent file - - - Star - Star - - - Page - Page - - - Back - Back - - - Next - Next - - - Nothing found - Nothing found - - - * share new torrent file to change it - * share new torrent file to change it - - - Submit torrent - Submit torrent - - - This torrent contains selected languages - This torrent contains selected languages - - - Mark torrent content as sensitive - Mark torrent content as sensitive - - - Edit locales - Edit locales - - - Torrent - Torrent - - - Edit locales for torrent - Edit locales for torrent - - - cancel - cancel - - - by - by - - - Delete - Delete - - - Disapprove - Disapprove - - - Approve - Approve - - - Edit sensitive status - Edit sensitive status - - - Edit sensitive status for torrent - Edit sensitive status for torrent - - - Moderation - Moderation - - - Yes - Yes - - - Toggle - Toggle - - - No - No - - - ID - ID - - - MD5 - MD5 - - - Info hash v1 - Info hash v1 - - - Info hash v2 - Info hash v2 - - - Created - Created - - - Pieces - Pieces - - - Source - Source - - - Software - Software - - - Comment - Comment - - - Contributors - Contributors - - - Scrape - Scrape - - - Trackers - Trackers - - - Filtered by settings - Filtered by settings - - - Edit - Edit - - - Locales - Locales - - - Recent activity - Recent activity - - - Theme - Theme - - - Language - Language - - - Join translation - Join translation - - - Content - Content - - - Activity - Activity - - - Downloads - Downloads - - - Yggdrasil only - Yggdrasil only - - - Bookmark - Bookmark - - - Active - Active - Languages - Languages + Мови Events subscribed - Events subscribed + Підписка на події undefined event - undefined event + невідома подія have downloaded torrent file - have downloaded torrent file + завантажив торрент файл waiting for approve - waiting for approve + очікує на підтвердження sensitive - sensitive + чутливий вміст have downloaded magnet link - have downloaded magnet link + завантажив торрент файл have disapproved torrent - have disapproved torrent + відхилив торент have approved torrent - have approved torrent + затвердив торент have added torrent - have added torrent + додав торент have deleted locales edition - have deleted locales edition + видалено версію локалей for torrent - for torrent + для торенту have disapproved locales edition - have disapproved locales edition + відхилив версію локалей have approved locales edition - have approved locales edition + затвердив версію локалей have added locales edition - have added locales edition + додав редакцію локалей have removed star from torrent - have removed star from torrent + видалив зірку з торента have added star for torrent - have added star for torrent + додав зірку для торента have deleted sensitive edition - have deleted sensitive edition + видалив редакцію чутливого вмісту have disapproved sensitive edition - have disapproved sensitive edition + відхилив редакцію чутливого вмісту have approved sensitive edition - have approved sensitive edition + затвердив редакцію чутливого вмісту have added sensitive edition - have added sensitive edition + додав редакцію чутливого вмісту have disabled - have disabled + вимкнув have disabled user - have disabled user + вимкнув користувача have enabled - have enabled + увімкнув have enabled user - have enabled user + увімкнув користувача have disapproved - have disapproved + відхилив have disapproved user - have disapproved user + відхилив користувача have approved - have approved + затвердив have approved user - have approved user + затвердив користувача have joined - have joined + приєднався have removed moderator permissions from - have removed moderator permissions from + видалив права модератора від have removed moderator permissions from user - have removed moderator permissions from user + видалив права модератора від користувача have granted moderator permissions to - have granted moderator permissions to + надано права модератора have granted moderator permissions to user - have granted moderator permissions to user + надано права модератора користувачеві have removed star from - have removed star from + видалив зірку від have removed star from user - have removed star from user + видалив зірку від користувача have added star for - have added star for + додав зірку до have added star for user - have added star for user + додав зірку користувачеві From 7587b38831e5efb6f624120fecfd6678bda12b9b Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 00:42:38 +0300 Subject: [PATCH 040/185] extract new strings --- translations/messages+intl-icu.cs.xlf | 36 +++++++++++++++++++++++++++ translations/messages+intl-icu.de.xlf | 36 +++++++++++++++++++++++++++ translations/messages+intl-icu.en.xlf | 36 +++++++++++++++++++++++++++ translations/messages+intl-icu.eo.xlf | 36 +++++++++++++++++++++++++++ translations/messages+intl-icu.es.xlf | 36 +++++++++++++++++++++++++++ translations/messages+intl-icu.fr.xlf | 36 +++++++++++++++++++++++++++ translations/messages+intl-icu.he.xlf | 36 +++++++++++++++++++++++++++ translations/messages+intl-icu.it.xlf | 36 +++++++++++++++++++++++++++ translations/messages+intl-icu.ka.xlf | 36 +++++++++++++++++++++++++++ translations/messages+intl-icu.lv.xlf | 36 +++++++++++++++++++++++++++ translations/messages+intl-icu.pl.xlf | 36 +++++++++++++++++++++++++++ translations/messages+intl-icu.pt.xlf | 36 +++++++++++++++++++++++++++ translations/messages+intl-icu.ru.xlf | 36 +++++++++++++++++++++++++++ translations/messages+intl-icu.uk.xlf | 36 +++++++++++++++++++++++++++ 14 files changed, 504 insertions(+) diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index fd1d625..440916e 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -665,6 +665,42 @@ have added star for user have added star for user + + Error + Error + + + Oops! + Oops! + + + Internal server error + Internal server error + + + Report + Report + + + Not found + Not found + + + Page not found! + Page not found! + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + Contains + Contains + diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index 2ccf8ab..034a5fb 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -665,6 +665,42 @@ have added star for user have added star for user + + Error + Error + + + Oops! + Oops! + + + Internal server error + Internal server error + + + Report + Report + + + Not found + Not found + + + Page not found! + Page not found! + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + Contains + Contains + diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index 308f1eb..d8598c5 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -665,6 +665,42 @@ have added star for user have added star for user + + Error + Error + + + Oops! + Oops! + + + Internal server error + Internal server error + + + Report + Report + + + Not found + Not found + + + Page not found! + Page not found! + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + Contains + Contains + diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index 207f2ef..1eed2b9 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -665,6 +665,42 @@ have added star for user have added star for user + + Error + Error + + + Oops! + Oops! + + + Internal server error + Internal server error + + + Report + Report + + + Not found + Not found + + + Page not found! + Page not found! + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + Contains + Contains + diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index cc77035..d0e57b1 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -665,6 +665,42 @@ have added star for user have added star for user + + Error + Error + + + Oops! + Oops! + + + Internal server error + Internal server error + + + Report + Report + + + Not found + Not found + + + Page not found! + Page not found! + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + Contains + Contains + diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index 7c262a4..36af0d9 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -665,6 +665,42 @@ have added star for user have added star for user + + Error + Error + + + Oops! + Oops! + + + Internal server error + Internal server error + + + Report + Report + + + Not found + Not found + + + Page not found! + Page not found! + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + Contains + Contains + diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index e0da032..6dc280a 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -665,6 +665,42 @@ have added star for user have added star for user + + Error + Error + + + Oops! + Oops! + + + Internal server error + Internal server error + + + Report + Report + + + Not found + Not found + + + Page not found! + Page not found! + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + Contains + Contains + diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index 90a2bdc..b03fca9 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -665,6 +665,42 @@ have added star for user have added star for user + + Error + Error + + + Oops! + Oops! + + + Internal server error + Internal server error + + + Report + Report + + + Not found + Not found + + + Page not found! + Page not found! + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + Contains + Contains + diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index 910808f..828a7d9 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -665,6 +665,42 @@ have added star for user have added star for user + + Error + Error + + + Oops! + Oops! + + + Internal server error + Internal server error + + + Report + Report + + + Not found + Not found + + + Page not found! + Page not found! + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + Contains + Contains + diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index 3f47604..a3c4133 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -665,6 +665,42 @@ have added star for user have added star for user + + Error + Error + + + Oops! + Oops! + + + Internal server error + Internal server error + + + Report + Report + + + Not found + Not found + + + Page not found! + Page not found! + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + Contains + Contains + diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index 0e3533a..c74e06b 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -665,6 +665,42 @@ have added star for user have added star for user + + Error + Error + + + Oops! + Oops! + + + Internal server error + Internal server error + + + Report + Report + + + Not found + Not found + + + Page not found! + Page not found! + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + Contains + Contains + diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index 3d7be42..372cc58 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -665,6 +665,42 @@ have added star for user have added star for user + + Error + Error + + + Oops! + Oops! + + + Internal server error + Internal server error + + + Report + Report + + + Not found + Not found + + + Page not found! + Page not found! + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + Contains + Contains + diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index f742dc9..c9eeb09 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -665,6 +665,42 @@ have added star for user have added star for user + + Error + Error + + + Oops! + Oops! + + + Internal server error + Internal server error + + + Report + Report + + + Not found + Not found + + + Page not found! + Page not found! + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + Contains + Contains + diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 4130529..f617bf4 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -665,6 +665,42 @@ have added star for user додав зірку користувачеві + + Error + Error + + + Oops! + Oops! + + + Internal server error + Internal server error + + + Report + Report + + + Not found + Not found + + + Page not found! + Page not found! + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + Contains + Contains + From 111fe6a7b5ddb8ebe49907806a0347ed2379ad54 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 01:06:18 +0300 Subject: [PATCH 041/185] add new strings translation --- translations/messages+intl-icu.uk.xlf | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index f617bf4..c62b505 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -667,39 +667,39 @@ Error - Error + Помилка Oops! - Oops! + Ой! Internal server error - Internal server error + Внутрішня помилка сервера Report - Report + Звіт Not found - Not found + Не знайдено Page not found! - Page not found! + Сторінку не знайдено! BitTorrent protocol version 2 - BitTorrent protocol version 2 + BitTorrent протокол версії 2 BitTorrent protocol version 1 - BitTorrent protocol version 1 + BitTorrent протокол версії 1 Contains - Contains + Містить From 7dfb1333284a17fe0b2f4ecb7c9c794a2d256720 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 01:08:45 +0300 Subject: [PATCH 042/185] add localization badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a12ecee..3a2c3be 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # YGGtracker +[![Crowdin](https://badges.crowdin.net/yggtracker/localized.svg)](https://crowdin.com/project/yggtracker) + BitTorrent Registry for Yggdrasil YGGtracker uses [Yggdrasil](https://github.com/yggdrasil-network/yggdrasil-go) IPv6 addresses to identify users without registration. From bc67ae21980648a25c7883b3770c21dc53f4761e Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 01:19:54 +0300 Subject: [PATCH 043/185] require allowed locales in routing requests --- src/Controller/ActivityController.php | 12 ++++-------- src/Controller/TorrentController.php | 28 +++++++++++++++++++++++---- src/Controller/UserController.php | 16 +++++++-------- 3 files changed, 36 insertions(+), 20 deletions(-) diff --git a/src/Controller/ActivityController.php b/src/Controller/ActivityController.php index 643371e..2f62d78 100644 --- a/src/Controller/ActivityController.php +++ b/src/Controller/ActivityController.php @@ -17,6 +17,9 @@ class ActivityController extends AbstractController #[Route( '/{_locale}/activity', name: 'activity_all', + requirements: [ + '_locale' => '%app.locales%' + ], methods: [ 'GET' @@ -64,9 +67,6 @@ class ActivityController extends AbstractController #[Route( '/{_locale}/rss/activity', name: 'rss_activity', - defaults: [ - '_locale' => '%app.locale%' - ], requirements: [ '_locale' => '%app.locales%' ], @@ -112,7 +112,6 @@ class ActivityController extends AbstractController '/{_locale}/rss/activity/user/{userId}', name: 'rss_activity_user', defaults: [ - '_locale' => '%app.locale%', 'userId' => 0 ], requirements: [ @@ -170,11 +169,8 @@ class ActivityController extends AbstractController #[Route( '/{_locale}/rss/activity/torrent/{torrentId}', name: 'rss_activity_torrent', - defaults: [ - '_locale' => '%app.locale%', - ], requirements: [ - '_locale' => '%app.locales%', + '_locale' => '%app.locales%', 'torrentId' => '\d+' ], methods: diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 78edd63..a328cbc 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -21,6 +21,7 @@ class TorrentController extends AbstractController name: 'torrent_info', requirements: [ + '_locale' => '%app.locales%', 'torrentId' => '\d+', ], methods: @@ -201,6 +202,10 @@ class TorrentController extends AbstractController #[Route( '/{_locale}/search', name: 'torrent_search', + requirements: + [ + '_locale' => '%app.locales%' + ], methods: [ 'GET' @@ -362,6 +367,10 @@ class TorrentController extends AbstractController #[Route( '/{_locale}', name: 'torrent_recent', + requirements: + [ + '_locale' => '%app.locales%' + ], methods: [ 'GET' @@ -515,9 +524,6 @@ class TorrentController extends AbstractController #[Route( '/{_locale}/rss/torrents', name: 'rss_torrents_recent', - defaults: [ - '_locale' => '%app.locale%' - ], requirements: [ '_locale' => '%app.locales%' ], @@ -596,6 +602,10 @@ class TorrentController extends AbstractController #[Route( '/{_locale}/submit', name: 'torrent_submit', + requirements: + [ + '_locale' => '%app.locales%' + ], methods: [ 'GET', @@ -746,6 +756,7 @@ class TorrentController extends AbstractController name: 'torrent_approve_toggle', requirements: [ + '_locale' => '%app.locales%', 'torrentId' => '\d+', ], methods: @@ -822,6 +833,7 @@ class TorrentController extends AbstractController name: 'torrent_locales_edit', requirements: [ + '_locale' => '%app.locales%', 'torrentId' => '\d+', 'torrentLocalesId' => '\d+', ], @@ -1021,6 +1033,7 @@ class TorrentController extends AbstractController name: 'torrent_locales_approve', requirements: [ + '_locale' => '%app.locales%', 'torrentId' => '\d+', 'torrentLocalesId' => '\d+', ], @@ -1107,6 +1120,7 @@ class TorrentController extends AbstractController name: 'torrent_locales_delete', requirements: [ + '_locale' => '%app.locales%', 'torrentId' => '\d+', 'torrentLocalesId' => '\d+', ], @@ -1181,7 +1195,8 @@ class TorrentController extends AbstractController name: 'torrent_sensitive_edit', requirements: [ - 'torrentId' => '\d+', + '_locale' => '%app.locales%', + 'torrentId' => '\d+', 'torrentSensitiveId' => '\d+', ], defaults: @@ -1350,6 +1365,7 @@ class TorrentController extends AbstractController name: 'torrent_sensitive_approve', requirements: [ + '_locale' => '%app.locales%', 'torrentId' => '\d+', 'torrentSensitiveId' => '\d+', ], @@ -1436,6 +1452,7 @@ class TorrentController extends AbstractController name: 'torrent_sensitive_delete', requirements: [ + '_locale' => '%app.locales%', 'torrentId' => '\d+', 'torrentSensitiveId' => '\d+', ], @@ -1510,6 +1527,7 @@ class TorrentController extends AbstractController name: 'torrent_star_toggle', requirements: [ + '_locale' => '%app.locales%', 'torrentId' => '\d+', ], methods: @@ -1588,6 +1606,7 @@ class TorrentController extends AbstractController name: 'torrent_download_file', requirements: [ + '_locale' => '%app.locales%', 'torrentId' => '\d+', ], methods: @@ -1708,6 +1727,7 @@ class TorrentController extends AbstractController name: 'torrent_download_magnet', requirements: [ + '_locale' => '%app.locales%', 'torrentId' => '\d+', ], methods: diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index 574a1e4..4b75626 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -40,9 +40,6 @@ class UserController extends AbstractController #[Route( '/{_locale}/settings', name: 'user_settings', - defaults: [ - '_locale' => '%app.locale%' - ], requirements: [ '_locale' => '%app.locales%', ], @@ -157,7 +154,6 @@ class UserController extends AbstractController '/{_locale}/profile/{userId}', name: 'user_info', defaults: [ - '_locale' => '%app.locale%', 'userId' => 0, ], requirements: [ @@ -265,7 +261,8 @@ class UserController extends AbstractController name: 'user_star_toggle', requirements: [ - 'userId' => '\d+', + '_locale' => '%app.locales%', + 'userId' => '\d+', ], methods: [ @@ -341,7 +338,8 @@ class UserController extends AbstractController name: 'user_moderator_toggle', requirements: [ - 'userId' => '\d+', + '_locale' => '%app.locales%', + 'userId' => '\d+', ], methods: [ @@ -415,7 +413,8 @@ class UserController extends AbstractController name: 'user_status_toggle', requirements: [ - 'userId' => '\d+', + '_locale' => '%app.locales%', + 'userId' => '\d+', ], methods: [ @@ -489,7 +488,8 @@ class UserController extends AbstractController name: 'user_approved_toggle', requirements: [ - 'userId' => '\d+', + '_locale' => '%app.locales%', + 'userId' => '\d+', ], methods: [ From 1cd252b610ce6ffd6fb42a9a71f282d232a7b907 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 01:23:13 +0300 Subject: [PATCH 044/185] remove deprecated construction --- templates/default/torrent/list.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index f4ed3e5..130472b 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -59,7 +59,7 @@ {% if torrent.keywords %}
{% for keyword, quantity in torrent.keywords %} - + #{{ keyword }} {% endfor %} From 8e204312e01e29e532fdb949318fede81a2655ba Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 01:35:52 +0300 Subject: [PATCH 045/185] update menu position --- public/asset/default/css/framework.css | 5 +++++ templates/default/user/module.html.twig | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/public/asset/default/css/framework.css b/public/asset/default/css/framework.css index 0a90826..5a2ef07 100644 --- a/public/asset/default/css/framework.css +++ b/public/asset/default/css/framework.css @@ -354,6 +354,11 @@ a:visited.background-color-hover-night-light:hover { padding-right: 24px; } +.padding-y-24-px { + padding-top: 24px; + padding-bottom: 24px; +} + .margin-l-4-px { margin-left: 4px; } diff --git a/templates/default/user/module.html.twig b/templates/default/user/module.html.twig index 14978f6..5dc7e51 100644 --- a/templates/default/user/module.html.twig +++ b/templates/default/user/module.html.twig @@ -1,4 +1,4 @@ -
+
{% if route == 'torrent_recent' %} From 1f51c56c0dcec57eec6242aaee563ac4156ba7b7 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 01:42:42 +0300 Subject: [PATCH 046/185] fix time ago strings interpretation --- src/Twig/AppExtension.php | 29 ++++---- translations/messages+intl-icu.cs.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.de.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.en.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.eo.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.es.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.fr.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.he.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.it.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.ka.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.lv.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.pl.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.pt.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.ru.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.uk.xlf | 102 ++++++++++++-------------- 15 files changed, 672 insertions(+), 785 deletions(-) diff --git a/src/Twig/AppExtension.php b/src/Twig/AppExtension.php index 50d142d..512e626 100644 --- a/src/Twig/AppExtension.php +++ b/src/Twig/AppExtension.php @@ -77,21 +77,21 @@ class AppExtension extends AbstractExtension $values = [ - 365 * 24 * 60 * 60 => $this->translator->trans('year'), - 30 * 24 * 60 * 60 => $this->translator->trans('month'), - 24 * 60 * 60 => $this->translator->trans('day'), - 60 * 60 => $this->translator->trans('hour'), - 60 => $this->translator->trans('minute'), - 1 => $this->translator->trans('second') + 365 * 24 * 60 * 60 => $this->translator->trans('year ago'), + 30 * 24 * 60 * 60 => $this->translator->trans('month ago'), + 24 * 60 * 60 => $this->translator->trans('day ago'), + 60 * 60 => $this->translator->trans('hour ago'), + 60 => $this->translator->trans('minute ago'), + 1 => $this->translator->trans('second ago') ]; $plural = [ - $this->translator->trans('year') => $this->translator->trans('years'), - $this->translator->trans('month') => $this->translator->trans('months'), - $this->translator->trans('day') => $this->translator->trans('days'), - $this->translator->trans('hour') => $this->translator->trans('hours'), - $this->translator->trans('minute') => $this->translator->trans('minutes'), - $this->translator->trans('second') => $this->translator->trans('seconds') + $this->translator->trans('year ago') => $this->translator->trans('years ago'), + $this->translator->trans('month ago') => $this->translator->trans('months ago'), + $this->translator->trans('day ago') => $this->translator->trans('days ago'), + $this->translator->trans('hour ago') => $this->translator->trans('hours ago'), + $this->translator->trans('minute ago') => $this->translator->trans('minutes ago'), + $this->translator->trans('second ago') => $this->translator->trans('seconds ago') ]; foreach ($values as $key => $value) @@ -103,10 +103,9 @@ class AppExtension extends AbstractExtension $round = round($result); return sprintf( - '%s %s %s', + '%s %s', $round, - $round > 1 ? $plural[$value] : $value, - $this->translator->trans('ago') + $round > 1 ? $plural[$value] : $value ); } } diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index 440916e..6d443b2 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index 034a5fb..65f9d0f 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index d8598c5..645cd13 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index 1eed2b9..22c47ad 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index d0e57b1..a134173 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index 36af0d9..d1dbedb 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index 6dc280a..55a8c0d 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index b03fca9..717e893 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index 828a7d9..8986d66 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index a3c4133..898de96 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index c74e06b..d901ba2 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index 372cc58..71b3a04 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index c9eeb09..24642b6 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index c62b505..95a2405 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -149,58 +149,6 @@ now щойно - - year - рік - - - month - місяць - - - day - день - - - hour - година - - - minute - хвилина - - - second - секунда - - - years - роки - - - months - місяці - - - days - дні - - - hours - години - - - minutes - хвилини - - - seconds - секунди - - - ago - тому - Keyword, file, hash... Ключове слово, файл, хеш... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent протокол версії 1 - - Contains - Містить + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago From 3005b16c947024fc2ddecd6df86e94038a601d48 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 01:45:12 +0300 Subject: [PATCH 047/185] update translation strings --- translations/messages+intl-icu.uk.xlf | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 95a2405..e02bdc1 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -647,51 +647,51 @@ year ago - year ago + рік тому month ago - month ago + місяць тому day ago - day ago + день тому hour ago - hour ago + годину тому minute ago - minute ago + хвилину тому second ago - second ago + секунду тому years ago - years ago + років тому months ago - months ago + місяців тому days ago - days ago + днів тому hours ago - hours ago + годин тому minutes ago - minutes ago + хвилин тому seconds ago - seconds ago + секунд тому From 453d70b7cb910b9a4bebc9b245fe5eea0bf0a06c Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 02:30:55 +0300 Subject: [PATCH 048/185] add cyrillic plural forms support --- src/Twig/AppExtension.php | 63 ++++++++++++++++++++------- translations/messages+intl-icu.cs.xlf | 24 ++++++++++ translations/messages+intl-icu.de.xlf | 24 ++++++++++ translations/messages+intl-icu.en.xlf | 24 ++++++++++ translations/messages+intl-icu.eo.xlf | 24 ++++++++++ translations/messages+intl-icu.es.xlf | 24 ++++++++++ translations/messages+intl-icu.fr.xlf | 24 ++++++++++ translations/messages+intl-icu.he.xlf | 24 ++++++++++ translations/messages+intl-icu.it.xlf | 24 ++++++++++ translations/messages+intl-icu.ka.xlf | 24 ++++++++++ translations/messages+intl-icu.lv.xlf | 24 ++++++++++ translations/messages+intl-icu.pl.xlf | 24 ++++++++++ translations/messages+intl-icu.pt.xlf | 24 ++++++++++ translations/messages+intl-icu.ru.xlf | 24 ++++++++++ translations/messages+intl-icu.uk.xlf | 24 ++++++++++ 15 files changed, 383 insertions(+), 16 deletions(-) diff --git a/src/Twig/AppExtension.php b/src/Twig/AppExtension.php index 512e626..6cf5813 100644 --- a/src/Twig/AppExtension.php +++ b/src/Twig/AppExtension.php @@ -77,21 +77,42 @@ class AppExtension extends AbstractExtension $values = [ - 365 * 24 * 60 * 60 => $this->translator->trans('year ago'), - 30 * 24 * 60 * 60 => $this->translator->trans('month ago'), - 24 * 60 * 60 => $this->translator->trans('day ago'), - 60 * 60 => $this->translator->trans('hour ago'), - 60 => $this->translator->trans('minute ago'), - 1 => $this->translator->trans('second ago') - ]; - - $plural = [ - $this->translator->trans('year ago') => $this->translator->trans('years ago'), - $this->translator->trans('month ago') => $this->translator->trans('months ago'), - $this->translator->trans('day ago') => $this->translator->trans('days ago'), - $this->translator->trans('hour ago') => $this->translator->trans('hours ago'), - $this->translator->trans('minute ago') => $this->translator->trans('minutes ago'), - $this->translator->trans('second ago') => $this->translator->trans('seconds ago') + 365 * 24 * 60 * 60 => + [ + $this->translator->trans('year ago'), + $this->translator->trans('years ago'), + $this->translator->trans(' years ago') + ], + 30 * 24 * 60 * 60 => + [ + $this->translator->trans('month ago'), + $this->translator->trans('months ago'), + $this->translator->trans(' months ago') + ], + 24 * 60 * 60 => + [ + $this->translator->trans('day ago'), + $this->translator->trans('days ago'), + $this->translator->trans(' days ago') + ], + 60 * 60 => + [ + $this->translator->trans('hour ago'), + $this->translator->trans('hours ago'), + $this->translator->trans(' hours ago') + ], + 60 => + [ + $this->translator->trans('minute ago'), + $this->translator->trans('minutes ago'), + $this->translator->trans(' minutes ago') + ], + 1 => + [ + $this->translator->trans('second ago'), + $this->translator->trans('seconds ago'), + $this->translator->trans(' seconds ago') + ] ]; foreach ($values as $key => $value) @@ -105,9 +126,19 @@ class AppExtension extends AbstractExtension return sprintf( '%s %s', $round, - $round > 1 ? $plural[$value] : $value + $this->plural( + $round, + $value + ) ); } } } + + private function plural(int $number, array $texts) + { + $cases = [2, 0, 1, 1, 1, 2]; + + return $texts[(($number % 100) > 4 && ($number % 100) < 20) ? 2 : $cases[min($number % 10, 5)]]; + } } \ No newline at end of file diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index 6d443b2..e31d182 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -693,6 +693,30 @@ seconds ago seconds ago + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index 65f9d0f..ea05fbf 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -693,6 +693,30 @@ seconds ago seconds ago + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index 645cd13..ce8592b 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -693,6 +693,30 @@ seconds ago seconds ago + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index 22c47ad..f3109f7 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -693,6 +693,30 @@ seconds ago seconds ago + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index a134173..8214c8d 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -693,6 +693,30 @@ seconds ago seconds ago + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index d1dbedb..a9ceeed 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -693,6 +693,30 @@ seconds ago seconds ago + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index 55a8c0d..57093c5 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -693,6 +693,30 @@ seconds ago seconds ago + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index 717e893..40c0271 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -693,6 +693,30 @@ seconds ago seconds ago + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index 8986d66..9d4e4c3 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -693,6 +693,30 @@ seconds ago seconds ago + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index 898de96..4077e03 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -693,6 +693,30 @@ seconds ago seconds ago + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index d901ba2..98a947a 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -693,6 +693,30 @@ seconds ago seconds ago + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index 71b3a04..e0d5cf7 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -693,6 +693,30 @@ seconds ago seconds ago + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index 24642b6..23e3246 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -693,6 +693,30 @@ seconds ago seconds ago + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index e02bdc1..6b65887 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -693,6 +693,30 @@ seconds ago секунд тому + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + From b7238eaf9f2dca6537f90473e2b15bae838503d3 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 02:37:23 +0300 Subject: [PATCH 049/185] fix plural forms in ukrainian translation --- translations/messages+intl-icu.uk.xlf | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 6b65887..d49d223 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -671,51 +671,51 @@ years ago - років тому + роки тому months ago - місяців тому + місяці тому days ago - днів тому + дні тому hours ago - годин тому + години тому minutes ago - хвилин тому + хвилини тому seconds ago - секунд тому + секунди тому years ago - years ago + років тому months ago - months ago + місяців тому days ago - days ago + днів тому hours ago - hours ago + годин тому minutes ago - minutes ago + хвилин тому seconds ago - seconds ago + секунд тому From 9c0b10b2835f2070185ffc017fd9ccf980b7c1ba Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 02:55:50 +0300 Subject: [PATCH 050/185] update version --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 063fdfd..b533600 100644 --- a/.env +++ b/.env @@ -46,7 +46,7 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 ###< symfony/crowdin-translation-provider ### # YGGtracker -APP_VERSION='2.0.1' +APP_VERSION='2.0.2' APP_NAME=YGGtracker From 5161becd60512c457c723b82e4f60582a4483027 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 04:00:46 +0300 Subject: [PATCH 051/185] pull new translations --- translations/messages+intl-icu.ru.xlf | 352 +++++++++++++------------- 1 file changed, 176 insertions(+), 176 deletions(-) diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index 23e3246..c17bcfa 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -7,307 +7,307 @@ File not found - File not found + Файл не найден Users - Users + Пользователи Joined - Joined + Присоединился Approved - Approved + Утвержден Disapproved - Disapproved + Отклонен User statuses - User statuses + Статусы пользователей Enabled - Enabled + Включено Disabled - Disabled + Отключено User moderators - User moderators + Модерация пользователей Added - Added + Добавлено Removed - Removed + Удалено User stars - User stars + Звезды пользователей Torrents - Torrents + Торренты Torrent locales - Torrent locales + Локали торрента Deleted - Deleted + Удалено Torrent sensitive - Torrent sensitive + Чувствительное содержимое Torrent stars - Torrent stars + Звезды торрента Torrent downloads - Torrent downloads + Загрузки торрентов Files - Files + Файлы Magnet links - Magnet links + Magnet-ссылки Access denied - Access denied + Доступ запрещен At least one locale required - At least one locale required + Требуется хотя бы одна локаль Torrent file out of size limit - Torrent file out of size limit + Превышен размер торрент-файла Torrent file already exists - Torrent file already exists + Торрент-файл уже существует Could not parse torrent file - Could not parse torrent file + Не удалось проанализировать торрент-файл Torrent file required - Torrent file required + Требуется указать торрент-файл B - B + Б Kb - Kb + Кб Mb - Mb + Мб Gb - Gb + Гб Tb - Tb + Тб Pb - Pb + Пб Eb - Eb + Эб Zb - Zb + Зб Yb - Yb + Иб now - now + сейчас Keyword, file, hash... - Keyword, file, hash... + Ключевое слово, файл, хэш... Search - Search + Поиск Recent uploads - Recent uploads + Последние загрузки Active leechers waiting for seeders - Active leechers waiting for seeders + Активные пиры ожидают раздачи wanted - wanted + розыск Waiting for approve - Waiting for approve + На рассмотрении Content visible for non sensitive users only - Content visible for non sensitive users only + Содержимое видимо только для нечувствительных пользователей Size - Size + Размер Seeders - Seeders + Сиды Peers - Peers + Пиры Leechers - Leechers + Личеры Open magnet link - Open magnet link + Открыть magnet-ссылку Total - Total + Всего Download torrent file - Download torrent file + Скачать торрент-файл Star - Star + Звезда Nothing found - Nothing found + Ничего не найдено * share new torrent file to change it - * share new torrent file to change it + * поделитесь новым торрент-файлом, чтобы исправить это Submit - Submit + Отправить Submit torrent - Submit torrent + Отправить торрент Content language - Content language + Язык контента This torrent contains selected languages - This torrent contains selected languages + Этот торрент содержит выбранные языки Sensitive - Sensitive + Чувствительность Mark torrent content as sensitive - Mark torrent content as sensitive + Отметить содержимое торрента как чувствительное Edit locales - Edit locales + Изменить локали Torrent - Torrent + Торрент Edit locales for torrent - Edit locales for torrent + Изменить локали для торрента cancel - cancel + отменить by - by + от identicon - identicon + пиктограмма Delete - Delete + Удалить Disapprove - Disapprove + Отклонить Approve - Approve + Утвердить Edit sensitive status - Edit sensitive status + Изменить статус чувствительности Edit sensitive status for torrent - Edit sensitive status for torrent + Редактировать статус чувствительности для торрента Page - Page + Страница Moderation - Moderation + Модерация Yes - Yes + Да Toggle - Toggle + Переключить No - No + Нет Common - Common + Общее ID @@ -319,403 +319,403 @@ Info hash v1 - Info hash v1 + Инфо-хеш v1 Info hash v2 - Info hash v2 + Инфо-хеш v2 Created - Created + Создано Pieces - Pieces + Фрагменты Source - Source + Источник Software - Software + Программа Comment - Comment + Комментарий Contributors - Contributors + Участники Scrape - Scrape + Статус Trackers - Trackers + Трекеры Filtered by settings - Filtered by settings + Отфильтровано согласно настройкам Edit - Edit + Редактировать Locales - Locales + Локали Recent activity - Recent activity + Недавняя активность Back - Back + Назад Next - Next + Далее Settings - Settings + Настройки Interface - Interface + Интерфейс Theme - Theme + Тема Language - Language + Язык Join translation - Join translation + Присоединиться к переводам Content - Content + Содержимое Activity - Activity + Активность Downloads - Downloads + Загрузки Yggdrasil only - Yggdrasil only + Только Yggdrasil Save - Save + Сохранить Home - Home + Главная Profile - Profile + Профиль User - User + Пользователь Bookmark - Bookmark + Закладка Address - Address + Адрес Address hidden for others - Address hidden for others + Адрес скрыт для других Access - Access + Доступ Status - Status + Статус Active - Active + Активный Moderator - Moderator + Модератор Languages - Languages + Языки Events subscribed - Events subscribed + Подписка на события undefined event - undefined event + неизвестное событие have downloaded torrent file - have downloaded torrent file + скачал торрент-файл waiting for approve - waiting for approve + на рассмотрении sensitive - sensitive + чувствительность have downloaded magnet link - have downloaded magnet link + скачал magnet-ссылку have disapproved torrent - have disapproved torrent + отменил утверждение торрента have approved torrent - have approved torrent + утвердил торрент have added torrent - have added torrent + добавил торрент have deleted locales edition - have deleted locales edition + удалил редакцию локалей for torrent - for torrent + для торрента have disapproved locales edition - have disapproved locales edition + отклонил редакцию локалей have approved locales edition - have approved locales edition + утвердил редакцию локалей have added locales edition - have added locales edition + добавил редакцию локалей have removed star from torrent - have removed star from torrent + удалили звезду с торрента have added star for torrent - have added star for torrent + добавил звезду для торрента have deleted sensitive edition - have deleted sensitive edition + удалил редакцию чувствительного контента have disapproved sensitive edition - have disapproved sensitive edition + отклонил редакцию чувствительного контента have approved sensitive edition - have approved sensitive edition + утвердил редакцию чувствительного контента have added sensitive edition - have added sensitive edition + добавил редакцию чувствительного контента have disabled - have disabled + отключил have disabled user - have disabled user + отключил пользователя have enabled - have enabled + включил have enabled user - have enabled user + включил пользователя have disapproved - have disapproved + отклонил have disapproved user - have disapproved user + отключил пользователя have approved - have approved + утвердил have approved user - have approved user + утвердил пользователя have joined - have joined + присоединился have removed moderator permissions from - have removed moderator permissions from + удалил права модератора от have removed moderator permissions from user - have removed moderator permissions from user + удалил права модератора от пользователя have granted moderator permissions to - have granted moderator permissions to + предоставил права модератора для have granted moderator permissions to user - have granted moderator permissions to user + предоставил права модератора для пользователя have removed star from - have removed star from + удалил звезду от have removed star from user - have removed star from user + удалили звезду от пользователя have added star for - have added star for + добавил звезду для have added star for user - have added star for user + добавил звезду для пользователя Error - Error + Ошибка Oops! - Oops! + Ой! Internal server error - Internal server error + Внутренняя ошибка сервера Report - Report + Сообщить Not found - Not found + Не найдено Page not found! - Page not found! + Страница не найдена! BitTorrent protocol version 2 - BitTorrent protocol version 2 + BitTorrent протокол версии 2 BitTorrent protocol version 1 - BitTorrent protocol version 1 + BitTorrent протокол версии 1 year ago - year ago + год назад month ago - month ago + месяц назад day ago - day ago + день назад hour ago - hour ago + час назад minute ago - minute ago + минуту назад second ago - second ago + секунду назад years ago - years ago + год назад months ago - months ago + месяца назад days ago - days ago + дня назад hours ago - hours ago + часа назад minutes ago - minutes ago + минуты назад seconds ago - seconds ago + секунды назад years ago - years ago + лет назад months ago - months ago + месяцев назад days ago - days ago + дней назад hours ago - hours ago + часов назад minutes ago - minutes ago + минут назад seconds ago - seconds ago + секунд назад From fd17185a9ee57013463722c76de15f84c2f859bd Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 04:01:01 +0300 Subject: [PATCH 052/185] fix activity event margins --- .../default/activity/event/torrent/download/file/add.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/activity/event/torrent/download/file/add.html.twig b/templates/default/activity/event/torrent/download/file/add.html.twig index 33f83ad..057743f 100644 --- a/templates/default/activity/event/torrent/download/file/add.html.twig +++ b/templates/default/activity/event/torrent/download/file/add.html.twig @@ -3,7 +3,7 @@ {{ 'identicon' | trans }} - + {{ 'have downloaded torrent file' | trans }} {% if session.user.moderator or session.user.owner %} From 8c48e3b40e36a4c7a1eaa1d438c57bf6f8f7d85e Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 04:04:59 +0300 Subject: [PATCH 053/185] update string translation --- translations/messages+intl-icu.ru.xlf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index c17bcfa..174d81d 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -151,7 +151,7 @@ Keyword, file, hash... - Ключевое слово, файл, хэш... + Ключевое слово, файл, хеш... Search From 8e069c79978793110878968c4ca874b28590f019 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 04:08:46 +0300 Subject: [PATCH 054/185] update translation strings --- translations/messages+intl-icu.ru.xlf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index 174d81d..91aa27d 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -151,7 +151,7 @@ Keyword, file, hash... - Ключевое слово, файл, хеш... + Ключевое слово, файл, хэш... Search @@ -319,11 +319,11 @@ Info hash v1 - Инфо-хеш v1 + Инфо-хэш v1 Info hash v2 - Инфо-хеш v2 + Инфо-хэш v2 Created From 99eb0ddcb261543ba798a7d6f23a56413023e749 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 04:18:14 +0300 Subject: [PATCH 055/185] update translations --- translations/messages+intl-icu.uk.xlf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index d49d223..090339d 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -275,7 +275,7 @@ Approve - Затверджено + Затвердити Edit sensitive status @@ -339,7 +339,7 @@ Software - Програмне забезпечення + Програма Comment From 4cafc51b677eaacc4b73d421063c3057bba28087 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 17:56:06 +0300 Subject: [PATCH 056/185] remove opacity style from sensitive content --- templates/default/torrent/list.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 130472b..613b959 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -13,7 +13,7 @@
{% if torrents %} {% for torrent in torrents %} -
+

From 2acfc06ca6c76437ce17f22a067d9bab889e3372 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 18:00:12 +0300 Subject: [PATCH 057/185] add missed bittorrent protocol info on search page --- src/Controller/TorrentController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index a328cbc..1b8e77a 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -299,6 +299,11 @@ class TorrentController extends AbstractController [ 'name' => $file->getName(), 'size' => $file->getSize(), + 'hash' => + [ + 'v1' => $file->getInfoHashV1(false), + 'v2' => $file->getInfoHashV2(false) + ], ], 'scrape' => [ From 70ce180765385bd66d4f03dfc3ffc7f167e52054 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 18:03:16 +0300 Subject: [PATCH 058/185] update translations --- translations/messages+intl-icu.ru.xlf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index 91aa27d..3d23486 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -523,7 +523,7 @@ have removed star from torrent - удалили звезду с торрента + удалил звезду с торрента have added star for torrent From 29553c75c8119c18318ef46b3688f60ad6fc32b3 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 20:35:02 +0300 Subject: [PATCH 059/185] update readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a2c3be..984ae6c 100644 --- a/README.md +++ b/README.md @@ -96,8 +96,9 @@ git checkout -b my-pr-branch-name * [Issues](https://github.com/YGGverse/YGGtracker/issues) * [Wiki](https://github.com/YGGverse/YGGtracker/wiki) +* [HowTo Yggdrasil](http://[222:a8e4:50cd:55c:788e:b0a5:4e2f:a92c]/yggdrasil:bittorrent:yggtracker) -#### Community +#### Blog * [Mastodon](https://mastodon.social/@YGGverse) From 1c869fd78e5024e14663c0479cb911bd0ccf2b81 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 20:39:55 +0300 Subject: [PATCH 060/185] update link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 984ae6c..78eab21 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ git checkout -b my-pr-branch-name * [Issues](https://github.com/YGGverse/YGGtracker/issues) * [Wiki](https://github.com/YGGverse/YGGtracker/wiki) -* [HowTo Yggdrasil](http://[222:a8e4:50cd:55c:788e:b0a5:4e2f:a92c]/yggdrasil:bittorrent:yggtracker) +* [HowTo Yggdrasil](https://ygg.work.gd/yggdrasil:bittorrent:yggtracker) #### Blog From 306ccb6078c2c630a6c31fcb628e1e7ca91e5968 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 21:27:01 +0300 Subject: [PATCH 061/185] fix margins --- templates/default/activity/event/torrent/add.html.twig | 6 ++---- .../default/activity/event/torrent/locales/add.html.twig | 6 ++---- .../activity/event/torrent/locales/approve/add.html.twig | 2 +- .../activity/event/torrent/locales/approve/delete.html.twig | 2 +- .../default/activity/event/torrent/locales/delete.html.twig | 2 +- .../default/activity/event/torrent/sensitive/add.html.twig | 2 +- .../activity/event/torrent/sensitive/approve/add.html.twig | 2 +- .../event/torrent/sensitive/approve/delete.html.twig | 2 +- .../activity/event/torrent/sensitive/delete.html.twig | 2 +- templates/default/activity/event/torrent/star/add.html.twig | 4 +--- .../default/activity/event/torrent/star/delete.html.twig | 4 +--- 11 files changed, 13 insertions(+), 21 deletions(-) diff --git a/templates/default/activity/event/torrent/add.html.twig b/templates/default/activity/event/torrent/add.html.twig index 3a113e7..42e2c30 100644 --- a/templates/default/activity/event/torrent/add.html.twig +++ b/templates/default/activity/event/torrent/add.html.twig @@ -1,11 +1,9 @@
- + {{ 'identicon' | trans }} - - {{ 'have added torrent' | trans }} - + {{ 'have added torrent' | trans }} {% if session.user.moderator or session.user.owner %} {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/locales/add.html.twig b/templates/default/activity/event/torrent/locales/add.html.twig index 1d2541f..a5f8c37 100644 --- a/templates/default/activity/event/torrent/locales/add.html.twig +++ b/templates/default/activity/event/torrent/locales/add.html.twig @@ -1,11 +1,9 @@
- + {{ 'identicon' | trans }} - - {{ 'have added locales edition' | trans }} - + {{ 'have added locales edition' | trans }} {% if torrent.locales.exist %} #{{ torrent.locales.id }} diff --git a/templates/default/activity/event/torrent/locales/approve/add.html.twig b/templates/default/activity/event/torrent/locales/approve/add.html.twig index c32780b..254e24b 100644 --- a/templates/default/activity/event/torrent/locales/approve/add.html.twig +++ b/templates/default/activity/event/torrent/locales/approve/add.html.twig @@ -1,6 +1,6 @@
- + {{ 'identicon' | trans }} {{ 'have approved locales edition' | trans }} diff --git a/templates/default/activity/event/torrent/locales/approve/delete.html.twig b/templates/default/activity/event/torrent/locales/approve/delete.html.twig index c9653e9..020216c 100644 --- a/templates/default/activity/event/torrent/locales/approve/delete.html.twig +++ b/templates/default/activity/event/torrent/locales/approve/delete.html.twig @@ -1,6 +1,6 @@
- + {{ 'identicon' | trans }} diff --git a/templates/default/activity/event/torrent/locales/delete.html.twig b/templates/default/activity/event/torrent/locales/delete.html.twig index a86610b..3794dc8 100644 --- a/templates/default/activity/event/torrent/locales/delete.html.twig +++ b/templates/default/activity/event/torrent/locales/delete.html.twig @@ -1,6 +1,6 @@
- + {{ 'identicon' | trans }} {{ 'have deleted locales edition' | trans }} diff --git a/templates/default/activity/event/torrent/sensitive/add.html.twig b/templates/default/activity/event/torrent/sensitive/add.html.twig index 843fa2d..6165658 100644 --- a/templates/default/activity/event/torrent/sensitive/add.html.twig +++ b/templates/default/activity/event/torrent/sensitive/add.html.twig @@ -1,6 +1,6 @@
- + {{ 'identicon' | trans }} {{ 'have added sensitive edition' | trans }} diff --git a/templates/default/activity/event/torrent/sensitive/approve/add.html.twig b/templates/default/activity/event/torrent/sensitive/approve/add.html.twig index 627d38c..464bd9b 100644 --- a/templates/default/activity/event/torrent/sensitive/approve/add.html.twig +++ b/templates/default/activity/event/torrent/sensitive/approve/add.html.twig @@ -1,6 +1,6 @@
- + {{ 'identicon' | trans }} {{ 'have approved sensitive edition' | trans }} diff --git a/templates/default/activity/event/torrent/sensitive/approve/delete.html.twig b/templates/default/activity/event/torrent/sensitive/approve/delete.html.twig index 7c8de47..9134a0f 100644 --- a/templates/default/activity/event/torrent/sensitive/approve/delete.html.twig +++ b/templates/default/activity/event/torrent/sensitive/approve/delete.html.twig @@ -1,6 +1,6 @@
- + {{ 'identicon' | trans }} {{ 'have disapproved sensitive edition' | trans }} diff --git a/templates/default/activity/event/torrent/sensitive/delete.html.twig b/templates/default/activity/event/torrent/sensitive/delete.html.twig index f212a44..9912cf3 100644 --- a/templates/default/activity/event/torrent/sensitive/delete.html.twig +++ b/templates/default/activity/event/torrent/sensitive/delete.html.twig @@ -1,6 +1,6 @@
- + {{ 'identicon' | trans }} {{ 'have deleted sensitive edition' | trans }} diff --git a/templates/default/activity/event/torrent/star/add.html.twig b/templates/default/activity/event/torrent/star/add.html.twig index 8b911cc..16095fe 100644 --- a/templates/default/activity/event/torrent/star/add.html.twig +++ b/templates/default/activity/event/torrent/star/add.html.twig @@ -1,11 +1,9 @@
- + {{ 'identicon' | trans }} - {{ 'have added star for torrent' | trans }} - {% if session.user.moderator or session.user.owner %} {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/star/delete.html.twig b/templates/default/activity/event/torrent/star/delete.html.twig index 0582790..fd8f6f7 100644 --- a/templates/default/activity/event/torrent/star/delete.html.twig +++ b/templates/default/activity/event/torrent/star/delete.html.twig @@ -1,12 +1,10 @@
- + {{ 'identicon' | trans }} - {{ 'have removed star from torrent' | trans }} - {% if session.user.moderator or session.user.owner %} {{ torrent.name }} From 2524a30476377534a742950b796fdbd69d4879ed Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 17 Oct 2023 03:24:24 +0300 Subject: [PATCH 062/185] add meta keywords support --- src/Controller/TorrentController.php | 1 + templates/default/layout.html.twig | 3 +++ templates/default/torrent/info.html.twig | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 1b8e77a..e5865dd 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -125,6 +125,7 @@ class TorrentController extends AbstractController 'peers' => (int) $torrent->getPeers(), 'leechers' => (int) $torrent->getLeechers(), ], + 'keywords' => $torrent->getKeywords(), 'locales' => $torrent->getLocales(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), diff --git a/templates/default/layout.html.twig b/templates/default/layout.html.twig index b6c1775..a9eb79e 100644 --- a/templates/default/layout.html.twig +++ b/templates/default/layout.html.twig @@ -3,6 +3,9 @@ {% block title %}{{ name }}{% endblock %} + {% block keywords %} + + {% endblock %} {% block stylesheets %} diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index a7951b2..ecd174b 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -21,6 +21,11 @@ {% from _self import recursive_file_tree %} {% extends 'default/layout.html.twig' %} {% block title %}{{ file.name }} - {{ 'Torrent' | trans }} #{{ torrent.id }}{% if pagination.page > 1 %} - {{ 'Page' | trans }} {{ pagination.page }}{% endif %} - {{ name }}{% endblock %} +{% block keywords %} + {% if torrent.keywords %} + + {% endif %} +{% endblock %} {% block main_content %}

From 4a801fa80902966da6a05c43be9acde6a70343c3 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 18 Oct 2023 15:17:41 +0300 Subject: [PATCH 063/185] disable activity log by crawler requests #24 --- .env | 2 ++ config/services.yaml | 1 + src/Controller/TorrentController.php | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/.env b/.env index b533600..3b3ce3a 100644 --- a/.env +++ b/.env @@ -64,4 +64,6 @@ APP_YGGDRASIL=1 APP_TRACKERS=http://[201:23b4:991a:634d:8359:4521:5576:15b7]:2023/announce|http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/announce|http://[316:c51a:62a3:8b9::5]/announce +APP_CRAWLERS=30a:5fad::e + APP_TORRENT_FILE_SIZE_MAX=1024000 \ No newline at end of file diff --git a/config/services.yaml b/config/services.yaml index c1ed9ce..7e673e1 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -9,6 +9,7 @@ parameters: app.key: '%env(APP_KEY)%' app.pagination: '%env(APP_PAGINATION)%' app.trackers: '%env(APP_TRACKERS)%' + app.crawlers: '%env(APP_CRAWLERS)%' app.locales: '%env(APP_LOCALES)%' app.themes: '%env(APP_THEMES)%' app.locale: '%env(APP_LOCALE)%' diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index e5865dd..c6a9213 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -1564,6 +1564,12 @@ class TorrentController extends AbstractController ); } + // Block crawler requests + if (in_array($request->getClientIp(), explode('|', $this->getParameter('app.crawlers')))) + { + throw $this->createNotFoundException(); + } + // Init torrent if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) { @@ -1643,6 +1649,12 @@ class TorrentController extends AbstractController ); } + // Block crawler requests + if (in_array($request->getClientIp(), explode('|', $this->getParameter('app.crawlers')))) + { + throw $this->createNotFoundException(); + } + // Init torrent if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) { @@ -1764,6 +1776,12 @@ class TorrentController extends AbstractController ); } + // Block crawler requests + if (in_array($request->getClientIp(), explode('|', $this->getParameter('app.crawlers')))) + { + throw $this->createNotFoundException(); + } + // Init torrent if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) { From 33e950bb42adbfd8c75767f630174750b820c214 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 18 Oct 2023 18:01:27 +0300 Subject: [PATCH 064/185] add yggo crawler address --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 3b3ce3a..3c633d9 100644 --- a/.env +++ b/.env @@ -64,6 +64,6 @@ APP_YGGDRASIL=1 APP_TRACKERS=http://[201:23b4:991a:634d:8359:4521:5576:15b7]:2023/announce|http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/announce|http://[316:c51a:62a3:8b9::5]/announce -APP_CRAWLERS=30a:5fad::e +APP_CRAWLERS=201:23b4:991a:634d:8359:4521:5576:15b7|30a:5fad::e APP_TORRENT_FILE_SIZE_MAX=1024000 \ No newline at end of file From d3cdbc831cdbed0b20b8aa1eb04c3fb4d29fc436 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 18 Oct 2023 19:41:08 +0300 Subject: [PATCH 065/185] fix offset/limit --- src/Repository/TorrentRepository.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Repository/TorrentRepository.php b/src/Repository/TorrentRepository.php index 035dc3d..01a10ec 100644 --- a/src/Repository/TorrentRepository.php +++ b/src/Repository/TorrentRepository.php @@ -26,8 +26,8 @@ class TorrentRepository extends ServiceEntityRepository array $locales, ?bool $sensitive = null, ?bool $approved = null, - int $limit = 0, - int $offset = 10 + int $limit = 10, + int $offset = 0 ): int { return $this->getTorrentsQueryByFilter( @@ -45,8 +45,8 @@ class TorrentRepository extends ServiceEntityRepository array $locales, ?bool $sensitive = null, ?bool $approved = null, - int $limit = 0, - int $offset = 10 + int $limit = 10, + int $offset = 0 ): array { return $this->getTorrentsQueryByFilter( @@ -55,10 +55,10 @@ class TorrentRepository extends ServiceEntityRepository $sensitive, $approved, )->setMaxResults($limit) - ->setFirstResult($offset) - ->orderBy('t.id', 'DESC') // same as t.added - ->getQuery() - ->getResult(); + ->setFirstResult($offset) + ->orderBy('t.id', 'DESC') // same as t.added + ->getQuery() + ->getResult(); } private function getTorrentsQueryByFilter( From 891868eccd24222722d09275412db347a79efd74 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 18 Oct 2023 19:54:57 +0300 Subject: [PATCH 066/185] implement sitemap --- src/Controller/TorrentController.php | 35 ++++++++++++++++++++++ templates/default/torrent/sitemap.xml.twig | 15 ++++++++++ 2 files changed, 50 insertions(+) create mode 100644 templates/default/torrent/sitemap.xml.twig diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index c6a9213..51b3794 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -1884,6 +1884,41 @@ class TorrentController extends AbstractController return new Response(); // @TODO } + #[Route( + '/sitemap.xml', + methods: + [ + 'GET' + ] + )] + public function sitemap( + TorrentService $torrentService + ): Response + { + $locale = $this->getParameter('app.locale'); + $locales = explode('|', $this->getParameter('app.locales')); + + $response = new Response(); + $response->headers->set('Content-Type', 'text/xml'); + + return $this->render( + 'default/torrent/sitemap.xml.twig', + [ + 'locale' => $locale, + 'locales' => $locales, + 'torrents' => $torrentService->findTorrents( + [], // without keywords filter + $locales, // all sensitive levels + null, // all sensitive levels + true, // approved only + 1000, // @TODO limit + 0 // offset + ) + ], + $response + ); + } + private function initUser( Request $request, UserService $userService, diff --git a/templates/default/torrent/sitemap.xml.twig b/templates/default/torrent/sitemap.xml.twig new file mode 100644 index 0000000..99d77e5 --- /dev/null +++ b/templates/default/torrent/sitemap.xml.twig @@ -0,0 +1,15 @@ + + + {% for torrent in torrents %} + + {{ torrent.added | date('Y-m-d') }} + {% for code in locales %} + {% if code == locale %} + {{ url('torrent_info', { '_locale': code , torrentId : torrent.id }) }} + {% else %} + + {% endif %} + {% endfor %} + + {% endfor %} + From b9111213b2880f482f72ed6fa7408bfcef701f11 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 18 Oct 2023 19:55:50 +0300 Subject: [PATCH 067/185] fix comment --- src/Controller/TorrentController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 51b3794..1884749 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -1908,7 +1908,7 @@ class TorrentController extends AbstractController 'locales' => $locales, 'torrents' => $torrentService->findTorrents( [], // without keywords filter - $locales, // all sensitive levels + $locales, // all system locales null, // all sensitive levels true, // approved only 1000, // @TODO limit From 3a14f29b38b48192ac364fe5ec87c845fd33b63a Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 18 Oct 2023 22:25:49 +0300 Subject: [PATCH 068/185] add search results RSS feed support --- src/Controller/TorrentController.php | 12 +++++++---- templates/default/torrent/list.html.twig | 27 +++++++++++++++++------- translations/messages+intl-icu.cs.xlf | 4 ++++ translations/messages+intl-icu.de.xlf | 4 ++++ translations/messages+intl-icu.en.xlf | 4 ++++ translations/messages+intl-icu.eo.xlf | 4 ++++ translations/messages+intl-icu.es.xlf | 4 ++++ translations/messages+intl-icu.fr.xlf | 4 ++++ translations/messages+intl-icu.he.xlf | 4 ++++ translations/messages+intl-icu.it.xlf | 4 ++++ translations/messages+intl-icu.ka.xlf | 4 ++++ translations/messages+intl-icu.lv.xlf | 4 ++++ translations/messages+intl-icu.pl.xlf | 4 ++++ translations/messages+intl-icu.pt.xlf | 4 ++++ translations/messages+intl-icu.ru.xlf | 4 ++++ translations/messages+intl-icu.uk.xlf | 6 +++++- 16 files changed, 84 insertions(+), 13 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 1884749..3d4ac71 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -517,7 +517,7 @@ class TorrentController extends AbstractController } return $this->render('default/torrent/list.html.twig', [ - 'torrents' => $torrents, + 'torrents' => $torrents, 'pagination' => [ 'page' => $page, @@ -552,9 +552,13 @@ class TorrentController extends AbstractController $activityService ); + // Init request + $query = $request->get('query') ? explode(' ', urldecode($request->get('query'))) : []; + $page = $request->get('page') ? (int) $request->get('page') : 1; + // Get total torrents $total = $torrentService->findTorrentsTotal( - [], + $query, $user->getLocales(), !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() ? true : null // show approved content only for regular users @@ -563,12 +567,12 @@ class TorrentController extends AbstractController // Create torrents list $torrents = []; foreach ($torrentService->findTorrents( - [], + $query, $user->getLocales(), !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() ? true : null, // show approved content only for regular users $this->getParameter('app.pagination'), - 0 + ($page - 1) * $this->getParameter('app.pagination') ) as $torrent) { // Read file diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 613b959..4d8c6ea 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -2,14 +2,25 @@ {% block title %}{% if query %}{{ query }} - {{ 'Search' | trans }} - {% endif %}{{ name }}{% endblock %} {% block main_content %}
-

{{ 'Recent uploads' | trans }}

- -
- - - - - + {% if query %} +

{{ 'Search results' | trans }}

+ + + + + + + + {% else %} +

{{ 'Recent uploads' | trans }}

+ + + + + + + + {% endif %}
{% if torrents %} {% for torrent in torrents %} diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index e31d182..33c94c0 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -717,6 +717,10 @@ seconds ago seconds ago + + Search results + Search results + diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index ea05fbf..739d732 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -717,6 +717,10 @@ seconds ago seconds ago + + Search results + Search results + diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index ce8592b..53aec08 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -717,6 +717,10 @@ seconds ago seconds ago + + Search results + Search results + diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index f3109f7..8c9206b 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -717,6 +717,10 @@ seconds ago seconds ago + + Search results + Search results + diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index 8214c8d..b20f791 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -717,6 +717,10 @@ seconds ago seconds ago + + Search results + Search results + diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index a9ceeed..6f1894a 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -717,6 +717,10 @@ seconds ago seconds ago + + Search results + Search results + diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index 57093c5..b5c3202 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -717,6 +717,10 @@ seconds ago seconds ago + + Search results + Search results + diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index 40c0271..64f52bc 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -717,6 +717,10 @@ seconds ago seconds ago + + Search results + Search results + diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index 9d4e4c3..d7546df 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -717,6 +717,10 @@ seconds ago seconds ago + + Search results + Search results + diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index 4077e03..58d1372 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -717,6 +717,10 @@ seconds ago seconds ago + + Search results + Search results + diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index 98a947a..3e87d08 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -717,6 +717,10 @@ seconds ago seconds ago + + Search results + Search results + diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index e0d5cf7..46133ce 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -717,6 +717,10 @@ seconds ago seconds ago + + Search results + Search results + diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index 3d23486..e0bc111 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -717,6 +717,10 @@ seconds ago секунд назад + + Search results + Результаты поиска + diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 090339d..802d8f2 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -7,7 +7,7 @@ File not found - Файл не знайдений + Файл не знайдено Users @@ -717,6 +717,10 @@ seconds ago секунд тому + + Search results + Результати пошуку + From d794e48a54fdb499142e0994e29e42696bbef60d Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 19 Oct 2023 03:53:32 +0300 Subject: [PATCH 069/185] implement torrents API #25 --- README.md | 8 +- src/Controller/TorrentController.php | 112 +++++++++++++++++++++++++++ 2 files changed, 118 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78eab21..f915497 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,11 @@ Custom settings could be provided in the `/.env.local` file by overwriting defau #### Localization -* Join community translations by [Crowdin](https://crowdin.com/project/yggtracker) +Join community translations by [Crowdin](https://crowdin.com/project/yggtracker) + +#### API + +[Wiki reference](https://github.com/YGGverse/YGGtracker/wiki/API) #### Contribution @@ -95,7 +99,7 @@ git checkout -b my-pr-branch-name #### Support * [Issues](https://github.com/YGGverse/YGGtracker/issues) -* [Wiki](https://github.com/YGGverse/YGGtracker/wiki) +* [Documentation](https://github.com/YGGverse/YGGtracker/wiki) * [HowTo Yggdrasil](https://ygg.work.gd/yggdrasil:bittorrent:yggtracker) #### Blog diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 3d4ac71..1393397 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -608,6 +608,118 @@ class TorrentController extends AbstractController ); } + // #25 + // https://github.com/YGGverse/YGGtracker/issues/25 + #[Route( + '/api/torrents', + methods: + [ + 'GET' + ] + )] + public function jsonRecent( + Request $request, + UserService $userService, + TorrentService $torrentService, + ActivityService $activityService + ): Response + { + // Init request + $query = $request->get('query') ? explode(' ', urldecode($request->get('query'))) : []; + $page = $request->get('page') ? (int) $request->get('page') : 1; + + $locales = $request->get('locales') ? explode('|', $request->get('locales')) : explode('|', $this->getParameter('app.locales')); + $sensitive = $request->get('sensitive') ? (bool) $request->get('sensitive') : null; + + // Get total torrents + $total = $torrentService->findTorrentsTotal( + $query, + $locales, + $sensitive, + true, // approved only + ); + + // Create torrents list + $torrents = []; + foreach ($torrentService->findTorrents( + $query, + $locales, + $sensitive, + true, // approved only + $this->getParameter('app.pagination'), + ($page - 1) * $this->getParameter('app.pagination') + ) as $torrent) + { + // Read file + if (!$file = $torrentService->readTorrentFileByTorrentId($torrent->getId())) + { + throw $this->createNotFoundException(); // @TODO exception + } + + // Generate url + $url = []; + foreach ($locales as $locale) + { + $url[$locale] = $this->generateUrl( + 'torrent_info', + [ + '_locale' => $locale, + 'torrentId' => $torrent->getId(), + ], + false + ); + } + + $torrents[] = + [ + 'torrent' => + [ + 'id' => $torrent->getId(), + 'added' => $torrent->getAdded(), + 'locales' => $torrent->getLocales(), + 'sensitive' => $torrent->isSensitive(), + 'file' => + [ + 'name' => $file->getName(), + 'size' => $file->getSize(), + ], + 'scrape' => + [ + 'seeders' => (int) $torrent->getSeeders(), + 'peers' => (int) $torrent->getPeers(), + 'leechers' => (int) $torrent->getLeechers(), + ], + 'url' => $url + ], + ]; + } + + $url = []; + foreach ($locales as $locale) + { + $url[$locale] = $this->generateUrl( + 'torrent_recent', + [ + '_locale' => $locale + ], + false + ); + } + + return $this->json( + [ + 'version' => time(), + 'tracker' => + [ + 'name' => $this->getParameter('app.name'), + 'version' => $this->getParameter('app.version'), + 'url' => $url + ], + 'torrents' => $torrents + ] + ); + } + // Forms #[Route( '/{_locale}/submit', From 4c519a56baa1ad55181544c674d2254a6b8dd8c0 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 19 Oct 2023 04:36:12 +0300 Subject: [PATCH 070/185] add torrent / magnet download links, remove locale references #25 --- src/Controller/TorrentController.php | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 1393397..6bcdcfc 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -682,6 +682,23 @@ class TorrentController extends AbstractController [ 'name' => $file->getName(), 'size' => $file->getSize(), + 'url' => $this->generateUrl( + 'torrent_download_file', + [ + 'torrentId' => $torrent->getId() + ], + false + ) + ], + 'magnet' => + [ + 'url' => $this->generateUrl( + 'torrent_download_magnet', + [ + 'torrentId' => $torrent->getId() + ], + false + ) ], 'scrape' => [ @@ -1730,12 +1747,11 @@ class TorrentController extends AbstractController // Torrent download file #[Route( - '/{_locale}/torrent/{torrentId}/download/file', + '/torrent/{torrentId}/download/file', name: 'torrent_download_file', requirements: [ - '_locale' => '%app.locales%', - 'torrentId' => '\d+', + 'torrentId' => '\d+' ], methods: [ @@ -1857,12 +1873,11 @@ class TorrentController extends AbstractController // Torrent download magnet #[Route( - '/{_locale}/torrent/{torrentId}/download/magnet', + '/torrent/{torrentId}/download/magnet', name: 'torrent_download_magnet', requirements: [ - '_locale' => '%app.locales%', - 'torrentId' => '\d+', + 'torrentId' => '\d+' ], methods: [ From 31bed20b4b8fd6bdd3aabfded6d18f196d937702 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 19 Oct 2023 04:41:19 +0300 Subject: [PATCH 071/185] update download routes #25 --- src/Controller/TorrentController.php | 12 ++++++------ templates/default/torrent/info.html.twig | 4 ++-- templates/default/torrent/list.html.twig | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 6bcdcfc..be9fd4d 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -683,7 +683,7 @@ class TorrentController extends AbstractController 'name' => $file->getName(), 'size' => $file->getSize(), 'url' => $this->generateUrl( - 'torrent_download_file', + 'torrent_file', [ 'torrentId' => $torrent->getId() ], @@ -693,7 +693,7 @@ class TorrentController extends AbstractController 'magnet' => [ 'url' => $this->generateUrl( - 'torrent_download_magnet', + 'torrent_magnet', [ 'torrentId' => $torrent->getId() ], @@ -1747,8 +1747,8 @@ class TorrentController extends AbstractController // Torrent download file #[Route( - '/torrent/{torrentId}/download/file', - name: 'torrent_download_file', + '/torrent/{torrentId}/file', + name: 'torrent_file', requirements: [ 'torrentId' => '\d+' @@ -1873,8 +1873,8 @@ class TorrentController extends AbstractController // Torrent download magnet #[Route( - '/torrent/{torrentId}/download/magnet', - name: 'torrent_download_magnet', + '/torrent/{torrentId}/magnet', + name: 'torrent_magnet', requirements: [ 'torrentId' => '\d+' diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index ecd174b..f59c5a4 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -33,7 +33,7 @@ {#{{ 'Torrent' | trans }} #{{ torrent.id }}#}

- + {% if torrent.download.magnet.exist %} @@ -47,7 +47,7 @@ {{ torrent.download.magnet.total }} - + {% if torrent.download.file.exist %} diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 4d8c6ea..909e0ee 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -117,7 +117,7 @@
- + {% if torrent.download.magnet.exist %} @@ -131,7 +131,7 @@ {{ torrent.download.magnet.total }} - + {% if torrent.download.file.exist %} From 51ee02201ab6faae66652e9435ce0fc6590005c8 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 19 Oct 2023 04:58:29 +0300 Subject: [PATCH 072/185] add magnet urn link #25 --- src/Controller/TorrentController.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index be9fd4d..f30c438 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -631,6 +631,11 @@ class TorrentController extends AbstractController $locales = $request->get('locales') ? explode('|', $request->get('locales')) : explode('|', $this->getParameter('app.locales')); $sensitive = $request->get('sensitive') ? (bool) $request->get('sensitive') : null; + $yggdrasil = $request->get('yggdrasil') ? (bool) $request->get('yggdrasil') : false; + + // Init trackers + $trackers = explode('|', $this->getParameter('app.trackers')); + // Get total torrents $total = $torrentService->findTorrentsTotal( $query, @@ -698,7 +703,16 @@ class TorrentController extends AbstractController 'torrentId' => $torrent->getId() ], false - ) + ), + 'urn' => $yggdrasil ? $file->setAnnounceList([$trackers])->getMagnetLink() + : $file->setAnnounceList( + array_unique( + array_merge( + $file->getAnnounceList(), + [$trackers] + ) + ) + )->getMagnetLink() ], 'scrape' => [ From 314320c554cfd18c0d3298969171ae28bef2e521 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 19 Oct 2023 05:14:06 +0300 Subject: [PATCH 073/185] add Semantic Versioning 2.0.0 notice --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index f915497..b157f8e 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,10 @@ git checkout -b my-pr-branch-name * Engine sources [MIT License](https://github.com/YGGverse/YGGtracker/blob/main/LICENSE) +#### Versioning + +[Semantic Versioning 2.0.0](https://semver.org/#semantic-versioning-200) + #### Components * [Symfony Framework](https://symfony.com) From 0b316734b872063ecb1e3fd7cf2023c2d9755c07 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 20 Oct 2023 00:12:15 +0300 Subject: [PATCH 074/185] fix warning notice --- src/Controller/TorrentController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index f30c438..3d11f96 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -708,7 +708,7 @@ class TorrentController extends AbstractController : $file->setAnnounceList( array_unique( array_merge( - $file->getAnnounceList(), + (array) $file->getAnnounceList(), [$trackers] ) ) From 5d8988719a45bd35345f2596aa6346810be2e707 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 20 Oct 2023 00:12:20 +0300 Subject: [PATCH 075/185] add qBittorrent search plugin link --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b157f8e..bb90d23 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,11 @@ git checkout -b my-pr-branch-name #### Instances -* [http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/](http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/) +* `http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/` + +#### Plugins + +* [qBitTorrent search plugin](https://github.com/YGGverse/qbittorrent-yggtracker-search-plugin) #### See also From 371dda9d31935937c58bc1ff964488a58f04ab59 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 20 Oct 2023 00:22:18 +0300 Subject: [PATCH 076/185] update readme --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index bb90d23..659117d 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,14 @@ YGGtracker uses [Yggdrasil](https://github.com/yggdrasil-network/yggdrasil-go) I ![Pasted image 1](https://github.com/YGGverse/YGGtracker/assets/108541346/962f7850-01e1-4add-9dbe-c11b80108a75) +#### Instances + +* `http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/` + +#### Plugins + +* [qBitTorrent](https://github.com/YGGverse/qbittorrent-yggtracker-search-plugin) + #### Installation ``` @@ -110,14 +118,6 @@ git checkout -b my-pr-branch-name * [Mastodon](https://mastodon.social/@YGGverse) -#### Instances - -* `http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/` - -#### Plugins - -* [qBitTorrent search plugin](https://github.com/YGGverse/qbittorrent-yggtracker-search-plugin) - #### See also * [YGGo - YGGo! Distributed Web Search Engine ](https://github.com/YGGverse/YGGo) From e6fac3d298f9be2ea547e2b92c3579c135fbccb5 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 20 Oct 2023 01:58:15 +0300 Subject: [PATCH 077/185] update readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 659117d..89bae99 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,6 @@ YGGtracker uses [Yggdrasil](https://github.com/yggdrasil-network/yggdrasil-go) I * `http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/` -#### Plugins - -* [qBitTorrent](https://github.com/YGGverse/qbittorrent-yggtracker-search-plugin) - #### Installation ``` @@ -118,6 +114,10 @@ git checkout -b my-pr-branch-name * [Mastodon](https://mastodon.social/@YGGverse) +#### Plugins + +* [qBitTorrent](https://github.com/YGGverse/qbittorrent-yggtracker-search-plugin) + #### See also * [YGGo - YGGo! Distributed Web Search Engine ](https://github.com/YGGverse/YGGo) From 8affbe86442db0877a7324e3817fc72d375255a4 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 20 Oct 2023 02:08:59 +0300 Subject: [PATCH 078/185] update version --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 3c633d9..188fef3 100644 --- a/.env +++ b/.env @@ -46,7 +46,7 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 ###< symfony/crowdin-translation-provider ### # YGGtracker -APP_VERSION='2.0.2' +APP_VERSION='2.1.0' APP_NAME=YGGtracker From 2d2c6be01624d7c855f5998a4e5c6c93ea1ca6f5 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 23 Oct 2023 07:07:43 +0300 Subject: [PATCH 079/185] improve yggdrasil filters on torrent/magnet download --- src/Controller/TorrentController.php | 130 +++++++++++++++++++-------- 1 file changed, 95 insertions(+), 35 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 3d11f96..c75df27 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -661,6 +661,9 @@ class TorrentController extends AbstractController throw $this->createNotFoundException(); // @TODO exception } + // Apply yggdrasil filters + $file = $this->filterYggdrasil($file, $yggdrasil); + // Generate url $url = []; foreach ($locales as $locale) @@ -704,15 +707,7 @@ class TorrentController extends AbstractController ], false ), - 'urn' => $yggdrasil ? $file->setAnnounceList([$trackers])->getMagnetLink() - : $file->setAnnounceList( - array_unique( - array_merge( - (array) $file->getAnnounceList(), - [$trackers] - ) - ) - )->getMagnetLink() + 'urn' => $file->getMagnetLink() ], 'scrape' => [ @@ -1809,10 +1804,7 @@ class TorrentController extends AbstractController if (!$file = $torrentService->readTorrentFileByTorrentId($torrent->getId())) { - // @TODO - throw new \Exception( - $translator->trans('File not found') - ); + throw $this->createNotFoundException(); } // Sensitive filter @@ -1841,16 +1833,13 @@ class TorrentController extends AbstractController $torrent->getId() ); - // Filter trackers - if ($user->isYggdrasil()) - { - $file->setAnnounceList( - [ - explode('|', $this->getParameter('app.trackers')) - ] - ); - } + // Apply filters + $file = $this->filterYggdrasil( + $file, + $user->isYggdrasil() + ); + // Get data $data = $file->dumpToString(); // Set headers @@ -1935,10 +1924,7 @@ class TorrentController extends AbstractController if (!$file = $torrentService->readTorrentFileByTorrentId($torrent->getId())) { - // @TODO - throw new \Exception( - $translator->trans('File not found') - ); + throw $this->createNotFoundException(); } // Sensitive filter @@ -1967,15 +1953,11 @@ class TorrentController extends AbstractController $torrent->getId() ); - // Filter trackers - if ($user->isYggdrasil()) - { - $file->setAnnounceList( - [ - explode('|', $this->getParameter('app.trackers')) - ] - ); - } + // Apply filters + $file = $this->filterYggdrasil( + $file, + $user->isYggdrasil() + ); // Return magnet link return $this->redirect( @@ -2094,4 +2076,82 @@ class TorrentController extends AbstractController return $user; } + + private function filterYggdrasil( + ?\Rhilip\Bencode\TorrentFile $file, bool $yggdrasil, string $regex = '/^0{0,1}[2-3][a-f0-9]{0,2}:/' + ): ?\Rhilip\Bencode\TorrentFile + { + // Get app trackers + $appTrackers = explode('|', $this->getParameter('app.trackers')); + + // Get original file announcements + $announceList = $file->getAnnounceList(); + + // Append app trackers + foreach ($appTrackers as $appTracker) + { + // Append application trackers + $announceList[0][] = $appTracker; + + // Append application re-trackers + $announceList[1][] = $appTracker; + } + + // Remove duplicated + $announceList[0] = array_unique($announceList[0]); + $announceList[1] = array_unique($announceList[1]); + + // Yggdrasil-only mode + if ($yggdrasil) + { + // Replace announce URL with first application tracker if original does not match Yggdrasil condition + if (!preg_match($regex, str_replace(['[',']'], false, parse_url($value, PHP_URL_HOST)))) + { + $file->setAnnounce( + $appTrackers[0] + ); + } + + // Remove non-Yggdrasil trackers from announcement list + foreach ($announceList[0] as $key => $value) + { + // trackers + if (!preg_match($regex, str_replace(['[',']'], false, parse_url($value, PHP_URL_HOST)))) + { + unset($announceList[0][$key]); + } + } + + // Remove non-Yggdrasil re-trackers from announcement list + foreach ($announceList[1] as $key => $value) + { + // trackers + if (!preg_match($regex, str_replace(['[',']'], false, parse_url($value, PHP_URL_HOST)))) + { + unset($announceList[1][$key]); + } + } + } + + // Format announce list + $trackers = []; + + foreach ($announceList[0] as $value) + { + $trackers[] = [$value]; + } + + foreach ($announceList[1] as $value) + { + $trackers[] = [$value]; + } + + // Update announce list + $file->setAnnounceList( + $trackers + ); + + // Return filtered file + return $file; + } } From a128cb7cb306229d9717b49d7a95924f6a34c0cc Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 23 Oct 2023 07:31:07 +0300 Subject: [PATCH 080/185] add wanted raw file with download feature --- src/Controller/TorrentController.php | 120 +++++++++++++++++++++++ templates/default/torrent/list.html.twig | 7 +- 2 files changed, 124 insertions(+), 3 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index c75df27..2938c68 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -1874,6 +1874,126 @@ class TorrentController extends AbstractController return $response->setContent($data); } + // Torrent download wanted file + #[Route( + '/torrent/{torrentId}/file/wanted', + name: 'torrent_file_wanted', + requirements: + [ + 'torrentId' => '\d+' + ], + methods: + [ + 'GET' + ] + )] + public function downloadFileWanted( + Request $request, + TranslatorInterface $translator, + UserService $userService, + TorrentService $torrentService, + ActivityService $activityService + ): Response + { + // Init user + $user = $this->initUser( + $request, + $userService, + $activityService + ); + + if (!$user->isStatus()) + { + // @TODO + throw new \Exception( + $translator->trans('Access denied') + ); + } + + // Block crawler requests + if (in_array($request->getClientIp(), explode('|', $this->getParameter('app.crawlers')))) + { + throw $this->createNotFoundException(); + } + + // Init torrent + if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) + { + throw $this->createNotFoundException(); + } + + if (!$file = $torrentService->readTorrentFileByTorrentId($torrent->getId())) + { + throw $this->createNotFoundException(); + } + + // Sensitive filter + if (!$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive()) + { + throw $this->createNotFoundException(); + } + + // Approved filter + if (!$user->isModerator() && $user->getId() != $torrent->getUserId() && !$torrent->isApproved()) + { + throw $this->createNotFoundException(); + } + + // Register download + $torrentService->addTorrentDownloadFile( + $torrent->getId(), + $user->getId(), + time() + ); + + // Register download event + $activityService->addEventTorrentDownloadFileAdd( + $user->getId(), + time(), + $torrent->getId() + ); + + // Apply filters + $file = $this->filterYggdrasil( + $file, + false // wanted file downloading with original trackers + ); + + // Get data + $data = $file->dumpToString(); + + // Set headers + $response = new Response(); + + $response->headers->set( + 'Content-type', + 'application/x-bittorrent' + ); + + $response->headers->set( + 'Content-length', + strlen($data) + ); + + $response->headers->set( + 'Content-Disposition', + sprintf( + 'attachment; filename="%s.wanted.%s.torrent";', + mb_strtolower( + $this->getParameter('app.name') + ), + mb_strtolower( + $file->getName() + ) + ) + ); + + $response->sendHeaders(); + + // Return file content + return $response->setContent($data); + } + // Torrent download magnet #[Route( '/torrent/{torrentId}/magnet', diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 909e0ee..b16b13a 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -33,10 +33,11 @@

{% if torrent.scrape.leechers > 0 and torrent.scrape.seeders == 0 %} - + {{ 'wanted' | trans }} - + {% endif %} {% if torrent.approved == false %} From c70205e20446206574e296626c3f04dd1bbccf91 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 23 Oct 2023 07:40:03 +0300 Subject: [PATCH 081/185] remove duplicates from announcement list --- src/Controller/TorrentController.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 2938c68..48395de 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -2253,15 +2253,25 @@ class TorrentController extends AbstractController } } - // Format announce list - $trackers = []; + // Remove duplicates in list + $values = []; foreach ($announceList[0] as $value) { - $trackers[] = [$value]; + $values[] = $value; } foreach ($announceList[1] as $value) + { + $values[] = $value; + } + + $values = array_unique($values); + + // Format announce list + $trackers = []; + + foreach ($values as $value) { $trackers[] = [$value]; } From 8190fc1914e850e932ce2f09159e31112daeb561 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 23 Oct 2023 21:16:40 +0300 Subject: [PATCH 082/185] implement FTP storage for wanted feature #27 --- .env | 24 ++- config/services.yaml | 2 + src/Controller/TorrentController.php | 211 ++++++++++++++++++++++++++- src/Service/TorrentService.php | 147 +++++++++---------- 4 files changed, 296 insertions(+), 88 deletions(-) diff --git a/.env b/.env index 188fef3..9b83a59 100644 --- a/.env +++ b/.env @@ -46,24 +46,46 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 ###< symfony/crowdin-translation-provider ### # YGGtracker + +# Application version, used for API and media cache APP_VERSION='2.1.0' +# Application name APP_NAME=YGGtracker +# Default locale APP_LOCALE=en + +# Supported locales for interface and content filters APP_LOCALES=en|cs|eo|fr|ka|de|he|it|lv|pl|pt|ru|es|uk +# Items per page on pagination APP_PAGINATION=10 +# Default application theme APP_THEME=default + +# Additional themes, stored in /src/templates, /public/asset APP_THEMES=default +# Default sensitive status for new users APP_SENSITIVE=0 + +# Default approved status for new users APP_APPROVED=0 + +# Default Yggdrasil filters status for new users APP_YGGDRASIL=1 +# Build-in trackers append to downloads APP_TRACKERS=http://[201:23b4:991a:634d:8359:4521:5576:15b7]:2023/announce|http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/announce|http://[316:c51a:62a3:8b9::5]/announce +# List of crawlers where ignored in actions and activity features APP_CRAWLERS=201:23b4:991a:634d:8359:4521:5576:15b7|30a:5fad::e -APP_TORRENT_FILE_SIZE_MAX=1024000 \ No newline at end of file +# Max torrent filesize for uploads +APP_TORRENT_FILE_SIZE_MAX=1024000 + +# Store wanted torrent files in /app/var/ftp by /app/crontab/torrent/scrape/{key} +APP_TORRENT_WANTED_FTP_ENABLED=1 +APP_TORRENT_WANTED_FTP_APPROVED_ONLY=1 \ No newline at end of file diff --git a/config/services.yaml b/config/services.yaml index 7e673e1..e2cb3f6 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -18,6 +18,8 @@ parameters: app.approved: '%env(APP_APPROVED)%' app.yggdrasil: '%env(APP_YGGDRASIL)%' app.torrent.size.max: '%env(APP_TORRENT_FILE_SIZE_MAX)%' + app.torrent.wanted.ftp.enabled: '%env(APP_TORRENT_WANTED_FTP_ENABLED)%' + app.torrent.wanted.ftp.approved: '%env(APP_TORRENT_WANTED_FTP_APPROVED_ONLY)%' services: # default configuration for services in *this* file diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 48395de..cde50c6 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -1858,10 +1858,11 @@ class TorrentController extends AbstractController $response->headers->set( 'Content-Disposition', sprintf( - 'attachment; filename="%s.%s.torrent";', + 'attachment; filename="%s#%s.%s.torrent";', mb_strtolower( $this->getParameter('app.name') ), + $torrent->getId(), mb_strtolower( $file->getName() ) @@ -1978,10 +1979,8 @@ class TorrentController extends AbstractController $response->headers->set( 'Content-Disposition', sprintf( - 'attachment; filename="%s.wanted.%s.torrent";', - mb_strtolower( - $this->getParameter('app.name') - ), + 'attachment; filename="wanted#%s.%s.torrent";', + $torrent->getId(), mb_strtolower( $file->getName() ) @@ -2102,10 +2101,208 @@ class TorrentController extends AbstractController TorrentService $torrentService, ): Response { - $torrentService->scrapeTorrentQueue( - explode('|', $this->getParameter('app.trackers')) + // Init Scraper + $scraper = new \Yggverse\Scrapeer\Scraper(); + + // Get next torrent in scrape queue + if (!$torrent = $torrentService->getTorrentScrapeQueue()) + { + throw $this->createNotFoundException(); + } + + // Get file + if (!$file = $torrentService->readTorrentFileByTorrentId($torrent->getId())) + { + throw $this->createNotFoundException(); + } + + // Filter yggdrasil trackers + $file = $this->filterYggdrasil($file, true); + + // Get trackers list + $trackers = []; + + if ($announce = $file->getAnnounce()) + { + $trackers[] = $announce; + } + + if ($announceList = $file->getAnnounceList()) + { + if (isset($announceList[0])) + { + foreach ($announceList[0] as $value) + { + $trackers[] = $value; + } + } + + if (isset($announceList[1])) + { + foreach ($announceList[1] as $value) + { + $trackers[] = $value; + } + } + } + + $trackers = array_unique($trackers); + + // Get info hashes + $hashes = []; + + if ($hash = $file->getInfoHashV1(false)) + { + $hashes[] = $hash; + } + + if ($hash = $file->getInfoHashV2(false)) + { + $hashes[] = $hash; + } + + // Get scrape + $seeders = 0; + $peers = 0; + $leechers = 0; + + if ($hashes && $trackers) + { + // Update scrape info + if ($results = $scraper->scrape($hashes, $trackers, null, 1)) + { + foreach ($results as $result) + { + if (isset($result['seeders'])) + { + $seeders = $seeders + (int) $result['seeders']; + } + + if (isset($result['completed'])) + { + $peers = $peers + (int) $result['completed']; + } + + if (isset($result['leechers'])) + { + $leechers = $leechers + (int) $result['leechers']; + } + } + } + } + + // Update DB + $torrentService->updateTorrentScrape( + $torrent->getId(), + $seeders, + $peers, + $leechers ); + // Update torrent wanted storage if enabled + if ($this->getParameter('app.torrent.wanted.ftp.enabled') === '1') + { + // Add wanted file + if ($leechers && !$seeders) + { + if ($this->getParameter('app.torrent.wanted.ftp.approved') === '0' || + ($this->getParameter('app.torrent.wanted.ftp.approved') === '1' && $torrent->isApproved())) + { + /// All + $torrentService->copyToFtpStorage( + $torrent->getId(), + sprintf( + '/torrents/wanted/all/wanted#%s.%s.torrent', + $torrent->getId(), + $file->getName() + ) + ); + + /// Sensitive + if ($torrent->isSensitive()) + { + $torrentService->copyToFtpStorage( + $torrent->getId(), + sprintf( + '/torrents/wanted/sensitive/yes/wanted#%s.%s.torrent', + $torrent->getId(), + $file->getName() + ) + ); + } + + else + { + $torrentService->copyToFtpStorage( + $torrent->getId(), + sprintf( + '/torrents/wanted/sensitive/no/wanted#%s.%s.torrent', + $torrent->getId(), + $file->getName() + ) + ); + } + + /// Locals + foreach ($torrent->getLocales() as $locale) + { + $torrentService->copyToFtpStorage( + $torrent->getId(), + sprintf( + '/torrents/wanted/locale/%s/wanted#%s.%s.torrent', + $locale, + $torrent->getId(), + $file->getName() + ) + ); + } + } + } + + // Remove not wanted files + else + { + /// All + $torrentService->removeFromFtpStorage( + sprintf( + '/torrents/wanted/all/wanted#%s.%s.torrent', + $torrent->getId(), + $file->getName() + ) + ); + + /// Sensitive + $torrentService->removeFromFtpStorage( + sprintf( + '/torrents/wanted/sensitive/yes/wanted#%s.%s.torrent', + $torrent->getId(), + $file->getName() + ) + ); + + $torrentService->removeFromFtpStorage( + sprintf( + '/torrents/wanted/sensitive/no/wanted#%s.%s.torrent', + $torrent->getId(), + $file->getName() + ) + ); + + /// Locals + foreach (explode('|', $this->getParameter('app.locales')) as $locale) + { + $torrentService->removeFromFtpStorage( + sprintf( + '/torrents/wanted/locale/%s/wanted#%s.%s.torrent', + $locale, + $torrent->getId(), + $file->getName() + ) + ); + } + } + } + // Render response return new Response(); // @TODO } diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index c34642f..5e2c4c3 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -36,86 +36,6 @@ class TorrentService } // Tools - public function scrapeTorrentQueue( - array $trackers = [] - ): void - { - // Init Scraper - $scraper = new \Yggverse\Scrapeer\Scraper(); - - if ($torrent = $this->getTorrentScrapeQueue()) - { - // Init default values - $seeders = 0; - $peers = 0; - $leechers = 0; - - // Get file - if ($file = $this->readTorrentFileByTorrentId($torrent->getId())) - { - // Get info hashes - $hashes = []; - - if ($hash = $file->getInfoHashV1(false)) - { - $hashes[] = $hash; - } - - if ($hash = $file->getInfoHashV2(false)) - { - $hashes[] = $hash; - } - - // Get scrape - if ($hashes && $trackers) - { - // Update scrape info - if ($results = $scraper->scrape($hashes, $trackers, null, 1)) - { - foreach ($results as $result) - { - if (isset($result['seeders'])) - { - $seeders = $seeders + (int) $result['seeders']; - } - - if (isset($result['completed'])) - { - $peers = $peers + (int) $result['completed']; - } - - if (isset($result['leechers'])) - { - $leechers = $leechers + (int) $result['leechers']; - } - } - } - } - } - - // Update torrent scrape - $torrent->setSeeders( - $seeders - ); - - $torrent->setPeers( - $peers - ); - - $torrent->setLeechers( - $leechers - ); - - $torrent->setScraped( - time() - ); - - // Save results to DB - $this->entityManagerInterface->persist($torrent); - $this->entityManagerInterface->flush(); - } - } - public function readTorrentFileByFilepath( string $filepath ): ?\Rhilip\Bencode\TorrentFile @@ -210,6 +130,15 @@ class TorrentService ); } + public function getFtpFilepathByFilename(string $filename): string + { + return sprintf( + '%s/var/ftp/%s', + $this->kernelInterface->getProjectDir(), + $filename + ); + } + public function getTorrentContributors(Torrent $torrent): array { $contributors = []; @@ -229,6 +158,34 @@ class TorrentService return array_unique($contributors); } + public function copyToFtpStorage( + int $torrentId, + string $filename + ): void + { + $filesystem = new Filesystem(); + $filesystem->copy( + $this->getStorageFilepathByTorrentId( + $torrentId + ), + $this->getFtpFilepathByFilename( + $filename + ) + ); + } + + public function removeFromFtpStorage( + string $filename + ): void + { + $filesystem = new Filesystem(); + $filesystem->remove( + $this->getFtpFilepathByFilename( + $filename + ) + ); + } + public function add( string $filepath, int $userId, @@ -450,6 +407,36 @@ class TorrentService } } + public function updateTorrentScrape( + int $torrentId, + int $seeders, + int $peers, + int $leechers + ): void + { + if ($torrent = $this->getTorrent($torrentId)) + { + $torrent->setSeeders( + $seeders + ); + + $torrent->setPeers( + $peers + ); + + $torrent->setLeechers( + $leechers + ); + + $torrent->setScraped( + time() + ); + + $this->entityManagerInterface->persist($torrent); + $this->entityManagerInterface->flush(); + } + } + public function reindexTorrentKeywordsAll(): void { foreach ($this->entityManagerInterface From 6bfd230915aeaa45032e3de7068469cba0307c14 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 23 Oct 2023 22:26:00 +0300 Subject: [PATCH 083/185] add header description (bridge tip) #27 --- templates/default/layout.html.twig | 5 ++++- translations/messages+intl-icu.cs.xlf | 8 ++++---- translations/messages+intl-icu.de.xlf | 8 ++++---- translations/messages+intl-icu.en.xlf | 8 ++++---- translations/messages+intl-icu.eo.xlf | 8 ++++---- translations/messages+intl-icu.es.xlf | 8 ++++---- translations/messages+intl-icu.fr.xlf | 8 ++++---- translations/messages+intl-icu.he.xlf | 8 ++++---- translations/messages+intl-icu.it.xlf | 8 ++++---- translations/messages+intl-icu.ka.xlf | 8 ++++---- translations/messages+intl-icu.lv.xlf | 8 ++++---- translations/messages+intl-icu.pl.xlf | 8 ++++---- translations/messages+intl-icu.pt.xlf | 8 ++++---- translations/messages+intl-icu.ru.xlf | 8 ++++---- translations/messages+intl-icu.uk.xlf | 8 ++++---- 15 files changed, 60 insertions(+), 57 deletions(-) diff --git a/templates/default/layout.html.twig b/templates/default/layout.html.twig index a9eb79e..2e25d05 100644 --- a/templates/default/layout.html.twig +++ b/templates/default/layout.html.twig @@ -16,9 +16,12 @@
- +
+ {{ 'Upload any torrent - download with Yggdrasil' | trans | format(path('torrent_submit')) | raw }} +
{% block header_search %} {{ render(controller( 'App\\Controller\\SearchController::module', diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index 33c94c0..e0d8492 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -5,10 +5,6 @@
- - File not found - File not found - Users Users @@ -721,6 +717,10 @@ Search results Search results + + <a href="%s">Upload</a> any torrent - download with Yggdrasil + Upload any torrent - download with Yggdrasil]]> + diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index 739d732..35bf7af 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -5,10 +5,6 @@ - - File not found - File not found - Users Users @@ -721,6 +717,10 @@ Search results Search results + + <a href="%s">Upload</a> any torrent - download with Yggdrasil + Upload any torrent - download with Yggdrasil]]> + diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index 53aec08..8c517f2 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -5,10 +5,6 @@ - - File not found - File not found - Users Users @@ -721,6 +717,10 @@ Search results Search results + + <a href="%s">Upload</a> any torrent - download with Yggdrasil + Upload any torrent - download with Yggdrasil]]> + diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index 8c9206b..bb305f8 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -5,10 +5,6 @@ - - File not found - File not found - Users Users @@ -721,6 +717,10 @@ Search results Search results + + <a href="%s">Upload</a> any torrent - download with Yggdrasil + Upload any torrent - download with Yggdrasil]]> + diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index b20f791..81efda9 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -5,10 +5,6 @@ - - File not found - File not found - Users Users @@ -721,6 +717,10 @@ Search results Search results + + <a href="%s">Upload</a> any torrent - download with Yggdrasil + Upload any torrent - download with Yggdrasil]]> + diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index 6f1894a..e028741 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -5,10 +5,6 @@ - - File not found - File not found - Users Users @@ -721,6 +717,10 @@ Search results Search results + + <a href="%s">Upload</a> any torrent - download with Yggdrasil + Upload any torrent - download with Yggdrasil]]> + diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index b5c3202..cf0fde6 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -5,10 +5,6 @@ - - File not found - File not found - Users Users @@ -721,6 +717,10 @@ Search results Search results + + <a href="%s">Upload</a> any torrent - download with Yggdrasil + Upload any torrent - download with Yggdrasil]]> + diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index 64f52bc..1e57b99 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -5,10 +5,6 @@ - - File not found - File not found - Users Users @@ -721,6 +717,10 @@ Search results Search results + + <a href="%s">Upload</a> any torrent - download with Yggdrasil + Upload any torrent - download with Yggdrasil]]> + diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index d7546df..1c5e2e3 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -5,10 +5,6 @@ - - File not found - File not found - Users Users @@ -721,6 +717,10 @@ Search results Search results + + <a href="%s">Upload</a> any torrent - download with Yggdrasil + Upload any torrent - download with Yggdrasil]]> + diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index 58d1372..c938aed 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -5,10 +5,6 @@ - - File not found - File not found - Users Users @@ -721,6 +717,10 @@ Search results Search results + + <a href="%s">Upload</a> any torrent - download with Yggdrasil + Upload any torrent - download with Yggdrasil]]> + diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index 3e87d08..da866bf 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -5,10 +5,6 @@ - - File not found - File not found - Users Users @@ -721,6 +717,10 @@ Search results Search results + + <a href="%s">Upload</a> any torrent - download with Yggdrasil + Upload any torrent - download with Yggdrasil]]> + diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index 46133ce..9a8e985 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -5,10 +5,6 @@ - - File not found - File not found - Users Users @@ -721,6 +717,10 @@ Search results Search results + + <a href="%s">Upload</a> any torrent - download with Yggdrasil + Upload any torrent - download with Yggdrasil]]> + diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index e0bc111..2af8787 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -5,10 +5,6 @@ - - File not found - Файл не найден - Users Пользователи @@ -721,6 +717,10 @@ Search results Результаты поиска + + <a href="%s">Upload</a> any torrent - download with Yggdrasil + Загрузить любой торрент - скачать с Yggdrasil]]> + diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 802d8f2..8575ff2 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -5,10 +5,6 @@ - - File not found - Файл не знайдено - Users Користувачі @@ -721,6 +717,10 @@ Search results Результати пошуку + + <a href="%s">Upload</a> any torrent - download with Yggdrasil + Надіслати будь-який торент - завантажити з Yggdrasil]]> + From d40436db0059497e4cb54eec04d45a86955858d2 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 23 Oct 2023 23:09:21 +0300 Subject: [PATCH 084/185] update readme --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 89bae99..2df1a1d 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,16 @@ [![Crowdin](https://badges.crowdin.net/yggtracker/localized.svg)](https://crowdin.com/project/yggtracker) -BitTorrent Registry for Yggdrasil +BitTorrent Network for Yggdrasil -YGGtracker uses [Yggdrasil](https://github.com/yggdrasil-network/yggdrasil-go) IPv6 addresses to identify users without registration. +YGGtracker is catalog, open tracker and bridge tools that allows to convert and download any torrent with [Yggdrasil network](https://github.com/yggdrasil-network). + +Engine uses IPv6 `200::/7` addresses to identify users without registration. #### [Showcase](https://github.com/YGGverse/YGGtracker/wiki/Showcase) ![Pasted image 1](https://github.com/YGGverse/YGGtracker/assets/108541346/962f7850-01e1-4add-9dbe-c11b80108a75) - #### Instances * `http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/` From 35bf1a8814e274879b35c90dd096ab7fe3f0510a Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 23 Oct 2023 23:10:18 +0300 Subject: [PATCH 085/185] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2df1a1d..590b31a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ BitTorrent Network for Yggdrasil -YGGtracker is catalog, open tracker and bridge tools that allows to convert and download any torrent with [Yggdrasil network](https://github.com/yggdrasil-network). +YGGtracker is catalog, open tracker and social network that allows to convert and download any torrent with [Yggdrasil network](https://github.com/yggdrasil-network) by community. Engine uses IPv6 `200::/7` addresses to identify users without registration. From 7373f622e4fc05e1bfad175577e4d0a060bd7bc9 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 23 Oct 2023 23:14:11 +0300 Subject: [PATCH 086/185] update readme --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 590b31a..f90150f 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ BitTorrent Network for Yggdrasil -YGGtracker is catalog, open tracker and social network that allows to convert and download any torrent with [Yggdrasil network](https://github.com/yggdrasil-network) by community. +YGGtracker is catalog, open tracker and social network with many features that allow to convert, filter and download any torrent in [Yggdrasil network](https://github.com/yggdrasil-network) by community. -Engine uses IPv6 `200::/7` addresses to identify users without registration. +Engine uses IPv6 `0200::/7` addresses to identify users without registration. #### [Showcase](https://github.com/YGGverse/YGGtracker/wiki/Showcase) @@ -59,6 +59,10 @@ php bin/console doctrine:migrations:migrate * `* * * * * /crontab/torrent/scrape/{%app.key%}` - update seeding stats +##### FTP + +Setup anonymous read-only access to `/var/ftp` catalog (on [wanted feature](https://github.com/YGGverse/YGGtracker/wiki/Features#wanted) enabled), grant `www-data` permissions + ##### App settings Custom settings could be provided in the `/.env.local` file by overwriting default `/.env` values From 09bd7ecf34b15e5e71705d92cb254f58d6b98d71 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 23 Oct 2023 23:17:26 +0300 Subject: [PATCH 087/185] update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f90150f..b65d374 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Engine uses IPv6 `0200::/7` addresses to identify users without registration. #### Instances * `http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/` + + `ftp://[201:23b4:991a:634d:8359:4521:5576:15b7]:21/torrents/wanted` #### Installation From 78a7134ced9a2b79d94344b018ec26be43421208 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 23 Oct 2023 23:24:52 +0300 Subject: [PATCH 088/185] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b65d374..44258c7 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Engine uses IPv6 `0200::/7` addresses to identify users without registration. #### Instances * `http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/` - + `ftp://[201:23b4:991a:634d:8359:4521:5576:15b7]:21/torrents/wanted` + + `ftp://[201:23b4:991a:634d:8359:4521:5576:15b7]:21/yggtracker/` #### Installation From 5f4a14ebe2aa2daa21266f7d2cbc368675e26d4a Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 23 Oct 2023 23:37:15 +0300 Subject: [PATCH 089/185] add APP_TORRENT_WANTED_FTP_FOLDER setting #27 --- .env | 1 + config/services.yaml | 1 + src/Controller/TorrentController.php | 24 ++++++++++++++++-------- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.env b/.env index 9b83a59..afba1d3 100644 --- a/.env +++ b/.env @@ -88,4 +88,5 @@ APP_TORRENT_FILE_SIZE_MAX=1024000 # Store wanted torrent files in /app/var/ftp by /app/crontab/torrent/scrape/{key} APP_TORRENT_WANTED_FTP_ENABLED=1 +APP_TORRENT_WANTED_FTP_FOLDER=/yggtracker APP_TORRENT_WANTED_FTP_APPROVED_ONLY=1 \ No newline at end of file diff --git a/config/services.yaml b/config/services.yaml index e2cb3f6..e53a8b1 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -19,6 +19,7 @@ parameters: app.yggdrasil: '%env(APP_YGGDRASIL)%' app.torrent.size.max: '%env(APP_TORRENT_FILE_SIZE_MAX)%' app.torrent.wanted.ftp.enabled: '%env(APP_TORRENT_WANTED_FTP_ENABLED)%' + app.torrent.wanted.ftp.folder: '%env(APP_TORRENT_WANTED_FTP_FOLDER)%' app.torrent.wanted.ftp.approved: '%env(APP_TORRENT_WANTED_FTP_APPROVED_ONLY)%' services: diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index cde50c6..09e9755 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -2212,7 +2212,8 @@ class TorrentController extends AbstractController $torrentService->copyToFtpStorage( $torrent->getId(), sprintf( - '/torrents/wanted/all/wanted#%s.%s.torrent', + '%s/torrents/wanted/all/wanted#%s.%s.torrent', + $this->getParameter('app.torrent.wanted.ftp.folder'), $torrent->getId(), $file->getName() ) @@ -2224,7 +2225,8 @@ class TorrentController extends AbstractController $torrentService->copyToFtpStorage( $torrent->getId(), sprintf( - '/torrents/wanted/sensitive/yes/wanted#%s.%s.torrent', + '%s/torrents/wanted/sensitive/yes/wanted#%s.%s.torrent', + $this->getParameter('app.torrent.wanted.ftp.folder'), $torrent->getId(), $file->getName() ) @@ -2236,7 +2238,8 @@ class TorrentController extends AbstractController $torrentService->copyToFtpStorage( $torrent->getId(), sprintf( - '/torrents/wanted/sensitive/no/wanted#%s.%s.torrent', + '%s/torrents/wanted/sensitive/no/wanted#%s.%s.torrent', + $this->getParameter('app.torrent.wanted.ftp.folder'), $torrent->getId(), $file->getName() ) @@ -2249,7 +2252,8 @@ class TorrentController extends AbstractController $torrentService->copyToFtpStorage( $torrent->getId(), sprintf( - '/torrents/wanted/locale/%s/wanted#%s.%s.torrent', + '%s/torrents/wanted/locale/%s/wanted#%s.%s.torrent', + $this->getParameter('app.torrent.wanted.ftp.folder'), $locale, $torrent->getId(), $file->getName() @@ -2265,7 +2269,8 @@ class TorrentController extends AbstractController /// All $torrentService->removeFromFtpStorage( sprintf( - '/torrents/wanted/all/wanted#%s.%s.torrent', + '%s/torrents/wanted/all/wanted#%s.%s.torrent', + $this->getParameter('app.torrent.wanted.ftp.folder'), $torrent->getId(), $file->getName() ) @@ -2274,7 +2279,8 @@ class TorrentController extends AbstractController /// Sensitive $torrentService->removeFromFtpStorage( sprintf( - '/torrents/wanted/sensitive/yes/wanted#%s.%s.torrent', + '%s/torrents/wanted/sensitive/yes/wanted#%s.%s.torrent', + $this->getParameter('app.torrent.wanted.ftp.folder'), $torrent->getId(), $file->getName() ) @@ -2282,7 +2288,8 @@ class TorrentController extends AbstractController $torrentService->removeFromFtpStorage( sprintf( - '/torrents/wanted/sensitive/no/wanted#%s.%s.torrent', + '%s/torrents/wanted/sensitive/no/wanted#%s.%s.torrent', + $this->getParameter('app.torrent.wanted.ftp.folder'), $torrent->getId(), $file->getName() ) @@ -2293,7 +2300,8 @@ class TorrentController extends AbstractController { $torrentService->removeFromFtpStorage( sprintf( - '/torrents/wanted/locale/%s/wanted#%s.%s.torrent', + '%s/torrents/wanted/locale/%s/wanted#%s.%s.torrent', + $this->getParameter('app.torrent.wanted.ftp.folder'), $locale, $torrent->getId(), $file->getName() From 24c58d43012a3a25d9d078e64e864fb66ce7ac58 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 24 Oct 2023 00:12:13 +0300 Subject: [PATCH 090/185] add wanted events support #27 --- src/Controller/ActivityController.php | 38 ++++++++++++++++ src/Controller/TorrentController.php | 11 +++++ src/Entity/Activity.php | 2 + src/Service/ActivityService.php | 45 +++++++++++++++++++ .../event/torrent/wanted/add.html.twig | 23 ++++++++++ .../event/torrent/wanted/add.rss.twig | 17 +++++++ translations/messages+intl-icu.cs.xlf | 8 ++++ translations/messages+intl-icu.de.xlf | 8 ++++ translations/messages+intl-icu.en.xlf | 8 ++++ translations/messages+intl-icu.eo.xlf | 8 ++++ translations/messages+intl-icu.es.xlf | 8 ++++ translations/messages+intl-icu.fr.xlf | 8 ++++ translations/messages+intl-icu.he.xlf | 8 ++++ translations/messages+intl-icu.it.xlf | 8 ++++ translations/messages+intl-icu.ka.xlf | 8 ++++ translations/messages+intl-icu.lv.xlf | 8 ++++ translations/messages+intl-icu.pl.xlf | 8 ++++ translations/messages+intl-icu.pt.xlf | 8 ++++ translations/messages+intl-icu.ru.xlf | 8 ++++ translations/messages+intl-icu.uk.xlf | 10 ++++- 20 files changed, 249 insertions(+), 1 deletion(-) create mode 100644 templates/default/activity/event/torrent/wanted/add.html.twig create mode 100644 templates/default/activity/event/torrent/wanted/add.rss.twig diff --git a/src/Controller/ActivityController.php b/src/Controller/ActivityController.php index 2f62d78..4ac57f1 100644 --- a/src/Controller/ActivityController.php +++ b/src/Controller/ActivityController.php @@ -764,6 +764,44 @@ class ActivityController extends AbstractController break; + // Torrent Wanted + case $activity::EVENT_TORRENT_WANTED_ADD: + + // Init torrent + if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) + { + throw $this->createNotFoundException(); + } + + return $this->render( + 'default/activity/event/torrent/wanted/add' . $extension, + [ + 'id' => $activity->getId(), + 'added' => $activity->getAdded(), + 'torrent' => + [ + 'id' => $torrent->getId(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'name' => $torrentService->readTorrentFileByTorrentId( + $torrent->getId() + )->getName() + ], + 'session' => + [ + 'user' => + [ + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), + ] + ] + ] + ); + + break; + /// Torrent Locales case $activity::EVENT_TORRENT_LOCALES_ADD: diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 09e9755..8027390 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -2191,6 +2191,17 @@ class TorrentController extends AbstractController } } + // Register activity event only on previous status changed + if ($leechers && !$seeders && + $leechers != (int) $torrent->getLeechers() && $seeders != (int) $torrent->getSeeders()) + { + $activityService->addEventTorrentWantedAdd( + $torrent->getUserId(), // just required field, let's relate with author, because we don't know which exactly user requires for seeders from crontab @TODO + time(), + $torrent->getId() + ); + } + // Update DB $torrentService->updateTorrentScrape( $torrent->getId(), diff --git a/src/Entity/Activity.php b/src/Entity/Activity.php index a08cfcb..3b208b9 100644 --- a/src/Entity/Activity.php +++ b/src/Entity/Activity.php @@ -57,6 +57,8 @@ class Activity public const EVENT_TORRENT_DOWNLOAD_MAGNET_ADD = 2600; + public const EVENT_TORRENT_WANTED_ADD = 2700; + // ... #[ORM\Column] diff --git a/src/Service/ActivityService.php b/src/Service/ActivityService.php index 14eaa9f..4dbbb74 100644 --- a/src/Service/ActivityService.php +++ b/src/Service/ActivityService.php @@ -61,6 +61,8 @@ class ActivityService Activity::EVENT_TORRENT_DOWNLOAD_FILE_ADD, Activity::EVENT_TORRENT_DOWNLOAD_MAGNET_ADD, + + Activity::EVENT_TORRENT_WANTED_ADD, ]; } @@ -365,6 +367,18 @@ class ActivityService ] = $code; break; + + case Activity::EVENT_TORRENT_WANTED_ADD: + + $events + [ + $this->translatorInterface->trans('Torrents') + ] + [ + $this->translatorInterface->trans('Wanted') + ] = $code; + + break; } } @@ -847,6 +861,37 @@ class ActivityService return $activity; } + + public function addEventTorrentWantedAdd( + int $userId, + int $added, + int $torrentId + ): ?Activity + { + $activity = new Activity(); + + $activity->setEvent( + Activity::EVENT_TORRENT_WANTED_ADD + ); + + $activity->setUserId( + $userId + ); + + $activity->setAdded( + $added + ); + + $activity->setTorrentId( + $torrentId + ); + + $this->entityManagerInterface->persist($activity); + $this->entityManagerInterface->flush(); + + return $activity; + } + /// Torrent Download public function addEventTorrentDownloadFileAdd( int $userId, diff --git a/templates/default/activity/event/torrent/wanted/add.html.twig b/templates/default/activity/event/torrent/wanted/add.html.twig new file mode 100644 index 0000000..06c14a5 --- /dev/null +++ b/templates/default/activity/event/torrent/wanted/add.html.twig @@ -0,0 +1,23 @@ +
+
+ + {{ 'seeders wanted for torrent' | trans }} + + {% if session.user.moderator or session.user.owner %} + + {{ torrent.name }} + + {% else %} + {% if torrent.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + + {{ torrent.name }} + + {% endif %} + {% endif %} +
+
+ {{ added | format_ago }} +
+
\ No newline at end of file diff --git a/templates/default/activity/event/torrent/wanted/add.rss.twig b/templates/default/activity/event/torrent/wanted/add.rss.twig new file mode 100644 index 0000000..1fdbc7c --- /dev/null +++ b/templates/default/activity/event/torrent/wanted/add.rss.twig @@ -0,0 +1,17 @@ + + + {{ 'seeders wanted for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + {{ torrent.name }} + {% else %} + {% if torrent.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + {{ torrent.name }} + {% endif %} + {% endif %} + + {{ added | date('D, d M Y h:i:s O') }} + {{ url('torrent_info', { torrentId : torrent.id }) }}#activity-{{ id }} + {{ url('torrent_info', { torrentId : torrent.id }) }}#activity + \ No newline at end of file diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index e0d8492..c837042 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -721,6 +721,14 @@ <a href="%s">Upload</a> any torrent - download with Yggdrasil Upload any torrent - download with Yggdrasil]]> + + Wanted + Wanted + + + seeders wanted for torrent + seeders wanted for torrent + diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index 35bf7af..9bca1ae 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -721,6 +721,14 @@ <a href="%s">Upload</a> any torrent - download with Yggdrasil Upload any torrent - download with Yggdrasil]]> + + Wanted + Wanted + + + seeders wanted for torrent + seeders wanted for torrent + diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index 8c517f2..59d282a 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -721,6 +721,14 @@ <a href="%s">Upload</a> any torrent - download with Yggdrasil Upload any torrent - download with Yggdrasil]]> + + Wanted + Wanted + + + seeders wanted for torrent + seeders wanted for torrent + diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index bb305f8..15d4350 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -721,6 +721,14 @@ <a href="%s">Upload</a> any torrent - download with Yggdrasil Upload any torrent - download with Yggdrasil]]> + + Wanted + Wanted + + + seeders wanted for torrent + seeders wanted for torrent + diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index 81efda9..0f475db 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -721,6 +721,14 @@ <a href="%s">Upload</a> any torrent - download with Yggdrasil Upload any torrent - download with Yggdrasil]]> + + Wanted + Wanted + + + seeders wanted for torrent + seeders wanted for torrent + diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index e028741..097d28f 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -721,6 +721,14 @@ <a href="%s">Upload</a> any torrent - download with Yggdrasil Upload any torrent - download with Yggdrasil]]> + + Wanted + Wanted + + + seeders wanted for torrent + seeders wanted for torrent + diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index cf0fde6..8435131 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -721,6 +721,14 @@ <a href="%s">Upload</a> any torrent - download with Yggdrasil Upload any torrent - download with Yggdrasil]]> + + Wanted + Wanted + + + seeders wanted for torrent + seeders wanted for torrent + diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index 1e57b99..aba8add 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -721,6 +721,14 @@ <a href="%s">Upload</a> any torrent - download with Yggdrasil Upload any torrent - download with Yggdrasil]]> + + Wanted + Wanted + + + seeders wanted for torrent + seeders wanted for torrent + diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index 1c5e2e3..a84f766 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -721,6 +721,14 @@ <a href="%s">Upload</a> any torrent - download with Yggdrasil Upload any torrent - download with Yggdrasil]]> + + Wanted + Wanted + + + seeders wanted for torrent + seeders wanted for torrent + diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index c938aed..fd5488d 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -721,6 +721,14 @@ <a href="%s">Upload</a> any torrent - download with Yggdrasil Upload any torrent - download with Yggdrasil]]> + + Wanted + Wanted + + + seeders wanted for torrent + seeders wanted for torrent + diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index da866bf..f151ff6 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -721,6 +721,14 @@ <a href="%s">Upload</a> any torrent - download with Yggdrasil Upload any torrent - download with Yggdrasil]]> + + Wanted + Wanted + + + seeders wanted for torrent + seeders wanted for torrent + diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index 9a8e985..a5c6465 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -721,6 +721,14 @@ <a href="%s">Upload</a> any torrent - download with Yggdrasil Upload any torrent - download with Yggdrasil]]> + + Wanted + Wanted + + + seeders wanted for torrent + seeders wanted for torrent + diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index 2af8787..c816722 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -721,6 +721,14 @@ <a href="%s">Upload</a> any torrent - download with Yggdrasil Загрузить любой торрент - скачать с Yggdrasil]]> + + Wanted + Розыск + + + seeders wanted for torrent + требуется раздача для торрента + diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 8575ff2..aca1774 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -163,7 +163,7 @@ wanted - розшукується + розшук Waiting for approve @@ -721,6 +721,14 @@ <a href="%s">Upload</a> any torrent - download with Yggdrasil Надіслати будь-який торент - завантажити з Yggdrasil]]> + + Wanted + Розшук + + + seeders wanted for torrent + розшукуються роздачі для торенту + From dd04922cc0d5b1df472ce9c3765bfb306d5e9d10 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 24 Oct 2023 00:58:25 +0300 Subject: [PATCH 091/185] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44258c7..1013d1f 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ php bin/console doctrine:migrations:migrate ##### FTP -Setup anonymous read-only access to `/var/ftp` catalog (on [wanted feature](https://github.com/YGGverse/YGGtracker/wiki/Features#wanted) enabled), grant `www-data` permissions +Setup anonymous read-only access to `/var/ftp` catalog ([read more](https://github.com/YGGverse/YGGtracker/wiki/Features#wanted)) ##### App settings From a72413706dda52cd7f2621fade53f0c82f30a825 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 24 Oct 2023 01:08:53 +0300 Subject: [PATCH 092/185] fix dependencies --- src/Controller/TorrentController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 8027390..1c09ccc 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -2099,6 +2099,7 @@ class TorrentController extends AbstractController Request $request, TranslatorInterface $translator, TorrentService $torrentService, + ActivityService $activityService ): Response { // Init Scraper From 5ecf8461b491579fde5855c5c1bb5323e65ee330 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 24 Oct 2023 01:13:20 +0300 Subject: [PATCH 093/185] update string translations, fix activity margin #27 --- .../default/activity/event/torrent/wanted/add.html.twig | 4 +--- .../default/activity/event/torrent/wanted/add.rss.twig | 2 +- translations/messages+intl-icu.cs.xlf | 6 +++--- translations/messages+intl-icu.de.xlf | 6 +++--- translations/messages+intl-icu.en.xlf | 6 +++--- translations/messages+intl-icu.eo.xlf | 6 +++--- translations/messages+intl-icu.es.xlf | 6 +++--- translations/messages+intl-icu.fr.xlf | 6 +++--- translations/messages+intl-icu.he.xlf | 6 +++--- translations/messages+intl-icu.it.xlf | 6 +++--- translations/messages+intl-icu.ka.xlf | 6 +++--- translations/messages+intl-icu.lv.xlf | 6 +++--- translations/messages+intl-icu.pl.xlf | 6 +++--- translations/messages+intl-icu.pt.xlf | 6 +++--- translations/messages+intl-icu.ru.xlf | 6 +++--- translations/messages+intl-icu.uk.xlf | 6 +++--- 16 files changed, 44 insertions(+), 46 deletions(-) diff --git a/templates/default/activity/event/torrent/wanted/add.html.twig b/templates/default/activity/event/torrent/wanted/add.html.twig index 06c14a5..92b6dbc 100644 --- a/templates/default/activity/event/torrent/wanted/add.html.twig +++ b/templates/default/activity/event/torrent/wanted/add.html.twig @@ -1,8 +1,6 @@
- - {{ 'seeders wanted for torrent' | trans }} - + {{ 'Seeders wanted for torrent' | trans }} {% if session.user.moderator or session.user.owner %} {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/wanted/add.rss.twig b/templates/default/activity/event/torrent/wanted/add.rss.twig index 1fdbc7c..4c79afd 100644 --- a/templates/default/activity/event/torrent/wanted/add.rss.twig +++ b/templates/default/activity/event/torrent/wanted/add.rss.twig @@ -1,6 +1,6 @@ - {{ 'seeders wanted for torrent' | trans }} + {{ 'Seeders wanted for torrent' | trans }} {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index c837042..2340666 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -725,9 +725,9 @@ <source>Wanted</source> <target>Wanted</target> </trans-unit> - <trans-unit id="B95C5DS" resname="seeders wanted for torrent"> - <source>seeders wanted for torrent</source> - <target>seeders wanted for torrent</target> + <trans-unit id="SK4nQBL" resname="Seeders wanted for torrent"> + <source>Seeders wanted for torrent</source> + <target>Seeders wanted for torrent</target> </trans-unit> </body> </file> diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index 9bca1ae..924e72d 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -725,9 +725,9 @@ <source>Wanted</source> <target>Wanted</target> </trans-unit> - <trans-unit id="B95C5DS" resname="seeders wanted for torrent"> - <source>seeders wanted for torrent</source> - <target>seeders wanted for torrent</target> + <trans-unit id="SK4nQBL" resname="Seeders wanted for torrent"> + <source>Seeders wanted for torrent</source> + <target>Seeders wanted for torrent</target> </trans-unit> </body> </file> diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index 59d282a..2dd2ad9 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -725,9 +725,9 @@ <source>Wanted</source> <target>Wanted</target> </trans-unit> - <trans-unit id="B95C5DS" resname="seeders wanted for torrent"> - <source>seeders wanted for torrent</source> - <target>seeders wanted for torrent</target> + <trans-unit id="SK4nQBL" resname="Seeders wanted for torrent"> + <source>Seeders wanted for torrent</source> + <target>Seeders wanted for torrent</target> </trans-unit> </body> </file> diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index 15d4350..c74329c 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -725,9 +725,9 @@ <source>Wanted</source> <target>Wanted</target> </trans-unit> - <trans-unit id="B95C5DS" resname="seeders wanted for torrent"> - <source>seeders wanted for torrent</source> - <target>seeders wanted for torrent</target> + <trans-unit id="SK4nQBL" resname="Seeders wanted for torrent"> + <source>Seeders wanted for torrent</source> + <target>Seeders wanted for torrent</target> </trans-unit> </body> </file> diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index 0f475db..8ff570b 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -725,9 +725,9 @@ <source>Wanted</source> <target>Wanted</target> </trans-unit> - <trans-unit id="B95C5DS" resname="seeders wanted for torrent"> - <source>seeders wanted for torrent</source> - <target>seeders wanted for torrent</target> + <trans-unit id="SK4nQBL" resname="Seeders wanted for torrent"> + <source>Seeders wanted for torrent</source> + <target>Seeders wanted for torrent</target> </trans-unit> </body> </file> diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index 097d28f..d0ff05a 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -725,9 +725,9 @@ <source>Wanted</source> <target>Wanted</target> </trans-unit> - <trans-unit id="B95C5DS" resname="seeders wanted for torrent"> - <source>seeders wanted for torrent</source> - <target>seeders wanted for torrent</target> + <trans-unit id="SK4nQBL" resname="Seeders wanted for torrent"> + <source>Seeders wanted for torrent</source> + <target>Seeders wanted for torrent</target> </trans-unit> </body> </file> diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index 8435131..7520e86 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -725,9 +725,9 @@ <source>Wanted</source> <target>Wanted</target> </trans-unit> - <trans-unit id="B95C5DS" resname="seeders wanted for torrent"> - <source>seeders wanted for torrent</source> - <target>seeders wanted for torrent</target> + <trans-unit id="SK4nQBL" resname="Seeders wanted for torrent"> + <source>Seeders wanted for torrent</source> + <target>Seeders wanted for torrent</target> </trans-unit> </body> </file> diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index aba8add..ec02070 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -725,9 +725,9 @@ <source>Wanted</source> <target>Wanted</target> </trans-unit> - <trans-unit id="B95C5DS" resname="seeders wanted for torrent"> - <source>seeders wanted for torrent</source> - <target>seeders wanted for torrent</target> + <trans-unit id="SK4nQBL" resname="Seeders wanted for torrent"> + <source>Seeders wanted for torrent</source> + <target>Seeders wanted for torrent</target> </trans-unit> </body> </file> diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index a84f766..3cf3e4e 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -725,9 +725,9 @@ <source>Wanted</source> <target>Wanted</target> </trans-unit> - <trans-unit id="B95C5DS" resname="seeders wanted for torrent"> - <source>seeders wanted for torrent</source> - <target>seeders wanted for torrent</target> + <trans-unit id="SK4nQBL" resname="Seeders wanted for torrent"> + <source>Seeders wanted for torrent</source> + <target>Seeders wanted for torrent</target> </trans-unit> </body> </file> diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index fd5488d..24257ae 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -725,9 +725,9 @@ <source>Wanted</source> <target>Wanted</target> </trans-unit> - <trans-unit id="B95C5DS" resname="seeders wanted for torrent"> - <source>seeders wanted for torrent</source> - <target>seeders wanted for torrent</target> + <trans-unit id="SK4nQBL" resname="Seeders wanted for torrent"> + <source>Seeders wanted for torrent</source> + <target>Seeders wanted for torrent</target> </trans-unit> </body> </file> diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index f151ff6..03a35fc 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -725,9 +725,9 @@ <source>Wanted</source> <target>Wanted</target> </trans-unit> - <trans-unit id="B95C5DS" resname="seeders wanted for torrent"> - <source>seeders wanted for torrent</source> - <target>seeders wanted for torrent</target> + <trans-unit id="SK4nQBL" resname="Seeders wanted for torrent"> + <source>Seeders wanted for torrent</source> + <target>Seeders wanted for torrent</target> </trans-unit> </body> </file> diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index a5c6465..c962f6a 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -725,9 +725,9 @@ <source>Wanted</source> <target>Wanted</target> </trans-unit> - <trans-unit id="B95C5DS" resname="seeders wanted for torrent"> - <source>seeders wanted for torrent</source> - <target>seeders wanted for torrent</target> + <trans-unit id="SK4nQBL" resname="Seeders wanted for torrent"> + <source>Seeders wanted for torrent</source> + <target>Seeders wanted for torrent</target> </trans-unit> </body> </file> diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index c816722..1805bfb 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -725,9 +725,9 @@ <source>Wanted</source> <target>Розыск</target> </trans-unit> - <trans-unit id="B95C5DS" resname="seeders wanted for torrent"> - <source>seeders wanted for torrent</source> - <target>требуется раздача для торрента</target> + <trans-unit id="SK4nQBL" resname="Seeders wanted for torrent"> + <source>Seeders wanted for torrent</source> + <target>Требуется раздача для торрента</target> </trans-unit> </body> </file> diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index aca1774..f4cae61 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -725,9 +725,9 @@ <source>Wanted</source> <target>Розшук</target> </trans-unit> - <trans-unit id="B95C5DS" resname="seeders wanted for torrent"> - <source>seeders wanted for torrent</source> - <target>розшукуються роздачі для торенту</target> + <trans-unit id="SK4nQBL" resname="Seeders wanted for torrent"> + <source>Seeders wanted for torrent</source> + <target>Розшукуються роздачі для торенту</target> </trans-unit> </body> </file> From 0d96cd3e3a24bd4ae4508cc4039ff76a2db74fad Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Tue, 24 Oct 2023 01:13:48 +0300 Subject: [PATCH 094/185] update version --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index afba1d3..9332030 100644 --- a/.env +++ b/.env @@ -48,7 +48,7 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 # YGGtracker # Application version, used for API and media cache -APP_VERSION='2.1.0' +APP_VERSION='2.2.0' # Application name APP_NAME=YGGtracker From b4c6a98d49a515096b33a0e7315bb7fb961bd02e Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Tue, 24 Oct 2023 01:48:26 +0300 Subject: [PATCH 095/185] fix announcement generation for wanted torrents #27 --- src/Controller/TorrentController.php | 68 ++++++++++++---------------- 1 file changed, 29 insertions(+), 39 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 1c09ccc..5e97ac0 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -2418,25 +2418,40 @@ class TorrentController extends AbstractController ?\Rhilip\Bencode\TorrentFile $file, bool $yggdrasil, string $regex = '/^0{0,1}[2-3][a-f0-9]{0,2}:/' ): ?\Rhilip\Bencode\TorrentFile { + // Init trackers registry + $allTrackers = []; + // Get app trackers $appTrackers = explode('|', $this->getParameter('app.trackers')); - // Get original file announcements - $announceList = $file->getAnnounceList(); - // Append app trackers foreach ($appTrackers as $appTracker) { - // Append application trackers - $announceList[0][] = $appTracker; - - // Append application re-trackers - $announceList[1][] = $appTracker; + $allTrackers[] = $appTracker; } - // Remove duplicated - $announceList[0] = array_unique($announceList[0]); - $announceList[1] = array_unique($announceList[1]); + // Get original file announcements + $announceList = $file->getAnnounceList(); + + // Append original file announcements + foreach ($announceList as $announce) + { + if (is_array($announce)) + { + foreach ($announce as $value) + { + $allTrackers[] = $value; + } + } + + else + { + $allTrackers[] = $value; + } + } + + // Remove duplicates + $allTrackers = array_unique($allTrackers); // Yggdrasil-only mode if ($yggdrasil) @@ -2450,45 +2465,20 @@ class TorrentController extends AbstractController } // Remove non-Yggdrasil trackers from announcement list - foreach ($announceList[0] as $key => $value) + foreach ($allTrackers as $key => $value) { // trackers if (!preg_match($regex, str_replace(['[',']'], false, parse_url($value, PHP_URL_HOST)))) { - unset($announceList[0][$key]); - } - } - - // Remove non-Yggdrasil re-trackers from announcement list - foreach ($announceList[1] as $key => $value) - { - // trackers - if (!preg_match($regex, str_replace(['[',']'], false, parse_url($value, PHP_URL_HOST)))) - { - unset($announceList[1][$key]); + unset($allTrackers[$key]); } } } - // Remove duplicates in list - $values = []; - - foreach ($announceList[0] as $value) - { - $values[] = $value; - } - - foreach ($announceList[1] as $value) - { - $values[] = $value; - } - - $values = array_unique($values); - // Format announce list $trackers = []; - foreach ($values as $value) + foreach ($allTrackers as $value) { $trackers[] = [$value]; } From fa1f1f18c66cb8fe2d155e29841f608e406512c7 Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Tue, 24 Oct 2023 04:59:36 +0300 Subject: [PATCH 096/185] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1013d1f..006d6f9 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ php bin/console doctrine:migrations:migrate ##### FTP -Setup anonymous read-only access to `/var/ftp` catalog ([read more](https://github.com/YGGverse/YGGtracker/wiki/Features#wanted)) +Setup anonymous read-only access to `/var/ftp` catalog ([read more](https://github.com/YGGverse/YGGtracker/wiki/Features#the-wanted)) ##### App settings From 341c3a70a5f96e03469ffe927af85633551b375f Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Wed, 25 Oct 2023 02:16:22 +0300 Subject: [PATCH 097/185] update readme --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 006d6f9..6d5d9a7 100644 --- a/README.md +++ b/README.md @@ -120,9 +120,10 @@ git checkout -b my-pr-branch-name * [Mastodon](https://mastodon.social/@YGGverse) -#### Plugins +#### Integrations -* [qBitTorrent](https://github.com/YGGverse/qbittorrent-yggtracker-search-plugin) +* [YGGtracker Search Plugin for qBittorrent](https://github.com/YGGverse/qbittorrent-yggtracker-search-plugin) +* [Crontab script that allows to receive wanted torrents from multiple YGGtracker nodes](https://github.com/YGGverse/yggtracker-wanted-torrents-receiver) #### See also From 6bc2c360a35af6a9ce06008ab9f10715184dc0ea Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Wed, 25 Oct 2023 18:48:31 +0300 Subject: [PATCH 098/185] fix activity template --- .../default/activity/event/torrent/approve/delete.html.twig | 3 --- 1 file changed, 3 deletions(-) diff --git a/templates/default/activity/event/torrent/approve/delete.html.twig b/templates/default/activity/event/torrent/approve/delete.html.twig index 6051686..3033a95 100644 --- a/templates/default/activity/event/torrent/approve/delete.html.twig +++ b/templates/default/activity/event/torrent/approve/delete.html.twig @@ -10,9 +10,6 @@ <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> {{ torrent.name }} </a> - {% if torrent.approved == false %} - #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% endif %} {% else %} {% if torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) From 1c9de9b27560cc007d7248ba6bd013c1e8155622 Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Wed, 25 Oct 2023 18:49:56 +0300 Subject: [PATCH 099/185] fix activity template --- templates/default/activity/event/torrent/add.html.twig | 3 --- 1 file changed, 3 deletions(-) diff --git a/templates/default/activity/event/torrent/add.html.twig b/templates/default/activity/event/torrent/add.html.twig index 42e2c30..11712a2 100644 --- a/templates/default/activity/event/torrent/add.html.twig +++ b/templates/default/activity/event/torrent/add.html.twig @@ -8,9 +8,6 @@ <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> {{ torrent.name }} </a> - {% if torrent.approved == false %} - #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% endif %} {% else %} {% if torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) From 1d6a7b03b2943b5ca85c6e46abd203891a7d113b Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Wed, 25 Oct 2023 19:27:43 +0300 Subject: [PATCH 100/185] fix long filename out of container width --- public/asset/default/css/framework.css | 12 ++++++++++++ templates/default/torrent/info.html.twig | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/public/asset/default/css/framework.css b/public/asset/default/css/framework.css index 5a2ef07..0d08a54 100644 --- a/public/asset/default/css/framework.css +++ b/public/asset/default/css/framework.css @@ -15,6 +15,18 @@ float: left; } +.word-break { + word-break: break-word; +} + +.overflow-auto { + overflow: auto; +} + +.float-left { + float: left; +} + .float-right { float: right; } diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index f59c5a4..48a0b38 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -10,7 +10,9 @@ </div> {% else %} <div class="padding-y-4-px padding-l-8-px background-color-hover-night-light cursor-default"> - {{ key }} + <span class="word-break"> + {{ key }} + </span> <div class="float-right padding-x-8-px"> {{ value | format_bytes }} </div> From 4969d33f576717bd1626eb8db4065b305c4754c7 Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Wed, 25 Oct 2023 19:34:07 +0300 Subject: [PATCH 101/185] fix long filename out of container width --- templates/default/torrent/info.html.twig | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index 48a0b38..24510e8 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -9,10 +9,8 @@ {{ self.recursive_file_tree(value) }} </div> {% else %} - <div class="padding-y-4-px padding-l-8-px background-color-hover-night-light cursor-default"> - <span class="word-break"> - {{ key }} - </span> + <div class="padding-y-4-px padding-l-8-px background-color-hover-night-light cursor-default word-break"> + {{ key }} <div class="float-right padding-x-8-px"> {{ value | format_bytes }} </div> @@ -292,7 +290,7 @@ </div> <div class="padding-y-16-px"> {% for tracker, status in trackers %} - <div class="padding-y-4-px"> + <div class="padding-y-4-px word-break"> {% if status %} {{ tracker }} {% else %} From 82f69c64a69ca30ac3615980eb6e004d4a5364bc Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Thu, 26 Oct 2023 02:32:11 +0300 Subject: [PATCH 102/185] fix line break for wanted label --- public/asset/default/css/framework.css | 4 ---- templates/default/torrent/list.html.twig | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/public/asset/default/css/framework.css b/public/asset/default/css/framework.css index 0d08a54..3c632be 100644 --- a/public/asset/default/css/framework.css +++ b/public/asset/default/css/framework.css @@ -160,10 +160,6 @@ a.button-green:hover { vertical-align: middle; } -.top--2-px { - top: -2px; -} - .top-2-px { top: 2px; } diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index b16b13a..12cfcdc 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -34,7 +34,7 @@ </h2> {% if torrent.scrape.leechers > 0 and torrent.scrape.seeders == 0 %} <a href="{{ path('torrent_file_wanted', { torrentId : torrent.id }) }}" - class="label label-green margin-l-4-px font-size-10-px position-relative top--2" + class="label label-green font-size-10-px position-relative display-inline-block" title="{{ 'Active leechers waiting for seeders' | trans }}"> {{ 'wanted' | trans }} </a> From 83ea09adad5bbc94a3a023fd779f50248eb09b02 Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Thu, 26 Oct 2023 03:58:51 +0300 Subject: [PATCH 103/185] fix event margin --- .../default/activity/event/torrent/download/file/add.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/activity/event/torrent/download/file/add.html.twig b/templates/default/activity/event/torrent/download/file/add.html.twig index 057743f..7959ff7 100644 --- a/templates/default/activity/event/torrent/download/file/add.html.twig +++ b/templates/default/activity/event/torrent/download/file/add.html.twig @@ -3,7 +3,7 @@ <a href="{{ path('user_info', { userId : user.id }) }}"> <img class="border-radius-50 border-color-default vertical-align-middle" src="{{ user.identicon }}" alt="{{ 'identicon' | trans }}" /> </a> - <span class="margin-x-4-px"> + <span class="margin-l-4-px"> {{ 'have downloaded torrent file' | trans }} </span> {% if session.user.moderator or session.user.owner %} From a47893ff9beb194fd0be38a8dabeac4ef23dcb44 Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Thu, 26 Oct 2023 04:02:35 +0300 Subject: [PATCH 104/185] request scrape update on torrent download --- src/Controller/TorrentController.php | 18 ++++++++++++++++++ src/Service/TorrentService.php | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 5e97ac0..c275c74 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -1826,6 +1826,12 @@ class TorrentController extends AbstractController time() ); + // Request scrape + $torrentService->updateTorrentScraped( + $torrent->getId(), + 0 + ); + // Register download event $activityService->addEventTorrentDownloadFileAdd( $user->getId(), @@ -1947,6 +1953,12 @@ class TorrentController extends AbstractController time() ); + // Request scrape + $torrentService->updateTorrentScraped( + $torrent->getId(), + 0 + ); + // Register download event $activityService->addEventTorrentDownloadFileAdd( $user->getId(), @@ -2065,6 +2077,12 @@ class TorrentController extends AbstractController time() ); + // Request scrape + $torrentService->updateTorrentScraped( + $torrent->getId(), + 0 + ); + // Register download event $activityService->addEventTorrentDownloadMagnetAdd( $user->getId(), diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index 5e2c4c3..6cb8a10 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -407,6 +407,22 @@ class TorrentService } } + public function updateTorrentScraped( + int $torrentId, + int $time + ): void + { + if ($torrent = $this->getTorrent($torrentId)) + { + $torrent->setScraped( + time() + ); + + $this->entityManagerInterface->persist($torrent); + $this->entityManagerInterface->flush(); + } + } + public function updateTorrentScrape( int $torrentId, int $seeders, From 79886c0d77b8816bfdf064d6e71fc45116043801 Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Thu, 26 Oct 2023 04:09:42 +0300 Subject: [PATCH 105/185] fix request scrape update on torrent download --- src/Service/TorrentService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index 6cb8a10..00986a3 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -415,7 +415,7 @@ class TorrentService if ($torrent = $this->getTorrent($torrentId)) { $torrent->setScraped( - time() + $time ); $this->entityManagerInterface->persist($torrent); From 0b77a5d17151a2b9267cc0c5a1556931eabe560b Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Thu, 26 Oct 2023 05:52:08 +0300 Subject: [PATCH 106/185] add line break support for torrent comments --- templates/default/torrent/info.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index 24510e8..e3f7251 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -219,7 +219,7 @@ {{ 'Comment' | trans }} </td> <td> - {{ file.comment }} + {{ file.comment | nl2br }} </td> </tr> {% endif %} From 5c4e9492698df0caa95c2e32fd5384676cda4e07 Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Thu, 26 Oct 2023 06:37:41 +0300 Subject: [PATCH 107/185] update file tree view --- templates/default/torrent/info.html.twig | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index e3f7251..50a8df4 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -2,16 +2,18 @@ {% import _self as self %} {% for key, value in tree %} {% if value is iterable %} - <div class="padding-l-8-px cursor-default"> - <div class="padding-y-4-px"> - {{ key }} - </div> + <div class="padding-x-4-px margin-b-4-px cursor-default line-height-20-px word-break"> + {{ key }} + </div> + <div class="padding-l-8-px"> {{ self.recursive_file_tree(value) }} </div> {% else %} - <div class="padding-y-4-px padding-l-8-px background-color-hover-night-light cursor-default word-break"> - {{ key }} - <div class="float-right padding-x-8-px"> + <div class="row padding-x-4-px margin-b-4-px cursor-default background-color-hover-night-light word-break"> + <div class="column width-80 line-height-20-px"> + {{ key }} + </div> + <div class="column width-20 line-height-20-px text-right"> {{ value | format_bytes }} </div> </div> From 246fdda4fbcd357bc928e0237f033f80b330ff8c Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Thu, 26 Oct 2023 06:57:10 +0300 Subject: [PATCH 108/185] fix sensitive content visibility for publication owners --- src/Controller/TorrentController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index c275c74..05e1b51 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -234,7 +234,7 @@ class TorrentController extends AbstractController $total = $torrentService->findTorrentsTotal( $query, $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all + !$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() ? true : null, // show approved content only for regular users ); @@ -242,7 +242,7 @@ class TorrentController extends AbstractController foreach ($torrentService->findTorrents( $query, $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all + !$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() ? true : null, // show approved content only for regular users $this->getParameter('app.pagination'), ($page - 1) * $this->getParameter('app.pagination') @@ -403,7 +403,7 @@ class TorrentController extends AbstractController $total = $torrentService->findTorrentsTotal( [], $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all + !$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() ? true : null, // show approved content only for regular users ); @@ -412,7 +412,7 @@ class TorrentController extends AbstractController foreach ($torrentService->findTorrents( [], $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all + !$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() ? true : null, // show approved content only for regular users $this->getParameter('app.pagination'), ($page - 1) * $this->getParameter('app.pagination') @@ -560,7 +560,7 @@ class TorrentController extends AbstractController $total = $torrentService->findTorrentsTotal( $query, $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all + !$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() ? true : null // show approved content only for regular users ); @@ -569,7 +569,7 @@ class TorrentController extends AbstractController foreach ($torrentService->findTorrents( $query, $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all + !$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() ? true : null, // show approved content only for regular users $this->getParameter('app.pagination'), ($page - 1) * $this->getParameter('app.pagination') From be248963e95b71553c5cd6d3e9ea4ce4870833e2 Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Thu, 26 Oct 2023 18:31:21 +0300 Subject: [PATCH 109/185] rollback commit 246fdda4fbcd357bc928e0237f033f80b330ff8c causes error --- src/Controller/TorrentController.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 05e1b51..a95ae77 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -57,7 +57,7 @@ class TorrentController extends AbstractController } // Sensitive filter - if (!$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive()) + if (!$user->isModerator() && $user->isSensitive()) { throw $this->createNotFoundException(); } @@ -234,7 +234,7 @@ class TorrentController extends AbstractController $total = $torrentService->findTorrentsTotal( $query, $user->getLocales(), - !$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all + !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() ? true : null, // show approved content only for regular users ); @@ -242,7 +242,7 @@ class TorrentController extends AbstractController foreach ($torrentService->findTorrents( $query, $user->getLocales(), - !$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all + !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() ? true : null, // show approved content only for regular users $this->getParameter('app.pagination'), ($page - 1) * $this->getParameter('app.pagination') @@ -403,7 +403,7 @@ class TorrentController extends AbstractController $total = $torrentService->findTorrentsTotal( [], $user->getLocales(), - !$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all + !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() ? true : null, // show approved content only for regular users ); @@ -412,7 +412,7 @@ class TorrentController extends AbstractController foreach ($torrentService->findTorrents( [], $user->getLocales(), - !$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all + !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() ? true : null, // show approved content only for regular users $this->getParameter('app.pagination'), ($page - 1) * $this->getParameter('app.pagination') @@ -560,7 +560,7 @@ class TorrentController extends AbstractController $total = $torrentService->findTorrentsTotal( $query, $user->getLocales(), - !$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all + !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() ? true : null // show approved content only for regular users ); @@ -569,7 +569,7 @@ class TorrentController extends AbstractController foreach ($torrentService->findTorrents( $query, $user->getLocales(), - !$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all + !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() ? true : null, // show approved content only for regular users $this->getParameter('app.pagination'), ($page - 1) * $this->getParameter('app.pagination') @@ -1808,7 +1808,7 @@ class TorrentController extends AbstractController } // Sensitive filter - if (!$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive()) + if (!$user->isModerator() && $user->isSensitive()) { throw $this->createNotFoundException(); } @@ -1935,7 +1935,7 @@ class TorrentController extends AbstractController } // Sensitive filter - if (!$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive()) + if (!$user->isModerator() && $user->isSensitive()) { throw $this->createNotFoundException(); } @@ -2059,7 +2059,7 @@ class TorrentController extends AbstractController } // Sensitive filter - if (!$user->isModerator() && $user->getId() != $torrent->getUserId() && $user->isSensitive()) + if (!$user->isModerator() && $user->isSensitive()) { throw $this->createNotFoundException(); } From dbc37da63dbe2f32929c1dbf74273b4a76637c9c Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Thu, 26 Oct 2023 18:37:48 +0300 Subject: [PATCH 110/185] fix sensitive settings description --- templates/default/user/settings.html.twig | 4 ++-- translations/messages+intl-icu.cs.xlf | 8 ++++---- translations/messages+intl-icu.de.xlf | 8 ++++---- translations/messages+intl-icu.en.xlf | 8 ++++---- translations/messages+intl-icu.eo.xlf | 8 ++++---- translations/messages+intl-icu.es.xlf | 8 ++++---- translations/messages+intl-icu.fr.xlf | 8 ++++---- translations/messages+intl-icu.he.xlf | 8 ++++---- translations/messages+intl-icu.it.xlf | 8 ++++---- translations/messages+intl-icu.ka.xlf | 8 ++++---- translations/messages+intl-icu.lv.xlf | 8 ++++---- translations/messages+intl-icu.pl.xlf | 8 ++++---- translations/messages+intl-icu.pt.xlf | 8 ++++---- translations/messages+intl-icu.ru.xlf | 8 ++++---- translations/messages+intl-icu.uk.xlf | 8 ++++---- 15 files changed, 58 insertions(+), 58 deletions(-) diff --git a/templates/default/user/settings.html.twig b/templates/default/user/settings.html.twig index 606b3fb..ad7fb65 100644 --- a/templates/default/user/settings.html.twig +++ b/templates/default/user/settings.html.twig @@ -65,7 +65,7 @@ </tr> <tr> <td class="padding-t-16-px"> - {{ 'Content' | trans }} + {{ 'Locales' | trans }} </td> <td class="padding-t-16-px"> {% for locale in locales %} @@ -84,7 +84,7 @@ </tr> <tr> <td class="padding-t-8-px"> - {{ 'Sensitive' | trans }} + {{ 'Hide sensitive' | trans }} </td> <td> <div class="padding-t-8-px"> diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index 2340666..64105a2 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -397,10 +397,6 @@ <source>Join translation</source> <target>Join translation</target> </trans-unit> - <trans-unit id="R70pB1_" resname="Content"> - <source>Content</source> - <target>Content</target> - </trans-unit> <trans-unit id="ONoVBcq" resname="Activity"> <source>Activity</source> <target>Activity</target> @@ -729,6 +725,10 @@ <source>Seeders wanted for torrent</source> <target>Seeders wanted for torrent</target> </trans-unit> + <trans-unit id="147HHy2" resname="Hide sensitive"> + <source>Hide sensitive</source> + <target>Hide sensitive</target> + </trans-unit> </body> </file> </xliff> diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index 924e72d..e5c2b2b 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -397,10 +397,6 @@ <source>Join translation</source> <target>Join translation</target> </trans-unit> - <trans-unit id="R70pB1_" resname="Content"> - <source>Content</source> - <target>Content</target> - </trans-unit> <trans-unit id="ONoVBcq" resname="Activity"> <source>Activity</source> <target>Activity</target> @@ -729,6 +725,10 @@ <source>Seeders wanted for torrent</source> <target>Seeders wanted for torrent</target> </trans-unit> + <trans-unit id="147HHy2" resname="Hide sensitive"> + <source>Hide sensitive</source> + <target>Hide sensitive</target> + </trans-unit> </body> </file> </xliff> diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index 2dd2ad9..b59c79c 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -397,10 +397,6 @@ <source>Join translation</source> <target>Join translation</target> </trans-unit> - <trans-unit id="R70pB1_" resname="Content"> - <source>Content</source> - <target>Content</target> - </trans-unit> <trans-unit id="ONoVBcq" resname="Activity"> <source>Activity</source> <target>Activity</target> @@ -729,6 +725,10 @@ <source>Seeders wanted for torrent</source> <target>Seeders wanted for torrent</target> </trans-unit> + <trans-unit id="147HHy2" resname="Hide sensitive"> + <source>Hide sensitive</source> + <target>Hide sensitive</target> + </trans-unit> </body> </file> </xliff> diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index c74329c..5dd0d65 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -397,10 +397,6 @@ <source>Join translation</source> <target>Join translation</target> </trans-unit> - <trans-unit id="R70pB1_" resname="Content"> - <source>Content</source> - <target>Content</target> - </trans-unit> <trans-unit id="ONoVBcq" resname="Activity"> <source>Activity</source> <target>Activity</target> @@ -729,6 +725,10 @@ <source>Seeders wanted for torrent</source> <target>Seeders wanted for torrent</target> </trans-unit> + <trans-unit id="147HHy2" resname="Hide sensitive"> + <source>Hide sensitive</source> + <target>Hide sensitive</target> + </trans-unit> </body> </file> </xliff> diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index 8ff570b..1319466 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -397,10 +397,6 @@ <source>Join translation</source> <target>Join translation</target> </trans-unit> - <trans-unit id="R70pB1_" resname="Content"> - <source>Content</source> - <target>Content</target> - </trans-unit> <trans-unit id="ONoVBcq" resname="Activity"> <source>Activity</source> <target>Activity</target> @@ -729,6 +725,10 @@ <source>Seeders wanted for torrent</source> <target>Seeders wanted for torrent</target> </trans-unit> + <trans-unit id="147HHy2" resname="Hide sensitive"> + <source>Hide sensitive</source> + <target>Hide sensitive</target> + </trans-unit> </body> </file> </xliff> diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index d0ff05a..64243e4 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -397,10 +397,6 @@ <source>Join translation</source> <target>Join translation</target> </trans-unit> - <trans-unit id="R70pB1_" resname="Content"> - <source>Content</source> - <target>Content</target> - </trans-unit> <trans-unit id="ONoVBcq" resname="Activity"> <source>Activity</source> <target>Activity</target> @@ -729,6 +725,10 @@ <source>Seeders wanted for torrent</source> <target>Seeders wanted for torrent</target> </trans-unit> + <trans-unit id="147HHy2" resname="Hide sensitive"> + <source>Hide sensitive</source> + <target>Hide sensitive</target> + </trans-unit> </body> </file> </xliff> diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index 7520e86..4cfe23b 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -397,10 +397,6 @@ <source>Join translation</source> <target>Join translation</target> </trans-unit> - <trans-unit id="R70pB1_" resname="Content"> - <source>Content</source> - <target>Content</target> - </trans-unit> <trans-unit id="ONoVBcq" resname="Activity"> <source>Activity</source> <target>Activity</target> @@ -729,6 +725,10 @@ <source>Seeders wanted for torrent</source> <target>Seeders wanted for torrent</target> </trans-unit> + <trans-unit id="147HHy2" resname="Hide sensitive"> + <source>Hide sensitive</source> + <target>Hide sensitive</target> + </trans-unit> </body> </file> </xliff> diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index ec02070..6e678db 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -397,10 +397,6 @@ <source>Join translation</source> <target>Join translation</target> </trans-unit> - <trans-unit id="R70pB1_" resname="Content"> - <source>Content</source> - <target>Content</target> - </trans-unit> <trans-unit id="ONoVBcq" resname="Activity"> <source>Activity</source> <target>Activity</target> @@ -729,6 +725,10 @@ <source>Seeders wanted for torrent</source> <target>Seeders wanted for torrent</target> </trans-unit> + <trans-unit id="147HHy2" resname="Hide sensitive"> + <source>Hide sensitive</source> + <target>Hide sensitive</target> + </trans-unit> </body> </file> </xliff> diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index 3cf3e4e..5966239 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -397,10 +397,6 @@ <source>Join translation</source> <target>Join translation</target> </trans-unit> - <trans-unit id="R70pB1_" resname="Content"> - <source>Content</source> - <target>Content</target> - </trans-unit> <trans-unit id="ONoVBcq" resname="Activity"> <source>Activity</source> <target>Activity</target> @@ -729,6 +725,10 @@ <source>Seeders wanted for torrent</source> <target>Seeders wanted for torrent</target> </trans-unit> + <trans-unit id="147HHy2" resname="Hide sensitive"> + <source>Hide sensitive</source> + <target>Hide sensitive</target> + </trans-unit> </body> </file> </xliff> diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index 24257ae..cd07809 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -397,10 +397,6 @@ <source>Join translation</source> <target>Join translation</target> </trans-unit> - <trans-unit id="R70pB1_" resname="Content"> - <source>Content</source> - <target>Content</target> - </trans-unit> <trans-unit id="ONoVBcq" resname="Activity"> <source>Activity</source> <target>Activity</target> @@ -729,6 +725,10 @@ <source>Seeders wanted for torrent</source> <target>Seeders wanted for torrent</target> </trans-unit> + <trans-unit id="147HHy2" resname="Hide sensitive"> + <source>Hide sensitive</source> + <target>Hide sensitive</target> + </trans-unit> </body> </file> </xliff> diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index 03a35fc..f128145 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -397,10 +397,6 @@ <source>Join translation</source> <target>Join translation</target> </trans-unit> - <trans-unit id="R70pB1_" resname="Content"> - <source>Content</source> - <target>Content</target> - </trans-unit> <trans-unit id="ONoVBcq" resname="Activity"> <source>Activity</source> <target>Activity</target> @@ -729,6 +725,10 @@ <source>Seeders wanted for torrent</source> <target>Seeders wanted for torrent</target> </trans-unit> + <trans-unit id="147HHy2" resname="Hide sensitive"> + <source>Hide sensitive</source> + <target>Hide sensitive</target> + </trans-unit> </body> </file> </xliff> diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index c962f6a..107c757 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -397,10 +397,6 @@ <source>Join translation</source> <target>Join translation</target> </trans-unit> - <trans-unit id="R70pB1_" resname="Content"> - <source>Content</source> - <target>Content</target> - </trans-unit> <trans-unit id="ONoVBcq" resname="Activity"> <source>Activity</source> <target>Activity</target> @@ -729,6 +725,10 @@ <source>Seeders wanted for torrent</source> <target>Seeders wanted for torrent</target> </trans-unit> + <trans-unit id="147HHy2" resname="Hide sensitive"> + <source>Hide sensitive</source> + <target>Hide sensitive</target> + </trans-unit> </body> </file> </xliff> diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index 1805bfb..d56e309 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -397,10 +397,6 @@ <source>Join translation</source> <target>Присоединиться к переводам</target> </trans-unit> - <trans-unit id="R70pB1_" resname="Content"> - <source>Content</source> - <target>Содержимое</target> - </trans-unit> <trans-unit id="ONoVBcq" resname="Activity"> <source>Activity</source> <target>Активность</target> @@ -729,6 +725,10 @@ <source>Seeders wanted for torrent</source> <target>Требуется раздача для торрента</target> </trans-unit> + <trans-unit id="147HHy2" resname="Hide sensitive"> + <source>Hide sensitive</source> + <target>Скрывать чувствительное содержимое</target> + </trans-unit> </body> </file> </xliff> diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index f4cae61..02aa5d3 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -397,10 +397,6 @@ <source>Join translation</source> <target>Приєднатись до перекладу</target> </trans-unit> - <trans-unit id="R70pB1_" resname="Content"> - <source>Content</source> - <target>Контент</target> - </trans-unit> <trans-unit id="ONoVBcq" resname="Activity"> <source>Activity</source> <target>Активність</target> @@ -729,6 +725,10 @@ <source>Seeders wanted for torrent</source> <target>Розшукуються роздачі для торенту</target> </trans-unit> + <trans-unit id="147HHy2" resname="Hide sensitive"> + <source>Hide sensitive</source> + <target>Приховувати чутливий вміст</target> + </trans-unit> </body> </file> </xliff> From 3cbc6ea90ff14af252bd8e4804ba8caf245a5226 Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Thu, 26 Oct 2023 19:05:19 +0300 Subject: [PATCH 111/185] add NL locale --- .env | 2 +- config/packages/translation.yaml | 2 +- translations/messages+intl-icu.nl.xlf | 734 ++++++++++++++++++++++++++ 3 files changed, 736 insertions(+), 2 deletions(-) create mode 100644 translations/messages+intl-icu.nl.xlf diff --git a/.env b/.env index 9332030..0a58587 100644 --- a/.env +++ b/.env @@ -57,7 +57,7 @@ APP_NAME=YGGtracker APP_LOCALE=en # Supported locales for interface and content filters -APP_LOCALES=en|cs|eo|fr|ka|de|he|it|lv|pl|pt|ru|es|uk +APP_LOCALES=en|cs|nl|eo|fr|ka|de|he|it|lv|pl|pt|ru|es|uk # Items per page on pagination APP_PAGINATION=10 diff --git a/config/packages/translation.yaml b/config/packages/translation.yaml index bd2fce8..525e63b 100644 --- a/config/packages/translation.yaml +++ b/config/packages/translation.yaml @@ -8,7 +8,7 @@ framework: crowdin: dsn: '%env(CROWDIN_DSN)%' domains: ['messages'] - locales: ['en','cs','eo','fr','ka','de','he','it','lv','pl','pt','ru','es','uk'] + locales: ['en','cs','nl','eo','fr','ka','de','he','it','lv','pl','pt','ru','es','uk'] # loco: # dsn: '%env(LOCO_DSN)%' # lokalise: diff --git a/translations/messages+intl-icu.nl.xlf b/translations/messages+intl-icu.nl.xlf new file mode 100644 index 0000000..5b0e4a9 --- /dev/null +++ b/translations/messages+intl-icu.nl.xlf @@ -0,0 +1,734 @@ +<?xml version="1.0" encoding="utf-8"?> +<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> + <file source-language="en" target-language="nl" datatype="plaintext" original="file.ext"> + <header> + <tool tool-id="symfony" tool-name="Symfony"/> + </header> + <body> + <trans-unit id="awzJBNC" resname="Users"> + <source>Users</source> + <target>Users</target> + </trans-unit> + <trans-unit id="aTGLDGq" resname="Joined"> + <source>Joined</source> + <target>Joined</target> + </trans-unit> + <trans-unit id="h7QuQMK" resname="Approved"> + <source>Approved</source> + <target>Approved</target> + </trans-unit> + <trans-unit id="4DA0L1y" resname="Disapproved"> + <source>Disapproved</source> + <target>Disapproved</target> + </trans-unit> + <trans-unit id="RJ.LE0Z" resname="User statuses"> + <source>User statuses</source> + <target>User statuses</target> + </trans-unit> + <trans-unit id="ksHN.fT" resname="Enabled"> + <source>Enabled</source> + <target>Enabled</target> + </trans-unit> + <trans-unit id="dQgbWT0" resname="Disabled"> + <source>Disabled</source> + <target>Disabled</target> + </trans-unit> + <trans-unit id="a8mndct" resname="User moderators"> + <source>User moderators</source> + <target>User moderators</target> + </trans-unit> + <trans-unit id="awLg02O" resname="Added"> + <source>Added</source> + <target>Added</target> + </trans-unit> + <trans-unit id="QRj7T_0" resname="Removed"> + <source>Removed</source> + <target>Removed</target> + </trans-unit> + <trans-unit id="kg68hPN" resname="User stars"> + <source>User stars</source> + <target>User stars</target> + </trans-unit> + <trans-unit id="ohibNaT" resname="Torrents"> + <source>Torrents</source> + <target>Torrents</target> + </trans-unit> + <trans-unit id="lq4iox7" resname="Torrent locales"> + <source>Torrent locales</source> + <target>Torrent locales</target> + </trans-unit> + <trans-unit id="tI.znC4" resname="Deleted"> + <source>Deleted</source> + <target>Deleted</target> + </trans-unit> + <trans-unit id="Vt2WDnJ" resname="Torrent sensitive"> + <source>Torrent sensitive</source> + <target>Torrent sensitive</target> + </trans-unit> + <trans-unit id="tL8VElY" resname="Torrent stars"> + <source>Torrent stars</source> + <target>Torrent stars</target> + </trans-unit> + <trans-unit id="ZxMky2X" resname="Torrent downloads"> + <source>Torrent downloads</source> + <target>Torrent downloads</target> + </trans-unit> + <trans-unit id="q8fpiSg" resname="Files"> + <source>Files</source> + <target>Files</target> + </trans-unit> + <trans-unit id="0y.A5if" resname="Magnet links"> + <source>Magnet links</source> + <target>Magnet links</target> + </trans-unit> + <trans-unit id="zBHUFdk" resname="Access denied"> + <source>Access denied</source> + <target>Access denied</target> + </trans-unit> + <trans-unit id="_ji6HWn" resname="At least one locale required"> + <source>At least one locale required</source> + <target>At least one locale required</target> + </trans-unit> + <trans-unit id="fYxwFh4" resname="Torrent file out of size limit"> + <source>Torrent file out of size limit</source> + <target>Torrent file out of size limit</target> + </trans-unit> + <trans-unit id="J4iakCK" resname="Torrent file already exists"> + <source>Torrent file already exists</source> + <target>Torrent file already exists</target> + </trans-unit> + <trans-unit id="OMHLqqs" resname="Could not parse torrent file"> + <source>Could not parse torrent file</source> + <target>Could not parse torrent file</target> + </trans-unit> + <trans-unit id="6rhNefb" resname="Torrent file required"> + <source>Torrent file required</source> + <target>Torrent file required</target> + </trans-unit> + <trans-unit id="335w5QI" resname="B"> + <source>B</source> + <target>B</target> + </trans-unit> + <trans-unit id="pNfcu5." resname="Kb"> + <source>Kb</source> + <target>Kb</target> + </trans-unit> + <trans-unit id="mhI2lhb" resname="Mb"> + <source>Mb</source> + <target>Mb</target> + </trans-unit> + <trans-unit id="e0K0oQ5" resname="Gb"> + <source>Gb</source> + <target>Gb</target> + </trans-unit> + <trans-unit id="wI8AiyL" resname="Tb"> + <source>Tb</source> + <target>Tb</target> + </trans-unit> + <trans-unit id="cfWnmQc" resname="Pb"> + <source>Pb</source> + <target>Pb</target> + </trans-unit> + <trans-unit id="0YVBcLX" resname="Eb"> + <source>Eb</source> + <target>Eb</target> + </trans-unit> + <trans-unit id="IISijB3" resname="Zb"> + <source>Zb</source> + <target>Zb</target> + </trans-unit> + <trans-unit id="xh_ZAt3" resname="Yb"> + <source>Yb</source> + <target>Yb</target> + </trans-unit> + <trans-unit id="7V65o34" resname="now"> + <source>now</source> + <target>now</target> + </trans-unit> + <trans-unit id="aw2VQXS" resname="Keyword, file, hash..."> + <source>Keyword, file, hash...</source> + <target>Keyword, file, hash...</target> + </trans-unit> + <trans-unit id="ScJmuqq" resname="Search"> + <source>Search</source> + <target>Search</target> + </trans-unit> + <trans-unit id="k8s5Jex" resname="Recent uploads"> + <source>Recent uploads</source> + <target>Recent uploads</target> + </trans-unit> + <trans-unit id="xQ9.bKM" resname="Active leechers waiting for seeders"> + <source>Active leechers waiting for seeders</source> + <target>Active leechers waiting for seeders</target> + </trans-unit> + <trans-unit id="ypBmhzv" resname="wanted"> + <source>wanted</source> + <target>wanted</target> + </trans-unit> + <trans-unit id="R138zpi" resname="Waiting for approve"> + <source>Waiting for approve</source> + <target>Waiting for approve</target> + </trans-unit> + <trans-unit id="uP0WnsM" resname="Content visible for non sensitive users only"> + <source>Content visible for non sensitive users only</source> + <target>Content visible for non sensitive users only</target> + </trans-unit> + <trans-unit id="GvhRkHM" resname="Size"> + <source>Size</source> + <target>Size</target> + </trans-unit> + <trans-unit id="QKvXHnR" resname="Seeders"> + <source>Seeders</source> + <target>Seeders</target> + </trans-unit> + <trans-unit id="ZLdpvK_" resname="Peers"> + <source>Peers</source> + <target>Peers</target> + </trans-unit> + <trans-unit id="mR8Ug6L" resname="Leechers"> + <source>Leechers</source> + <target>Leechers</target> + </trans-unit> + <trans-unit id="E_vs9Gs" resname="Open magnet link"> + <source>Open magnet link</source> + <target>Open magnet link</target> + </trans-unit> + <trans-unit id="ybPDgkf" resname="Total"> + <source>Total</source> + <target>Total</target> + </trans-unit> + <trans-unit id="5Y_6cg2" resname="Download torrent file"> + <source>Download torrent file</source> + <target>Download torrent file</target> + </trans-unit> + <trans-unit id="41fTloc" resname="Star"> + <source>Star</source> + <target>Star</target> + </trans-unit> + <trans-unit id="n1ysPPL" resname="Nothing found"> + <source>Nothing found</source> + <target>Nothing found</target> + </trans-unit> + <trans-unit id="gtAEXOf" resname="* share new torrent file to change it"> + <source>* share new torrent file to change it</source> + <target>* share new torrent file to change it</target> + </trans-unit> + <trans-unit id="FV_BbAQ" resname="Submit"> + <source>Submit</source> + <target>Submit</target> + </trans-unit> + <trans-unit id="ZTfB0U1" resname="Submit torrent"> + <source>Submit torrent</source> + <target>Submit torrent</target> + </trans-unit> + <trans-unit id="wAsU1pF" resname="Content language"> + <source>Content language</source> + <target>Content language</target> + </trans-unit> + <trans-unit id="y_ytxTz" resname="This torrent contains selected languages"> + <source>This torrent contains selected languages</source> + <target>This torrent contains selected languages</target> + </trans-unit> + <trans-unit id="LGTAMNS" resname="Sensitive"> + <source>Sensitive</source> + <target>Sensitive</target> + </trans-unit> + <trans-unit id="fhhVD.B" resname="Mark torrent content as sensitive"> + <source>Mark torrent content as sensitive</source> + <target>Mark torrent content as sensitive</target> + </trans-unit> + <trans-unit id="2ZuDCA5" resname="Edit locales"> + <source>Edit locales</source> + <target>Edit locales</target> + </trans-unit> + <trans-unit id="OBSQFyT" resname="Torrent"> + <source>Torrent</source> + <target>Torrent</target> + </trans-unit> + <trans-unit id="kE0Fugk" resname="Edit locales for torrent"> + <source>Edit locales for torrent</source> + <target>Edit locales for torrent</target> + </trans-unit> + <trans-unit id="I3TZF5S" resname="cancel"> + <source>cancel</source> + <target>cancel</target> + </trans-unit> + <trans-unit id="p_LSbo0" resname="by"> + <source>by</source> + <target>by</target> + </trans-unit> + <trans-unit id="kONatGQ" resname="identicon"> + <source>identicon</source> + <target>identicon</target> + </trans-unit> + <trans-unit id="4tClSWj" resname="Delete"> + <source>Delete</source> + <target>Delete</target> + </trans-unit> + <trans-unit id="GFXm4Yt" resname="Disapprove"> + <source>Disapprove</source> + <target>Disapprove</target> + </trans-unit> + <trans-unit id="YAesvjC" resname="Approve"> + <source>Approve</source> + <target>Approve</target> + </trans-unit> + <trans-unit id="Iqk3OBD" resname="Edit sensitive status"> + <source>Edit sensitive status</source> + <target>Edit sensitive status</target> + </trans-unit> + <trans-unit id="rzkdzo_" resname="Edit sensitive status for torrent"> + <source>Edit sensitive status for torrent</source> + <target>Edit sensitive status for torrent</target> + </trans-unit> + <trans-unit id="CjCoFdZ" resname="Page"> + <source>Page</source> + <target>Page</target> + </trans-unit> + <trans-unit id="Em1EFUR" resname="Moderation"> + <source>Moderation</source> + <target>Moderation</target> + </trans-unit> + <trans-unit id="haOas0X" resname="Yes"> + <source>Yes</source> + <target>Yes</target> + </trans-unit> + <trans-unit id="PQOh3qV" resname="Toggle"> + <source>Toggle</source> + <target>Toggle</target> + </trans-unit> + <trans-unit id="HqRCoTS" resname="No"> + <source>No</source> + <target>No</target> + </trans-unit> + <trans-unit id="MJlV4Ah" resname="Common"> + <source>Common</source> + <target>Common</target> + </trans-unit> + <trans-unit id="OEOXHc." resname="ID"> + <source>ID</source> + <target>ID</target> + </trans-unit> + <trans-unit id="ZCcQ4t2" resname="MD5"> + <source>MD5</source> + <target>MD5</target> + </trans-unit> + <trans-unit id="T3Un3Wo" resname="Info hash v1"> + <source>Info hash v1</source> + <target>Info hash v1</target> + </trans-unit> + <trans-unit id="k77N_dn" resname="Info hash v2"> + <source>Info hash v2</source> + <target>Info hash v2</target> + </trans-unit> + <trans-unit id="1wueJLy" resname="Created"> + <source>Created</source> + <target>Created</target> + </trans-unit> + <trans-unit id="3QXQ4kf" resname="Pieces"> + <source>Pieces</source> + <target>Pieces</target> + </trans-unit> + <trans-unit id="DlcMpvq" resname="Source"> + <source>Source</source> + <target>Source</target> + </trans-unit> + <trans-unit id="mzKJo4W" resname="Software"> + <source>Software</source> + <target>Software</target> + </trans-unit> + <trans-unit id="RPXj__x" resname="Comment"> + <source>Comment</source> + <target>Comment</target> + </trans-unit> + <trans-unit id="NQrUM8Q" resname="Contributors"> + <source>Contributors</source> + <target>Contributors</target> + </trans-unit> + <trans-unit id="mvYF.Ky" resname="Scrape"> + <source>Scrape</source> + <target>Scrape</target> + </trans-unit> + <trans-unit id="Bud8ddd" resname="Trackers"> + <source>Trackers</source> + <target>Trackers</target> + </trans-unit> + <trans-unit id="Ph5aqB7" resname="Filtered by settings"> + <source>Filtered by settings</source> + <target>Filtered by settings</target> + </trans-unit> + <trans-unit id="RkxP.QG" resname="Edit"> + <source>Edit</source> + <target>Edit</target> + </trans-unit> + <trans-unit id="g7KFKj7" resname="Locales"> + <source>Locales</source> + <target>Locales</target> + </trans-unit> + <trans-unit id="bLRLVjN" resname="Recent activity"> + <source>Recent activity</source> + <target>Recent activity</target> + </trans-unit> + <trans-unit id="dpAPG.0" resname="Back"> + <source>Back</source> + <target>Back</target> + </trans-unit> + <trans-unit id="H.V6Kdf" resname="Next"> + <source>Next</source> + <target>Next</target> + </trans-unit> + <trans-unit id="dKiDoDe" resname="Settings"> + <source>Settings</source> + <target>Settings</target> + </trans-unit> + <trans-unit id="wms_1M5" resname="Interface"> + <source>Interface</source> + <target>Interface</target> + </trans-unit> + <trans-unit id="77UucXK" resname="Theme"> + <source>Theme</source> + <target>Theme</target> + </trans-unit> + <trans-unit id="pP5lJk7" resname="Language"> + <source>Language</source> + <target>Language</target> + </trans-unit> + <trans-unit id="ByvVctG" resname="Join translation"> + <source>Join translation</source> + <target>Join translation</target> + </trans-unit> + <trans-unit id="ONoVBcq" resname="Activity"> + <source>Activity</source> + <target>Activity</target> + </trans-unit> + <trans-unit id="1f3BrwI" resname="Downloads"> + <source>Downloads</source> + <target>Downloads</target> + </trans-unit> + <trans-unit id="zmgk0li" resname="Yggdrasil only"> + <source>Yggdrasil only</source> + <target>Yggdrasil only</target> + </trans-unit> + <trans-unit id="FQn1YfJ" resname="Save"> + <source>Save</source> + <target>Save</target> + </trans-unit> + <trans-unit id="OnhpU4i" resname="Home"> + <source>Home</source> + <target>Home</target> + </trans-unit> + <trans-unit id="1pajW90" resname="Profile"> + <source>Profile</source> + <target>Profile</target> + </trans-unit> + <trans-unit id="tRLZfny" resname="User"> + <source>User</source> + <target>User</target> + </trans-unit> + <trans-unit id="G6xAB4g" resname="Bookmark"> + <source>Bookmark</source> + <target>Bookmark</target> + </trans-unit> + <trans-unit id="Vu_PIJV" resname="Address"> + <source>Address</source> + <target>Address</target> + </trans-unit> + <trans-unit id="3VuNjXf" resname="Address hidden for others"> + <source>Address hidden for others</source> + <target>Address hidden for others</target> + </trans-unit> + <trans-unit id="7Fugq7c" resname="Access"> + <source>Access</source> + <target>Access</target> + </trans-unit> + <trans-unit id="kg5BPH1" resname="Status"> + <source>Status</source> + <target>Status</target> + </trans-unit> + <trans-unit id="kjQGlYm" resname="Active"> + <source>Active</source> + <target>Active</target> + </trans-unit> + <trans-unit id="Z0jsi3Z" resname="Moderator"> + <source>Moderator</source> + <target>Moderator</target> + </trans-unit> + <trans-unit id="MYZVzqS" resname="Languages"> + <source>Languages</source> + <target>Languages</target> + </trans-unit> + <trans-unit id="CLoCFMI" resname="Events subscribed"> + <source>Events subscribed</source> + <target>Events subscribed</target> + </trans-unit> + <trans-unit id="qqJclwn" resname="undefined event"> + <source>undefined event</source> + <target>undefined event</target> + </trans-unit> + <trans-unit id="4Il4Y5X" resname="have downloaded torrent file"> + <source>have downloaded torrent file</source> + <target>have downloaded torrent file</target> + </trans-unit> + <trans-unit id="h80m7iF" resname="waiting for approve"> + <source>waiting for approve</source> + <target>waiting for approve</target> + </trans-unit> + <trans-unit id="LV6GAKT" resname="sensitive"> + <source>sensitive</source> + <target>sensitive</target> + </trans-unit> + <trans-unit id="t_REuxn" resname="have downloaded magnet link"> + <source>have downloaded magnet link</source> + <target>have downloaded magnet link</target> + </trans-unit> + <trans-unit id="GUgRc6p" resname="have disapproved torrent"> + <source>have disapproved torrent</source> + <target>have disapproved torrent</target> + </trans-unit> + <trans-unit id="peGPPOh" resname="have approved torrent"> + <source>have approved torrent</source> + <target>have approved torrent</target> + </trans-unit> + <trans-unit id="Ax4hwgW" resname="have added torrent"> + <source>have added torrent</source> + <target>have added torrent</target> + </trans-unit> + <trans-unit id="kOS_6Om" resname="have deleted locales edition"> + <source>have deleted locales edition</source> + <target>have deleted locales edition</target> + </trans-unit> + <trans-unit id="naGLbTA" resname="for torrent"> + <source>for torrent</source> + <target>for torrent</target> + </trans-unit> + <trans-unit id="eD4JIr7" resname="have disapproved locales edition"> + <source>have disapproved locales edition</source> + <target>have disapproved locales edition</target> + </trans-unit> + <trans-unit id="L8_5bk0" resname="have approved locales edition"> + <source>have approved locales edition</source> + <target>have approved locales edition</target> + </trans-unit> + <trans-unit id="gbo5PRi" resname="have added locales edition"> + <source>have added locales edition</source> + <target>have added locales edition</target> + </trans-unit> + <trans-unit id="aazoJuz" resname="have removed star from torrent"> + <source>have removed star from torrent</source> + <target>have removed star from torrent</target> + </trans-unit> + <trans-unit id="cES0sXy" resname="have added star for torrent"> + <source>have added star for torrent</source> + <target>have added star for torrent</target> + </trans-unit> + <trans-unit id="DJ7R0RO" resname="have deleted sensitive edition"> + <source>have deleted sensitive edition</source> + <target>have deleted sensitive edition</target> + </trans-unit> + <trans-unit id="hDJxvYG" resname="have disapproved sensitive edition"> + <source>have disapproved sensitive edition</source> + <target>have disapproved sensitive edition</target> + </trans-unit> + <trans-unit id="46W8iLj" resname="have approved sensitive edition"> + <source>have approved sensitive edition</source> + <target>have approved sensitive edition</target> + </trans-unit> + <trans-unit id="oAC9LIa" resname="have added sensitive edition"> + <source>have added sensitive edition</source> + <target>have added sensitive edition</target> + </trans-unit> + <trans-unit id="BQifRyb" resname="have disabled"> + <source>have disabled</source> + <target>have disabled</target> + </trans-unit> + <trans-unit id="LdA3apc" resname="have disabled user"> + <source>have disabled user</source> + <target>have disabled user</target> + </trans-unit> + <trans-unit id="ksNGaFf" resname="have enabled"> + <source>have enabled</source> + <target>have enabled</target> + </trans-unit> + <trans-unit id="qA2qjC5" resname="have enabled user"> + <source>have enabled user</source> + <target>have enabled user</target> + </trans-unit> + <trans-unit id="gXbWkeB" resname="have disapproved"> + <source>have disapproved</source> + <target>have disapproved</target> + </trans-unit> + <trans-unit id="kFzblGl" resname="have disapproved user"> + <source>have disapproved user</source> + <target>have disapproved user</target> + </trans-unit> + <trans-unit id="Gm8.zqs" resname="have approved"> + <source>have approved</source> + <target>have approved</target> + </trans-unit> + <trans-unit id="9m0Bjnq" resname="have approved user"> + <source>have approved user</source> + <target>have approved user</target> + </trans-unit> + <trans-unit id="6lqK6b6" resname="have joined"> + <source>have joined</source> + <target>have joined</target> + </trans-unit> + <trans-unit id="yEC_h0o" resname="have removed moderator permissions from"> + <source>have removed moderator permissions from</source> + <target>have removed moderator permissions from</target> + </trans-unit> + <trans-unit id="xU4ckhu" resname="have removed moderator permissions from user"> + <source>have removed moderator permissions from user</source> + <target>have removed moderator permissions from user</target> + </trans-unit> + <trans-unit id="aiqFdWc" resname="have granted moderator permissions to"> + <source>have granted moderator permissions to</source> + <target>have granted moderator permissions to</target> + </trans-unit> + <trans-unit id="IygeMVn" resname="have granted moderator permissions to user"> + <source>have granted moderator permissions to user</source> + <target>have granted moderator permissions to user</target> + </trans-unit> + <trans-unit id="H06V5cY" resname="have removed star from"> + <source>have removed star from</source> + <target>have removed star from</target> + </trans-unit> + <trans-unit id="7_4hNGn" resname="have removed star from user"> + <source>have removed star from user</source> + <target>have removed star from user</target> + </trans-unit> + <trans-unit id="ojDrmfX" resname="have added star for"> + <source>have added star for</source> + <target>have added star for</target> + </trans-unit> + <trans-unit id="iN2_Dtz" resname="have added star for user"> + <source>have added star for user</source> + <target>have added star for user</target> + </trans-unit> + <trans-unit id="VKDowX6" resname="Error"> + <source>Error</source> + <target>Error</target> + </trans-unit> + <trans-unit id="g0SUekA" resname="Oops!"> + <source>Oops!</source> + <target>Oops!</target> + </trans-unit> + <trans-unit id="9010RFH" resname="Internal server error"> + <source>Internal server error</source> + <target>Internal server error</target> + </trans-unit> + <trans-unit id="ts54jZe" resname="Report"> + <source>Report</source> + <target>Report</target> + </trans-unit> + <trans-unit id="4_uqFt2" resname="Not found"> + <source>Not found</source> + <target>Not found</target> + </trans-unit> + <trans-unit id="hestk9M" resname="Page not found!"> + <source>Page not found!</source> + <target>Page not found!</target> + </trans-unit> + <trans-unit id="HfJe0N1" resname="BitTorrent protocol version 2"> + <source>BitTorrent protocol version 2</source> + <target>BitTorrent protocol version 2</target> + </trans-unit> + <trans-unit id="U4t_NWU" resname="BitTorrent protocol version 1"> + <source>BitTorrent protocol version 1</source> + <target>BitTorrent protocol version 1</target> + </trans-unit> + <trans-unit id="FEgqWb_" resname="year ago"> + <source>year ago</source> + <target>year ago</target> + </trans-unit> + <trans-unit id="pfk9V_Q" resname="month ago"> + <source>month ago</source> + <target>month ago</target> + </trans-unit> + <trans-unit id="5rpeYTJ" resname="day ago"> + <source>day ago</source> + <target>day ago</target> + </trans-unit> + <trans-unit id="hM62aMH" resname="hour ago"> + <source>hour ago</source> + <target>hour ago</target> + </trans-unit> + <trans-unit id="r2QgE4i" resname="minute ago"> + <source>minute ago</source> + <target>minute ago</target> + </trans-unit> + <trans-unit id="RbqRzDS" resname="second ago"> + <source>second ago</source> + <target>second ago</target> + </trans-unit> + <trans-unit id="TQof7nK" resname="years ago"> + <source>years ago</source> + <target>years ago</target> + </trans-unit> + <trans-unit id="fEGjy26" resname="months ago"> + <source>months ago</source> + <target>months ago</target> + </trans-unit> + <trans-unit id="N9rZHfe" resname="days ago"> + <source>days ago</source> + <target>days ago</target> + </trans-unit> + <trans-unit id="JQ76A_T" resname="hours ago"> + <source>hours ago</source> + <target>hours ago</target> + </trans-unit> + <trans-unit id="HhrazP8" resname="minutes ago"> + <source>minutes ago</source> + <target>minutes ago</target> + </trans-unit> + <trans-unit id="IsfvBWU" resname="seconds ago"> + <source>seconds ago</source> + <target>seconds ago</target> + </trans-unit> + <trans-unit id="KGg3UPj" resname=" years ago"> + <source> years ago</source> + <target> years ago</target> + </trans-unit> + <trans-unit id="LJz20sI" resname=" months ago"> + <source> months ago</source> + <target> months ago</target> + </trans-unit> + <trans-unit id="r7fyHp0" resname=" days ago"> + <source> days ago</source> + <target> days ago</target> + </trans-unit> + <trans-unit id="mga12oW" resname=" hours ago"> + <source> hours ago</source> + <target> hours ago</target> + </trans-unit> + <trans-unit id="BAlvYYB" resname=" minutes ago"> + <source> minutes ago</source> + <target> minutes ago</target> + </trans-unit> + <trans-unit id="m4YrK9n" resname=" seconds ago"> + <source> seconds ago</source> + <target> seconds ago</target> + </trans-unit> + <trans-unit id="6XiwDeR" resname="Search results"> + <source>Search results</source> + <target>Search results</target> + </trans-unit> + <trans-unit id="HSCiIv7" resname="<a href="%s">Upload</a> any torrent - download with Yggdrasil"> + <source><a href="%s">Upload</a> any torrent - download with Yggdrasil</source> + <target><![CDATA[<a href="%s">Upload</a> any torrent - download with Yggdrasil]]></target> + </trans-unit> + <trans-unit id="wpaDJlY" resname="Wanted"> + <source>Wanted</source> + <target>Wanted</target> + </trans-unit> + <trans-unit id="SK4nQBL" resname="Seeders wanted for torrent"> + <source>Seeders wanted for torrent</source> + <target>Seeders wanted for torrent</target> + </trans-unit> + <trans-unit id="147HHy2" resname="Hide sensitive"> + <source>Hide sensitive</source> + <target>Hide sensitive</target> + </trans-unit> + </body> + </file> +</xliff> From 989f2f3311eb452b5b4063418d0cbf1247445a60 Mon Sep 17 00:00:00 2001 From: ghost <localhost> Date: Fri, 27 Oct 2023 01:36:50 +0300 Subject: [PATCH 112/185] implement torrent statuses management #28 --- .env | 2 +- migrations/Version20231026163131.php | 37 ++++ public/asset/default/css/framework.css | 12 ++ src/Controller/ActivityController.php | 111 ++++++++++ src/Controller/TorrentController.php | 204 ++++++++++++------ src/Entity/Activity.php | 3 + src/Entity/Torrent.php | 15 ++ src/Repository/TorrentRepository.php | 75 +++++-- src/Service/ActivityService.php | 86 ++++++++ src/Service/TorrentService.php | 50 ++++- .../activity/event/torrent/add.html.twig | 6 +- .../activity/event/torrent/add.rss.twig | 6 +- .../event/torrent/approve/add.html.twig | 6 +- .../event/torrent/approve/add.rss.twig | 6 +- .../event/torrent/approve/delete.html.twig | 6 +- .../event/torrent/approve/delete.rss.twig | 6 +- .../event/torrent/download/file/add.html.twig | 6 +- .../event/torrent/download/file/add.rss.twig | 6 +- .../torrent/download/magnet/add.html.twig | 6 +- .../torrent/download/magnet/add.rss.twig | 6 +- .../event/torrent/locales/add.html.twig | 6 +- .../event/torrent/locales/add.rss.twig | 6 +- .../torrent/locales/approve/add.html.twig | 6 +- .../torrent/locales/approve/add.rss.twig | 6 +- .../torrent/locales/approve/delete.html.twig | 6 +- .../torrent/locales/approve/delete.rss.twig | 6 +- .../event/torrent/locales/delete.html.twig | 6 +- .../event/torrent/locales/delete.rss.twig | 6 +- .../event/torrent/sensitive/add.html.twig | 8 +- .../event/torrent/sensitive/add.rss.twig | 8 +- .../torrent/sensitive/approve/add.html.twig | 8 +- .../torrent/sensitive/approve/add.rss.twig | 8 +- .../sensitive/approve/delete.html.twig | 8 +- .../torrent/sensitive/approve/delete.rss.twig | 8 +- .../event/torrent/sensitive/delete.html.twig | 8 +- .../event/torrent/sensitive/delete.rss.twig | 8 +- .../activity/event/torrent/star/add.html.twig | 6 +- .../activity/event/torrent/star/add.rss.twig | 6 +- .../event/torrent/star/delete.html.twig | 6 +- .../event/torrent/star/delete.rss.twig | 6 +- .../event/torrent/status/add.html.twig | 30 +++ .../event/torrent/status/add.rss.twig | 26 +++ .../event/torrent/status/delete.html.twig | 30 +++ .../event/torrent/status/delete.rss.twig | 26 +++ .../event/torrent/wanted/add.html.twig | 6 +- .../event/torrent/wanted/add.rss.twig | 6 +- templates/default/torrent/info.html.twig | 34 ++- templates/default/torrent/list.html.twig | 10 +- templates/default/user/settings.html.twig | 44 ++-- translations/messages+intl-icu.cs.xlf | 22 +- translations/messages+intl-icu.de.xlf | 22 +- translations/messages+intl-icu.en.xlf | 22 +- translations/messages+intl-icu.eo.xlf | 22 +- translations/messages+intl-icu.es.xlf | 22 +- translations/messages+intl-icu.fr.xlf | 22 +- translations/messages+intl-icu.he.xlf | 22 +- translations/messages+intl-icu.it.xlf | 22 +- translations/messages+intl-icu.ka.xlf | 22 +- translations/messages+intl-icu.lv.xlf | 22 +- translations/messages+intl-icu.nl.xlf | 22 +- translations/messages+intl-icu.pl.xlf | 22 +- translations/messages+intl-icu.pt.xlf | 22 +- translations/messages+intl-icu.ru.xlf | 22 +- translations/messages+intl-icu.uk.xlf | 22 +- 64 files changed, 1051 insertions(+), 282 deletions(-) create mode 100644 migrations/Version20231026163131.php create mode 100644 templates/default/activity/event/torrent/status/add.html.twig create mode 100644 templates/default/activity/event/torrent/status/add.rss.twig create mode 100644 templates/default/activity/event/torrent/status/delete.html.twig create mode 100644 templates/default/activity/event/torrent/status/delete.rss.twig diff --git a/.env b/.env index 0a58587..f2013ac 100644 --- a/.env +++ b/.env @@ -48,7 +48,7 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 # YGGtracker # Application version, used for API and media cache -APP_VERSION='2.2.0' +APP_VERSION='2.2.1' # Application name APP_NAME=YGGtracker diff --git a/migrations/Version20231026163131.php b/migrations/Version20231026163131.php new file mode 100644 index 0000000..51c0288 --- /dev/null +++ b/migrations/Version20231026163131.php @@ -0,0 +1,37 @@ +<?php + +declare(strict_types=1); + +namespace DoctrineMigrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20231026163131 extends AbstractMigration +{ + public function getDescription(): string + { + return ''; + } + + public function up(Schema $schema): void + { + // this up() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE torrent ADD COLUMN status BOOLEAN DEFAULT 1'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE TEMPORARY TABLE __temp__torrent AS SELECT id, user_id, added, scraped, locales, sensitive, approved, md5file, keywords, seeders, peers, leechers FROM torrent'); + $this->addSql('DROP TABLE torrent'); + $this->addSql('CREATE TABLE torrent (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, user_id INTEGER NOT NULL, added INTEGER NOT NULL, scraped INTEGER DEFAULT NULL, locales CLOB NOT NULL --(DC2Type:simple_array) + , sensitive BOOLEAN NOT NULL, approved BOOLEAN NOT NULL, md5file VARCHAR(32) NOT NULL, keywords CLOB DEFAULT NULL --(DC2Type:simple_array) + , seeders INTEGER DEFAULT NULL, peers INTEGER DEFAULT NULL, leechers INTEGER DEFAULT NULL)'); + $this->addSql('INSERT INTO torrent (id, user_id, added, scraped, locales, sensitive, approved, md5file, keywords, seeders, peers, leechers) SELECT id, user_id, added, scraped, locales, sensitive, approved, md5file, keywords, seeders, peers, leechers FROM __temp__torrent'); + $this->addSql('DROP TABLE __temp__torrent'); + } +} diff --git a/public/asset/default/css/framework.css b/public/asset/default/css/framework.css index 3c632be..7fb4b66 100644 --- a/public/asset/default/css/framework.css +++ b/public/asset/default/css/framework.css @@ -208,6 +208,14 @@ a.button-green:hover { border-top: 1px #5d627d solid; } +.border-bottom-dashed { + border-bottom: 1px #5d627d dashed; +} + +.border-top-dashed { + border-top: 1px #5d627d dashed; +} + .border-width-2-px { border-width: 2px; } @@ -367,6 +375,10 @@ a:visited.background-color-hover-night-light:hover { padding-bottom: 24px; } +.margin-t-4-px { + margin-top: 4px; +} + .margin-l-4-px { margin-left: 4px; } diff --git a/src/Controller/ActivityController.php b/src/Controller/ActivityController.php index 4ac57f1..c4e147d 100644 --- a/src/Controller/ActivityController.php +++ b/src/Controller/ActivityController.php @@ -560,6 +560,7 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName() @@ -606,6 +607,7 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName() @@ -652,6 +654,7 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName() @@ -699,6 +702,7 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName() @@ -745,6 +749,7 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName() @@ -783,6 +788,102 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), + 'name' => $torrentService->readTorrentFileByTorrentId( + $torrent->getId() + )->getName() + ], + 'session' => + [ + 'user' => + [ + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), + ] + ] + ] + ); + + break; + + // Torrent Status + case $activity::EVENT_TORRENT_STATUS_ADD: + + // Init torrent + if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) + { + throw $this->createNotFoundException(); + } + + return $this->render( + 'default/activity/event/torrent/status/add' . $extension, + [ + 'id' => $activity->getId(), + 'added' => $activity->getAdded(), + 'user' => + [ + 'id' => $activity->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $activity->getUserId() + )->getAddress() + ) + ], + 'torrent' => + [ + 'id' => $torrent->getId(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), + 'name' => $torrentService->readTorrentFileByTorrentId( + $torrent->getId() + )->getName() + ], + 'session' => + [ + 'user' => + [ + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), + ] + ] + ] + ); + + break; + + case $activity::EVENT_TORRENT_STATUS_DELETE: + + // Init torrent + if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) + { + throw $this->createNotFoundException(); + } + + return $this->render( + 'default/activity/event/torrent/status/delete' . $extension, + [ + 'id' => $activity->getId(), + 'added' => $activity->getAdded(), + 'user' => + [ + 'id' => $activity->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $activity->getUserId() + )->getAddress() + ) + ], + 'torrent' => + [ + 'id' => $torrent->getId(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName() @@ -830,6 +931,7 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName(), @@ -882,6 +984,7 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName(), @@ -934,6 +1037,7 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName(), @@ -986,6 +1090,7 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName(), @@ -1039,6 +1144,7 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName(), @@ -1091,6 +1197,7 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName(), @@ -1143,6 +1250,7 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName(), @@ -1195,6 +1303,7 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName(), @@ -1248,6 +1357,7 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName() @@ -1294,6 +1404,7 @@ class ActivityController extends AbstractController 'id' => $torrent->getId(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'name' => $torrentService->readTorrentFileByTorrentId( $torrent->getId() )->getName() diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index a95ae77..a775048 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -62,8 +62,9 @@ class TorrentController extends AbstractController throw $this->createNotFoundException(); } - // Approved filter - if (!$user->isModerator() && $user->getId() != $torrent->getUserId() && !$torrent->isApproved()) + // Access filter + if (!$user->isModerator() && $user->getId() != $torrent->getUserId() && + (!$torrent->isStatus() || !$torrent->isApproved())) { throw $this->createNotFoundException(); } @@ -110,9 +111,10 @@ class TorrentController extends AbstractController [ 'session' => [ - 'user' => $user, + 'user' => $user, 'id' => $user->getId(), - 'moderator' => $user->isModerator() + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), ], 'torrent' => [ @@ -129,6 +131,7 @@ class TorrentController extends AbstractController 'locales' => $torrent->getLocales(), 'sensitive' => $torrent->isSensitive(), 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), 'download' => [ 'file' => @@ -226,24 +229,30 @@ class TorrentController extends AbstractController $activityService ); + // + // Init request $query = $request->get('query') ? explode(' ', urldecode($request->get('query'))) : []; $page = $request->get('page') ? (int) $request->get('page') : 1; // Get total torrents $total = $torrentService->findTorrentsTotal( + $user->getId(), $query, $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all - !$user->isModerator() ? true : null, // show approved content only for regular users + !$user->isModerator() && $user->isSensitive() ? false : null, + !$user->isModerator() ? true : null, + !$user->isModerator() ? true : null, ); $torrents = []; foreach ($torrentService->findTorrents( + $user->getId(), $query, $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all - !$user->isModerator() ? true : null, // show approved content only for regular users + !$user->isModerator() && $user->isSensitive() ? false : null, + !$user->isModerator() ? true : null, + !$user->isModerator() ? true : null, $this->getParameter('app.pagination'), ($page - 1) * $this->getParameter('app.pagination') ) as $torrent) @@ -254,18 +263,6 @@ class TorrentController extends AbstractController throw $this->createNotFoundException(); // @TODO exception } - // Generate keywords - /* @TODO deprecated, based on active search result - $keywords = []; - foreach ($torrent->getKeywords() as $keyword) - { - if (in_array($keyword, $query)) - { - $keywords[] = $keyword; - } - } - */ - // Generate keywords by extension $keywords = []; @@ -296,6 +293,7 @@ class TorrentController extends AbstractController 'added' => $torrent->getAdded(), 'approved' => $torrent->isApproved(), 'sensitive' => $torrent->isSensitive(), + 'status' => $torrent->isStatus(), 'file' => [ 'name' => $file->getName(), @@ -401,19 +399,23 @@ class TorrentController extends AbstractController // Get total torrents $total = $torrentService->findTorrentsTotal( + $user->getId(), [], $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all - !$user->isModerator() ? true : null, // show approved content only for regular users + !$user->isModerator() && $user->isSensitive() ? false : null, + !$user->isModerator() ? true : null, + !$user->isModerator() ? true : null, ); // Create torrents list $torrents = []; foreach ($torrentService->findTorrents( + $user->getId(), [], $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all - !$user->isModerator() ? true : null, // show approved content only for regular users + !$user->isModerator() && $user->isSensitive() ? false : null, + !$user->isModerator() ? true : null, + !$user->isModerator() ? true : null, $this->getParameter('app.pagination'), ($page - 1) * $this->getParameter('app.pagination') ) as $torrent) @@ -454,6 +456,7 @@ class TorrentController extends AbstractController 'added' => $torrent->getAdded(), 'approved' => $torrent->isApproved(), 'sensitive' => $torrent->isSensitive(), + 'status' => $torrent->isStatus(), 'file' => [ 'name' => $file->getName(), @@ -558,19 +561,23 @@ class TorrentController extends AbstractController // Get total torrents $total = $torrentService->findTorrentsTotal( + $user->getId(), $query, $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all - !$user->isModerator() ? true : null // show approved content only for regular users + !$user->isModerator() && $user->isSensitive() ? false : null, + !$user->isModerator() ? true : null, + !$user->isModerator() ? true : null, ); // Create torrents list $torrents = []; foreach ($torrentService->findTorrents( + $user->getId(), $query, $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all - !$user->isModerator() ? true : null, // show approved content only for regular users + !$user->isModerator() && $user->isSensitive() ? false : null, + !$user->isModerator() ? true : null, + !$user->isModerator() ? true : null, $this->getParameter('app.pagination'), ($page - 1) * $this->getParameter('app.pagination') ) as $torrent) @@ -583,9 +590,9 @@ class TorrentController extends AbstractController $torrents[] = [ - 'id' => $torrent->getId(), - 'added' => $torrent->getAdded(), - 'file' => + 'id' => $torrent->getId(), + 'added' => $torrent->getAdded(), + 'file' => [ 'name' => $file->getName(), ], @@ -624,6 +631,13 @@ class TorrentController extends AbstractController ActivityService $activityService ): Response { + // Init user + $user = $this->initUser( + $request, + $userService, + $activityService + ); + // Init request $query = $request->get('query') ? explode(' ', urldecode($request->get('query'))) : []; $page = $request->get('page') ? (int) $request->get('page') : 1; @@ -638,19 +652,23 @@ class TorrentController extends AbstractController // Get total torrents $total = $torrentService->findTorrentsTotal( + $user->getId(), $query, $locales, - $sensitive, - true, // approved only + !$user->isModerator() ? $sensitive : null, + !$user->isModerator() ? true : null, + !$user->isModerator() ? true : null, ); // Create torrents list $torrents = []; foreach ($torrentService->findTorrents( + $user->getId(), $query, $locales, - $sensitive, - true, // approved only + !$user->isModerator() ? $sensitive : null, + !$user->isModerator() ? true : null, + !$user->isModerator() ? true : null, $this->getParameter('app.pagination'), ($page - 1) * $this->getParameter('app.pagination') ) as $torrent) @@ -867,7 +885,8 @@ class TorrentController extends AbstractController time(), (array) $locales, (bool) $request->get('sensitive'), - $user->isApproved() + $user->isApproved(), + $user->isStatus() ); // Add activity event @@ -898,7 +917,7 @@ class TorrentController extends AbstractController ); } - + // Torrent moderation #[Route( '/{_locale}/torrent/{torrentId}/approve/toggle', name: 'torrent_approve_toggle', @@ -975,6 +994,82 @@ class TorrentController extends AbstractController ); } + #[Route( + '/{_locale}/torrent/{torrentId}/status/toggle', + name: 'torrent_status_toggle', + requirements: + [ + '_locale' => '%app.locales%', + 'torrentId' => '\d+', + ], + methods: + [ + 'GET' + ] + )] + public function status( + Request $request, + UserService $userService, + TorrentService $torrentService, + ActivityService $activityService + ): Response + { + // Init user + $user = $this->initUser( + $request, + $userService, + $activityService + ); + + // Init torrent + if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) + { + throw $this->createNotFoundException(); + } + + // Check permissions + if (!($user->isModerator() || $user->getId() == $torrent->getUserId())) + { + // @TODO + throw new \Exception( + $translator->trans('Access denied') + ); + } + + // Register activity event + if (!$torrent->isStatus()) + { + $activityService->addEventTorrentStatusAdd( + $user->getId(), + $torrent->getId(), + time() + ); + } + + else + { + $activityService->addEventTorrentStatusDelete( + $user->getId(), + $torrent->getId(), + time() + ); + } + + // Update status + $torrentService->toggleTorrentStatus( + $torrent->getId() + ); + + // Redirect back to form + return $this->redirectToRoute( + 'torrent_info', + [ + '_locale' => $request->get('_locale'), + 'torrentId' => $torrent->getId() + ] + ); + } + // Torrent locales #[Route( '/{_locale}/torrent/{torrentId}/edit/locales/{torrentLocalesId}', @@ -1807,14 +1902,9 @@ class TorrentController extends AbstractController throw $this->createNotFoundException(); } - // Sensitive filter - if (!$user->isModerator() && $user->isSensitive()) - { - throw $this->createNotFoundException(); - } - - // Approved filter - if (!$user->isModerator() && $user->getId() != $torrent->getUserId() && !$torrent->isApproved()) + // Access filter + if (!$user->isModerator() && $user->getId() != $torrent->getUserId() && + (!$torrent->isStatus() || !$torrent->isApproved())) { throw $this->createNotFoundException(); } @@ -1934,14 +2024,9 @@ class TorrentController extends AbstractController throw $this->createNotFoundException(); } - // Sensitive filter - if (!$user->isModerator() && $user->isSensitive()) - { - throw $this->createNotFoundException(); - } - - // Approved filter - if (!$user->isModerator() && $user->getId() != $torrent->getUserId() && !$torrent->isApproved()) + // Access filter + if (!$user->isModerator() && $user->getId() != $torrent->getUserId() && + (!$torrent->isStatus() || !$torrent->isApproved())) { throw $this->createNotFoundException(); } @@ -2058,14 +2143,9 @@ class TorrentController extends AbstractController throw $this->createNotFoundException(); } - // Sensitive filter - if (!$user->isModerator() && $user->isSensitive()) - { - throw $this->createNotFoundException(); - } - - // Approved filter - if (!$user->isModerator() && $user->getId() != $torrent->getUserId() && !$torrent->isApproved()) + // Access filter + if (!$user->isModerator() && $user->getId() != $torrent->getUserId() && + (!$torrent->isStatus() || !$torrent->isApproved())) { throw $this->createNotFoundException(); } @@ -2389,10 +2469,12 @@ class TorrentController extends AbstractController 'locale' => $locale, 'locales' => $locales, 'torrents' => $torrentService->findTorrents( + 0, // no user session init, pass 0 [], // without keywords filter $locales, // all system locales null, // all sensitive levels true, // approved only + true, // enabled only 1000, // @TODO limit 0 // offset ) diff --git a/src/Entity/Activity.php b/src/Entity/Activity.php index 3b208b9..233ab46 100644 --- a/src/Entity/Activity.php +++ b/src/Entity/Activity.php @@ -59,6 +59,9 @@ class Activity public const EVENT_TORRENT_WANTED_ADD = 2700; + public const EVENT_TORRENT_STATUS_ADD = 1800; + public const EVENT_TORRENT_STATUS_DELETE = 1801; + // ... #[ORM\Column] diff --git a/src/Entity/Torrent.php b/src/Entity/Torrent.php index 876bd1e..ef34679 100644 --- a/src/Entity/Torrent.php +++ b/src/Entity/Torrent.php @@ -33,6 +33,9 @@ class Torrent #[ORM\Column] private ?bool $approved = null; + #[ORM\Column] + private ?bool $status = null; + #[ORM\Column(length: 32)] private ?string $md5file = null; @@ -156,6 +159,18 @@ class Torrent return $this; } + public function isStatus(): ?bool + { + return $this->status; + } + + public function setStatus(bool $status): static + { + $this->status = $status; + + return $this; + } + public function getSeeders(): ?int { return $this->seeders; diff --git a/src/Repository/TorrentRepository.php b/src/Repository/TorrentRepository.php index 01a10ec..f960e90 100644 --- a/src/Repository/TorrentRepository.php +++ b/src/Repository/TorrentRepository.php @@ -22,38 +22,46 @@ class TorrentRepository extends ServiceEntityRepository } public function findTorrentsTotal( + int $userId, array $keywords, array $locales, ?bool $sensitive = null, - ?bool $approved = null, - int $limit = 10, - int $offset = 0 + ?bool $approved = null, + ?bool $status = null, + int $limit = 10, + int $offset = 0 ): int { return $this->getTorrentsQueryByFilter( + $userId, $keywords, $locales, $sensitive, $approved, + $status, )->select('count(t.id)') ->getQuery() ->getSingleScalarResult(); } public function findTorrents( + int $userId, array $keywords, array $locales, ?bool $sensitive = null, - ?bool $approved = null, + ?bool $approved = null, + ?bool $status = null, int $limit = 10, int $offset = 0 ): array { return $this->getTorrentsQueryByFilter( + $userId, $keywords, $locales, $sensitive, $approved, + $status, )->setMaxResults($limit) ->setFirstResult($offset) ->orderBy('t.id', 'DESC') // same as t.added @@ -62,54 +70,85 @@ class TorrentRepository extends ServiceEntityRepository } private function getTorrentsQueryByFilter( + int $userId, array $keywords, array $locales, ?bool $sensitive = null, - ?bool $approved = null, + ?bool $approved = null, + ?bool $status = null, ): \Doctrine\ORM\QueryBuilder { $query = $this->createQueryBuilder('t'); - if ($keywords) // @TODO ANY or DTS + if ($keywords) { - $andX = $query->expr()->andX(); + $andKeywords = $query->expr()->andX(); foreach ($keywords as $i => $keyword) { $keyword = mb_strtolower($keyword); // all keywords stored in lowercase - $andX->add("t.keywords LIKE :keyword{$i}"); + $andKeywords->add("t.keywords LIKE :keyword{$i}"); + $query->setParameter(":keyword{$i}", "%{$keyword}%"); } - $query->andWhere($andX); + $query->andWhere($andKeywords); } - if ($locales) // @TODO ANY or DTS + if ($locales) { - //$orX = $query->expr()->orX(); - $orX = $query->expr()->orX(); + $orLocales = $query->expr()->orX(); foreach ($locales as $i => $locale) { - $orX->add("t.locales LIKE :locale{$i}"); + $orLocales->add("t.locales LIKE :locale{$i}"); + $orLocales->add("t.userId = :userId"); $query->setParameter(":locale{$i}", "%{$locale}%"); + $query->setParameter('userId', $userId); } - $query->andWhere($orX); + $query->andWhere($orLocales); } if (is_bool($sensitive)) { - $query->andWhere('t.sensitive = :sensitive') - ->setParameter('sensitive', $sensitive); + $orSensitive = $query->expr()->orX(); + + $orSensitive->add("t.sensitive = :sensitive"); + $orSensitive->add("t.userId = :userId"); + + $query->setParameter('sensitive', $sensitive); + $query->setParameter('userId', $userId); + + $query->andWhere($orSensitive); } if (is_bool($approved)) { - $query->andWhere('t.approved = :approved') - ->setParameter('approved', $approved); + $orApproved = $query->expr()->orX(); + + $orApproved->add("t.approved = :approved"); + $orApproved->add("t.userId = :userId"); + + $query->setParameter('approved', $approved); + $query->setParameter('userId', $userId); + + $query->andWhere($orApproved); + } + + if (is_bool($status)) + { + $orStatus = $query->expr()->orX(); + + $orStatus->add("t.status = :status"); + $orStatus->add("t.userId = :userId"); + + $query->setParameter('status', $status); + $query->setParameter('userId', $userId); + + $query->andWhere($orStatus); } return $query; diff --git a/src/Service/ActivityService.php b/src/Service/ActivityService.php index 4dbbb74..d7dfb5a 100644 --- a/src/Service/ActivityService.php +++ b/src/Service/ActivityService.php @@ -62,6 +62,9 @@ class ActivityService Activity::EVENT_TORRENT_DOWNLOAD_FILE_ADD, Activity::EVENT_TORRENT_DOWNLOAD_MAGNET_ADD, + Activity::EVENT_TORRENT_STATUS_ADD, + Activity::EVENT_TORRENT_STATUS_DELETE, + Activity::EVENT_TORRENT_WANTED_ADD, ]; } @@ -379,6 +382,30 @@ class ActivityService ] = $code; break; + + case Activity::EVENT_TORRENT_STATUS_ADD: + + $events + [ + $this->translatorInterface->trans('Torrents') + ] + [ + $this->translatorInterface->trans('Enabled') + ] = $code; + + break; + + case Activity::EVENT_TORRENT_STATUS_DELETE: + + $events + [ + $this->translatorInterface->trans('Torrents') + ] + [ + $this->translatorInterface->trans('Disabled') + ] = $code; + + break; } } @@ -861,6 +888,65 @@ class ActivityService return $activity; } + public function addEventTorrentStatusAdd( + int $userId, + int $torrentId, + int $added + ): ?Activity + { + $activity = new Activity(); + + $activity->setEvent( + Activity::EVENT_TORRENT_STATUS_ADD + ); + + $activity->setUserId( + $userId + ); + + $activity->setTorrentId( + $torrentId + ); + + $activity->setAdded( + $added + ); + + $this->entityManagerInterface->persist($activity); + $this->entityManagerInterface->flush(); + + return $activity; + } + + public function addEventTorrentStatusDelete( + int $userId, + int $torrentId, + int $added + ): ?Activity + { + $activity = new Activity(); + + $activity->setEvent( + Activity::EVENT_TORRENT_STATUS_DELETE + ); + + $activity->setUserId( + $userId + ); + + $activity->setTorrentId( + $torrentId + ); + + $activity->setAdded( + $added + ); + + $this->entityManagerInterface->persist($activity); + $this->entityManagerInterface->flush(); + + return $activity; + } public function addEventTorrentWantedAdd( int $userId, diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index 00986a3..b7129fe 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -192,7 +192,8 @@ class TorrentService int $added, array $locales, bool $sensitive, - bool $approved + bool $approved, + bool $status ): ?Torrent { $torrent = $this->addTorrent( @@ -204,7 +205,8 @@ class TorrentService ), $locales, $sensitive, - $approved + $approved, + $status ); $filesystem = new Filesystem(); @@ -249,7 +251,8 @@ class TorrentService array $keywords, array $locales, bool $sensitive, - bool $approved + bool $approved, + bool $status ): ?Torrent { $torrent = new Torrent(); @@ -261,6 +264,7 @@ class TorrentService $torrent->setLocales($locales); $torrent->setSensitive($sensitive); $torrent->setApproved($approved); + $torrent->setStatus($status); $this->entityManagerInterface->persist($torrent); $this->entityManagerInterface->flush(); @@ -292,6 +296,30 @@ class TorrentService return $torrent; } + public function toggleTorrentStatus( + int $torrentId + ): ?Torrent + { + $torrent = $this->getTorrent($torrentId); + + $torrent->setStatus( + !$torrent->isStatus() // toggle current value + ); + + $this->entityManagerInterface->persist($torrent); + $this->entityManagerInterface->flush(); + + $this->updateTorrentLocales( + $torrent->getId() + ); + + $this->updateTorrentSensitive( + $torrent->getId() + ); + + return $torrent; + } + public function getTorrentScrapeQueue(): ?Torrent { return $this->entityManagerInterface @@ -305,40 +333,48 @@ class TorrentService } public function findTorrents( + int $userId, array $keywords, array $locales, ?bool $sensitive, ?bool $approved, - int $limit, - int $offset + ?bool $status, + int $limit, + int $offset ) : array { return $this->entityManagerInterface ->getRepository(Torrent::class) ->findTorrents( + $userId, $keywords, $locales, $sensitive, $approved, + $status, $limit, $offset ); } public function findTorrentsTotal( + int $userId, array $keywords, array $locales, ?bool $sensitive, - ?bool $approved + ?bool $approved, + ?bool $status ) : int { return $this->entityManagerInterface ->getRepository(Torrent::class) ->findTorrentsTotal( + $userId, $keywords, $locales, $sensitive, - $approved + $approved, + $status ); } diff --git a/templates/default/activity/event/torrent/add.html.twig b/templates/default/activity/event/torrent/add.html.twig index 11712a2..b7e2610 100644 --- a/templates/default/activity/event/torrent/add.html.twig +++ b/templates/default/activity/event/torrent/add.html.twig @@ -9,9 +9,11 @@ {{ torrent.name }} </a> {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> diff --git a/templates/default/activity/event/torrent/add.rss.twig b/templates/default/activity/event/torrent/add.rss.twig index 174c82c..db55c4c 100644 --- a/templates/default/activity/event/torrent/add.rss.twig +++ b/templates/default/activity/event/torrent/add.rss.twig @@ -6,9 +6,11 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/approve/add.html.twig b/templates/default/activity/event/torrent/approve/add.html.twig index ab2350c..e394ecb 100644 --- a/templates/default/activity/event/torrent/approve/add.html.twig +++ b/templates/default/activity/event/torrent/approve/add.html.twig @@ -11,7 +11,11 @@ {{ torrent.name }} </a> {% else %} - {% if torrent.sensitive == true %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> diff --git a/templates/default/activity/event/torrent/approve/add.rss.twig b/templates/default/activity/event/torrent/approve/add.rss.twig index 7287540..e378199 100644 --- a/templates/default/activity/event/torrent/approve/add.rss.twig +++ b/templates/default/activity/event/torrent/approve/add.rss.twig @@ -6,7 +6,11 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.sensitive == true %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/approve/delete.html.twig b/templates/default/activity/event/torrent/approve/delete.html.twig index 3033a95..50d6079 100644 --- a/templates/default/activity/event/torrent/approve/delete.html.twig +++ b/templates/default/activity/event/torrent/approve/delete.html.twig @@ -11,9 +11,11 @@ {{ torrent.name }} </a> {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> diff --git a/templates/default/activity/event/torrent/approve/delete.rss.twig b/templates/default/activity/event/torrent/approve/delete.rss.twig index d358829..7252d9f 100644 --- a/templates/default/activity/event/torrent/approve/delete.rss.twig +++ b/templates/default/activity/event/torrent/approve/delete.rss.twig @@ -6,7 +6,11 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.sensitive == true %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/download/file/add.html.twig b/templates/default/activity/event/torrent/download/file/add.html.twig index 7959ff7..f71609a 100644 --- a/templates/default/activity/event/torrent/download/file/add.html.twig +++ b/templates/default/activity/event/torrent/download/file/add.html.twig @@ -14,9 +14,11 @@ #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) {% endif %} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> diff --git a/templates/default/activity/event/torrent/download/file/add.rss.twig b/templates/default/activity/event/torrent/download/file/add.rss.twig index ebeaf7c..d9bee5b 100644 --- a/templates/default/activity/event/torrent/download/file/add.rss.twig +++ b/templates/default/activity/event/torrent/download/file/add.rss.twig @@ -6,9 +6,11 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/download/magnet/add.html.twig b/templates/default/activity/event/torrent/download/magnet/add.html.twig index a3aa52a..1545e69 100644 --- a/templates/default/activity/event/torrent/download/magnet/add.html.twig +++ b/templates/default/activity/event/torrent/download/magnet/add.html.twig @@ -14,9 +14,11 @@ #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) {% endif %} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> diff --git a/templates/default/activity/event/torrent/download/magnet/add.rss.twig b/templates/default/activity/event/torrent/download/magnet/add.rss.twig index 6afad66..e29157f 100644 --- a/templates/default/activity/event/torrent/download/magnet/add.rss.twig +++ b/templates/default/activity/event/torrent/download/magnet/add.rss.twig @@ -6,9 +6,11 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/locales/add.html.twig b/templates/default/activity/event/torrent/locales/add.html.twig index a5f8c37..facd581 100644 --- a/templates/default/activity/event/torrent/locales/add.html.twig +++ b/templates/default/activity/event/torrent/locales/add.html.twig @@ -20,9 +20,11 @@ #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) {% endif %} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> diff --git a/templates/default/activity/event/torrent/locales/add.rss.twig b/templates/default/activity/event/torrent/locales/add.rss.twig index 20a65f5..81ec578 100644 --- a/templates/default/activity/event/torrent/locales/add.rss.twig +++ b/templates/default/activity/event/torrent/locales/add.rss.twig @@ -8,9 +8,11 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/locales/approve/add.html.twig b/templates/default/activity/event/torrent/locales/approve/add.html.twig index 254e24b..27ed85b 100644 --- a/templates/default/activity/event/torrent/locales/approve/add.html.twig +++ b/templates/default/activity/event/torrent/locales/approve/add.html.twig @@ -20,9 +20,11 @@ #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) {% endif %} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> diff --git a/templates/default/activity/event/torrent/locales/approve/add.rss.twig b/templates/default/activity/event/torrent/locales/approve/add.rss.twig index fc86232..64dbcdd 100644 --- a/templates/default/activity/event/torrent/locales/approve/add.rss.twig +++ b/templates/default/activity/event/torrent/locales/approve/add.rss.twig @@ -8,9 +8,11 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/locales/approve/delete.html.twig b/templates/default/activity/event/torrent/locales/approve/delete.html.twig index 020216c..d49dcb1 100644 --- a/templates/default/activity/event/torrent/locales/approve/delete.html.twig +++ b/templates/default/activity/event/torrent/locales/approve/delete.html.twig @@ -22,9 +22,11 @@ #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) {% endif %} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> diff --git a/templates/default/activity/event/torrent/locales/approve/delete.rss.twig b/templates/default/activity/event/torrent/locales/approve/delete.rss.twig index de936f1..b0cbada 100644 --- a/templates/default/activity/event/torrent/locales/approve/delete.rss.twig +++ b/templates/default/activity/event/torrent/locales/approve/delete.rss.twig @@ -8,9 +8,11 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/locales/delete.html.twig b/templates/default/activity/event/torrent/locales/delete.html.twig index 3794dc8..4327e41 100644 --- a/templates/default/activity/event/torrent/locales/delete.html.twig +++ b/templates/default/activity/event/torrent/locales/delete.html.twig @@ -20,9 +20,11 @@ #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) {% endif %} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> diff --git a/templates/default/activity/event/torrent/locales/delete.rss.twig b/templates/default/activity/event/torrent/locales/delete.rss.twig index 2c26702..1bb311d 100644 --- a/templates/default/activity/event/torrent/locales/delete.rss.twig +++ b/templates/default/activity/event/torrent/locales/delete.rss.twig @@ -8,9 +8,11 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/sensitive/add.html.twig b/templates/default/activity/event/torrent/sensitive/add.html.twig index 6165658..e21705a 100644 --- a/templates/default/activity/event/torrent/sensitive/add.html.twig +++ b/templates/default/activity/event/torrent/sensitive/add.html.twig @@ -20,10 +20,12 @@ #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) {% endif %} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} - #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} {% else %} <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/sensitive/add.rss.twig b/templates/default/activity/event/torrent/sensitive/add.rss.twig index 4280165..e1036bb 100644 --- a/templates/default/activity/event/torrent/sensitive/add.rss.twig +++ b/templates/default/activity/event/torrent/sensitive/add.rss.twig @@ -8,10 +8,12 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} - #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} {% else %} {{ torrent.name }} {% endif %} diff --git a/templates/default/activity/event/torrent/sensitive/approve/add.html.twig b/templates/default/activity/event/torrent/sensitive/approve/add.html.twig index 464bd9b..4bad7b0 100644 --- a/templates/default/activity/event/torrent/sensitive/approve/add.html.twig +++ b/templates/default/activity/event/torrent/sensitive/approve/add.html.twig @@ -20,10 +20,12 @@ #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) {% endif %} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} - #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} {% else %} <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/sensitive/approve/add.rss.twig b/templates/default/activity/event/torrent/sensitive/approve/add.rss.twig index f8d029e..583a42f 100644 --- a/templates/default/activity/event/torrent/sensitive/approve/add.rss.twig +++ b/templates/default/activity/event/torrent/sensitive/approve/add.rss.twig @@ -8,10 +8,12 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} - #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} {% else %} {{ torrent.name }} {% endif %} diff --git a/templates/default/activity/event/torrent/sensitive/approve/delete.html.twig b/templates/default/activity/event/torrent/sensitive/approve/delete.html.twig index 9134a0f..c02a804 100644 --- a/templates/default/activity/event/torrent/sensitive/approve/delete.html.twig +++ b/templates/default/activity/event/torrent/sensitive/approve/delete.html.twig @@ -20,10 +20,12 @@ #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) {% endif %} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} - #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} {% else %} <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/sensitive/approve/delete.rss.twig b/templates/default/activity/event/torrent/sensitive/approve/delete.rss.twig index da8ea11..f1a697f 100644 --- a/templates/default/activity/event/torrent/sensitive/approve/delete.rss.twig +++ b/templates/default/activity/event/torrent/sensitive/approve/delete.rss.twig @@ -8,10 +8,12 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} - #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} {% else %} {{ torrent.name }} {% endif %} diff --git a/templates/default/activity/event/torrent/sensitive/delete.html.twig b/templates/default/activity/event/torrent/sensitive/delete.html.twig index 9912cf3..a2640dc 100644 --- a/templates/default/activity/event/torrent/sensitive/delete.html.twig +++ b/templates/default/activity/event/torrent/sensitive/delete.html.twig @@ -20,10 +20,12 @@ #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) {% endif %} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} - #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} {% else %} <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/sensitive/delete.rss.twig b/templates/default/activity/event/torrent/sensitive/delete.rss.twig index d2254e8..3c13424 100644 --- a/templates/default/activity/event/torrent/sensitive/delete.rss.twig +++ b/templates/default/activity/event/torrent/sensitive/delete.rss.twig @@ -8,10 +8,12 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} - #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} {% else %} {{ torrent.name }} {% endif %} diff --git a/templates/default/activity/event/torrent/star/add.html.twig b/templates/default/activity/event/torrent/star/add.html.twig index 16095fe..9d27547 100644 --- a/templates/default/activity/event/torrent/star/add.html.twig +++ b/templates/default/activity/event/torrent/star/add.html.twig @@ -12,9 +12,11 @@ #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) {% endif %} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> diff --git a/templates/default/activity/event/torrent/star/add.rss.twig b/templates/default/activity/event/torrent/star/add.rss.twig index d56a7b5..a5fb324 100644 --- a/templates/default/activity/event/torrent/star/add.rss.twig +++ b/templates/default/activity/event/torrent/star/add.rss.twig @@ -6,9 +6,11 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/star/delete.html.twig b/templates/default/activity/event/torrent/star/delete.html.twig index fd8f6f7..a160792 100644 --- a/templates/default/activity/event/torrent/star/delete.html.twig +++ b/templates/default/activity/event/torrent/star/delete.html.twig @@ -13,9 +13,11 @@ #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) {% endif %} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> diff --git a/templates/default/activity/event/torrent/star/delete.rss.twig b/templates/default/activity/event/torrent/star/delete.rss.twig index e24ff3a..6c4c02c 100644 --- a/templates/default/activity/event/torrent/star/delete.rss.twig +++ b/templates/default/activity/event/torrent/star/delete.rss.twig @@ -6,9 +6,11 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.approved == false %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) - {% elseif torrent.sensitive == true %} + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} {{ torrent.name }} diff --git a/templates/default/activity/event/torrent/status/add.html.twig b/templates/default/activity/event/torrent/status/add.html.twig new file mode 100644 index 0000000..0466adc --- /dev/null +++ b/templates/default/activity/event/torrent/status/add.html.twig @@ -0,0 +1,30 @@ +<div class="row"> + <div class="column width-80"> + <a href="{{ path('user_info', { userId : user.id }) }}"> + <img class="border-radius-50 border-color-default vertical-align-middle" src="{{ user.identicon }}" alt="{{ 'identicon' | trans }}" /> + </a> + <span class="margin-l-4-px"> + {{ 'have enabled torrent' | trans }} + </span> + {% if session.user.moderator or session.user.owner %} + <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> + {{ torrent.name }} + </a> + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> + {{ torrent.name }} + </a> + {% endif %} + {% endif %} + </div> + <div class="column width-20 text-right"> + {{ added | format_ago }} + </div> +</div> \ No newline at end of file diff --git a/templates/default/activity/event/torrent/status/add.rss.twig b/templates/default/activity/event/torrent/status/add.rss.twig new file mode 100644 index 0000000..1f21d67 --- /dev/null +++ b/templates/default/activity/event/torrent/status/add.rss.twig @@ -0,0 +1,26 @@ +<item> + <title> + {{ 'User' | trans }} + #{{ user.id }} + {{ 'have enabled torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + {{ torrent.name }} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> + {{ torrent.name }} + </a> + {% endif %} + {% endif %} + + #{{ user.id }} + {{ added | date('D, d M Y h:i:s O') }} + {{ url('torrent_info', { torrentId : torrent.id }) }}#activity-{{ id }} + {{ url('torrent_info', { torrentId : torrent.id }) }}#activity + \ No newline at end of file diff --git a/templates/default/activity/event/torrent/status/delete.html.twig b/templates/default/activity/event/torrent/status/delete.html.twig new file mode 100644 index 0000000..3c5dea3 --- /dev/null +++ b/templates/default/activity/event/torrent/status/delete.html.twig @@ -0,0 +1,30 @@ +
+
+ + {{ 'identicon' | trans }} + + + {{ 'have disabled torrent' | trans }} + + {% if session.user.moderator or session.user.owner %} + + {{ torrent.name }} + + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + + {{ torrent.name }} + + {% endif %} + {% endif %} +
+
+ {{ added | format_ago }} +
+
\ No newline at end of file diff --git a/templates/default/activity/event/torrent/status/delete.rss.twig b/templates/default/activity/event/torrent/status/delete.rss.twig new file mode 100644 index 0000000..f1ef108 --- /dev/null +++ b/templates/default/activity/event/torrent/status/delete.rss.twig @@ -0,0 +1,26 @@ + + + {{ 'User' | trans }} + #{{ user.id }} + {{ 'have disabled torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + {{ torrent.name }} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + <a href="{{ path('torrent_info', { torrentId : torrent.id }) }}"> + {{ torrent.name }} + </a> + {% endif %} + {% endif %} + + #{{ user.id }} + {{ added | date('D, d M Y h:i:s O') }} + {{ url('torrent_info', { torrentId : torrent.id }) }}#activity-{{ id }} + {{ url('torrent_info', { torrentId : torrent.id }) }}#activity + \ No newline at end of file diff --git a/templates/default/activity/event/torrent/wanted/add.html.twig b/templates/default/activity/event/torrent/wanted/add.html.twig index 92b6dbc..86a8744 100644 --- a/templates/default/activity/event/torrent/wanted/add.html.twig +++ b/templates/default/activity/event/torrent/wanted/add.html.twig @@ -6,7 +6,11 @@ {{ torrent.name }} {% else %} - {% if torrent.sensitive == true %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} diff --git a/templates/default/activity/event/torrent/wanted/add.rss.twig b/templates/default/activity/event/torrent/wanted/add.rss.twig index 4c79afd..9459b57 100644 --- a/templates/default/activity/event/torrent/wanted/add.rss.twig +++ b/templates/default/activity/event/torrent/wanted/add.rss.twig @@ -4,7 +4,11 @@ {% if session.user.moderator or session.user.owner %} {{ torrent.name }} {% else %} - {% if torrent.sensitive == true %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} #{{ torrent.id }} ({{ 'sensitive' | trans }}) {% else %} {{ torrent.name }} diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index 50a8df4..46e939f 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -80,7 +80,7 @@
- {% if session.moderator %} + {% if session.moderator or session.owner %} + {% if session.moderator %} + + + + + {% endif %} {% endif %} - - - @@ -104,20 +109,22 @@ + {% set i = 0 %} {% for group, event in events %} + {% set i = i + 1 %} - - diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index 64105a2..933e632 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -169,10 +169,6 @@ Waiting for approve Waiting for approve - - Content visible for non sensitive users only - Content visible for non sensitive users only - Size Size @@ -725,9 +721,21 @@ Seeders wanted for torrent Seeders wanted for torrent - - Hide sensitive - Hide sensitive + + Hide + Hide + + + have disabled torrent + have disabled torrent + + + have enabled torrent + have enabled torrent + + + disabled + disabled diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index e5c2b2b..449e2f8 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -169,10 +169,6 @@ Waiting for approve Waiting for approve - - Content visible for non sensitive users only - Content visible for non sensitive users only - Size Size @@ -725,9 +721,21 @@ Seeders wanted for torrent Seeders wanted for torrent - - Hide sensitive - Hide sensitive + + Hide + Hide + + + have disabled torrent + have disabled torrent + + + have enabled torrent + have enabled torrent + + + disabled + disabled diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index b59c79c..d3e21bd 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -169,10 +169,6 @@ Waiting for approve Waiting for approve - - Content visible for non sensitive users only - Content visible for non sensitive users only - Size Size @@ -725,9 +721,21 @@ Seeders wanted for torrent Seeders wanted for torrent - - Hide sensitive - Hide sensitive + + Hide + Hide + + + have disabled torrent + have disabled torrent + + + have enabled torrent + have enabled torrent + + + disabled + disabled diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index 5dd0d65..8745b05 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -169,10 +169,6 @@ Waiting for approve Waiting for approve - - Content visible for non sensitive users only - Content visible for non sensitive users only - Size Size @@ -725,9 +721,21 @@ Seeders wanted for torrent Seeders wanted for torrent - - Hide sensitive - Hide sensitive + + Hide + Hide + + + have disabled torrent + have disabled torrent + + + have enabled torrent + have enabled torrent + + + disabled + disabled diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index 1319466..71ce44b 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -169,10 +169,6 @@ Waiting for approve Waiting for approve - - Content visible for non sensitive users only - Content visible for non sensitive users only - Size Size @@ -725,9 +721,21 @@ Seeders wanted for torrent Seeders wanted for torrent - - Hide sensitive - Hide sensitive + + Hide + Hide + + + have disabled torrent + have disabled torrent + + + have enabled torrent + have enabled torrent + + + disabled + disabled diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index 64243e4..db0cd5c 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -169,10 +169,6 @@ Waiting for approve Waiting for approve - - Content visible for non sensitive users only - Content visible for non sensitive users only - Size Size @@ -725,9 +721,21 @@ Seeders wanted for torrent Seeders wanted for torrent - - Hide sensitive - Hide sensitive + + Hide + Hide + + + have disabled torrent + have disabled torrent + + + have enabled torrent + have enabled torrent + + + disabled + disabled diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index 4cfe23b..259eb03 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -169,10 +169,6 @@ Waiting for approve Waiting for approve - - Content visible for non sensitive users only - Content visible for non sensitive users only - Size Size @@ -725,9 +721,21 @@ Seeders wanted for torrent Seeders wanted for torrent - - Hide sensitive - Hide sensitive + + Hide + Hide + + + have disabled torrent + have disabled torrent + + + have enabled torrent + have enabled torrent + + + disabled + disabled diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index 6e678db..9a26fd3 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -169,10 +169,6 @@ Waiting for approve Waiting for approve - - Content visible for non sensitive users only - Content visible for non sensitive users only - Size Size @@ -725,9 +721,21 @@ Seeders wanted for torrent Seeders wanted for torrent - - Hide sensitive - Hide sensitive + + Hide + Hide + + + have disabled torrent + have disabled torrent + + + have enabled torrent + have enabled torrent + + + disabled + disabled diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index 5966239..8b3eb39 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -169,10 +169,6 @@ Waiting for approve Waiting for approve - - Content visible for non sensitive users only - Content visible for non sensitive users only - Size Size @@ -725,9 +721,21 @@ Seeders wanted for torrent Seeders wanted for torrent - - Hide sensitive - Hide sensitive + + Hide + Hide + + + have disabled torrent + have disabled torrent + + + have enabled torrent + have enabled torrent + + + disabled + disabled diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index cd07809..6822945 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -169,10 +169,6 @@ Waiting for approve Waiting for approve - - Content visible for non sensitive users only - Content visible for non sensitive users only - Size Size @@ -725,9 +721,21 @@ Seeders wanted for torrent Seeders wanted for torrent - - Hide sensitive - Hide sensitive + + Hide + Hide + + + have disabled torrent + have disabled torrent + + + have enabled torrent + have enabled torrent + + + disabled + disabled diff --git a/translations/messages+intl-icu.nl.xlf b/translations/messages+intl-icu.nl.xlf index 5b0e4a9..a1e2e4b 100644 --- a/translations/messages+intl-icu.nl.xlf +++ b/translations/messages+intl-icu.nl.xlf @@ -169,10 +169,6 @@ Waiting for approve Waiting for approve - - Content visible for non sensitive users only - Content visible for non sensitive users only - Size Size @@ -725,9 +721,21 @@ Seeders wanted for torrent Seeders wanted for torrent - - Hide sensitive - Hide sensitive + + Hide + Hide + + + have disabled torrent + have disabled torrent + + + have enabled torrent + have enabled torrent + + + disabled + disabled diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index f128145..a03fc20 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -169,10 +169,6 @@ Waiting for approve Waiting for approve - - Content visible for non sensitive users only - Content visible for non sensitive users only - Size Size @@ -725,9 +721,21 @@ Seeders wanted for torrent Seeders wanted for torrent - - Hide sensitive - Hide sensitive + + Hide + Hide + + + have disabled torrent + have disabled torrent + + + have enabled torrent + have enabled torrent + + + disabled + disabled diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index 107c757..f70bf14 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -169,10 +169,6 @@ Waiting for approve Waiting for approve - - Content visible for non sensitive users only - Content visible for non sensitive users only - Size Size @@ -725,9 +721,21 @@ Seeders wanted for torrent Seeders wanted for torrent - - Hide sensitive - Hide sensitive + + Hide + Hide + + + have disabled torrent + have disabled torrent + + + have enabled torrent + have enabled torrent + + + disabled + disabled diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index d56e309..5a27f8b 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -169,10 +169,6 @@ Waiting for approve На рассмотрении - - Content visible for non sensitive users only - Содержимое видимо только для нечувствительных пользователей - Size Размер @@ -725,9 +721,21 @@ Seeders wanted for torrent Требуется раздача для торрента - - Hide sensitive - Скрывать чувствительное содержимое + + Hide + Скрыть + + + have disabled torrent + отключил торрент + + + have enabled torrent + включил торрент + + + disabled + отключено diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 02aa5d3..43f735c 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -169,10 +169,6 @@ Waiting for approve Очікує на підтвердження - - Content visible for non sensitive users only - Контент видимий лише для нечутливих користувачів - Size Розмір @@ -725,9 +721,21 @@ Seeders wanted for torrent Розшукуються роздачі для торенту - - Hide sensitive - Приховувати чутливий вміст + + Hide + Приховати + + + have disabled torrent + вимкнув торент + + + have enabled torrent + увімкнув торент + + + disabled + вимкнено From afcacebe261df0c8aa445a787aec7b3b0f583b0f Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 27 Oct 2023 01:40:07 +0300 Subject: [PATCH 113/185] update version --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index f2013ac..af22220 100644 --- a/.env +++ b/.env @@ -48,7 +48,7 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 # YGGtracker # Application version, used for API and media cache -APP_VERSION='2.2.1' +APP_VERSION='2.3.0' # Application name APP_NAME=YGGtracker From c7c5d7340cda57a8f49b4e8bc3340d169e8d6fc7 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 27 Oct 2023 21:22:16 +0300 Subject: [PATCH 114/185] implement additional torrent fields index, add indexer configuration #31 --- .env | 29 +++- config/services.yaml | 9 ++ src/Controller/TorrentController.php | 24 ++- src/Service/TorrentService.php | 230 ++++++++++++++++++++++----- 4 files changed, 248 insertions(+), 44 deletions(-) diff --git a/.env b/.env index af22220..5afd327 100644 --- a/.env +++ b/.env @@ -89,4 +89,31 @@ APP_TORRENT_FILE_SIZE_MAX=1024000 # Store wanted torrent files in /app/var/ftp by /app/crontab/torrent/scrape/{key} APP_TORRENT_WANTED_FTP_ENABLED=1 APP_TORRENT_WANTED_FTP_FOLDER=/yggtracker -APP_TORRENT_WANTED_FTP_APPROVED_ONLY=1 \ No newline at end of file +APP_TORRENT_WANTED_FTP_APPROVED_ONLY=1 + +# Enable search index for torrent name +APP_INDEX_TORRENT_NAME=1 + +# Enable search index for torrent info hash v1 +APP_INDEX_TORRENT_HASH_V1=1 + +# Enable search index for torrent info hash v2 +APP_INDEX_TORRENT_HASH_V2=1 + +# Enable search index for torrent filenames +APP_INDEX_TORRENT_FILENAMES=1 + +# Enable search index for torrent source +APP_INDEX_TORRENT_SOURCE=1 + +# Enable search index for torrent comment +APP_INDEX_TORRENT_COMMENT=1 + +# Enable search index for words length greater than N chars +APP_INDEX_WORD_LENGTH_MIN=3 + +# Enable search index for words length not greater than N chars +APP_INDEX_WORD_LENGTH_MAX=255 + +# Enable search index transliteration @TODO +APP_INDEX_TRANSLITERATION=1 \ No newline at end of file diff --git a/config/services.yaml b/config/services.yaml index e53a8b1..a63214a 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -21,6 +21,15 @@ parameters: app.torrent.wanted.ftp.enabled: '%env(APP_TORRENT_WANTED_FTP_ENABLED)%' app.torrent.wanted.ftp.folder: '%env(APP_TORRENT_WANTED_FTP_FOLDER)%' app.torrent.wanted.ftp.approved: '%env(APP_TORRENT_WANTED_FTP_APPROVED_ONLY)%' + app.index.torrent.name: '%env(APP_INDEX_TORRENT_NAME)%' + app.index.torrent.filenames: '%env(APP_INDEX_TORRENT_FILENAMES)%' + app.index.torrent.hash.v1: '%env(APP_INDEX_TORRENT_HASH_V1)%' + app.index.torrent.hash.v2: '%env(APP_INDEX_TORRENT_HASH_V2)%' + app.index.torrent.source: '%env(APP_INDEX_TORRENT_SOURCE)%' + app.index.torrent.comment: '%env(APP_INDEX_TORRENT_COMMENT)%' + app.index.word.length.min: '%env(APP_INDEX_WORD_LENGTH_MIN)%' + app.index.word.length.max: '%env(APP_INDEX_WORD_LENGTH_MAX)%' + app.index.transliteration: '%env(APP_INDEX_TRANSLITERATION)%' services: # default configuration for services in *this* file diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index a775048..713f020 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -880,7 +880,19 @@ class TorrentController extends AbstractController { // Save data $torrent = $torrentService->add( + $file->getPathName(), + + (bool) $this->getParameter('app.index.torrent.name'), + (bool) $this->getParameter('app.index.torrent.filenames'), + (bool) $this->getParameter('app.index.torrent.hash.v1'), + (bool) $this->getParameter('app.index.torrent.hash.v2'), + (bool) $this->getParameter('app.index.torrent.source'), + (bool) $this->getParameter('app.index.torrent.comment'), + (bool) $this->getParameter('app.index.transliteration'), + (int) $this->getParameter('app.index.word.length.min'), + (int) $this->getParameter('app.index.word.length.max'), + $user->getId(), time(), (array) $locales, @@ -2440,7 +2452,17 @@ class TorrentController extends AbstractController ): Response { // Reindex keywords - $torrentService->reindexTorrentKeywordsAll(); + $torrentService->reindexTorrentKeywordsAll( + (bool) $this->getParameter('app.index.torrent.name'), + (bool) $this->getParameter('app.index.torrent.filenames'), + (bool) $this->getParameter('app.index.torrent.hash.v1'), + (bool) $this->getParameter('app.index.torrent.hash.v2'), + (bool) $this->getParameter('app.index.torrent.source'), + (bool) $this->getParameter('app.index.torrent.comment'), + (bool) $this->getParameter('app.index.transliteration'), + (int) $this->getParameter('app.index.word.length.min'), + (int) $this->getParameter('app.index.word.length.max') + ); // Render response return new Response(); // @TODO diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index b7129fe..7546e1b 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -62,63 +62,167 @@ class TorrentService ); } + public function generateTorrentKeywordsByString( + string $string, + bool $transliteration, + int $wordLengthMin, + int $wordLengthMax, + ): array + { + $words = explode( + ' ', + preg_replace( + '/[\s]+/', + ' ', + preg_replace( + '/[\W_]+/u', + ' ', + $string + ) + ) + ); + + // Apply words filter + foreach ((array) $words as $key => $value) + { + // Apply word length filter + $length = mb_strlen($value); + + if ($length < $wordLengthMin || $length > $wordLengthMax) + { + unset($words[$key]); + } + + else + { + // Apply case insensitive search conversion + $words[$key] = mb_strtolower($value); + + if ($transliteration) + { + // @TODO + } + } + } + + // Build simple array + $keywords = []; + foreach ((array) $words as $word) + { + $keywords[] = $word; + } + + // Return unique keywords + return array_unique( + $keywords + ); + } + public function generateTorrentKeywordsByTorrentFilepath( + string $filepath, - int $minLength = 3 + + bool $extractName, + bool $extractFilenames, + bool $extractInfoHashV1, + bool $extractInfoHashV2, + bool $extractSource, + bool $extractComment, + + bool $wordTransliteration, + int $wordLengthMin, + int $wordLengthMax + ): array { $keywords = []; if ($file = $this->readTorrentFileByFilepath($filepath)) { - foreach ($file->getFileList() as $list) + if ($extractName) { - $words = explode( - ' ', - preg_replace( - '/[\s]+/', - ' ', - preg_replace( - '/[\W_]+/u', - ' ', - $list['path'] - ) - ) - ); - - foreach ($words as $key => $value) + if ($name = $file->getName(false)) { - if (mb_strlen($value) < $minLength) - { - unset($words[$key]); - } - - else - { - $words[$key] = mb_strtolower($value); - } + $keywords = array_merge( + $keywords, + $this->generateTorrentKeywordsByString( + $name, + $wordTransliteration, + $wordLengthMin, + $wordLengthMax + ) + ); } + } + if ($extractFilenames) + { + foreach ($file->getFileList() as $list) + { + $keywords = array_merge( + $keywords, + $this->generateTorrentKeywordsByString( + $list['path'], + $wordTransliteration, + $wordLengthMin, + $wordLengthMax + ) + ); + } + } + + if ($extractSource) + { + if ($source = $file->getSource(false)) + { + $keywords = array_merge( + $keywords, + $this->generateTorrentKeywordsByString( + $source, + $wordTransliteration, + $wordLengthMin, + $wordLengthMax + ) + ); + } + } + + if ($extractComment) + { + if ($comment = $file->getComment(false)) + { + $keywords = array_merge( + $keywords, + $this->generateTorrentKeywordsByString( + $comment, + $wordTransliteration, + $wordLengthMin, + $wordLengthMax + ) + ); + } + } + + if ($extractInfoHashV1) + { if ($hash = $file->getInfoHashV1(false)) { $keywords[] = $hash; } + } + if ($extractInfoHashV2) + { if ($hash = $file->getInfoHashV2(false)) { $keywords[] = $hash; } - - if ($name = $file->getName(false)) - { - $keywords[] = $name; - } - - $keywords = array_merge($keywords, $words); } } - return array_unique($keywords); + return array_unique( + $keywords + ); } public function getStorageFilepathByTorrentId(int $torrentId): string @@ -187,13 +291,27 @@ class TorrentService } public function add( + string $filepath, - int $userId, - int $added, - array $locales, - bool $sensitive, - bool $approved, - bool $status + + bool $extractName, + bool $extractFilenames, + bool $extractInfoHashV1, + bool $extractInfoHashV2, + bool $extractSource, + bool $extractComment, + + bool $wordTransliteration, + int $wordLengthMin, + int $wordLengthMax, + + int $userId, + int $added, + array $locales, + bool $sensitive, + bool $approved, + bool $status + ): ?Torrent { $torrent = $this->addTorrent( @@ -201,7 +319,16 @@ class TorrentService $added, md5_file($filepath), $this->generateTorrentKeywordsByTorrentFilepath( - $filepath + $filepath, + $extractName, + $extractFilenames, + $extractInfoHashV1, + $extractInfoHashV2, + $extractSource, + $extractComment, + $wordTransliteration, + $wordLengthMin, + $wordLengthMax ), $locales, $sensitive, @@ -489,7 +616,17 @@ class TorrentService } } - public function reindexTorrentKeywordsAll(): void + public function reindexTorrentKeywordsAll( + bool $extractName, + bool $extractFilenames, + bool $extractInfoHashV1, + bool $extractInfoHashV2, + bool $extractSource, + bool $extractComment, + bool $wordTransliteration, + int $wordLengthMin, + int $wordLengthMax + ): void { foreach ($this->entityManagerInterface ->getRepository(Torrent::class) @@ -499,7 +636,16 @@ class TorrentService $this->generateTorrentKeywordsByTorrentFilepath( $this->getStorageFilepathByTorrentId( $torrent->getId() - ) + ), + $extractName, + $extractFilenames, + $extractInfoHashV1, + $extractInfoHashV2, + $extractSource, + $extractComment, + $wordTransliteration, + $wordLengthMin, + $wordLengthMax ) ); From 997666ab8efa8b5870aa163ad7c72d813fc59b01 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 28 Oct 2023 00:03:42 +0300 Subject: [PATCH 115/185] implement transliteration word forms in search #33 --- .env | 17 +++--- README.md | 1 + composer.json | 1 + composer.lock | 45 ++++++++++++++- config/services.yaml | 13 ++--- src/Controller/TorrentController.php | 28 ++++------ src/Repository/TorrentRepository.php | 82 +++++++++++++++++++++++++--- src/Service/TorrentService.php | 15 ----- 8 files changed, 144 insertions(+), 58 deletions(-) diff --git a/.env b/.env index 5afd327..105d50b 100644 --- a/.env +++ b/.env @@ -92,28 +92,25 @@ APP_TORRENT_WANTED_FTP_FOLDER=/yggtracker APP_TORRENT_WANTED_FTP_APPROVED_ONLY=1 # Enable search index for torrent name -APP_INDEX_TORRENT_NAME=1 +APP_INDEX_TORRENT_NAME_ENABLED=1 # Enable search index for torrent info hash v1 -APP_INDEX_TORRENT_HASH_V1=1 +APP_INDEX_TORRENT_HASH_V1_ENABLED=1 # Enable search index for torrent info hash v2 -APP_INDEX_TORRENT_HASH_V2=1 +APP_INDEX_TORRENT_HASH_V2_ENABLED=1 # Enable search index for torrent filenames -APP_INDEX_TORRENT_FILENAMES=1 +APP_INDEX_TORRENT_FILENAMES_ENABLED=1 # Enable search index for torrent source -APP_INDEX_TORRENT_SOURCE=1 +APP_INDEX_TORRENT_SOURCE_ENABLED=1 # Enable search index for torrent comment -APP_INDEX_TORRENT_COMMENT=1 +APP_INDEX_TORRENT_COMMENT_ENABLED=1 # Enable search index for words length greater than N chars APP_INDEX_WORD_LENGTH_MIN=3 # Enable search index for words length not greater than N chars -APP_INDEX_WORD_LENGTH_MAX=255 - -# Enable search index transliteration @TODO -APP_INDEX_TRANSLITERATION=1 \ No newline at end of file +APP_INDEX_WORD_LENGTH_MAX=255 \ No newline at end of file diff --git a/README.md b/README.md index 6d5d9a7..0d6d65e 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ git checkout -b my-pr-branch-name * [SVG icons](https://icons.getbootstrap.com) * [Scrapper](https://github.com/medariox/scrapeer) / [Composer Edition](https://github.com/YGGverse/scrapeer) * [Bencode Library](https://github.com/Rhilip/Bencode) +* [Transliteration Library](https://github.com/ashtokalo/php-translit) * [Identicons](https://github.com/dmester/jdenticon-php) #### Support diff --git a/composer.json b/composer.json index c0d3e3c..a91504c 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,7 @@ "php": ">=8.1", "ext-ctype": "*", "ext-iconv": "*", + "ashtokalo/php-translit": "^0.2.0", "doctrine/annotations": "^2.0", "doctrine/doctrine-bundle": "^2.10", "doctrine/doctrine-migrations-bundle": "^3.2", diff --git a/composer.lock b/composer.lock index e3eddf2..babbb48 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,51 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3770ffcd80695bc10a22f8ece4f68d1f", + "content-hash": "4d930a43cf9a80e1622029c4a4048a6b", "packages": [ + { + "name": "ashtokalo/php-translit", + "version": "0.2.0", + "source": { + "type": "git", + "url": "https://github.com/ashtokalo/php-translit.git", + "reference": "8ced36cbcd0ed8befb1388ef51935eb53bcfe5b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ashtokalo/php-translit/zipball/8ced36cbcd0ed8befb1388ef51935eb53bcfe5b3", + "reference": "8ced36cbcd0ed8befb1388ef51935eb53bcfe5b3", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "~7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ashtokalo\\translit\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP library to convert text from one script to another.", + "keywords": [ + "latinization", + "romanization", + "translit", + "transliteration" + ], + "support": { + "issues": "https://github.com/ashtokalo/php-translit/issues", + "source": "https://github.com/ashtokalo/php-translit/tree/0.2.0" + }, + "time": "2022-09-26T09:05:24+00:00" + }, { "name": "doctrine/annotations", "version": "2.0.1", diff --git a/config/services.yaml b/config/services.yaml index a63214a..bb2762b 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -21,15 +21,14 @@ parameters: app.torrent.wanted.ftp.enabled: '%env(APP_TORRENT_WANTED_FTP_ENABLED)%' app.torrent.wanted.ftp.folder: '%env(APP_TORRENT_WANTED_FTP_FOLDER)%' app.torrent.wanted.ftp.approved: '%env(APP_TORRENT_WANTED_FTP_APPROVED_ONLY)%' - app.index.torrent.name: '%env(APP_INDEX_TORRENT_NAME)%' - app.index.torrent.filenames: '%env(APP_INDEX_TORRENT_FILENAMES)%' - app.index.torrent.hash.v1: '%env(APP_INDEX_TORRENT_HASH_V1)%' - app.index.torrent.hash.v2: '%env(APP_INDEX_TORRENT_HASH_V2)%' - app.index.torrent.source: '%env(APP_INDEX_TORRENT_SOURCE)%' - app.index.torrent.comment: '%env(APP_INDEX_TORRENT_COMMENT)%' + app.index.torrent.name.enabled: '%env(APP_INDEX_TORRENT_NAME_ENABLED)%' + app.index.torrent.filenames.enabled: '%env(APP_INDEX_TORRENT_FILENAMES_ENABLED)%' + app.index.torrent.hash.v1.enabled: '%env(APP_INDEX_TORRENT_HASH_V1_ENABLED)%' + app.index.torrent.hash.v2.enabled: '%env(APP_INDEX_TORRENT_HASH_V2_ENABLED)%' + app.index.torrent.source.enabled: '%env(APP_INDEX_TORRENT_SOURCE_ENABLED)%' + app.index.torrent.comment.enabled: '%env(APP_INDEX_TORRENT_COMMENT_ENABLED)%' app.index.word.length.min: '%env(APP_INDEX_WORD_LENGTH_MIN)%' app.index.word.length.max: '%env(APP_INDEX_WORD_LENGTH_MAX)%' - app.index.transliteration: '%env(APP_INDEX_TRANSLITERATION)%' services: # default configuration for services in *this* file diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 713f020..0191315 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -229,8 +229,6 @@ class TorrentController extends AbstractController $activityService ); - // - // Init request $query = $request->get('query') ? explode(' ', urldecode($request->get('query'))) : []; $page = $request->get('page') ? (int) $request->get('page') : 1; @@ -883,13 +881,12 @@ class TorrentController extends AbstractController $file->getPathName(), - (bool) $this->getParameter('app.index.torrent.name'), - (bool) $this->getParameter('app.index.torrent.filenames'), - (bool) $this->getParameter('app.index.torrent.hash.v1'), - (bool) $this->getParameter('app.index.torrent.hash.v2'), - (bool) $this->getParameter('app.index.torrent.source'), - (bool) $this->getParameter('app.index.torrent.comment'), - (bool) $this->getParameter('app.index.transliteration'), + (bool) $this->getParameter('app.index.torrent.name.enabled'), + (bool) $this->getParameter('app.index.torrent.filenames.enabled'), + (bool) $this->getParameter('app.index.torrent.hash.v1.enabled'), + (bool) $this->getParameter('app.index.torrent.hash.v2.enabled'), + (bool) $this->getParameter('app.index.torrent.source.enabled'), + (bool) $this->getParameter('app.index.torrent.comment.enabled'), (int) $this->getParameter('app.index.word.length.min'), (int) $this->getParameter('app.index.word.length.max'), @@ -2453,13 +2450,12 @@ class TorrentController extends AbstractController { // Reindex keywords $torrentService->reindexTorrentKeywordsAll( - (bool) $this->getParameter('app.index.torrent.name'), - (bool) $this->getParameter('app.index.torrent.filenames'), - (bool) $this->getParameter('app.index.torrent.hash.v1'), - (bool) $this->getParameter('app.index.torrent.hash.v2'), - (bool) $this->getParameter('app.index.torrent.source'), - (bool) $this->getParameter('app.index.torrent.comment'), - (bool) $this->getParameter('app.index.transliteration'), + (bool) $this->getParameter('app.index.torrent.name.enabled'), + (bool) $this->getParameter('app.index.torrent.filenames.enabled'), + (bool) $this->getParameter('app.index.torrent.hash.v1.enabled'), + (bool) $this->getParameter('app.index.torrent.hash.v2.enabled'), + (bool) $this->getParameter('app.index.torrent.source.enabled'), + (bool) $this->getParameter('app.index.torrent.comment.enabled'), (int) $this->getParameter('app.index.word.length.min'), (int) $this->getParameter('app.index.word.length.max') ); diff --git a/src/Repository/TorrentRepository.php b/src/Repository/TorrentRepository.php index f960e90..1ccd425 100644 --- a/src/Repository/TorrentRepository.php +++ b/src/Repository/TorrentRepository.php @@ -73,27 +73,36 @@ class TorrentRepository extends ServiceEntityRepository int $userId, array $keywords, array $locales, - ?bool $sensitive = null, - ?bool $approved = null, - ?bool $status = null, + ?bool $sensitive = null, + ?bool $approved = null, + ?bool $status = null ): \Doctrine\ORM\QueryBuilder { $query = $this->createQueryBuilder('t'); if ($keywords) { - $andKeywords = $query->expr()->andX(); - foreach ($keywords as $i => $keyword) { - $keyword = mb_strtolower($keyword); // all keywords stored in lowercase + // Make query to the index case insensitive + $keyword = mb_strtolower($keyword); - $andKeywords->add("t.keywords LIKE :keyword{$i}"); + // Init OR condition for each word form + $orKeywords = $query->expr()->orX(); + $orKeywords->add("t.keywords LIKE :keyword{$i}"); $query->setParameter(":keyword{$i}", "%{$keyword}%"); - } - $query->andWhere($andKeywords); + // Generate word forms for each transliteration locale #33 + foreach ($this->generateWordForms($keyword) as $j => $wordForm) + { + $orKeywords->add("t.keywords LIKE :keyword{$i}{$j}"); + $query->setParameter(":keyword{$i}{$j}", "%{$wordForm}%"); + } + + // Append AND condition + $query->andWhere($orKeywords); + } } if ($locales) @@ -153,4 +162,59 @@ class TorrentRepository extends ServiceEntityRepository return $query; } + + // Word forms generator to improve search results + // e.g. transliteration rules for latin filenames + private function generateWordForms( + string $keyword, + // #33 supported locales: + // https://github.com/ashtokalo/php-translit + array $transliteration = [ + 'be', + 'bg', + 'el', + 'hy', + 'kk', + 'mk', + 'ru', + 'ka', + 'uk' + ], + // Additional char forms + array $charForms = + [ + 'c' => 'k', + 'k' => 'c', + ] + ): array + { + $wordForms = []; + + // Apply transliteration + foreach ($transliteration as $locale) + { + $wordForms[] = \ashtokalo\translit\Translit::object()->convert( + $keyword, + $locale + ); + } + + // Apply char forms + foreach ($wordForms as $wordForm) + { + foreach ($charForms as $from => $to) + { + $wordForms[] = str_replace( + $from, + $to, + $wordForm + ); + } + } + + // Remove duplicates + return array_unique( + $wordForms + ); + } } diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index 7546e1b..62cd0c5 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -64,7 +64,6 @@ class TorrentService public function generateTorrentKeywordsByString( string $string, - bool $transliteration, int $wordLengthMin, int $wordLengthMax, ): array @@ -97,11 +96,6 @@ class TorrentService { // Apply case insensitive search conversion $words[$key] = mb_strtolower($value); - - if ($transliteration) - { - // @TODO - } } } @@ -129,7 +123,6 @@ class TorrentService bool $extractSource, bool $extractComment, - bool $wordTransliteration, int $wordLengthMin, int $wordLengthMax @@ -147,7 +140,6 @@ class TorrentService $keywords, $this->generateTorrentKeywordsByString( $name, - $wordTransliteration, $wordLengthMin, $wordLengthMax ) @@ -163,7 +155,6 @@ class TorrentService $keywords, $this->generateTorrentKeywordsByString( $list['path'], - $wordTransliteration, $wordLengthMin, $wordLengthMax ) @@ -179,7 +170,6 @@ class TorrentService $keywords, $this->generateTorrentKeywordsByString( $source, - $wordTransliteration, $wordLengthMin, $wordLengthMax ) @@ -195,7 +185,6 @@ class TorrentService $keywords, $this->generateTorrentKeywordsByString( $comment, - $wordTransliteration, $wordLengthMin, $wordLengthMax ) @@ -301,7 +290,6 @@ class TorrentService bool $extractSource, bool $extractComment, - bool $wordTransliteration, int $wordLengthMin, int $wordLengthMax, @@ -326,7 +314,6 @@ class TorrentService $extractInfoHashV2, $extractSource, $extractComment, - $wordTransliteration, $wordLengthMin, $wordLengthMax ), @@ -623,7 +610,6 @@ class TorrentService bool $extractInfoHashV2, bool $extractSource, bool $extractComment, - bool $wordTransliteration, int $wordLengthMin, int $wordLengthMax ): void @@ -643,7 +629,6 @@ class TorrentService $extractInfoHashV2, $extractSource, $extractComment, - $wordTransliteration, $wordLengthMin, $wordLengthMax ) From 8ae1b3f0b77d745052e24a4a9db33d99daf2406b Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 29 Oct 2023 20:00:27 +0200 Subject: [PATCH 116/185] init torrent poster database #18 --- src/Entity/TorrentPoster.php | 117 +++++++++++++++++++++ src/Repository/TorrentPosterRepository.php | 23 ++++ 2 files changed, 140 insertions(+) create mode 100644 src/Entity/TorrentPoster.php create mode 100644 src/Repository/TorrentPosterRepository.php diff --git a/src/Entity/TorrentPoster.php b/src/Entity/TorrentPoster.php new file mode 100644 index 0000000..c866dea --- /dev/null +++ b/src/Entity/TorrentPoster.php @@ -0,0 +1,117 @@ +id; + } + + public function setId(string $id): static + { + $this->id = $id; + + return $this; + } + + public function getTorrentId(): ?int + { + return $this->torrentId; + } + + public function setTorrentId(int $torrentId): static + { + $this->torrentId = $torrentId; + + return $this; + } + + public function getUserId(): ?int + { + return $this->userId; + } + + public function setUserId(int $userId): static + { + $this->userId = $userId; + + return $this; + } + + public function getAdded(): ?int + { + return $this->added; + } + + public function setAdded(int $added): static + { + $this->added = $added; + + return $this; + } + + public function isApproved(): ?bool + { + return $this->approved; + } + + public function setApproved(bool $approved): static + { + $this->approved = $approved; + + return $this; + } + + public function getColor(): ?string + { + return $this->color; + } + + public function setColor(string $color): static + { + $this->color = $color; + + return $this; + } + + public function getMd5file(): ?string + { + return $this->md5file; + } + + public function setMd5file(string $md5file): static + { + $this->md5file = $md5file; + + return $this; + } +} diff --git a/src/Repository/TorrentPosterRepository.php b/src/Repository/TorrentPosterRepository.php new file mode 100644 index 0000000..235231c --- /dev/null +++ b/src/Repository/TorrentPosterRepository.php @@ -0,0 +1,23 @@ + + * + * @method TorrentPoster|null find($id, $lockMode = null, $lockVersion = null) + * @method TorrentPoster|null findOneBy(array $criteria, array $orderBy = null) + * @method TorrentPoster[] findAll() + * @method TorrentPoster[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class TorrentPosterRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, TorrentPoster::class); + } +} From bd5191e894e91ed3abf7253a20f128435231b121 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 30 Oct 2023 04:44:44 +0200 Subject: [PATCH 117/185] implement torrent posters feature #18 --- .env | 6 + config/services.yaml | 2 + migrations/Version20231029184600.php | 35 ++ public/asset/default/css/framework.css | 21 +- src/Controller/ActivityController.php | 1 + src/Controller/TorrentController.php | 438 +++++++++++++++++- src/Controller/UserController.php | 12 + src/Entity/Torrent.php | 15 + src/Entity/TorrentPoster.php | 15 - src/Entity/User.php | 15 + src/Service/TorrentService.php | 290 +++++++++++- src/Service/UserService.php | 5 + .../default/torrent/edit/poster.html.twig | 84 ++++ templates/default/torrent/info.html.twig | 19 +- templates/default/torrent/list.html.twig | 12 +- templates/default/user/settings.html.twig | 17 + 16 files changed, 944 insertions(+), 43 deletions(-) create mode 100644 migrations/Version20231029184600.php create mode 100644 templates/default/torrent/edit/poster.html.twig diff --git a/.env b/.env index 105d50b..7864012 100644 --- a/.env +++ b/.env @@ -77,6 +77,9 @@ APP_APPROVED=0 # Default Yggdrasil filters status for new users APP_YGGDRASIL=1 +# Default posters status for new users +APP_POSTERS=1 + # Build-in trackers append to downloads APP_TRACKERS=http://[201:23b4:991a:634d:8359:4521:5576:15b7]:2023/announce|http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/announce|http://[316:c51a:62a3:8b9::5]/announce @@ -86,6 +89,9 @@ APP_CRAWLERS=201:23b4:991a:634d:8359:4521:5576:15b7|30a:5fad::e # Max torrent filesize for uploads APP_TORRENT_FILE_SIZE_MAX=1024000 +# Max torrent poster filesize for uploads +APP_TORRENT_POSTER_FILE_SIZE_MAX=10240000 + # Store wanted torrent files in /app/var/ftp by /app/crontab/torrent/scrape/{key} APP_TORRENT_WANTED_FTP_ENABLED=1 APP_TORRENT_WANTED_FTP_FOLDER=/yggtracker diff --git a/config/services.yaml b/config/services.yaml index bb2762b..110b2a6 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -17,7 +17,9 @@ parameters: app.sensitive: '%env(APP_SENSITIVE)%' app.approved: '%env(APP_APPROVED)%' app.yggdrasil: '%env(APP_YGGDRASIL)%' + app.posters: '%env(APP_POSTERS)%' app.torrent.size.max: '%env(APP_TORRENT_FILE_SIZE_MAX)%' + app.torrent.poster.size.max: '%env(APP_TORRENT_POSTER_FILE_SIZE_MAX)%' app.torrent.wanted.ftp.enabled: '%env(APP_TORRENT_WANTED_FTP_ENABLED)%' app.torrent.wanted.ftp.folder: '%env(APP_TORRENT_WANTED_FTP_FOLDER)%' app.torrent.wanted.ftp.approved: '%env(APP_TORRENT_WANTED_FTP_APPROVED_ONLY)%' diff --git a/migrations/Version20231029184600.php b/migrations/Version20231029184600.php new file mode 100644 index 0000000..634e2a1 --- /dev/null +++ b/migrations/Version20231029184600.php @@ -0,0 +1,35 @@ +addSql('CREATE TABLE torrent_poster (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, torrent_id INTEGER NOT NULL, user_id INTEGER NOT NULL, added INTEGER NOT NULL, approved BOOLEAN NOT NULL, md5file VARCHAR(32) NOT NULL)'); + $this->addSql('ALTER TABLE user ADD COLUMN posters BOOLEAN NOT NULL DEFAULT 1'); + $this->addSql('ALTER TABLE torrent ADD COLUMN torrent_poster_id BOOLEAN NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('DROP TABLE torrent_poster'); + $this->addSql('ALTER TABLE user DROP COLUMN posters'); + $this->addSql('ALTER TABLE torrent DROP COLUMN torrent_poster_id'); + } +} diff --git a/public/asset/default/css/framework.css b/public/asset/default/css/framework.css index 7fb4b66..1c31c9c 100644 --- a/public/asset/default/css/framework.css +++ b/public/asset/default/css/framework.css @@ -197,29 +197,36 @@ a.button-green:hover { } .border-color-default { - border: 1px #5d627d solid; + border: 1px rgba(93, 98, 125, .6) solid; } .border-bottom-default { - border-bottom: 1px #5d627d solid; + border-bottom: 1px rgba(93, 98, 125, .6) solid; } .border-top-default { - border-top: 1px #5d627d solid; + border-top: 1px rgba(93, 98, 125, .6) solid; } .border-bottom-dashed { - border-bottom: 1px #5d627d dashed; + border-bottom: 1px rgba(93, 98, 125, .6) dashed; } .border-top-dashed { - border-top: 1px #5d627d dashed; + border-top: 1px rgba(93, 98, 125, .6) dashed; } .border-width-2-px { border-width: 2px; } +.background-poster { + background-position: center; + background-repeat: no-repeat; + background-size: cover; + background-blend-mode: soft-light; +} + .background-color-night { background-color: #34384f; } @@ -503,6 +510,10 @@ a:visited.background-color-hover-night-light:hover { /* responsive rules */ +.height-148-px { + height: 148px; +} + .width-100 { width: 100%; } diff --git a/src/Controller/ActivityController.php b/src/Controller/ActivityController.php index c4e147d..06bdec1 100644 --- a/src/Controller/ActivityController.php +++ b/src/Controller/ActivityController.php @@ -1463,6 +1463,7 @@ class ActivityController extends AbstractController $this->getParameter('app.theme'), $this->getParameter('app.sensitive'), $this->getParameter('app.yggdrasil'), + $this->getParameter('app.posters'), $this->getParameter('app.approved') ); diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 0191315..f5c02d9 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -106,6 +106,22 @@ class TorrentController extends AbstractController // Init page $page = $request->get('page') ? (int) $request->get('page') : 1; + // Poster + if ($user->isPosters() && $torrent->getTorrentPosterId()) + { + $poster = $request->getScheme() . '://' . + $request->getHttpHost() . + $request->getBasePath() . + $torrentService->getImageUriByTorrentPosterId( + $torrent->getTorrentPosterId() + ); + } + + else + { + $poster = false; + } + // Render template return $this->render('default/torrent/info.html.twig', [ @@ -155,7 +171,7 @@ class TorrentController extends AbstractController ) ] ], - 'star' => + 'star' => [ 'exist' => (bool) $torrentService->findTorrentStar( $torrent->getId(), @@ -165,7 +181,8 @@ class TorrentController extends AbstractController $torrent->getId() ) ], - 'contributors' => $contributors + 'contributors' => $contributors, + 'poster' => $poster ], 'file' => [ @@ -284,6 +301,22 @@ class TorrentController extends AbstractController arsort($keywords); + // Poster + if ($user->isPosters() && $torrent->getTorrentPosterId()) + { + $poster = $request->getScheme() . '://' . + $request->getHttpHost() . + $request->getBasePath() . + $torrentService->getImageUriByTorrentPosterId( + $torrent->getTorrentPosterId() + ); + } + + else + { + $poster = false; + } + // Push torrent $torrents[] = [ @@ -351,6 +384,7 @@ class TorrentController extends AbstractController $torrent->getId() ) ], + 'poster' => $poster ]; } @@ -447,6 +481,22 @@ class TorrentController extends AbstractController arsort($keywords); + // Poster + if ($user->isPosters() && $torrent->getTorrentPosterId()) + { + $poster = $request->getScheme() . '://' . + $request->getHttpHost() . + $request->getBasePath() . + $torrentService->getImageUriByTorrentPosterId( + $torrent->getTorrentPosterId() + ); + } + + else + { + $poster = false; + } + // Push torrent $torrents[] = [ @@ -471,15 +521,6 @@ class TorrentController extends AbstractController 'peers' => (int) $torrent->getPeers(), 'leechers' => (int) $torrent->getLeechers(), ], - 'user' => - [ - 'id' => $torrent->getUserId(), - 'identicon' => $userService->identicon( - $userService->getUser( - $torrent->getUserId() - )->getAddress() - ) - ], 'keywords' => $keywords, 'download' => [ @@ -514,6 +555,7 @@ class TorrentController extends AbstractController $torrent->getId() ) ], + 'poster' => $poster ]; } @@ -1773,6 +1815,379 @@ class TorrentController extends AbstractController ); } + // Torrent poster + #[Route( + '/{_locale}/torrent/{torrentId}/edit/poster/{torrentPosterId}', + name: 'torrent_poster_edit', + requirements: + [ + '_locale' => '%app.locales%', + 'torrentId' => '\d+', + 'torrentPosterId' => '\d+', + ], + defaults: + [ + 'torrentPosterId' => null, + ], + methods: + [ + 'GET', + 'POST' + ] + )] + public function editPoster( + Request $request, + TranslatorInterface $translator, + UserService $userService, + TorrentService $torrentService, + ActivityService $activityService + ): Response + { + // Init user + $user = $this->initUser( + $request, + $userService, + $activityService + ); + + if (!$user->isStatus()) + { + // @TODO + throw new \Exception( + $translator->trans('Access denied') + ); + } + + // Init torrent + if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) + { + throw $this->createNotFoundException(); + } + + // Init poster value + if ($request->get('torrentPosterId')) + { + if ($torrentPoster = $torrentService->getTorrentPoster($request->get('torrentPosterId'))) + { + $torrentPosterCurrent = + [ + 'id' => $torrentPoster->getId(), + 'userId' => $torrentPoster->getUserId(), + 'value' => 'src' // @TODO + ]; + } + + else + { + throw $this->createNotFoundException(); + } + } + else + { + if ($torrentPoster = $torrentService->findLastTorrentPosterByTorrentId($torrent->getId())) + { + $torrentPosterCurrent = + [ + 'id' => $torrentPoster->getId(), + 'userId' => $torrentPoster->getUserId(), + 'value' => 'src' // @TODO + ]; + } + + else + { + $torrentPosterCurrent = + [ + 'id' => null, + 'userId' => null, + 'value' => false, + ]; + } + } + + // Init edition history + $editions = []; + foreach ($torrentService->findTorrentPosterByTorrentId($torrent->getId()) as $torrentPosterEdition) + { + $editions[] = + [ + 'id' => $torrentPosterEdition->getId(), + 'added' => $torrentPosterEdition->getAdded(), + 'approved' => $torrentPosterEdition->isApproved(), + 'active' => $torrentPosterEdition->getId() == $torrentPosterCurrent['id'], + 'user' => + [ + 'id' => $torrentPosterEdition->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $torrentPosterEdition->getUserId() + )->getAddress() + ), + ], + 'poster' => + $request->getScheme() . '://' . + $request->getHttpHost() . + $request->getBasePath() . + $torrentService->getImageUriByTorrentPosterId( + $torrentPosterEdition->getId() + ) + ]; + } + + // Init form + $form = + [ + 'poster' => + [ + 'error' => [] + ] + ]; + + // Process request + if ($request->isMethod('post')) + { + if ($file = $request->files->get('poster')) + { + //// Validate poster file + if (filesize($file->getPathName()) > $this->getParameter('app.torrent.poster.size.max')) + { + $form['poster']['error'][] = $translator->trans('Poster file out of size limit'); + } + + //// Validate image format + if (!@getimagesize($file->getPathName())) + { + $form['poster']['error'][] = $translator->trans('Image file not supported'); + } + } + + else + { + $form['poster']['error'][] = $translator->trans('Poster file required'); + } + + // Request is valid + if (empty($form['poster']['error'])) + { + // Save data + $torrentPoster = $torrentService->addTorrentPoster( + $file->getPathName(), + $torrent->getId(), + $user->getId(), + time(), + $user->isApproved() + ); + + // Add activity event + /* @TODO + $activityService->addEventTorrentPosterAdd( + $user->getId(), + $torrent->getId(), + time(), + $torrentPoster->getId() + ); + */ + + // Redirect to info page created + return $this->redirectToRoute( + 'torrent_info', + [ + '_locale' => $request->get('_locale'), + 'torrentId' => $torrent->getId() + ] + ); + } + } + + // Render form template + return $this->render( + 'default/torrent/edit/poster.html.twig', + [ + 'torrentId' => $torrent->getId(), + 'editions' => $editions, + 'form' => $form, + 'session' => + [ + 'moderator' => $user->isModerator(), + 'owner' => $torrentPosterCurrent['userId'] === $user->getId(), + ] + ] + ); + } + + #[Route( + '/{_locale}/torrent/{torrentId}/approve/poster/{torrentPosterId}', + name: 'torrent_poster_approve', + requirements: + [ + '_locale' => '%app.locales%', + 'torrentId' => '\d+', + 'torrentPosterId' => '\d+', + ], + methods: + [ + 'GET' + ] + )] + public function approvePoster( + Request $request, + TranslatorInterface $translator, + UserService $userService, + TorrentService $torrentService, + ActivityService $activityService + ): Response + { + // Init user + $user = $this->initUser( + $request, + $userService, + $activityService + ); + + // Init torrent + if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) + { + throw $this->createNotFoundException(); + } + + // Init torrent poster + if (!$torrentPoster = $torrentService->getTorrentPoster($request->get('torrentPosterId'))) + { + throw $this->createNotFoundException(); + } + + // Check permissions + if (!$user->isModerator()) + { + // @TODO + throw new \Exception( + $translator->trans('Access denied') + ); + } + + // Add activity event + if (!$torrentPoster->isApproved()) + { + /* @TODO + $activityService->addEventTorrentPosterApproveAdd( + $user->getId(), + $torrent->getId(), + time(), + $torrentPoster->getId() + ); + */ + } + + else + { + /* @TODO + $activityService->addEventTorrentPosterApproveDelete( + $user->getId(), + $torrent->getId(), + time(), + $torrentPoster->getId() + ); + */ + } + + // Update approved + $torrentService->toggleTorrentPosterApproved( + $torrentPoster->getId() + ); + + // Redirect + return $this->redirectToRoute( + 'torrent_poster_edit', + [ + '_locale' => $request->get('_locale'), + 'torrentId' => $torrent->getId(), + 'torrentPosterId' => $torrentPoster->getId(), + ] + ); + } + + #[Route( + '/{_locale}/torrent/{torrentId}/delete/poster/{torrentPosterId}', + name: 'torrent_poster_delete', + requirements: + [ + '_locale' => '%app.locales%', + 'torrentId' => '\d+', + 'torrentPosterId' => '\d+', + ], + methods: + [ + 'GET' + ] + )] + public function deletePoster( + Request $request, + TranslatorInterface $translator, + UserService $userService, + TorrentService $torrentService, + ActivityService $activityService + ): Response + { + // Init user + $user = $this->initUser( + $request, + $userService, + $activityService + ); + + // Init torrent + if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) + { + throw $this->createNotFoundException(); + } + + // Init torrent poster + if (!$torrentPoster = $torrentService->getTorrentPoster($request->get('torrentPosterId'))) + { + throw $this->createNotFoundException(); + } + + // Check permissions + if (!($user->isModerator() || $user->getId() === $torrentPoster->getUserId())) + { + // @TODO + throw new \Exception( + $translator->trans('Access denied') + ); + } + + // Add activity event + /* @TODO + $activityService->addEventTorrentPosterDelete( + $user->getId(), + $torrent->getId(), + time(), + $torrentPoster->getId() + ); + */ + + // Update approved + $torrentService->deleteTorrentPoster( + $torrentPoster->getId() + ); + + // Redirect + return $this->redirectToRoute( + 'torrent_poster_edit', + [ + '_locale' => $request->get('_locale'), + 'torrentId' => $torrent->getId(), + 'torrentPosterId' => $torrentPoster->getId(), + ] + ); + } + + + + + + + // Torrent star #[Route( '/{_locale}/torrent/{torrentId}/star/toggle', @@ -2519,6 +2934,7 @@ class TorrentController extends AbstractController $this->getParameter('app.theme'), $this->getParameter('app.sensitive'), $this->getParameter('app.yggdrasil'), + $this->getParameter('app.posters'), $this->getParameter('app.approved') ); diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index 4b75626..d6dea1f 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -117,6 +117,11 @@ class UserController extends AbstractController $request->get('yggdrasil') === 'true' ); + // Update posters + $user->setPosters( + $request->get('posters') === 'true' + ); + // Save changes to DB $userService->save($user); @@ -137,6 +142,7 @@ class UserController extends AbstractController 'id' => $user->getId(), 'sensitive' => $user->isSensitive(), 'yggdrasil' => $user->isYggdrasil(), + 'posters' => $user->isPosters(), 'locale' => $user->getLocale(), 'locales' => $user->getLocales(), 'events' => $user->getEvents(), @@ -543,6 +549,11 @@ class UserController extends AbstractController true ); + $torrentService->setTorrentPostersApprovedByUserId( + $userTarget->getId(), + true + ); + // @TODO make event for each item } @@ -613,6 +624,7 @@ class UserController extends AbstractController $this->getParameter('app.theme'), $this->getParameter('app.sensitive'), $this->getParameter('app.yggdrasil'), + $this->getParameter('app.posters'), $this->getParameter('app.approved') ); diff --git a/src/Entity/Torrent.php b/src/Entity/Torrent.php index ef34679..0252a8e 100644 --- a/src/Entity/Torrent.php +++ b/src/Entity/Torrent.php @@ -51,6 +51,9 @@ class Torrent #[ORM\Column(nullable: true)] private ?int $leechers = null; + #[ORM\Column(nullable: true)] + private ?int $torrentPosterId = null; + public function getId(): ?int { return $this->id; @@ -206,4 +209,16 @@ class Torrent return $this; } + + public function getTorrentPosterId(): ?int + { + return $this->torrentPosterId; + } + + public function setTorrentPosterId(int $torrentPosterId): static + { + $this->torrentPosterId = $torrentPosterId; + + return $this; + } } diff --git a/src/Entity/TorrentPoster.php b/src/Entity/TorrentPoster.php index c866dea..495fae3 100644 --- a/src/Entity/TorrentPoster.php +++ b/src/Entity/TorrentPoster.php @@ -25,9 +25,6 @@ class TorrentPoster #[ORM\Column] private ?bool $approved = null; - #[ORM\Column(length: 255)] - private ?string $color = null; - #[ORM\Column(length: 32)] private ?string $md5file = null; @@ -91,18 +88,6 @@ class TorrentPoster return $this; } - public function getColor(): ?string - { - return $this->color; - } - - public function setColor(string $color): static - { - $this->color = $color; - - return $this; - } - public function getMd5file(): ?string { return $this->md5file; diff --git a/src/Entity/User.php b/src/Entity/User.php index 7339f65..9f346a7 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -47,6 +47,9 @@ class User #[ORM\Column] private ?bool $yggdrasil = null; + #[ORM\Column] + private ?bool $posters = null; + public function getId(): ?int { return $this->id; @@ -190,4 +193,16 @@ class User return $this; } + + public function isPosters(): ?bool + { + return $this->posters; + } + + public function setPosters(bool $posters): static + { + $this->posters = $posters; + + return $this; + } } diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index 62cd0c5..90ea870 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -5,6 +5,7 @@ namespace App\Service; use App\Entity\Torrent; use App\Entity\TorrentLocales; use App\Entity\TorrentSensitive; +use App\Entity\TorrentPoster; use App\Entity\TorrentStar; use App\Entity\TorrentDownloadFile; use App\Entity\TorrentDownloadMagnet; @@ -12,6 +13,7 @@ use App\Entity\TorrentDownloadMagnet; use App\Repository\TorrentRepository; use App\Repository\TorrentLocalesRepository; use App\Repository\TorrentSensitiveRepository; +use App\Repository\TorrentPosterRepository; use App\Repository\TorrentStarRepository; use App\Repository\TorrentDownloadFileRepository; use App\Repository\TorrentDownloadMagnetRepository; @@ -214,10 +216,93 @@ class TorrentService ); } + public function getImageUriByTorrentPosterId( + int $torrentPosterId, + int $quality = 100, + int $width = 748, + int $height = 0, + float $opacity = 1, + bool $grayscale = false, + string $format = 'webp' + ): string + { + $uri = sprintf( + '/posters/%s.%s', + implode('/', str_split($torrentPosterId)), + $format + ); + + $filename = sprintf( + '%s/public/posters/%s.%s', + $this->kernelInterface->getProjectDir(), + implode('/', str_split($torrentPosterId)), + $format + ); + + if (file_exists($filename)) + { + return $uri; + } + + $path = explode('/', $filename); + + array_pop($path); + + @mkdir(implode('/', $path), 0755, true); + + $image = new \Imagick(); + + $image->readImage( + $this->getStorageFilepathByTorrentPosterId( + $torrentPosterId + ) + ); + + $image->setImageFormat($format); + $image->setImageCompressionQuality($quality); + + if ($width || $height) + { + $image->adaptiveResizeImage( + $width, + $height + ); + } + + if ($grayscale) + { + $image->setImageType( + \Imagick::IMGTYPE_GRAYSCALE + ); + } + + if ($opacity) + { + $image->setImageOpacity( + $opacity + ); + } + + $image->writeImage( + $filename + ); + + return $uri; + } + + public function getStorageFilepathByTorrentPosterId(int $torrentPosterId): string + { + return sprintf( + '%s/var/posters/%s', + $this->kernelInterface->getProjectDir(), + implode('/', str_split($torrentPosterId)) + ); + } + public function getStorageFilepathByTorrentId(int $torrentId): string { return sprintf( - '%s/var/torrents/%s.torrent', + '%s/var/torrents/%s.torrent', // @TODO remove extension as not required in background storage $this->kernelInterface->getProjectDir(), implode('/', str_split($torrentId)) ); @@ -932,6 +1017,209 @@ class TorrentService } } + // Torrent poster + public function getTorrentPoster( + int $torrentPosterId + ): ?TorrentPoster + { + return $this->entityManagerInterface + ->getRepository(TorrentPoster::class) + ->find( + $torrentPosterId + ); + } + + public function findTorrentPosterByMd5File( + string $md5file + ): ?Torrent + { + return $this->entityManagerInterface + ->getRepository(TorrentPoster::class) + ->findOneBy( + [ + 'md5file' => $md5file + ] + ); + } + + public function findLastTorrentPosterByTorrentId( + int $torrentId + ): ?TorrentPoster + { + return $this->entityManagerInterface + ->getRepository(TorrentPoster::class) + ->findOneBy( + [ + 'torrentId' => $torrentId + ], + [ + 'id' => 'DESC' + ] + ); + } + + public function findTorrentPosterByTorrentId( + int $torrentId + ): array + { + return $this->entityManagerInterface + ->getRepository(TorrentPoster::class) + ->findBy( + [ + 'torrentId' => $torrentId + ], + [ + 'id' => 'DESC' + ] + ); + } + + public function toggleTorrentPosterApproved( + int $torrentPosterId + ): ?TorrentPoster + { + $torrentPoster = $this->entityManagerInterface + ->getRepository(TorrentPoster::class) + ->find($torrentPosterId); + + $torrentPoster->setApproved( + !$torrentPoster->isApproved() // toggle current value + ); + + $this->entityManagerInterface->persist($torrentPoster); + $this->entityManagerInterface->flush(); + + $this->updateTorrentPoster( + $torrentPoster->getTorrentId() + ); + + return $torrentSensitive; + } + + public function deleteTorrentPoster( + int $torrentPosterId + ): ?TorrentPoster + { + // Remove torrent file from permanent storage + $filesystem = new Filesystem(); + $filesystem->remove( + $this->getStorageFilepathByTorrentPosterId( + $torrentPosterId + ) + ); + + // Remove from DB + $torrentPoster = $this->getTorrentPoster( + $torrentPosterId + ); + + $this->entityManagerInterface->remove($torrentPoster); + $this->entityManagerInterface->flush(); + + // Update torrent + $this->updateTorrentPoster( + $torrentPoster->getTorrentId() + ); + + return $torrentSensitive; + } + + public function addTorrentPoster( + string $filename, + int $torrentId, + int $userId, + int $added, + bool $approved + ): ?TorrentPoster + { + // Add new DB record + $torrentPoster = new TorrentPoster(); + + $torrentPoster->setTorrentId($torrentId); + $torrentPoster->setUserId($userId); + $torrentPoster->setAdded($added); + $torrentPoster->setApproved($approved); + $torrentPoster->setMd5file( + md5_file($filename) + ); + + $this->entityManagerInterface->persist($torrentPoster); + $this->entityManagerInterface->flush(); + + // Save file in permanent storage + $filesystem = new Filesystem(); + $filesystem->copy( + $filename, + $this->getStorageFilepathByTorrentPosterId( + $torrentPoster->getId() + ) + ); + + // Update torrent info + $this->updateTorrentPoster( + $torrentId + ); + + return $torrentPoster; + } + + public function setTorrentPostersApprovedByUserId( + int $userId, + bool $value + ): void + { + foreach ($this->entityManagerInterface + ->getRepository(TorrentPoster::class) + ->findBy( + [ + 'userId' => $userId + ]) as $torrentPoster) + { + $torrentPoster->setApproved( + $value + ); + + $this->entityManagerInterface->persist($torrentPoster); + $this->entityManagerInterface->flush(); + + $this->updateTorrentPoster( + $torrentPoster->getTorrentId(), + ); + } + } + + public function updateTorrentPoster( + int $torrentId, + ): void + { + if ($torrent = $this->getTorrent($torrentId)) + { + if ($torrentPoster = $this->entityManagerInterface + ->getRepository(TorrentPoster::class) + ->findOneBy( + [ + 'torrentId' => $torrentId, + 'approved' => true, + ], + [ + 'id' => 'DESC' + ] + )) + { + $torrent->setTorrentPosterId( + $torrentPoster->getId() + ); + + $this->entityManagerInterface->persist($torrent); + $this->entityManagerInterface->flush(); + } + } + } + + + + + // Torrent star public function findTorrentStar( int $torrentId, diff --git a/src/Service/UserService.php b/src/Service/UserService.php index 2459d5d..eeba420 100644 --- a/src/Service/UserService.php +++ b/src/Service/UserService.php @@ -32,6 +32,7 @@ class UserService string $theme, bool $sensitive = true, bool $yggdrasil = true, + bool $posters = true, bool $approved = false, bool $moderator = false, bool $status = true @@ -84,6 +85,10 @@ class UserService $yggdrasil ); + $user->setPosters( + $posters + ); + $this->entityManagerInterface->persist($user); $this->entityManagerInterface->flush(); diff --git a/templates/default/torrent/edit/poster.html.twig b/templates/default/torrent/edit/poster.html.twig new file mode 100644 index 0000000..a987a22 --- /dev/null +++ b/templates/default/torrent/edit/poster.html.twig @@ -0,0 +1,84 @@ +{% extends 'default/layout.html.twig' %} +{% block title %}{{ 'Edit torrent poster' | trans }} - {{ 'Torrent' | trans }} #{{ torrentId }} - {{ name }}{% endblock %} +{% block main_content %} +
+ +
+
+ {% for error in form.poster.error %} +
+ {{ error }} +
+ {% endfor %} + +
+
+ + +
+ {% for edition in editions %} +
+ {% if edition.active %} + {{ edition.added | format_ago }} + {% else %} + + {{ edition.added | format_ago }} + + {% endif %} + {{ 'by' | trans }} + + {{'identicon'|trans }} + +
+ {% if session.moderator or session.owner %} + + + + + + + {% endif %} + {% if edition.approved %} + {% if session.moderator %} + + + + + + {% else %} + + + + + + {% endif %} + {% else %} + {% if session.moderator %} + + + + + + {% else %} + + + + + + {% endif %} + {% endif %} +
+
+ {% endfor %} +{% endblock %} diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index 46e939f..1004759 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -29,7 +29,8 @@ {% endif %} {% endblock %} {% block main_content %} -
+

{{ file.name }} {#{{ 'Torrent' | trans }} #{{ torrent.id }}#} @@ -364,6 +365,22 @@ {% endif %}

+
+ + + + + + {{ 'Poster' | trans }} +
+
+ {% if torrent.poster %} + {{ 'Yes' | trans }} + {% else %} + {{ 'No' | trans }} + {% endif %} +
+
diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index c0824d8..404f3eb 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -24,7 +24,8 @@
{% if torrents %} {% for torrent in torrents %} -
+

@@ -86,15 +87,6 @@

{% endif %}
- {# - - {{ torrent.added | format_ago }} - {{ 'by' | trans }} - - {{ 'identicon' | trans }} - - - #} {{ torrent.file.size | format_bytes }} diff --git a/templates/default/user/settings.html.twig b/templates/default/user/settings.html.twig index 857c555..62fe207 100644 --- a/templates/default/user/settings.html.twig +++ b/templates/default/user/settings.html.twig @@ -58,6 +58,23 @@
+
+ + + + + + + {% endif %} @@ -246,7 +246,7 @@ {{ 'Comment' | trans }} {% endif %} From 261031dc50715daddf5ebc1a69667b4200633067 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 3 Nov 2023 15:36:24 +0200 Subject: [PATCH 138/185] unify syntax style --- src/Twig/AppExtension.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Twig/AppExtension.php b/src/Twig/AppExtension.php index 6d4e987..c0bbcf4 100644 --- a/src/Twig/AppExtension.php +++ b/src/Twig/AppExtension.php @@ -52,7 +52,7 @@ class AppExtension extends AbstractExtension public function formatBytes( int $bytes, int $precision = 2 - ) : string + ): string { $size = [ $this->translator->trans('B'), @@ -73,7 +73,7 @@ class AppExtension extends AbstractExtension public function formatAgo( int $time, - ) : string + ): string { $diff = time() - $time; @@ -144,7 +144,7 @@ class AppExtension extends AbstractExtension public function urlToMarkdown( string $text - ) : string + ): string { return preg_replace( '~(https?://(?:www\.)?[^\s]+)~i', From f8e0890966e7cff25e741bbc87091bf61eb7f9cf Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 3 Nov 2023 15:36:35 +0200 Subject: [PATCH 139/185] update composer --- composer.lock | 823 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 652 insertions(+), 171 deletions(-) diff --git a/composer.lock b/composer.lock index babbb48..605e0af 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4d930a43cf9a80e1622029c4a4048a6b", + "content-hash": "99ad25219a6bff24126d6f83ebd1756a", "packages": [ { "name": "ashtokalo/php-translit", @@ -49,6 +49,81 @@ }, "time": "2022-09-26T09:05:24+00:00" }, + { + "name": "dflydev/dot-access-data", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "f41715465d65213d644d3141a6a93081be5d3549" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/f41715465d65213d644d3141a6a93081be5d3549", + "reference": "f41715465d65213d644d3141a6a93081be5d3549", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.42", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.3", + "scrutinizer/ocular": "1.6.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Dflydev\\DotAccessData\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + }, + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "support": { + "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", + "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.2" + }, + "time": "2022-10-27T11:44:00+00:00" + }, { "name": "doctrine/annotations", "version": "2.0.1", @@ -397,16 +472,16 @@ }, { "name": "doctrine/dbal", - "version": "3.7.0", + "version": "3.7.1", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "00d03067f07482f025d41ab55e4ba0db5eca2cdf" + "reference": "5b7bd66c9ff58c04c5474ab85edce442f8081cb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/00d03067f07482f025d41ab55e4ba0db5eca2cdf", - "reference": "00d03067f07482f025d41ab55e4ba0db5eca2cdf", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/5b7bd66c9ff58c04c5474ab85edce442f8081cb2", + "reference": "5b7bd66c9ff58c04c5474ab85edce442f8081cb2", "shasum": "" }, "require": { @@ -490,7 +565,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.7.0" + "source": "https://github.com/doctrine/dbal/tree/3.7.1" }, "funding": [ { @@ -506,7 +581,7 @@ "type": "tidelift" } ], - "time": "2023-09-26T20:56:55+00:00" + "time": "2023-10-06T05:06:20+00:00" }, { "name": "doctrine/deprecations", @@ -1556,17 +1631,205 @@ "time": "2022-10-30T17:15:02+00:00" }, { - "name": "monolog/monolog", - "version": "3.4.0", + "name": "league/commonmark", + "version": "2.4.1", "source": { "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "e2392369686d420ca32df3803de28b5d6f76867d" + "url": "https://github.com/thephpleague/commonmark.git", + "reference": "3669d6d5f7a47a93c08ddff335e6d945481a1dd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/e2392369686d420ca32df3803de28b5d6f76867d", - "reference": "e2392369686d420ca32df3803de28b5d6f76867d", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/3669d6d5f7a47a93c08ddff335e6d945481a1dd5", + "reference": "3669d6d5f7a47a93c08ddff335e6d945481a1dd5", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "league/config": "^1.1.1", + "php": "^7.4 || ^8.0", + "psr/event-dispatcher": "^1.0", + "symfony/deprecation-contracts": "^2.1 || ^3.0", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "cebe/markdown": "^1.0", + "commonmark/cmark": "0.30.0", + "commonmark/commonmark.js": "0.30.0", + "composer/package-versions-deprecated": "^1.8", + "embed/embed": "^4.4", + "erusev/parsedown": "^1.0", + "ext-json": "*", + "github/gfm": "0.29.0", + "michelf/php-markdown": "^1.4 || ^2.0", + "nyholm/psr7": "^1.5", + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.21", + "scrutinizer/ocular": "^1.8.1", + "symfony/finder": "^5.3 | ^6.0", + "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0", + "unleashedtech/php-coding-standard": "^3.1.1", + "vimeo/psalm": "^4.24.0 || ^5.0.0" + }, + "suggest": { + "symfony/yaml": "v2.3+ required if using the Front Matter extension" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + } + }, + "autoload": { + "psr-4": { + "League\\CommonMark\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)", + "homepage": "https://commonmark.thephpleague.com", + "keywords": [ + "commonmark", + "flavored", + "gfm", + "github", + "github-flavored", + "markdown", + "md", + "parser" + ], + "support": { + "docs": "https://commonmark.thephpleague.com/", + "forum": "https://github.com/thephpleague/commonmark/discussions", + "issues": "https://github.com/thephpleague/commonmark/issues", + "rss": "https://github.com/thephpleague/commonmark/releases.atom", + "source": "https://github.com/thephpleague/commonmark" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/commonmark", + "type": "tidelift" + } + ], + "time": "2023-08-30T16:55:00+00:00" + }, + { + "name": "league/config", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/config.git", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/config/zipball/754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^3.0.1", + "nette/schema": "^1.2", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.5", + "scrutinizer/ocular": "^1.8.1", + "unleashedtech/php-coding-standard": "^3.1", + "vimeo/psalm": "^4.7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Define configuration arrays with strict schemas and access values with dot notation", + "homepage": "https://config.thephpleague.com", + "keywords": [ + "array", + "config", + "configuration", + "dot", + "dot-access", + "nested", + "schema" + ], + "support": { + "docs": "https://config.thephpleague.com/", + "issues": "https://github.com/thephpleague/config/issues", + "rss": "https://github.com/thephpleague/config/releases.atom", + "source": "https://github.com/thephpleague/config" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + } + ], + "time": "2022-12-11T20:36:23+00:00" + }, + { + "name": "monolog/monolog", + "version": "3.5.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c915e2634718dbc8a4a15c61b0e62e7a44e14448", + "reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448", "shasum": "" }, "require": { @@ -1642,7 +1905,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.4.0" + "source": "https://github.com/Seldaek/monolog/tree/3.5.0" }, "funding": [ { @@ -1654,7 +1917,155 @@ "type": "tidelift" } ], - "time": "2023-06-21T08:46:11+00:00" + "time": "2023-10-27T15:32:31+00:00" + }, + { + "name": "nette/schema", + "version": "v1.2.5", + "source": { + "type": "git", + "url": "https://github.com/nette/schema.git", + "reference": "0462f0166e823aad657c9224d0f849ecac1ba10a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/schema/zipball/0462f0166e823aad657c9224d0f849ecac1ba10a", + "reference": "0462f0166e823aad657c9224d0f849ecac1ba10a", + "shasum": "" + }, + "require": { + "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0", + "php": "7.1 - 8.3" + }, + "require-dev": { + "nette/tester": "^2.3 || ^2.4", + "phpstan/phpstan-nette": "^1.0", + "tracy/tracy": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "📐 Nette Schema: validating data structures against a given Schema.", + "homepage": "https://nette.org", + "keywords": [ + "config", + "nette" + ], + "support": { + "issues": "https://github.com/nette/schema/issues", + "source": "https://github.com/nette/schema/tree/v1.2.5" + }, + "time": "2023-10-05T20:37:59+00:00" + }, + { + "name": "nette/utils", + "version": "v4.0.3", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "a9d127dd6a203ce6d255b2e2db49759f7506e015" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/a9d127dd6a203ce6d255b2e2db49759f7506e015", + "reference": "a9d127dd6a203ce6d255b2e2db49759f7506e015", + "shasum": "" + }, + "require": { + "php": ">=8.0 <8.4" + }, + "conflict": { + "nette/finder": "<3", + "nette/schema": "<1.2.2" + }, + "require-dev": { + "jetbrains/phpstorm-attributes": "dev-master", + "nette/tester": "^2.5", + "phpstan/phpstan": "^1.0", + "tracy/tracy": "^2.9" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", + "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "support": { + "issues": "https://github.com/nette/utils/issues", + "source": "https://github.com/nette/utils/tree/v4.0.3" + }, + "time": "2023-10-29T21:02:13+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -2299,16 +2710,16 @@ }, { "name": "symfony/cache", - "version": "v6.3.5", + "version": "v6.3.6", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "6c1a3ea078c4d88ee892530945df63a87981b2da" + "reference": "84aff8d948d6292d2b5a01ac622760be44dddc72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/6c1a3ea078c4d88ee892530945df63a87981b2da", - "reference": "6c1a3ea078c4d88ee892530945df63a87981b2da", + "url": "https://api.github.com/repos/symfony/cache/zipball/84aff8d948d6292d2b5a01ac622760be44dddc72", + "reference": "84aff8d948d6292d2b5a01ac622760be44dddc72", "shasum": "" }, "require": { @@ -2317,7 +2728,7 @@ "psr/log": "^1.1|^2|^3", "symfony/cache-contracts": "^2.5|^3", "symfony/service-contracts": "^2.5|^3", - "symfony/var-exporter": "^6.2.10" + "symfony/var-exporter": "^6.3.6" }, "conflict": { "doctrine/dbal": "<2.13.1", @@ -2332,7 +2743,7 @@ }, "require-dev": { "cache/integration-tests": "dev-master", - "doctrine/dbal": "^2.13.1|^3.0", + "doctrine/dbal": "^2.13.1|^3|^4", "predis/predis": "^1.1|^2.0", "psr/simple-cache": "^1.0|^2.0|^3.0", "symfony/config": "^5.4|^6.0", @@ -2375,7 +2786,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v6.3.5" + "source": "https://github.com/symfony/cache/tree/v6.3.6" }, "funding": [ { @@ -2391,7 +2802,7 @@ "type": "tidelift" } ], - "time": "2023-09-26T15:48:55+00:00" + "time": "2023-10-17T14:44:58+00:00" }, { "name": "symfony/cache-contracts", @@ -2930,16 +3341,16 @@ }, { "name": "symfony/doctrine-bridge", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-bridge.git", - "reference": "9977eb1adf999ceded213e88c1ac6dff7a1a0306" + "reference": "c8af292f733cc28149485639177c5f2b67dff200" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/9977eb1adf999ceded213e88c1ac6dff7a1a0306", - "reference": "9977eb1adf999ceded213e88c1ac6dff7a1a0306", + "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/c8af292f733cc28149485639177c5f2b67dff200", + "reference": "c8af292f733cc28149485639177c5f2b67dff200", "shasum": "" }, "require": { @@ -2972,8 +3383,8 @@ "doctrine/annotations": "^1.13.1|^2", "doctrine/collections": "^1.0|^2.0", "doctrine/data-fixtures": "^1.1", - "doctrine/dbal": "^2.13.1|^3.0", - "doctrine/orm": "^2.12", + "doctrine/dbal": "^2.13.1|^3|^4", + "doctrine/orm": "^2.12|^3", "psr/log": "^1|^2|^3", "symfony/cache": "^5.4|^6.0", "symfony/config": "^5.4|^6.0", @@ -3020,7 +3431,7 @@ "description": "Provides integration for Doctrine with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/doctrine-bridge/tree/v6.3.5" + "source": "https://github.com/symfony/doctrine-bridge/tree/v6.3.7" }, "funding": [ { @@ -3036,24 +3447,24 @@ "type": "tidelift" } ], - "time": "2023-09-29T16:16:03+00:00" + "time": "2023-10-28T23:11:45+00:00" }, { "name": "symfony/doctrine-messenger", - "version": "v6.3.1", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-messenger.git", - "reference": "f1c253e24ae6d2bc4939b1439e074e6d2e73ecdb" + "reference": "b8dab85f66ffd5e4275eaf7558f9db8f4586dd41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-messenger/zipball/f1c253e24ae6d2bc4939b1439e074e6d2e73ecdb", - "reference": "f1c253e24ae6d2bc4939b1439e074e6d2e73ecdb", + "url": "https://api.github.com/repos/symfony/doctrine-messenger/zipball/b8dab85f66ffd5e4275eaf7558f9db8f4586dd41", + "reference": "b8dab85f66ffd5e4275eaf7558f9db8f4586dd41", "shasum": "" }, "require": { - "doctrine/dbal": "^2.13|^3.0", + "doctrine/dbal": "^2.13|^3|^4", "php": ">=8.1", "symfony/messenger": "^5.4|^6.0", "symfony/service-contracts": "^2.5|^3" @@ -3092,7 +3503,7 @@ "description": "Symfony Doctrine Messenger Bridge", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/doctrine-messenger/tree/v6.3.1" + "source": "https://github.com/symfony/doctrine-messenger/tree/v6.3.7" }, "funding": [ { @@ -3108,20 +3519,20 @@ "type": "tidelift" } ], - "time": "2023-06-24T11:51:27+00:00" + "time": "2023-10-26T18:15:14+00:00" }, { "name": "symfony/dotenv", - "version": "v6.3.0", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/dotenv.git", - "reference": "ceadb434fe2a6763a03d2d110441745834f3dd1e" + "reference": "7dfbe2976f3c1b7cfa8fac2212a050bfa9bd7d9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dotenv/zipball/ceadb434fe2a6763a03d2d110441745834f3dd1e", - "reference": "ceadb434fe2a6763a03d2d110441745834f3dd1e", + "url": "https://api.github.com/repos/symfony/dotenv/zipball/7dfbe2976f3c1b7cfa8fac2212a050bfa9bd7d9e", + "reference": "7dfbe2976f3c1b7cfa8fac2212a050bfa9bd7d9e", "shasum": "" }, "require": { @@ -3166,7 +3577,7 @@ "environment" ], "support": { - "source": "https://github.com/symfony/dotenv/tree/v6.3.0" + "source": "https://github.com/symfony/dotenv/tree/v6.3.7" }, "funding": [ { @@ -3182,7 +3593,7 @@ "type": "tidelift" } ], - "time": "2023-04-21T14:41:17+00:00" + "time": "2023-10-26T18:15:14+00:00" }, { "name": "symfony/error-handler", @@ -3607,16 +4018,16 @@ }, { "name": "symfony/flex", - "version": "v2.3.3", + "version": "v2.4.1", "source": { "type": "git", "url": "https://github.com/symfony/flex.git", - "reference": "9c402af768c6c9f8126a9ffa192ecf7c16581e35" + "reference": "ae6dea68771c5fca9d172e0c0910bdd06199f6f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/flex/zipball/9c402af768c6c9f8126a9ffa192ecf7c16581e35", - "reference": "9c402af768c6c9f8126a9ffa192ecf7c16581e35", + "url": "https://api.github.com/repos/symfony/flex/zipball/ae6dea68771c5fca9d172e0c0910bdd06199f6f4", + "reference": "ae6dea68771c5fca9d172e0c0910bdd06199f6f4", "shasum": "" }, "require": { @@ -3652,7 +4063,7 @@ "description": "Composer plugin for Symfony", "support": { "issues": "https://github.com/symfony/flex/issues", - "source": "https://github.com/symfony/flex/tree/v2.3.3" + "source": "https://github.com/symfony/flex/tree/v2.4.1" }, "funding": [ { @@ -3668,20 +4079,20 @@ "type": "tidelift" } ], - "time": "2023-08-04T09:02:35+00:00" + "time": "2023-10-30T18:35:17+00:00" }, { "name": "symfony/form", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/form.git", - "reference": "0f9ad8600c1021983d096512066ee54332aa3139" + "reference": "e6743d188f168643cb247f65cbad09ddb1dfcfe5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/form/zipball/0f9ad8600c1021983d096512066ee54332aa3139", - "reference": "0f9ad8600c1021983d096512066ee54332aa3139", + "url": "https://api.github.com/repos/symfony/form/zipball/e6743d188f168643cb247f65cbad09ddb1dfcfe5", + "reference": "e6743d188f168643cb247f65cbad09ddb1dfcfe5", "shasum": "" }, "require": { @@ -3749,7 +4160,7 @@ "description": "Allows to easily create, process and reuse HTML forms", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/form/tree/v6.3.5" + "source": "https://github.com/symfony/form/tree/v6.3.7" }, "funding": [ { @@ -3765,20 +4176,20 @@ "type": "tidelift" } ], - "time": "2023-09-10T17:47:23+00:00" + "time": "2023-10-28T23:11:45+00:00" }, { "name": "symfony/framework-bundle", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "567cafcfc08e3076b47290a7558b0ca17a98b0ce" + "reference": "dba20792c726c30d455626eddfb2db008f64085f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/567cafcfc08e3076b47290a7558b0ca17a98b0ce", - "reference": "567cafcfc08e3076b47290a7558b0ca17a98b0ce", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/dba20792c726c30d455626eddfb2db008f64085f", + "reference": "dba20792c726c30d455626eddfb2db008f64085f", "shasum": "" }, "require": { @@ -3893,7 +4304,7 @@ "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v6.3.5" + "source": "https://github.com/symfony/framework-bundle/tree/v6.3.7" }, "funding": [ { @@ -3909,20 +4320,20 @@ "type": "tidelift" } ], - "time": "2023-09-29T10:45:15+00:00" + "time": "2023-10-26T18:15:14+00:00" }, { "name": "symfony/http-client", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "213e564da4cbf61acc9728d97e666bcdb868c10d" + "reference": "cd67fcaf4524ec6ae5d9b2d9497682d7ad3ce57d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/213e564da4cbf61acc9728d97e666bcdb868c10d", - "reference": "213e564da4cbf61acc9728d97e666bcdb868c10d", + "url": "https://api.github.com/repos/symfony/http-client/zipball/cd67fcaf4524ec6ae5d9b2d9497682d7ad3ce57d", + "reference": "cd67fcaf4524ec6ae5d9b2d9497682d7ad3ce57d", "shasum": "" }, "require": { @@ -3985,7 +4396,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.3.5" + "source": "https://github.com/symfony/http-client/tree/v6.3.7" }, "funding": [ { @@ -4001,7 +4412,7 @@ "type": "tidelift" } ], - "time": "2023-09-29T15:57:12+00:00" + "time": "2023-10-29T12:41:36+00:00" }, { "name": "symfony/http-client-contracts", @@ -4083,16 +4494,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "b50f5e281d722cb0f4c296f908bacc3e2b721957" + "reference": "59d1837d5d992d16c2628cd0d6b76acf8d69b33e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b50f5e281d722cb0f4c296f908bacc3e2b721957", - "reference": "b50f5e281d722cb0f4c296f908bacc3e2b721957", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/59d1837d5d992d16c2628cd0d6b76acf8d69b33e", + "reference": "59d1837d5d992d16c2628cd0d6b76acf8d69b33e", "shasum": "" }, "require": { @@ -4102,12 +4513,12 @@ "symfony/polyfill-php83": "^1.27" }, "conflict": { - "symfony/cache": "<6.2" + "symfony/cache": "<6.3" }, "require-dev": { - "doctrine/dbal": "^2.13.1|^3.0", + "doctrine/dbal": "^2.13.1|^3|^4", "predis/predis": "^1.1|^2.0", - "symfony/cache": "^5.4|^6.0", + "symfony/cache": "^6.3", "symfony/dependency-injection": "^5.4|^6.0", "symfony/expression-language": "^5.4|^6.0", "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", @@ -4140,7 +4551,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.3.5" + "source": "https://github.com/symfony/http-foundation/tree/v6.3.7" }, "funding": [ { @@ -4156,20 +4567,20 @@ "type": "tidelift" } ], - "time": "2023-09-04T21:33:54+00:00" + "time": "2023-10-28T23:55:27+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "9f991a964368bee8d883e8d57ced4fe9fff04dfc" + "reference": "6d4098095f93279d9536a0e9124439560cc764d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/9f991a964368bee8d883e8d57ced4fe9fff04dfc", - "reference": "9f991a964368bee8d883e8d57ced4fe9fff04dfc", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/6d4098095f93279d9536a0e9124439560cc764d0", + "reference": "6d4098095f93279d9536a0e9124439560cc764d0", "shasum": "" }, "require": { @@ -4253,7 +4664,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.3.5" + "source": "https://github.com/symfony/http-kernel/tree/v6.3.7" }, "funding": [ { @@ -4269,20 +4680,20 @@ "type": "tidelift" } ], - "time": "2023-09-30T06:37:04+00:00" + "time": "2023-10-29T14:31:45+00:00" }, { "name": "symfony/intl", - "version": "v6.3.2", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/intl.git", - "reference": "1f8cb145c869ed089a8531c51a6a4b31ed0b3c69" + "reference": "4cc98c05f2c55150a6aa5b3e20667f7a6d06cca9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/intl/zipball/1f8cb145c869ed089a8531c51a6a4b31ed0b3c69", - "reference": "1f8cb145c869ed089a8531c51a6a4b31ed0b3c69", + "url": "https://api.github.com/repos/symfony/intl/zipball/4cc98c05f2c55150a6aa5b3e20667f7a6d06cca9", + "reference": "4cc98c05f2c55150a6aa5b3e20667f7a6d06cca9", "shasum": "" }, "require": { @@ -4335,7 +4746,7 @@ "localization" ], "support": { - "source": "https://github.com/symfony/intl/tree/v6.3.2" + "source": "https://github.com/symfony/intl/tree/v6.3.7" }, "funding": [ { @@ -4351,7 +4762,7 @@ "type": "tidelift" } ], - "time": "2023-07-20T07:43:09+00:00" + "time": "2023-10-28T23:11:45+00:00" }, { "name": "symfony/mailer", @@ -4435,22 +4846,23 @@ }, { "name": "symfony/messenger", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/messenger.git", - "reference": "fb29632c2abdc52f4f10f9402f8f93ebb8938234" + "reference": "a0a8860ca625116c474c9c1f5570bd7ec752c599" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/messenger/zipball/fb29632c2abdc52f4f10f9402f8f93ebb8938234", - "reference": "fb29632c2abdc52f4f10f9402f8f93ebb8938234", + "url": "https://api.github.com/repos/symfony/messenger/zipball/a0a8860ca625116c474c9c1f5570bd7ec752c599", + "reference": "a0a8860ca625116c474c9c1f5570bd7ec752c599", "shasum": "" }, "require": { "php": ">=8.1", "psr/log": "^1|^2|^3", - "symfony/clock": "^6.3" + "symfony/clock": "^6.3", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "symfony/console": "<6.3", @@ -4464,7 +4876,6 @@ "psr/cache": "^1.0|^2.0|^3.0", "symfony/console": "^6.3", "symfony/dependency-injection": "^5.4|^6.0", - "symfony/deprecation-contracts": "^2.5|^3", "symfony/event-dispatcher": "^5.4|^6.0", "symfony/http-kernel": "^5.4|^6.0", "symfony/process": "^5.4|^6.0", @@ -4502,7 +4913,7 @@ "description": "Helps applications send and receive messages to/from other applications or via message queues", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/messenger/tree/v6.3.5" + "source": "https://github.com/symfony/messenger/tree/v6.3.7" }, "funding": [ { @@ -4518,7 +4929,7 @@ "type": "tidelift" } ], - "time": "2023-09-29T16:11:24+00:00" + "time": "2023-10-26T18:15:14+00:00" }, { "name": "symfony/mime", @@ -4765,16 +5176,16 @@ }, { "name": "symfony/notifier", - "version": "v6.3.0", + "version": "v6.3.6", "source": { "type": "git", "url": "https://github.com/symfony/notifier.git", - "reference": "a30aee1bf767835d7948138c1629e310cee26a8b" + "reference": "2e39d4a9a96e25d127ffe30171127f6ef73934df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/notifier/zipball/a30aee1bf767835d7948138c1629e310cee26a8b", - "reference": "a30aee1bf767835d7948138c1629e310cee26a8b", + "url": "https://api.github.com/repos/symfony/notifier/zipball/2e39d4a9a96e25d127ffe30171127f6ef73934df", + "reference": "2e39d4a9a96e25d127ffe30171127f6ef73934df", "shasum": "" }, "require": { @@ -4823,7 +5234,7 @@ "notifier" ], "support": { - "source": "https://github.com/symfony/notifier/tree/v6.3.0" + "source": "https://github.com/symfony/notifier/tree/v6.3.6" }, "funding": [ { @@ -4839,7 +5250,7 @@ "type": "tidelift" } ], - "time": "2023-05-12T10:17:15+00:00" + "time": "2023-10-07T07:32:05+00:00" }, { "name": "symfony/options-resolver", @@ -5867,16 +6278,16 @@ }, { "name": "symfony/security-bundle", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/security-bundle.git", - "reference": "2df460eacceb11b9287cfafddda4d27023dd9001" + "reference": "8ece4fd6e242acbabad4461feae7c52fe1982c48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-bundle/zipball/2df460eacceb11b9287cfafddda4d27023dd9001", - "reference": "2df460eacceb11b9287cfafddda4d27023dd9001", + "url": "https://api.github.com/repos/symfony/security-bundle/zipball/8ece4fd6e242acbabad4461feae7c52fe1982c48", + "reference": "8ece4fd6e242acbabad4461feae7c52fe1982c48", "shasum": "" }, "require": { @@ -5893,7 +6304,8 @@ "symfony/password-hasher": "^5.4|^6.0", "symfony/security-core": "^6.2", "symfony/security-csrf": "^5.4|^6.0", - "symfony/security-http": "^6.3.4" + "symfony/security-http": "^6.3.6", + "symfony/service-contracts": "^2.5|^3" }, "conflict": { "symfony/browser-kit": "<5.4", @@ -5957,7 +6369,7 @@ "description": "Provides a tight integration of the Security component into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-bundle/tree/v6.3.5" + "source": "https://github.com/symfony/security-bundle/tree/v6.3.7" }, "funding": [ { @@ -5973,20 +6385,20 @@ "type": "tidelift" } ], - "time": "2023-09-25T17:05:55+00:00" + "time": "2023-10-26T18:15:14+00:00" }, { "name": "symfony/security-core", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/security-core.git", - "reference": "ec8f24dc1195f46483510892271d01a5202bba70" + "reference": "7ceb30fed93f5ea40ccde3173d1f7712527c0d62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-core/zipball/ec8f24dc1195f46483510892271d01a5202bba70", - "reference": "ec8f24dc1195f46483510892271d01a5202bba70", + "url": "https://api.github.com/repos/symfony/security-core/zipball/7ceb30fed93f5ea40ccde3173d1f7712527c0d62", + "reference": "7ceb30fed93f5ea40ccde3173d1f7712527c0d62", "shasum": "" }, "require": { @@ -6042,7 +6454,7 @@ "description": "Symfony Security Component - Core Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-core/tree/v6.3.5" + "source": "https://github.com/symfony/security-core/tree/v6.3.7" }, "funding": [ { @@ -6058,7 +6470,7 @@ "type": "tidelift" } ], - "time": "2023-09-10T17:47:23+00:00" + "time": "2023-10-28T23:11:45+00:00" }, { "name": "symfony/security-csrf", @@ -6130,16 +6542,16 @@ }, { "name": "symfony/security-http", - "version": "v6.3.5", + "version": "v6.3.6", "source": { "type": "git", "url": "https://github.com/symfony/security-http.git", - "reference": "47058ea557a4c64ba86e9249651222842bd52e2a" + "reference": "573ef96ab62d509ac953362fa61f9d1bd283f3a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-http/zipball/47058ea557a4c64ba86e9249651222842bd52e2a", - "reference": "47058ea557a4c64ba86e9249651222842bd52e2a", + "url": "https://api.github.com/repos/symfony/security-http/zipball/573ef96ab62d509ac953362fa61f9d1bd283f3a7", + "reference": "573ef96ab62d509ac953362fa61f9d1bd283f3a7", "shasum": "" }, "require": { @@ -6149,7 +6561,8 @@ "symfony/http-kernel": "^6.3", "symfony/polyfill-mbstring": "~1.0", "symfony/property-access": "^5.4|^6.0", - "symfony/security-core": "^6.3" + "symfony/security-core": "^6.3", + "symfony/service-contracts": "^2.5|^3" }, "conflict": { "symfony/clock": "<6.3", @@ -6197,7 +6610,7 @@ "description": "Symfony Security Component - HTTP Integration", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-http/tree/v6.3.5" + "source": "https://github.com/symfony/security-http/tree/v6.3.6" }, "funding": [ { @@ -6213,20 +6626,20 @@ "type": "tidelift" } ], - "time": "2023-08-30T06:30:46+00:00" + "time": "2023-10-13T10:26:24+00:00" }, { "name": "symfony/serializer", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "855fc058c8bdbb69f53834f2fdb3876c9bc0ab7c" + "reference": "641472dd3d6dc3c4d0fdd1496ebd1b55c72e43d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/855fc058c8bdbb69f53834f2fdb3876c9bc0ab7c", - "reference": "855fc058c8bdbb69f53834f2fdb3876c9bc0ab7c", + "url": "https://api.github.com/repos/symfony/serializer/zipball/641472dd3d6dc3c4d0fdd1496ebd1b55c72e43d9", + "reference": "641472dd3d6dc3c4d0fdd1496ebd1b55c72e43d9", "shasum": "" }, "require": { @@ -6291,7 +6704,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v6.3.5" + "source": "https://github.com/symfony/serializer/tree/v6.3.7" }, "funding": [ { @@ -6307,7 +6720,7 @@ "type": "tidelift" } ], - "time": "2023-09-29T16:18:53+00:00" + "time": "2023-10-26T18:15:14+00:00" }, { "name": "symfony/service-contracts", @@ -6541,16 +6954,16 @@ }, { "name": "symfony/translation", - "version": "v6.3.3", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd" + "reference": "30212e7c87dcb79c83f6362b00bde0e0b1213499" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd", - "reference": "3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd", + "url": "https://api.github.com/repos/symfony/translation/zipball/30212e7c87dcb79c83f6362b00bde0e0b1213499", + "reference": "30212e7c87dcb79c83f6362b00bde0e0b1213499", "shasum": "" }, "require": { @@ -6616,7 +7029,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.3.3" + "source": "https://github.com/symfony/translation/tree/v6.3.7" }, "funding": [ { @@ -6632,7 +7045,7 @@ "type": "tidelift" } ], - "time": "2023-07-31T07:08:24+00:00" + "time": "2023-10-28T23:11:45+00:00" }, { "name": "symfony/translation-contracts", @@ -6907,16 +7320,16 @@ }, { "name": "symfony/validator", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "48e815ba3b5eb72e632588dbf7ea2dc4e608ee47" + "reference": "9cc736663fa5839b9710ac2c303bb0b951014fc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/48e815ba3b5eb72e632588dbf7ea2dc4e608ee47", - "reference": "48e815ba3b5eb72e632588dbf7ea2dc4e608ee47", + "url": "https://api.github.com/repos/symfony/validator/zipball/9cc736663fa5839b9710ac2c303bb0b951014fc1", + "reference": "9cc736663fa5839b9710ac2c303bb0b951014fc1", "shasum": "" }, "require": { @@ -6983,7 +7396,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v6.3.5" + "source": "https://github.com/symfony/validator/tree/v6.3.7" }, "funding": [ { @@ -6999,20 +7412,20 @@ "type": "tidelift" } ], - "time": "2023-09-29T07:41:15+00:00" + "time": "2023-10-28T23:11:45+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.3.5", + "version": "v6.3.6", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "3d9999376be5fea8de47752837a3e1d1c5f69ef5" + "reference": "999ede244507c32b8e43aebaa10e9fce20de7c97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3d9999376be5fea8de47752837a3e1d1c5f69ef5", - "reference": "3d9999376be5fea8de47752837a3e1d1c5f69ef5", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/999ede244507c32b8e43aebaa10e9fce20de7c97", + "reference": "999ede244507c32b8e43aebaa10e9fce20de7c97", "shasum": "" }, "require": { @@ -7067,7 +7480,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.3.5" + "source": "https://github.com/symfony/var-dumper/tree/v6.3.6" }, "funding": [ { @@ -7083,20 +7496,20 @@ "type": "tidelift" } ], - "time": "2023-09-12T10:11:35+00:00" + "time": "2023-10-12T18:45:56+00:00" }, { "name": "symfony/var-exporter", - "version": "v6.3.4", + "version": "v6.3.6", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "df1f8aac5751871b83d30bf3e2c355770f8f0691" + "reference": "374d289c13cb989027274c86206ddc63b16a2441" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/df1f8aac5751871b83d30bf3e2c355770f8f0691", - "reference": "df1f8aac5751871b83d30bf3e2c355770f8f0691", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/374d289c13cb989027274c86206ddc63b16a2441", + "reference": "374d289c13cb989027274c86206ddc63b16a2441", "shasum": "" }, "require": { @@ -7141,7 +7554,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.3.4" + "source": "https://github.com/symfony/var-exporter/tree/v6.3.6" }, "funding": [ { @@ -7157,7 +7570,7 @@ "type": "tidelift" } ], - "time": "2023-08-16T18:14:47+00:00" + "time": "2023-10-13T09:16:49+00:00" }, { "name": "symfony/web-link", @@ -7244,16 +7657,16 @@ }, { "name": "symfony/yaml", - "version": "v6.3.3", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e23292e8c07c85b971b44c1c4b87af52133e2add" + "reference": "9758b6c69d179936435d0ffb577c3708d57e38a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e23292e8c07c85b971b44c1c4b87af52133e2add", - "reference": "e23292e8c07c85b971b44c1c4b87af52133e2add", + "url": "https://api.github.com/repos/symfony/yaml/zipball/9758b6c69d179936435d0ffb577c3708d57e38a8", + "reference": "9758b6c69d179936435d0ffb577c3708d57e38a8", "shasum": "" }, "require": { @@ -7296,7 +7709,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.3.3" + "source": "https://github.com/symfony/yaml/tree/v6.3.7" }, "funding": [ { @@ -7312,7 +7725,7 @@ "type": "tidelift" } ], - "time": "2023-07-31T07:08:24+00:00" + "time": "2023-10-28T23:31:00+00:00" }, { "name": "twig/extra-bundle", @@ -7452,6 +7865,74 @@ ], "time": "2023-07-29T15:34:56+00:00" }, + { + "name": "twig/markdown-extra", + "version": "v3.7.1", + "source": { + "type": "git", + "url": "https://github.com/twigphp/markdown-extra.git", + "reference": "83dfa86a0379f784ea30bdb9c15a356b8aabf780" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/83dfa86a0379f784ea30bdb9c15a356b8aabf780", + "reference": "83dfa86a0379f784ea30bdb9c15a356b8aabf780", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "twig/twig": "^2.7|^3.0" + }, + "require-dev": { + "erusev/parsedown": "^1.7", + "league/commonmark": "^1.0|^2.0", + "league/html-to-markdown": "^4.8|^5.0", + "michelf/php-markdown": "^1.8|^2.0", + "symfony/phpunit-bridge": "^5.4|^6.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Twig\\Extra\\Markdown\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + } + ], + "description": "A Twig extension for Markdown", + "homepage": "https://twig.symfony.com", + "keywords": [ + "html", + "markdown", + "twig" + ], + "support": { + "source": "https://github.com/twigphp/markdown-extra/tree/v3.7.1" + }, + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "time": "2023-07-29T15:34:56+00:00" + }, { "name": "twig/string-extra", "version": "v3.7.1", @@ -9738,16 +10219,16 @@ }, { "name": "symfony/phpunit-bridge", - "version": "v6.3.2", + "version": "v6.3.6", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "e020e1efbd1b42cb670fcd7d19a25abbddba035d" + "reference": "c6f1df6a76c2c12bd14a0a5bf7c556dd935efe1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/e020e1efbd1b42cb670fcd7d19a25abbddba035d", - "reference": "e020e1efbd1b42cb670fcd7d19a25abbddba035d", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/c6f1df6a76c2c12bd14a0a5bf7c556dd935efe1d", + "reference": "c6f1df6a76c2c12bd14a0a5bf7c556dd935efe1d", "shasum": "" }, "require": { @@ -9799,7 +10280,7 @@ "description": "Provides utilities for PHPUnit, especially user deprecation notices management", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/phpunit-bridge/tree/v6.3.2" + "source": "https://github.com/symfony/phpunit-bridge/tree/v6.3.6" }, "funding": [ { @@ -9815,20 +10296,20 @@ "type": "tidelift" } ], - "time": "2023-07-12T16:00:22+00:00" + "time": "2023-10-12T15:02:41+00:00" }, { "name": "symfony/web-profiler-bundle", - "version": "v6.3.2", + "version": "v6.3.6", "source": { "type": "git", "url": "https://github.com/symfony/web-profiler-bundle.git", - "reference": "6101b5ab7857c373d237e121f9060c68b32e1373" + "reference": "249cb2486597d3ab810d8bcc8e4db5ad0fc3e3bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/6101b5ab7857c373d237e121f9060c68b32e1373", - "reference": "6101b5ab7857c373d237e121f9060c68b32e1373", + "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/249cb2486597d3ab810d8bcc8e4db5ad0fc3e3bd", + "reference": "249cb2486597d3ab810d8bcc8e4db5ad0fc3e3bd", "shasum": "" }, "require": { @@ -9880,7 +10361,7 @@ "dev" ], "support": { - "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.3.2" + "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.3.6" }, "funding": [ { @@ -9896,7 +10377,7 @@ "type": "tidelift" } ], - "time": "2023-07-19T20:17:28+00:00" + "time": "2023-10-11T18:18:20+00:00" }, { "name": "theseer/tokenizer", From 35babed517bde61c09a24b48b6508744fe50e3f5 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 4 Nov 2023 03:30:32 +0200 Subject: [PATCH 140/185] add missed locale --- config/packages/translation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/packages/translation.yaml b/config/packages/translation.yaml index 525e63b..210ba05 100644 --- a/config/packages/translation.yaml +++ b/config/packages/translation.yaml @@ -8,7 +8,7 @@ framework: crowdin: dsn: '%env(CROWDIN_DSN)%' domains: ['messages'] - locales: ['en','cs','nl','eo','fr','ka','de','he','it','lv','pl','pt','ru','es','uk'] + locales: ['en','cs','nl','eo','fr', 'ja', 'ka','de','he','it','lv','pl','pt','ru','es','uk'] # loco: # dsn: '%env(LOCO_DSN)%' # lokalise: From 701b448cd6757c5d470ec6a99e4355ea591afe32 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 4 Nov 2023 06:26:01 +0200 Subject: [PATCH 141/185] init torrent categories feature #26 --- .env | 3 + config/services.yaml | 1 + migrations/Version20231103235504.php | 37 ++ src/Controller/TorrentController.php | 463 ++++++++++++++++-- src/Controller/UserController.php | 77 ++- src/Entity/Torrent.php | 15 + src/Entity/TorrentCategories.php | 103 ++++ src/Entity/User.php | 15 + .../TorrentCategoriesRepository.php | 23 + src/Repository/TorrentRepository.php | 41 +- src/Service/TorrentService.php | 175 ++++++- .../default/torrent/edit/categories.html.twig | 109 +++++ .../default/torrent/edit/locales.html.twig | 2 +- templates/default/torrent/info.html.twig | 20 +- templates/default/torrent/submit.html.twig | 37 +- templates/default/user/info.html.twig | 10 +- templates/default/user/settings.html.twig | 27 +- translations/messages+intl-icu.en.xlf | 32 ++ 18 files changed, 1113 insertions(+), 77 deletions(-) create mode 100644 migrations/Version20231103235504.php create mode 100644 src/Entity/TorrentCategories.php create mode 100644 src/Repository/TorrentCategoriesRepository.php create mode 100644 templates/default/torrent/edit/categories.html.twig diff --git a/.env b/.env index b7750ba..52307ec 100644 --- a/.env +++ b/.env @@ -59,6 +59,9 @@ APP_LOCALE=en # Supported locales for interface and content filters APP_LOCALES=en|cs|nl|eo|fr|ja|ka|de|he|it|lv|pl|pt|ru|es|uk +# Content categories, lowercase, enabled by default for new users +APP_CATEGORIES=movie|series|tv|animation|music|game|audiobook|podcast|book|archive|picture|software|other + # Items per page on pagination APP_PAGINATION=10 diff --git a/config/services.yaml b/config/services.yaml index 110b2a6..b515a42 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -11,6 +11,7 @@ parameters: app.trackers: '%env(APP_TRACKERS)%' app.crawlers: '%env(APP_CRAWLERS)%' app.locales: '%env(APP_LOCALES)%' + app.categories: '%env(APP_CATEGORIES)%' app.themes: '%env(APP_THEMES)%' app.locale: '%env(APP_LOCALE)%' app.theme: '%env(APP_THEME)%' diff --git a/migrations/Version20231103235504.php b/migrations/Version20231103235504.php new file mode 100644 index 0000000..1ec3213 --- /dev/null +++ b/migrations/Version20231103235504.php @@ -0,0 +1,37 @@ +addSql('CREATE TABLE torrent_categories (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, torrent_id INTEGER NOT NULL, user_id INTEGER NOT NULL, added INTEGER NOT NULL, value CLOB NOT NULL --(DC2Type:simple_array) + , approved BOOLEAN NOT NULL)'); + $this->addSql('ALTER TABLE user ADD COLUMN categories CLOB DEFAULT "other"'); + $this->addSql('ALTER TABLE torrent ADD COLUMN categories CLOB DEFAULT "other"'); + $this->addSql('UPDATE user SET categories = "movie,series,tv,animation,music,game,audiobook,podcast,book,archive,picture,software,other"'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('DROP TABLE torrent_categories'); + $this->addSql('ALTER TABLE user DROP COLUMN categories'); + $this->addSql('ALTER TABLE torrent DROP COLUMN categories'); + } +} diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 9b22608..0179ebd 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -150,12 +150,13 @@ class TorrentController extends AbstractController 'peers' => (int) $torrent->getPeers(), 'leechers' => (int) $torrent->getLeechers(), ], - 'keywords' => $torrent->getKeywords(), - 'locales' => $torrent->getLocales(), - 'sensitive' => $torrent->isSensitive(), - 'approved' => $torrent->isApproved(), - 'status' => $torrent->isStatus(), - 'download' => + 'keywords' => $torrent->getKeywords(), + 'locales' => $torrent->getLocales(), + 'categories' => $torrent->getCategories(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), + 'download' => [ 'file' => [ @@ -262,7 +263,8 @@ class TorrentController extends AbstractController $user->getId(), $query, $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, + $user->getCategories(), + $user->isSensitive() ? false : null, !$user->isModerator() ? true : null, !$user->isModerator() ? true : null, ); @@ -272,7 +274,8 @@ class TorrentController extends AbstractController $user->getId(), $query, $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, + $user->getCategories(), + $user->isSensitive() ? false : null, !$user->isModerator() ? true : null, !$user->isModerator() ? true : null, $this->getParameter('app.pagination'), @@ -448,7 +451,8 @@ class TorrentController extends AbstractController $user->getId(), [], $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, + $user->getCategories(), + $user->isSensitive() ? false : null, !$user->isModerator() ? true : null, !$user->isModerator() ? true : null, ); @@ -459,7 +463,8 @@ class TorrentController extends AbstractController $user->getId(), [], $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, + $user->getCategories(), + $user->isSensitive() ? false : null, !$user->isModerator() ? true : null, !$user->isModerator() ? true : null, $this->getParameter('app.pagination'), @@ -625,7 +630,8 @@ class TorrentController extends AbstractController $user->getId(), $query, $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, + $user->getCategories(), + $user->isSensitive() ? false : null, !$user->isModerator() ? true : null, !$user->isModerator() ? true : null, ); @@ -636,7 +642,8 @@ class TorrentController extends AbstractController $user->getId(), $query, $user->getLocales(), - !$user->isModerator() && $user->isSensitive() ? false : null, + $user->getCategories(), + $user->isSensitive() ? false : null, !$user->isModerator() ? true : null, !$user->isModerator() ? true : null, $this->getParameter('app.pagination'), @@ -700,13 +707,14 @@ class TorrentController extends AbstractController ); // Init request - $query = $request->get('query') ? explode(' ', urldecode($request->get('query'))) : []; - $page = $request->get('page') ? (int) $request->get('page') : 1; + $query = $request->get('query') ? explode(' ', urldecode($request->get('query'))) : []; + $page = $request->get('page') ? (int) $request->get('page') : 1; - $locales = $request->get('locales') ? explode('|', $request->get('locales')) : explode('|', $this->getParameter('app.locales')); - $sensitive = $request->get('sensitive') ? (bool) $request->get('sensitive') : null; + $locales = $request->get('locales') ? explode('|', $request->get('locales')) : explode('|', $this->getParameter('app.locales')); + $categories = $request->get('categories') ? explode('|', $request->get('categories')) : explode('|', $this->getParameter('app.categories')); + $sensitive = $request->get('sensitive') ? (bool) $request->get('sensitive') : null; - $yggdrasil = $request->get('yggdrasil') ? (bool) $request->get('yggdrasil') : false; + $yggdrasil = $request->get('yggdrasil') ? (bool) $request->get('yggdrasil') : false; // Init trackers $trackers = explode('|', $this->getParameter('app.trackers')); @@ -716,7 +724,8 @@ class TorrentController extends AbstractController $user->getId(), $query, $locales, - !$user->isModerator() ? $sensitive : null, + $categories, + $sensitive, !$user->isModerator() ? true : null, !$user->isModerator() ? true : null, ); @@ -727,7 +736,8 @@ class TorrentController extends AbstractController $user->getId(), $query, $locales, - !$user->isModerator() ? $sensitive : null, + $categories, + $sensitive, !$user->isModerator() ? true : null, !$user->isModerator() ? true : null, $this->getParameter('app.pagination'), @@ -873,6 +883,14 @@ class TorrentController extends AbstractController 'value' => $request->get('locales') ? $request->get('locales') : [$request->get('_locale')], ] ], + 'categories' => + [ + 'error' => [], + 'attribute' => + [ + 'value' => $request->get('categories') ? $request->get('categories') : [], + ] + ], 'torrent' => [ 'error' => [], @@ -909,6 +927,25 @@ class TorrentController extends AbstractController $form['locales']['error'][] = $translator->trans('At least one locale required'); } + /// Categories + $categories = []; + if ($request->get('categories')) + { + foreach ((array) $request->get('categories') as $locale) + { + if (in_array($locale, explode('|', $this->getParameter('app.categories')))) + { + $categories[] = $locale; + } + } + } + + //// At least one valid locale required + if (!$categories) + { + $form['categories']['error'][] = $translator->trans('At least one category required'); + } + /// Torrent if ($file = $request->files->get('torrent')) { @@ -937,7 +974,7 @@ class TorrentController extends AbstractController } // Request is valid - if (empty($form['torrent']['error']) && empty($form['locales']['error'])) + if (empty($form['torrent']['error']) && empty($form['locales']['error']) && empty($form['categories']['error'])) { // Save data $torrent = $torrentService->add( @@ -956,6 +993,7 @@ class TorrentController extends AbstractController $user->getId(), time(), (array) $locales, + (array) $categories, (bool) $request->get('sensitive'), $user->isApproved(), $user->isStatus() @@ -983,8 +1021,9 @@ class TorrentController extends AbstractController return $this->render( 'default/torrent/submit.html.twig', [ - 'locales' => explode('|', $this->getParameter('app.locales')), - 'form' => $form, + 'locales' => explode('|', $this->getParameter('app.locales')), + 'categories' => explode('|', $this->getParameter('app.categories')), + 'form' => $form, ] ); } @@ -1504,6 +1543,369 @@ class TorrentController extends AbstractController ); } + // Torrent categories + #[Route( + '/{_locale}/torrent/{torrentId}/edit/categories/{torrentCategoriesId}', + name: 'torrent_categories_edit', + requirements: + [ + '_locale' => '%app.locales%', + 'torrentId' => '\d+', + 'torrentCategoriesId' => '\d+', + ], + defaults: + [ + 'torrentCategoriesId' => null, + ], + methods: + [ + 'GET', + 'POST' + ] + )] + public function editCategories( + Request $request, + TranslatorInterface $translator, + UserService $userService, + TorrentService $torrentService, + ActivityService $activityService + ): Response + { + // Init user + $user = $this->initUser( + $request, + $userService, + $activityService + ); + + if (!$user->isStatus()) + { + // @TODO + throw new \Exception( + $translator->trans('Access denied') + ); + } + + // Init torrent + if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) + { + throw $this->createNotFoundException(); + } + + // Init torrent categories + $torrentCategoriesCurrent = [ + 'userId' => null, + 'value' => [] + ]; + + // Get from edition version requested + if ($request->get('torrentCategoriesId')) + { + if ($torrentCategories = $torrentService->getTorrentCategories($request->get('torrentCategoriesId'))) + { + $torrentCategoriesCurrent['userId'] = $torrentCategories->getUserId(); + + foreach ($torrentCategories->getValue() as $value) + { + $torrentCategoriesCurrent['value'][] = $value; + } + } + + else + { + throw $this->createNotFoundException(); + } + } + + // Otherwise, get latest available + else + { + if ($torrentCategories = $torrentService->findLastTorrentCategoriesByTorrentId($torrent->getId())) + { + $torrentCategoriesCurrent['userId'] = $torrentCategories->getUserId(); + + foreach ($torrentCategories->getValue() as $value) + { + $torrentCategoriesCurrent['value'][] = $value; + } + + // Update active categories + $request->attributes->set('torrentCategoriesId', $torrentCategories->getId()); + } + } + + // Init edition history + $editions = []; + foreach ($torrentService->findTorrentCategoriesByTorrentId($torrent->getId()) as $torrentCategoriesEdition) + { + $editions[] = + [ + 'id' => $torrentCategoriesEdition->getId(), + 'added' => $torrentCategoriesEdition->getAdded(), + 'approved' => $torrentCategoriesEdition->isApproved(), + 'active' => $torrentCategoriesEdition->getId() == $request->get('torrentCategoriesId'), + 'user' => + [ + 'id' => $torrentCategoriesEdition->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $torrentCategoriesEdition->getUserId() + )->getAddress() + ), + ] + ]; + } + + // Init form + $form = + [ + 'categories' => + [ + 'error' => [], + 'attribute' => + [ + 'value' => $request->get('categories') ? $request->get('categories') : $torrentCategoriesCurrent['value'], + ] + ] + ]; + + // Process request + if ($request->isMethod('post')) + { + /// Categories + $categories = []; + if ($request->get('categories')) + { + foreach ((array) $request->get('categories') as $category) + { + if (in_array($category, explode('|', $this->getParameter('app.categories')))) + { + $categories[] = $category; + } + } + } + + //// At least one valid category required + if (!$categories) + { + $form['categories']['error'][] = $translator->trans('At least one category required'); + } + + // Request is valid + if (empty($form['categories']['error'])) + { + // Save data + $torrentCategories = $torrentService->addTorrentCategories( + $torrent->getId(), + $user->getId(), + time(), + $categories, + $user->isApproved() + ); + + // Register activity event + /* @TODO + $activityService->addEventTorrentCategoriesAdd( + $user->getId(), + $torrent->getId(), + time(), + $torrentCategories->getId() + ); + */ + + // Redirect to info page + return $this->redirectToRoute( + 'torrent_info', + [ + '_locale' => $request->get('_locale'), + 'torrentId' => $torrent->getId() + ] + ); + } + } + + // Render form template + return $this->render( + 'default/torrent/edit/categories.html.twig', + [ + 'torrentId' => $torrent->getId(), + 'categories' => explode('|', $this->getParameter('app.categories')), + 'editions' => $editions, + 'form' => $form, + 'session' => + [ + 'moderator' => $user->isModerator(), + 'owner' => $torrentCategoriesCurrent['userId'] === $user->getId(), + ] + ] + ); + } + + #[Route( + '/{_locale}/torrent/{torrentId}/approve/categories/{torrentCategoriesId}', + name: 'torrent_categories_approve', + requirements: + [ + '_locale' => '%app.locales%', + 'torrentId' => '\d+', + 'torrentCategoriesId' => '\d+', + ], + methods: + [ + 'GET' + ] + )] + public function approveCategories( + Request $request, + TranslatorInterface $translator, + UserService $userService, + TorrentService $torrentService, + ActivityService $activityService + ): Response + { + // Init user + $user = $this->initUser( + $request, + $userService, + $activityService + ); + + // Init torrent + if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) + { + throw $this->createNotFoundException(); + } + + // Init torrent categories + if (!$torrentCategories = $torrentService->getTorrentCategories($request->get('torrentCategoriesId'))) + { + throw $this->createNotFoundException(); + } + + // Check permissions + if (!$user->isModerator()) + { + // @TODO + throw new \Exception( + $translator->trans('Access denied') + ); + } + + // Register activity event + /* @TODO + if (!$torrentCategories->isApproved()) + { + $activityService->addEventTorrentCategoriesApproveAdd( + $user->getId(), + $torrent->getId(), + time(), + $torrentCategories->getId() + ); + } + + else + { + $activityService->addEventTorrentCategoriesApproveDelete( + $user->getId(), + $torrent->getId(), + time(), + $torrentCategories->getId() + ); + } + */ + + // Update approved + $torrentService->toggleTorrentCategoriesApproved( + $torrentCategories->getId() + ); + + // Redirect back to form + return $this->redirectToRoute( + 'torrent_categories_edit', + [ + '_locale' => $request->get('_locale'), + 'torrentId' => $torrent->getId(), + 'torrentCategoriesId' => $torrentCategories->getId(), + ] + ); + } + + #[Route( + '/{_locale}/torrent/{torrentId}/delete/categories/{torrentCategoriesId}', + name: 'torrent_categories_delete', + requirements: + [ + '_locale' => '%app.locales%', + 'torrentId' => '\d+', + 'torrentCategoriesId' => '\d+', + ], + methods: + [ + 'GET' + ] + )] + public function deleteCategories( + Request $request, + TranslatorInterface $translator, + UserService $userService, + TorrentService $torrentService, + ActivityService $activityService + ): Response + { + // Init user + $user = $this->initUser( + $request, + $userService, + $activityService + ); + + // Init torrent + if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) + { + throw $this->createNotFoundException(); + } + + // Init torrent categories + if (!$torrentCategories = $torrentService->getTorrentCategories($request->get('torrentCategoriesId'))) + { + throw $this->createNotFoundException(); + } + + // Check permissions + if (!($user->isModerator() || $user->getId() === $torrentCategories->getUserId())) + { + // @TODO + throw new \Exception( + $translator->trans('Access denied') + ); + } + + // Add activity event + /* @TODO + $activityService->addEventTorrentCategoriesDelete( + $user->getId(), + $torrent->getId(), + time(), + $torrentCategories->getId() + ); + */ + + // Update approved + $torrentService->deleteTorrentCategories( + $torrentCategories->getId() + ); + + // Redirect back to form + return $this->redirectToRoute( + 'torrent_categories_edit', + [ + '_locale' => $request->get('_locale'), + 'torrentId' => $torrent->getId(), + 'torrentCategoriesId' => $torrentCategories->getId(), + ] + ); + } + // Torrent sensitive #[Route( '/{_locale}/torrent/{torrentId}/edit/sensitive/{torrentSensitiveId}', @@ -2926,14 +3328,15 @@ class TorrentController extends AbstractController 'locale' => $locale, 'locales' => $locales, 'torrents' => $torrentService->findTorrents( - 0, // no user session init, pass 0 - [], // without keywords filter - $locales, // all system locales - null, // all sensitive levels - true, // approved only - true, // enabled only - 1000, // @TODO limit - 0 // offset + 0, // no user session init, pass 0 + [], // without keywords filter + $locales, // all system locales + $categories, // all system locales + null, // all sensitive levels + true, // approved only + true, // enabled only + 1000, // @TODO limit + 0 // offset ) ], $response diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index a408a11..ae31028 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -85,6 +85,23 @@ class UserController extends AbstractController ); } + // Update categories + if ($request->get('categories')) + { + $categories = []; + foreach ((array) $request->get('categories') as $category) + { + if (in_array($category, explode('|', $this->getParameter('app.categories')))) + { + $categories[] = $category; + } + } + + $user->setCategories( + $categories + ); + } + // Update theme if (in_array($request->get('theme'), explode('|', $this->getParameter('app.themes')))) { @@ -139,19 +156,21 @@ class UserController extends AbstractController 'default/user/settings.html.twig', [ 'user' => [ - 'id' => $user->getId(), - 'sensitive' => $user->isSensitive(), - 'yggdrasil' => $user->isYggdrasil(), - 'posters' => $user->isPosters(), - 'locale' => $user->getLocale(), - 'locales' => $user->getLocales(), - 'events' => $user->getEvents(), - 'theme' => $user->getTheme(), - 'added' => $user->getAdded() + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'yggdrasil' => $user->isYggdrasil(), + 'posters' => $user->isPosters(), + 'locale' => $user->getLocale(), + 'locales' => $user->getLocales(), + 'categories' => $user->getCategories(), + 'events' => $user->getEvents(), + 'theme' => $user->getTheme(), + 'added' => $user->getAdded() ], - 'locales' => explode('|', $this->getParameter('app.locales')), - 'themes' => explode('|', $this->getParameter('app.themes')), - 'events' => $activityService->getEventsTree() + 'locales' => explode('|', $this->getParameter('app.locales')), + 'categories' => explode('|', $this->getParameter('app.categories')), + 'themes' => explode('|', $this->getParameter('app.themes')), + 'events' => $activityService->getEventsTree() ] ); } @@ -217,20 +236,21 @@ class UserController extends AbstractController 'moderator' => $user->isModerator() ], 'user' => [ - 'id' => $userTarget->getId(), - 'address' => $userTarget->getAddress(), - 'moderator' => $userTarget->isModerator(), - 'approved' => $userTarget->isApproved(), - 'status' => $userTarget->isStatus(), - 'posters' => $userTarget->isPosters(), - 'sensitive' => $userTarget->isSensitive(), - 'yggdrasil' => $userTarget->isYggdrasil(), - 'locale' => $userTarget->getLocale(), - 'locales' => $userTarget->getLocales(), - 'events' => $userTarget->getEvents(), - 'theme' => $userTarget->getTheme(), - 'added' => $userTarget->getAdded(), - 'identicon' => $userService->identicon( + 'id' => $userTarget->getId(), + 'address' => $userTarget->getAddress(), + 'moderator' => $userTarget->isModerator(), + 'approved' => $userTarget->isApproved(), + 'status' => $userTarget->isStatus(), + 'posters' => $userTarget->isPosters(), + 'sensitive' => $userTarget->isSensitive(), + 'yggdrasil' => $userTarget->isYggdrasil(), + 'locale' => $userTarget->getLocale(), + 'locales' => $userTarget->getLocales(), + 'categories' => $user->getCategories(), + 'events' => $userTarget->getEvents(), + 'theme' => $userTarget->getTheme(), + 'added' => $userTarget->getAdded(), + 'identicon' => $userService->identicon( $userTarget->getAddress(), 48 ), @@ -545,6 +565,11 @@ class UserController extends AbstractController true ); + $torrentService->setTorrentCategoriesApprovedByUserId( + $userTarget->getId(), + true + ); + $torrentService->setTorrentSensitivesApprovedByUserId( $userTarget->getId(), true diff --git a/src/Entity/Torrent.php b/src/Entity/Torrent.php index e29c448..515a62e 100644 --- a/src/Entity/Torrent.php +++ b/src/Entity/Torrent.php @@ -54,6 +54,9 @@ class Torrent #[ORM\Column(nullable: true)] private ?int $torrentPosterId = null; + #[ORM\Column(type: Types::SIMPLE_ARRAY)] + private ?array $categories = null; + public function getId(): ?int { return $this->id; @@ -221,4 +224,16 @@ class Torrent return $this; } + + public function getCategories(): ?array + { + return $this->categories; + } + + public function setCategories(?array $categories): static + { + $this->categories = $categories; + + return $this; + } } diff --git a/src/Entity/TorrentCategories.php b/src/Entity/TorrentCategories.php new file mode 100644 index 0000000..9d73809 --- /dev/null +++ b/src/Entity/TorrentCategories.php @@ -0,0 +1,103 @@ +id; + } + + public function setId(string $id): static + { + $this->id = $id; + + return $this; + } + + public function getTorrentId(): ?int + { + return $this->torrentId; + } + + public function setTorrentId(int $torrentId): static + { + $this->torrentId = $torrentId; + + return $this; + } + + public function getUserId(): ?int + { + return $this->userId; + } + + public function setUserId(int $userId): static + { + $this->userId = $userId; + + return $this; + } + + public function getAdded(): ?int + { + return $this->added; + } + + public function setAdded(int $added): static + { + $this->added = $added; + + return $this; + } + + public function getValue(): array + { + return $this->value; + } + + public function setValue(array $value): static + { + $this->value = $value; + + return $this; + } + + public function isApproved(): ?bool + { + return $this->approved; + } + + public function setApproved(bool $approved): static + { + $this->approved = $approved; + + return $this; + } +} diff --git a/src/Entity/User.php b/src/Entity/User.php index 9f346a7..330a97a 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -50,6 +50,9 @@ class User #[ORM\Column] private ?bool $posters = null; + #[ORM\Column(type: Types::SIMPLE_ARRAY)] + private ?array $categories = null; + public function getId(): ?int { return $this->id; @@ -205,4 +208,16 @@ class User return $this; } + + public function getCategories(): ?array + { + return $this->categories; + } + + public function setCategories(?array $categories): static + { + $this->categories = $categories; + + return $this; + } } diff --git a/src/Repository/TorrentCategoriesRepository.php b/src/Repository/TorrentCategoriesRepository.php new file mode 100644 index 0000000..030f69c --- /dev/null +++ b/src/Repository/TorrentCategoriesRepository.php @@ -0,0 +1,23 @@ + + * + * @method TorrentCategories|null find($id, $lockMode = null, $lockVersion = null) + * @method TorrentCategories|null findOneBy(array $criteria, array $orderBy = null) + * @method TorrentCategories[] findAll() + * @method TorrentCategories[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class TorrentCategoriesRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, TorrentCategories::class); + } +} diff --git a/src/Repository/TorrentRepository.php b/src/Repository/TorrentRepository.php index 1ccd425..536a72f 100644 --- a/src/Repository/TorrentRepository.php +++ b/src/Repository/TorrentRepository.php @@ -24,7 +24,8 @@ class TorrentRepository extends ServiceEntityRepository public function findTorrentsTotal( int $userId, array $keywords, - array $locales, + ?array $locales, + ?array $categories, ?bool $sensitive = null, ?bool $approved = null, ?bool $status = null, @@ -36,6 +37,7 @@ class TorrentRepository extends ServiceEntityRepository $userId, $keywords, $locales, + $categories, $sensitive, $approved, $status, @@ -47,7 +49,8 @@ class TorrentRepository extends ServiceEntityRepository public function findTorrents( int $userId, array $keywords, - array $locales, + ?array $locales, + ?array $categories, ?bool $sensitive = null, ?bool $approved = null, ?bool $status = null, @@ -59,6 +62,7 @@ class TorrentRepository extends ServiceEntityRepository $userId, $keywords, $locales, + $categories, $sensitive, $approved, $status, @@ -70,17 +74,18 @@ class TorrentRepository extends ServiceEntityRepository } private function getTorrentsQueryByFilter( - int $userId, - array $keywords, - array $locales, - ?bool $sensitive = null, - ?bool $approved = null, - ?bool $status = null + int $userId, + ?array $keywords, + ?array $locales, + ?array $categories, + ?bool $sensitive = null, + ?bool $approved = null, + ?bool $status = null ): \Doctrine\ORM\QueryBuilder { $query = $this->createQueryBuilder('t'); - if ($keywords) + if (is_array($keywords)) { foreach ($keywords as $i => $keyword) { @@ -105,7 +110,7 @@ class TorrentRepository extends ServiceEntityRepository } } - if ($locales) + if (is_array($locales)) { $orLocales = $query->expr()->orX(); @@ -121,6 +126,22 @@ class TorrentRepository extends ServiceEntityRepository $query->andWhere($orLocales); } + if (is_array($categories)) + { + $orCategories = $query->expr()->orX(); + + foreach ($categories as $i => $category) + { + $orCategories->add("t.categories LIKE :category{$i}"); + $orCategories->add("t.userId = :userId"); + + $query->setParameter(":category{$i}", "%{$category}%"); + $query->setParameter('userId', $userId); + } + + $query->andWhere($orCategories); + } + if (is_bool($sensitive)) { $orSensitive = $query->expr()->orX(); diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index 0a5b3bf..abb902e 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -4,6 +4,7 @@ namespace App\Service; use App\Entity\Torrent; use App\Entity\TorrentLocales; +use App\Entity\TorrentCategories; use App\Entity\TorrentSensitive; use App\Entity\TorrentPoster; use App\Entity\TorrentStar; @@ -12,6 +13,7 @@ use App\Entity\TorrentDownloadMagnet; use App\Repository\TorrentRepository; use App\Repository\TorrentLocalesRepository; +use App\Repository\TorrentCategoriesRepository; use App\Repository\TorrentSensitiveRepository; use App\Repository\TorrentPosterRepository; use App\Repository\TorrentStarRepository; @@ -381,6 +383,7 @@ class TorrentService int $userId, int $added, array $locales, + array $categories, bool $sensitive, bool $approved, bool $status @@ -403,6 +406,7 @@ class TorrentService $wordLengthMax ), $locales, + $categories, $sensitive, $approved, $status @@ -424,6 +428,14 @@ class TorrentService $approved ); + $this->addTorrentCategories( + $torrent->getId(), + $userId, + $added, + $categories, + $approved + ); + $this->addTorrentSensitive( $torrent->getId(), $userId, @@ -449,6 +461,7 @@ class TorrentService string $md5file, array $keywords, array $locales, + array $categories, bool $sensitive, bool $approved, bool $status @@ -461,6 +474,7 @@ class TorrentService $torrent->setMd5File($md5file); $torrent->setKeywords($keywords); $torrent->setLocales($locales); + $torrent->setCategories($categories); $torrent->setSensitive($sensitive); $torrent->setApproved($approved); $torrent->setStatus($status); @@ -534,7 +548,8 @@ class TorrentService public function findTorrents( int $userId, array $keywords, - array $locales, + ?array $locales, + ?array $categories, ?bool $sensitive, ?bool $approved, ?bool $status, @@ -548,6 +563,7 @@ class TorrentService $userId, $keywords, $locales, + $categories, $sensitive, $approved, $status, @@ -559,7 +575,8 @@ class TorrentService public function findTorrentsTotal( int $userId, array $keywords, - array $locales, + ?array $locales, + ?array $categories, ?bool $sensitive, ?bool $approved, ?bool $status @@ -571,6 +588,7 @@ class TorrentService $userId, $keywords, $locales, + $categories, $sensitive, $approved, $status @@ -642,6 +660,32 @@ class TorrentService } } + public function updateTorrentCategories( + int $torrentId + ): void + { + if ($torrent = $this->getTorrent($torrentId)) + { + if ($torrentCategories = $this->entityManagerInterface + ->getRepository(TorrentCategories::class) + ->findOneBy( + [ + 'torrentId' => $torrentId, + 'approved' => true, + ], + [ + 'id' => 'DESC' + ] + )) + { + $torrent->setCategories($torrentCategories->getValue()); + + $this->entityManagerInterface->persist($torrent); + $this->entityManagerInterface->flush(); + } + } + } + public function updateTorrentScraped( int $torrentId, int $time @@ -886,6 +930,133 @@ class TorrentService } } + // Torrent category + public function getTorrentCategories( + int $torrentCategoryId + ): ?TorrentCategories + { + return $this->entityManagerInterface + ->getRepository(TorrentCategories::class) + ->find($torrentCategoryId); + } + + public function findLastTorrentCategoriesByTorrentId( + int $torrentId + ): ?TorrentCategories + { + return $this->entityManagerInterface + ->getRepository(TorrentCategories::class) + ->findOneBy( + [ + 'torrentId' => $torrentId + ], + [ + 'id' => 'DESC' + ] + ); + } + + public function findTorrentCategoriesByTorrentId(int $torrentId): array + { + return $this->entityManagerInterface + ->getRepository(TorrentCategories::class) + ->findBy( + [ + 'torrentId' => $torrentId, + ], + [ + 'id' => 'DESC' + ] + ); + } + + public function toggleTorrentCategoriesApproved( + int $torrentCategoriesId + ): ?TorrentCategories + { + $torrentCategories = $this->getTorrentCategories($torrentCategoriesId); + + $torrentCategories->setApproved( + !$torrentCategories->isApproved() // toggle current value + ); + + $this->entityManagerInterface->persist($torrentCategories); + $this->entityManagerInterface->flush(); + + $this->updateTorrentCategories( + $torrentCategories->getTorrentId() + ); + + return $torrentCategories; + } + + public function deleteTorrentCategories( + int $torrentCategoriesId + ): ?TorrentCategories + { + $torrentCategories = $this->getTorrentCategories($torrentCategoriesId); + + $this->entityManagerInterface->remove($torrentCategories); + $this->entityManagerInterface->flush(); + + $this->updateTorrentCategories( + $torrentCategories->getTorrentId() + ); + + return $torrentCategories; + } + + public function addTorrentCategories( + int $torrentId, + int $userId, + int $added, + array $value, + bool $approved + ): ?TorrentCategories + { + $torrentCategories = new TorrentCategories(); + + $torrentCategories->setTorrentId($torrentId); + $torrentCategories->setUserId($userId); + $torrentCategories->setAdded($added); + $torrentCategories->setValue($value); + $torrentCategories->setApproved($approved); + + $this->entityManagerInterface->persist($torrentCategories); + $this->entityManagerInterface->flush(); + + $this->updateTorrentCategories( + $torrentId + ); + + return $torrentCategories; + } + + public function setTorrentCategoriesApprovedByUserId( + int $userId, + bool $value + ): void + { + foreach ($this->entityManagerInterface + ->getRepository(TorrentCategories::class) + ->findBy( + [ + 'userId' => $userId + ]) as $torrentCategories) + { + $torrentCategories->setApproved( + $value + ); + + $this->entityManagerInterface->persist($torrentCategories); + $this->entityManagerInterface->flush(); + + $this->updateTorrentCategories( + $torrentCategories->getTorrentId(), + ); + } + } + // Torrent sensitive public function getTorrentSensitive( int $torrentSensitiveId diff --git a/templates/default/torrent/edit/categories.html.twig b/templates/default/torrent/edit/categories.html.twig new file mode 100644 index 0000000..c094952 --- /dev/null +++ b/templates/default/torrent/edit/categories.html.twig @@ -0,0 +1,109 @@ +{% extends 'default/layout.html.twig' %} +{% block title %}{{'Edit categories'|trans }} - {{'Torrent'|trans }} #{{ torrentId }} - {{ name }}{% endblock %} +{% block main_content %} +
+
+

+ {{'Edit categories for torrent' | trans }} + #{{ torrentId }} +

+
+
+
+ + + + + + + {% for error in form.categories.error %} +
+ {{ error }} +
+ {% endfor %} +
+ {% for category in categories | sort %} +
+ {% if category in form.categories.attribute.value %} + + {% else %} + + {% endif %} + +
+ {% endfor %} + {# + + #} +
+
+
+ + +
+ {% for edition in editions %} +
+ {% if edition.active %} + {{ edition.added | format_ago }} + {% else %} + + {{ edition.added | format_ago }} + + {% endif %} + {{ 'by'|trans }} + + {{'identicon'|trans }} + +
+ {% if session.moderator or session.owner %} + + + + + + + {% endif %} + {% if edition.approved %} + {% if session.moderator %} + + + + + + {% else %} + + + + + + {% endif %} + {% else %} + {% if session.moderator %} + + + + + + {% else %} + + + + + + {% endif %} + {% endif %} +
+
+ {% endfor %} +{% endblock %} diff --git a/templates/default/torrent/edit/locales.html.twig b/templates/default/torrent/edit/locales.html.twig index 1245721..dcab8db 100644 --- a/templates/default/torrent/edit/locales.html.twig +++ b/templates/default/torrent/edit/locales.html.twig @@ -24,7 +24,7 @@ {% endfor %}
- {% for locale in locales %} + {% for locale in locales | sort %}
{% if locale in form.locales.attribute.value %} diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index 5aebc08..9560e68 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -339,12 +339,28 @@ - {{ 'Locales' | trans }} + {{ 'Locale' | trans }}
{% if torrent.locales %}
- {% for i, locale in torrent.locales %}{% if i > 0 %},{% endif %} {{ locale|locale_name(locale)|u.title }}{% endfor %} + {% for i, locale in torrent.locales | sort %}{% if i > 0 %},{% endif %} {{ locale | locale_name(locale) | u.title }}{% endfor %} +
+ {% endif %} +
+
+
+ + + + + + {{ 'Category' | trans }} +
+
+ {% if torrent.categories %} +
+ {% for i, category in torrent.categories | sort %}{% if i > 0 %},{% endif %} {{ category | u.title }}{% endfor %}
{% endif %}
diff --git a/templates/default/torrent/submit.html.twig b/templates/default/torrent/submit.html.twig index 27f6a14..4d3283b 100644 --- a/templates/default/torrent/submit.html.twig +++ b/templates/default/torrent/submit.html.twig @@ -31,7 +31,7 @@
{% endfor %}
- {% for locale in locales %} + {% for locale in locales | sort %}
{% if locale in form.locales.attribute.value %} @@ -48,9 +48,42 @@ #}
+
+
+ + + + + + + {% for error in form.categories.error %} +
+ {{ error }} +
+ {% endfor %} +
+ {% for category in categories | sort %} +
+ {% if category in form.categories.attribute.value %} + + {% else %} + + {% endif %} + +
+ {% endfor %} + {# + {{'Other...'|trans }} + #} +
+
-
+ + + + diff --git a/templates/default/user/settings.html.twig b/templates/default/user/settings.html.twig index 62fe207..dc084f3 100644 --- a/templates/default/user/settings.html.twig +++ b/templates/default/user/settings.html.twig @@ -89,7 +89,7 @@ - + + + + - @@ -180,7 +181,8 @@ {{ 'Categories' | trans }} From 31aad6339943ad1de8c1915fba01fadca3f833e2 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 4 Nov 2023 07:45:58 +0200 Subject: [PATCH 144/185] add category edition events support #26 --- src/Controller/ActivityController.php | 213 ++++++++++++++++++ src/Controller/TorrentController.php | 6 - src/Entity/Activity.php | 67 +++--- src/Service/ActivityService.php | 203 +++++++++++++++++ .../event/torrent/categories/add.html.twig | 39 ++++ .../event/torrent/categories/add.rss.twig | 26 +++ .../torrent/categories/approve/add.html.twig | 39 ++++ .../torrent/categories/approve/add.rss.twig | 26 +++ .../categories/approve/delete.html.twig | 41 ++++ .../categories/approve/delete.rss.twig | 26 +++ .../event/torrent/categories/delete.html.twig | 39 ++++ .../event/torrent/categories/delete.rss.twig | 26 +++ translations/messages+intl-icu.cs.xlf | 52 +++++ translations/messages+intl-icu.de.xlf | 52 +++++ translations/messages+intl-icu.en.xlf | 20 ++ translations/messages+intl-icu.eo.xlf | 52 +++++ translations/messages+intl-icu.es.xlf | 52 +++++ translations/messages+intl-icu.fr.xlf | 52 +++++ translations/messages+intl-icu.he.xlf | 52 +++++ translations/messages+intl-icu.it.xlf | 52 +++++ translations/messages+intl-icu.ja.xlf | 52 +++++ translations/messages+intl-icu.ka.xlf | 52 +++++ translations/messages+intl-icu.lv.xlf | 52 +++++ translations/messages+intl-icu.nl.xlf | 52 +++++ translations/messages+intl-icu.pl.xlf | 52 +++++ translations/messages+intl-icu.pt.xlf | 52 +++++ translations/messages+intl-icu.ru.xlf | 52 +++++ translations/messages+intl-icu.uk.xlf | 52 +++++ 28 files changed, 1514 insertions(+), 37 deletions(-) create mode 100644 templates/default/activity/event/torrent/categories/add.html.twig create mode 100644 templates/default/activity/event/torrent/categories/add.rss.twig create mode 100644 templates/default/activity/event/torrent/categories/approve/add.html.twig create mode 100644 templates/default/activity/event/torrent/categories/approve/add.rss.twig create mode 100644 templates/default/activity/event/torrent/categories/approve/delete.html.twig create mode 100644 templates/default/activity/event/torrent/categories/approve/delete.rss.twig create mode 100644 templates/default/activity/event/torrent/categories/delete.html.twig create mode 100644 templates/default/activity/event/torrent/categories/delete.rss.twig diff --git a/src/Controller/ActivityController.php b/src/Controller/ActivityController.php index 5bdec65..c8bb152 100644 --- a/src/Controller/ActivityController.php +++ b/src/Controller/ActivityController.php @@ -1116,6 +1116,219 @@ class ActivityController extends AbstractController break; + /// Torrent Categories + case $activity::EVENT_TORRENT_CATEGORIES_ADD: + + // Init torrent + if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) + { + throw $this->createNotFoundException(); + } + + return $this->render( + 'default/activity/event/torrent/categories/add' . $extension, + [ + 'id' => $activity->getId(), + 'added' => $activity->getAdded(), + 'user' => + [ + 'id' => $activity->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $activity->getUserId() + )->getAddress() + ) + ], + 'torrent' => + [ + 'id' => $torrent->getId(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), + 'name' => $torrentService->readTorrentFileByTorrentId( + $torrent->getId() + )->getName(), + 'categories' => [ + 'id' => $activity->getData()['torrentCategoriesId'], + 'exist' => $torrentService->getTorrentCategories( + $activity->getData()['torrentCategoriesId'] // could be deleted by moderator, remove links + ) + ] + ], + 'session' => + [ + 'user' => + [ + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), + ] + ] + ] + ); + + break; + + case $activity::EVENT_TORRENT_CATEGORIES_DELETE: + + // Init torrent + if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) + { + throw $this->createNotFoundException(); + } + + return $this->render( + 'default/activity/event/torrent/categories/delete' . $extension, + [ + 'id' => $activity->getId(), + 'added' => $activity->getAdded(), + 'user' => + [ + 'id' => $activity->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $activity->getUserId() + )->getAddress() + ) + ], + 'torrent' => + [ + 'id' => $torrent->getId(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), + 'name' => $torrentService->readTorrentFileByTorrentId( + $torrent->getId() + )->getName(), + 'categories' => [ + 'id' => $activity->getData()['torrentCategoriesId'], + 'exist' => $torrentService->getTorrentCategories( + $activity->getData()['torrentCategoriesId'] // could be deleted by moderator, remove links + ) + ] + ], + 'session' => + [ + 'user' => + [ + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), + ] + ] + ] + ); + + break; + + case $activity::EVENT_TORRENT_CATEGORIES_APPROVE_ADD: + + // Init torrent + if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) + { + throw $this->createNotFoundException(); + } + + return $this->render( + 'default/activity/event/torrent/categories/approve/add' . $extension, + [ + 'id' => $activity->getId(), + 'added' => $activity->getAdded(), + 'user' => + [ + 'id' => $activity->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $activity->getUserId() + )->getAddress() + ) + ], + 'torrent' => + [ + 'id' => $torrent->getId(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), + 'name' => $torrentService->readTorrentFileByTorrentId( + $torrent->getId() + )->getName(), + 'categories' => [ + 'id' => $activity->getData()['torrentCategoriesId'], + 'exist' => $torrentService->getTorrentCategories( + $activity->getData()['torrentCategoriesId'] // could be deleted by moderator, remove links + ) + ] + ], + 'session' => + [ + 'user' => + [ + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), + ] + ] + ] + ); + + break; + + case $activity::EVENT_TORRENT_CATEGORIES_APPROVE_DELETE: + + // Init torrent + if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) + { + throw $this->createNotFoundException(); + } + + return $this->render( + 'default/activity/event/torrent/categories/approve/delete' . $extension, + [ + 'id' => $activity->getId(), + 'added' => $activity->getAdded(), + 'user' => + [ + 'id' => $activity->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $activity->getUserId() + )->getAddress() + ) + ], + 'torrent' => + [ + 'id' => $torrent->getId(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), + 'name' => $torrentService->readTorrentFileByTorrentId( + $torrent->getId() + )->getName(), + 'categories' => [ + 'id' => $activity->getData()['torrentCategoriesId'], + 'exist' => $torrentService->getTorrentCategories( + $activity->getData()['torrentCategoriesId'] // could be deleted by moderator, remove links + ) + ] + ], + 'session' => + [ + 'user' => + [ + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), + ] + ] + ] + ); + + break; + /// Torrent Sensitive case $activity::EVENT_TORRENT_SENSITIVE_ADD: diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 0179ebd..bf962f8 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -1704,14 +1704,12 @@ class TorrentController extends AbstractController ); // Register activity event - /* @TODO $activityService->addEventTorrentCategoriesAdd( $user->getId(), $torrent->getId(), time(), $torrentCategories->getId() ); - */ // Redirect to info page return $this->redirectToRoute( @@ -1792,7 +1790,6 @@ class TorrentController extends AbstractController } // Register activity event - /* @TODO if (!$torrentCategories->isApproved()) { $activityService->addEventTorrentCategoriesApproveAdd( @@ -1812,7 +1809,6 @@ class TorrentController extends AbstractController $torrentCategories->getId() ); } - */ // Update approved $torrentService->toggleTorrentCategoriesApproved( @@ -1881,14 +1877,12 @@ class TorrentController extends AbstractController } // Add activity event - /* @TODO $activityService->addEventTorrentCategoriesDelete( $user->getId(), $torrent->getId(), time(), $torrentCategories->getId() ); - */ // Update approved $torrentService->deleteTorrentCategories( diff --git a/src/Entity/Activity.php b/src/Entity/Activity.php index 1102a03..1be1097 100644 --- a/src/Entity/Activity.php +++ b/src/Entity/Activity.php @@ -20,52 +20,57 @@ class Activity // Event codes /// User - public const EVENT_USER_ADD = 1000; + public const EVENT_USER_ADD = 1000; - public const EVENT_USER_APPROVE_ADD = 1200; - public const EVENT_USER_APPROVE_DELETE = 1201; + public const EVENT_USER_APPROVE_ADD = 1200; + public const EVENT_USER_APPROVE_DELETE = 1201; - public const EVENT_USER_MODERATOR_ADD = 1300; - public const EVENT_USER_MODERATOR_DELETE = 1301; + public const EVENT_USER_MODERATOR_ADD = 1300; + public const EVENT_USER_MODERATOR_DELETE = 1301; - public const EVENT_USER_STATUS_ADD = 1400; - public const EVENT_USER_STATUS_DELETE = 1401; + public const EVENT_USER_STATUS_ADD = 1400; + public const EVENT_USER_STATUS_DELETE = 1401; - public const EVENT_USER_STAR_ADD = 1500; - public const EVENT_USER_STAR_DELETE = 1501; + public const EVENT_USER_STAR_ADD = 1500; + public const EVENT_USER_STAR_DELETE = 1501; /// Torrent - public const EVENT_TORRENT_ADD = 2000; + public const EVENT_TORRENT_ADD = 2000; - public const EVENT_TORRENT_APPROVE_ADD = 1100; - public const EVENT_TORRENT_APPROVE_DELETE = 1101; + public const EVENT_TORRENT_APPROVE_ADD = 1100; + public const EVENT_TORRENT_APPROVE_DELETE = 1101; - public const EVENT_TORRENT_LOCALES_ADD = 2200; - public const EVENT_TORRENT_LOCALES_DELETE = 2201; - public const EVENT_TORRENT_LOCALES_APPROVE_ADD = 2210; - public const EVENT_TORRENT_LOCALES_APPROVE_DELETE = 2211; + public const EVENT_TORRENT_LOCALES_ADD = 2200; + public const EVENT_TORRENT_LOCALES_DELETE = 2201; + public const EVENT_TORRENT_LOCALES_APPROVE_ADD = 2210; + public const EVENT_TORRENT_LOCALES_APPROVE_DELETE = 2211; - public const EVENT_TORRENT_SENSITIVE_ADD = 2300; - public const EVENT_TORRENT_SENSITIVE_DELETE = 2301; - public const EVENT_TORRENT_SENSITIVE_APPROVE_ADD = 2310; - public const EVENT_TORRENT_SENSITIVE_APPROVE_DELETE = 2311; + public const EVENT_TORRENT_SENSITIVE_ADD = 2300; + public const EVENT_TORRENT_SENSITIVE_DELETE = 2301; + public const EVENT_TORRENT_SENSITIVE_APPROVE_ADD = 2310; + public const EVENT_TORRENT_SENSITIVE_APPROVE_DELETE = 2311; - public const EVENT_TORRENT_STAR_ADD = 2400; - public const EVENT_TORRENT_STAR_DELETE = 2401; + public const EVENT_TORRENT_STAR_ADD = 2400; + public const EVENT_TORRENT_STAR_DELETE = 2401; - public const EVENT_TORRENT_DOWNLOAD_FILE_ADD = 2500; + public const EVENT_TORRENT_DOWNLOAD_FILE_ADD = 2500; - public const EVENT_TORRENT_DOWNLOAD_MAGNET_ADD = 2600; + public const EVENT_TORRENT_DOWNLOAD_MAGNET_ADD = 2600; - public const EVENT_TORRENT_WANTED_ADD = 2700; + public const EVENT_TORRENT_WANTED_ADD = 2700; - public const EVENT_TORRENT_STATUS_ADD = 1800; - public const EVENT_TORRENT_STATUS_DELETE = 1801; + public const EVENT_TORRENT_STATUS_ADD = 1800; + public const EVENT_TORRENT_STATUS_DELETE = 1801; - public const EVENT_TORRENT_POSTER_ADD = 2800; - public const EVENT_TORRENT_POSTER_DELETE = 2801; - public const EVENT_TORRENT_POSTER_APPROVE_ADD = 2810; - public const EVENT_TORRENT_POSTER_APPROVE_DELETE = 2811; + public const EVENT_TORRENT_POSTER_ADD = 2800; + public const EVENT_TORRENT_POSTER_DELETE = 2801; + public const EVENT_TORRENT_POSTER_APPROVE_ADD = 2810; + public const EVENT_TORRENT_POSTER_APPROVE_DELETE = 2811; + + public const EVENT_TORRENT_CATEGORIES_ADD = 2900; + public const EVENT_TORRENT_CATEGORIES_DELETE = 2901; + public const EVENT_TORRENT_CATEGORIES_APPROVE_ADD = 2910; + public const EVENT_TORRENT_CATEGORIES_APPROVE_DELETE = 2911; // ... diff --git a/src/Service/ActivityService.php b/src/Service/ActivityService.php index 75b37e8..dd785d1 100644 --- a/src/Service/ActivityService.php +++ b/src/Service/ActivityService.php @@ -51,6 +51,11 @@ class ActivityService Activity::EVENT_TORRENT_LOCALES_APPROVE_ADD, Activity::EVENT_TORRENT_LOCALES_APPROVE_DELETE, + Activity::EVENT_TORRENT_CATEGORIES_ADD, + Activity::EVENT_TORRENT_CATEGORIES_DELETE, + Activity::EVENT_TORRENT_CATEGORIES_APPROVE_ADD, + Activity::EVENT_TORRENT_CATEGORIES_APPROVE_DELETE, + Activity::EVENT_TORRENT_SENSITIVE_ADD, Activity::EVENT_TORRENT_SENSITIVE_DELETE, Activity::EVENT_TORRENT_SENSITIVE_APPROVE_ADD, @@ -277,6 +282,55 @@ class ActivityService break; + /// Torrent categories + case Activity::EVENT_TORRENT_CATEGORIES_ADD: + + $events + [ + $this->translatorInterface->trans('Torrent categories') + ] + [ + $this->translatorInterface->trans('Added') + ] = $code; + + break; + + case Activity::EVENT_TORRENT_CATEGORIES_DELETE: + + $events + [ + $this->translatorInterface->trans('Torrent categories') + ] + [ + $this->translatorInterface->trans('Deleted') + ] = $code; + + break; + + case Activity::EVENT_TORRENT_CATEGORIES_APPROVE_ADD: + + $events + [ + $this->translatorInterface->trans('Torrent categories') + ] + [ + $this->translatorInterface->trans('Approved') + ] = $code; + + break; + + case Activity::EVENT_TORRENT_CATEGORIES_APPROVE_DELETE: + + $events + [ + $this->translatorInterface->trans('Torrent categories') + ] + [ + $this->translatorInterface->trans('Disapproved') + ] = $code; + + break; + /// Torrent sensitive case Activity::EVENT_TORRENT_SENSITIVE_ADD: @@ -1303,6 +1357,155 @@ class ActivityService return $activity; } + /// Torrent categories + public function addEventTorrentCategoriesAdd( + int $userId, + int $torrentId, + int $added, + int $torrentCategoriesId, + ): ?Activity + { + $activity = new Activity(); + + $activity->setEvent( + Activity::EVENT_TORRENT_CATEGORIES_ADD + ); + + $activity->setUserId( + $userId + ); + + $activity->setTorrentId( + $torrentId + ); + + $activity->setAdded( + $added + ); + + $activity->setData( + [ + 'torrentCategoriesId' => $torrentCategoriesId + ] + ); + + $this->entityManagerInterface->persist($activity); + $this->entityManagerInterface->flush(); + + return $activity; + } + + public function addEventTorrentCategoriesDelete( + int $userId, + int $torrentId, + int $added, + int $torrentCategoriesId, + ): ?Activity + { + $activity = new Activity(); + + $activity->setEvent( + Activity::EVENT_TORRENT_CATEGORIES_DELETE + ); + + $activity->setUserId( + $userId + ); + + $activity->setTorrentId( + $torrentId + ); + + $activity->setAdded( + $added + ); + + $activity->setData( + [ + 'torrentCategoriesId' => $torrentCategoriesId + ] + ); + + $this->entityManagerInterface->persist($activity); + $this->entityManagerInterface->flush(); + + return $activity; + } + + public function addEventTorrentCategoriesApproveAdd( + int $userId, + int $torrentId, + int $added, + int $torrentCategoriesId, + ): ?Activity + { + $activity = new Activity(); + + $activity->setEvent( + Activity::EVENT_TORRENT_CATEGORIES_APPROVE_ADD + ); + + $activity->setUserId( + $userId + ); + + $activity->setTorrentId( + $torrentId + ); + + $activity->setAdded( + $added + ); + + $activity->setData( + [ + 'torrentCategoriesId' => $torrentCategoriesId + ] + ); + + $this->entityManagerInterface->persist($activity); + $this->entityManagerInterface->flush(); + + return $activity; + } + + public function addEventTorrentCategoriesApproveDelete( + int $userId, + int $torrentId, + int $added, + int $torrentCategoriesId, + ): ?Activity + { + $activity = new Activity(); + + $activity->setEvent( + Activity::EVENT_TORRENT_CATEGORIES_APPROVE_DELETE + ); + + $activity->setUserId( + $userId + ); + + $activity->setTorrentId( + $torrentId + ); + + $activity->setAdded( + $added + ); + + $activity->setData( + [ + 'torrentCategoriesId' => $torrentCategoriesId + ] + ); + + $this->entityManagerInterface->persist($activity); + $this->entityManagerInterface->flush(); + + return $activity; + } + /// Torrent sensitive public function addEventTorrentSensitiveAdd( int $userId, diff --git a/templates/default/activity/event/torrent/categories/add.html.twig b/templates/default/activity/event/torrent/categories/add.html.twig new file mode 100644 index 0000000..1d081c7 --- /dev/null +++ b/templates/default/activity/event/torrent/categories/add.html.twig @@ -0,0 +1,39 @@ +
+
+ + {{ 'identicon' | trans }} + + {{ 'have added categories edition' | trans }} + {% if torrent.categories.exist %} + + #{{ torrent.categories.id }} + + {% else %} + #{{ torrent.categories.id }} + {% endif %} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + + {{ torrent.name }} + + {% if torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% endif %} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + + {{ torrent.name }} + + {% endif %} + {% endif %} +
+
+ {{ added | format_ago }} +
+
\ No newline at end of file diff --git a/templates/default/activity/event/torrent/categories/add.rss.twig b/templates/default/activity/event/torrent/categories/add.rss.twig new file mode 100644 index 0000000..2262f72 --- /dev/null +++ b/templates/default/activity/event/torrent/categories/add.rss.twig @@ -0,0 +1,26 @@ + + + {{ 'User' | trans }} + #{{ user.id }} + {{ 'have added categories edition' | trans }} + #{{ torrent.categories.id }} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + {{ torrent.name }} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + {{ torrent.name }} + {% endif %} + {% endif %} + + #{{ user.id }} + {{ added | date('D, d M Y h:i:s O') }} + {{ url('torrent_categories_edit', { torrentId : torrent.id, torrentCategoriesId : torrent.categories.id }) }}#activity-{{ id }} + {{ url('torrent_categories_edit', { torrentId : torrent.id, torrentCategoriesId : torrent.categories.id }) }}#activity + \ No newline at end of file diff --git a/templates/default/activity/event/torrent/categories/approve/add.html.twig b/templates/default/activity/event/torrent/categories/approve/add.html.twig new file mode 100644 index 0000000..19c4836 --- /dev/null +++ b/templates/default/activity/event/torrent/categories/approve/add.html.twig @@ -0,0 +1,39 @@ +
+
+ + {{ 'identicon' | trans }} + + {{ 'have approved categories edition' | trans }} + {% if torrent.categories.exist %} + + #{{ torrent.categories.id }} + + {% else %} + #{{ torrent.categories.id }} + {% endif %} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + + {{ torrent.name }} + + {% if torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% endif %} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + + {{ torrent.name }} + + {% endif %} + {% endif %} +
+
+ {{ added | format_ago }} +
+
\ No newline at end of file diff --git a/templates/default/activity/event/torrent/categories/approve/add.rss.twig b/templates/default/activity/event/torrent/categories/approve/add.rss.twig new file mode 100644 index 0000000..9395f46 --- /dev/null +++ b/templates/default/activity/event/torrent/categories/approve/add.rss.twig @@ -0,0 +1,26 @@ + + + {{ 'User' | trans }} + #{{ user.id }} + {{ 'have approved categories edition' | trans }} + #{{ torrent.categories.id }} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + {{ torrent.name }} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + {{ torrent.name }} + {% endif %} + {% endif %} + + #{{ user.id }} + {{ added | date('D, d M Y h:i:s O') }} + {{ url('torrent_categories_edit', { torrentId : torrent.id, torrentCategoriesId : torrent.categories.id }) }}#activity-{{ id }} + {{ url('torrent_categories_edit', { torrentId : torrent.id, torrentCategoriesId : torrent.categories.id }) }}#activity + \ No newline at end of file diff --git a/templates/default/activity/event/torrent/categories/approve/delete.html.twig b/templates/default/activity/event/torrent/categories/approve/delete.html.twig new file mode 100644 index 0000000..2d9b682 --- /dev/null +++ b/templates/default/activity/event/torrent/categories/approve/delete.html.twig @@ -0,0 +1,41 @@ +
+
+ + {{ 'identicon' | trans }} + + + {{ 'have disapproved categories edition' | trans }} + + {% if torrent.categories.exist %} + + #{{ torrent.categories.id }} + + {% else %} + #{{ torrent.categories.id }} + {% endif %} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + + {{ torrent.name }} + + {% if torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% endif %} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + + {{ torrent.name }} + + {% endif %} + {% endif %} +
+
+ {{ added | format_ago }} +
+
\ No newline at end of file diff --git a/templates/default/activity/event/torrent/categories/approve/delete.rss.twig b/templates/default/activity/event/torrent/categories/approve/delete.rss.twig new file mode 100644 index 0000000..a6a6970 --- /dev/null +++ b/templates/default/activity/event/torrent/categories/approve/delete.rss.twig @@ -0,0 +1,26 @@ + + + {{ 'User' | trans }} + #{{ user.id }} + {{ 'have disapproved categories edition' | trans }} + #{{ torrent.categories.id }} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + {{ torrent.name }} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + {{ torrent.name }} + {% endif %} + {% endif %} + + #{{ user.id }} + {{ added | date('D, d M Y h:i:s O') }} + {{ url('torrent_categories_edit', { torrentId : torrent.id, torrentCategoriesId : torrent.categories.id }) }}#activity-{{ id }} + {{ url('torrent_categories_edit', { torrentId : torrent.id, torrentCategoriesId : torrent.categories.id }) }}#activity + \ No newline at end of file diff --git a/templates/default/activity/event/torrent/categories/delete.html.twig b/templates/default/activity/event/torrent/categories/delete.html.twig new file mode 100644 index 0000000..06b972b --- /dev/null +++ b/templates/default/activity/event/torrent/categories/delete.html.twig @@ -0,0 +1,39 @@ +
+
+ + {{ 'identicon' | trans }} + + {{ 'have deleted categories edition' | trans }} + {% if torrent.categories.exist %} + + #{{ torrent.categories.id }} + + {% else %} + #{{ torrent.categories.id }} + {% endif %} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + + {{ torrent.name }} + + {% if torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% endif %} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + + {{ torrent.name }} + + {% endif %} + {% endif %} +
+
+ {{ added | format_ago }} +
+
\ No newline at end of file diff --git a/templates/default/activity/event/torrent/categories/delete.rss.twig b/templates/default/activity/event/torrent/categories/delete.rss.twig new file mode 100644 index 0000000..063750b --- /dev/null +++ b/templates/default/activity/event/torrent/categories/delete.rss.twig @@ -0,0 +1,26 @@ + + + {{ 'User' | trans }} + #{{ user.id }} + {{ 'have deleted categories edition' | trans }} + #{{ torrent.categories.id }} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + {{ torrent.name }} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + {{ torrent.name }} + {% endif %} + {% endif %} + + #{{ user.id }} + {{ added | date('D, d M Y h:i:s O') }} + {{ url('torrent_categories_edit', { torrentId : torrent.id }) }}#activity-{{ id }} + {{ url('torrent_categories_edit', { torrentId : torrent.id }) }}#activity + \ No newline at end of file diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index 49c610a..1115d0c 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index 1baf706..cfbeb98 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index 3085a7b..d26ce5e 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -829,6 +829,26 @@ Category Category + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index 73c15c1..a253a32 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index d759331..e24ce1d 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index f2a251f..6bc5976 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index 39a42e3..9fa5a88 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index 6c16e22..b4cffab 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.ja.xlf b/translations/messages+intl-icu.ja.xlf index 0aafa20..45b196f 100644 --- a/translations/messages+intl-icu.ja.xlf +++ b/translations/messages+intl-icu.ja.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index 8c5f53e..ffa30a5 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index 1bfc3af..963f4df 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.nl.xlf b/translations/messages+intl-icu.nl.xlf index 7eb6e86..b3640ec 100644 --- a/translations/messages+intl-icu.nl.xlf +++ b/translations/messages+intl-icu.nl.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index fc015e5..bd71936 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index 356f38d..d8f40a7 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index 6861445..e96055f 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -797,6 +797,58 @@ Bottom Низ + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 59dc5d8..7b48cf8 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -797,6 +797,58 @@ Bottom Низ + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + From e1e3bfb2ce45ea7a634f78e10c26b52a56161bcc Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 4 Nov 2023 09:57:42 +0200 Subject: [PATCH 145/185] update json api #26 --- src/Controller/TorrentController.php | 114 +++++++++++++++++---------- 1 file changed, 73 insertions(+), 41 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index bf962f8..e577e4a 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -707,21 +707,65 @@ class TorrentController extends AbstractController ); // Init request - $query = $request->get('query') ? explode(' ', urldecode($request->get('query'))) : []; - $page = $request->get('page') ? (int) $request->get('page') : 1; + $query = $request->get('query') ? + explode(' ', urldecode($request->get('query'))) : []; - $locales = $request->get('locales') ? explode('|', $request->get('locales')) : explode('|', $this->getParameter('app.locales')); - $categories = $request->get('categories') ? explode('|', $request->get('categories')) : explode('|', $this->getParameter('app.categories')); - $sensitive = $request->get('sensitive') ? (bool) $request->get('sensitive') : null; + $page = $request->get('page') ? + (int) $request->get('page') : 1; - $yggdrasil = $request->get('yggdrasil') ? (bool) $request->get('yggdrasil') : false; + $filter = $request->get('filter') ? + true : false; + + if ($request->get('locales')) + { + $locales = explode('|', $request->get('locales')); + } + + else + { + $locales = $user->getLocales(); + } + + if ($request->get('categories')) + { + $categories = explode('|', $request->get('categories')); + } + + else + { + $categories = $user->getCategories(); + } + + switch ($request->get('sensitive')) + { + case 'true': + $sensitive = true; + break; + case 'false': + $sensitive = false; + break; + default: + $sensitive = $user->isSensitive() ? false : null; + } + + switch ($request->get('yggdrasil')) + { + case 'true': + $yggdrasil = true; + break; + case 'false': + $yggdrasil = false; + break; + default: + $yggdrasil = $user->isYggdrasil(); + } // Init trackers $trackers = explode('|', $this->getParameter('app.trackers')); // Get total torrents $total = $torrentService->findTorrentsTotal( - $user->getId(), + $filter ? 0 : $user->getId(), $query, $locales, $categories, @@ -733,7 +777,7 @@ class TorrentController extends AbstractController // Create torrents list $torrents = []; foreach ($torrentService->findTorrents( - $user->getId(), + $filter ? 0 : $user->getId(), $query, $locales, $categories, @@ -753,28 +797,15 @@ class TorrentController extends AbstractController // Apply yggdrasil filters $file = $this->filterYggdrasil($file, $yggdrasil); - // Generate url - $url = []; - foreach ($locales as $locale) - { - $url[$locale] = $this->generateUrl( - 'torrent_info', - [ - '_locale' => $locale, - 'torrentId' => $torrent->getId(), - ], - false - ); - } - $torrents[] = [ 'torrent' => [ - 'id' => $torrent->getId(), - 'added' => $torrent->getAdded(), - 'locales' => $torrent->getLocales(), - 'sensitive' => $torrent->isSensitive(), + 'id' => $torrent->getId(), + 'added' => $torrent->getAdded(), + 'locales' => $torrent->getLocales(), + 'categories' => $torrent->getCategories(), + 'sensitive' => $torrent->isSensitive(), 'file' => [ 'name' => $file->getName(), @@ -796,7 +827,7 @@ class TorrentController extends AbstractController ], false ), - 'urn' => $file->getMagnetLink() + //'urn' => $file->getMagnetLink() ], 'scrape' => [ @@ -804,23 +835,18 @@ class TorrentController extends AbstractController 'peers' => (int) $torrent->getPeers(), 'leechers' => (int) $torrent->getLeechers(), ], - 'url' => $url + 'url' => $this->generateUrl( + 'torrent_info', + [ + '_locale' => $user->getLocale(), + 'torrentId' => $torrent->getId(), + ], + false + ) ], ]; } - $url = []; - foreach ($locales as $locale) - { - $url[$locale] = $this->generateUrl( - 'torrent_recent', - [ - '_locale' => $locale - ], - false - ); - } - return $this->json( [ 'version' => time(), @@ -828,7 +854,13 @@ class TorrentController extends AbstractController [ 'name' => $this->getParameter('app.name'), 'version' => $this->getParameter('app.version'), - 'url' => $url + 'url' => $this->generateUrl( + 'torrent_recent', + [ + '_locale' => $user->getLocale() + ], + false + ) ], 'torrents' => $torrents ] From 178ab2303163a59b9ce12f81de25afe8433155e2 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 4 Nov 2023 09:58:16 +0200 Subject: [PATCH 146/185] update version --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 52307ec..e3d5643 100644 --- a/.env +++ b/.env @@ -48,7 +48,7 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 # YGGtracker # Application version, used for API and media cache -APP_VERSION='2.4.0' +APP_VERSION='2.5.0' # Application name APP_NAME=YGGtracker From d1e9e72401fac89d7cbbf5d97f37efe9213f35da Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 4 Nov 2023 11:04:05 +0200 Subject: [PATCH 147/185] disallow toggleStar method for crawlers --- src/Controller/UserController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index ae31028..538af56 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -318,6 +318,12 @@ class UserController extends AbstractController ); } + // Block crawler requests + if (in_array($request->getClientIp(), explode('|', $this->getParameter('app.crawlers')))) + { + throw $this->createNotFoundException(); + } + // Init target user if (!$userTarget = $userService->getUser($request->get('userId'))) { From ff565ac33be94ec7fc0634b5dc33546d963ffdb7 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 4 Nov 2023 13:51:41 +0200 Subject: [PATCH 148/185] add categories feature translation #26 --- .env | 1 + src/Twig/AppExtension.php | 30 +++++++ .../default/torrent/edit/categories.html.twig | 2 +- templates/default/torrent/info.html.twig | 2 +- templates/default/torrent/submit.html.twig | 2 +- templates/default/user/info.html.twig | 2 +- templates/default/user/settings.html.twig | 2 +- translations/messages+intl-icu.cs.xlf | 52 +++++++++++++ translations/messages+intl-icu.de.xlf | 52 +++++++++++++ translations/messages+intl-icu.en.xlf | 52 +++++++++++++ translations/messages+intl-icu.eo.xlf | 52 +++++++++++++ translations/messages+intl-icu.es.xlf | 52 +++++++++++++ translations/messages+intl-icu.fr.xlf | 52 +++++++++++++ translations/messages+intl-icu.he.xlf | 52 +++++++++++++ translations/messages+intl-icu.it.xlf | 52 +++++++++++++ translations/messages+intl-icu.ja.xlf | 52 +++++++++++++ translations/messages+intl-icu.ka.xlf | 52 +++++++++++++ translations/messages+intl-icu.lv.xlf | 52 +++++++++++++ translations/messages+intl-icu.nl.xlf | 52 +++++++++++++ translations/messages+intl-icu.pl.xlf | 52 +++++++++++++ translations/messages+intl-icu.pt.xlf | 52 +++++++++++++ translations/messages+intl-icu.ru.xlf | 78 +++++++++++++++---- translations/messages+intl-icu.uk.xlf | 78 +++++++++++++++---- 23 files changed, 894 insertions(+), 31 deletions(-) diff --git a/.env b/.env index e3d5643..9dac3a8 100644 --- a/.env +++ b/.env @@ -60,6 +60,7 @@ APP_LOCALE=en APP_LOCALES=en|cs|nl|eo|fr|ja|ka|de|he|it|lv|pl|pt|ru|es|uk # Content categories, lowercase, enabled by default for new users +# src/Twig/AppExtension.php:transCategory APP_CATEGORIES=movie|series|tv|animation|music|game|audiobook|podcast|book|archive|picture|software|other # Items per page on pagination diff --git a/src/Twig/AppExtension.php b/src/Twig/AppExtension.php index c0bbcf4..8da3975 100644 --- a/src/Twig/AppExtension.php +++ b/src/Twig/AppExtension.php @@ -46,6 +46,13 @@ class AppExtension extends AbstractExtension 'urlToMarkdown' ] ), + new TwigFilter( + 'trans_category', + [ + $this, + 'transCategory' + ] + ), ]; } @@ -153,6 +160,29 @@ class AppExtension extends AbstractExtension ); } + public function transCategory( + string $name + ): string + { + switch ($name) + { + case 'movie': return $this->translator->trans('movie'); + case 'series': return $this->translator->trans('series'); + case 'tv': return $this->translator->trans('tv'); + case 'animation': return $this->translator->trans('animation'); + case 'music': return $this->translator->trans('music'); + case 'game': return $this->translator->trans('game'); + case 'audiobook': return $this->translator->trans('audiobook'); + case 'podcast': return $this->translator->trans('podcast'); + case 'book': return $this->translator->trans('book'); + case 'archive': return $this->translator->trans('archive'); + case 'picture': return $this->translator->trans('picture'); + case 'software': return $this->translator->trans('software'); + case 'other': return $this->translator->trans('other'); + default: return $name; + } + } + private function plural(int $number, array $texts) { $cases = [2, 0, 1, 1, 1, 2]; diff --git a/templates/default/torrent/edit/categories.html.twig b/templates/default/torrent/edit/categories.html.twig index c094952..417828d 100644 --- a/templates/default/torrent/edit/categories.html.twig +++ b/templates/default/torrent/edit/categories.html.twig @@ -32,7 +32,7 @@ {% endif %} {% endfor %} diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index 10f8721..4d530ab 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -362,7 +362,7 @@ {% if torrent.categories %}
{% set i = 0 %} - {% for category in torrent.categories | sort %}{% if i > 0 %},{% endif %} {{ category | u.title }}{% set i = i + 1 %}{% endfor %} + {% for category in torrent.categories | sort %}{% if i > 0 %},{% endif %} {{ category | trans_category | u.title }}{% set i = i + 1 %}{% endfor %}
{% endif %} diff --git a/templates/default/torrent/submit.html.twig b/templates/default/torrent/submit.html.twig index 4d3283b..c36da9a 100644 --- a/templates/default/torrent/submit.html.twig +++ b/templates/default/torrent/submit.html.twig @@ -72,7 +72,7 @@ {% endif %} {% endfor %} diff --git a/templates/default/user/info.html.twig b/templates/default/user/info.html.twig index dcc72cf..a22da9e 100644 --- a/templates/default/user/info.html.twig +++ b/templates/default/user/info.html.twig @@ -182,7 +182,7 @@
diff --git a/templates/default/user/settings.html.twig b/templates/default/user/settings.html.twig index dc084f3..b7312e6 100644 --- a/templates/default/user/settings.html.twig +++ b/templates/default/user/settings.html.twig @@ -116,7 +116,7 @@ {% endif %} {% endfor %} diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index 1115d0c..b34a837 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -849,6 +849,58 @@ have added categories edition have added categories edition + + movie + movie + + + series + series + + + tv + tv + + + animation + animation + + + music + music + + + game + game + + + audiobook + audiobook + + + podcast + podcast + + + book + book + + + archive + archive + + + picture + picture + + + software + software + + + other + other + diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index cfbeb98..2137691 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -849,6 +849,58 @@ have added categories edition have added categories edition + + movie + movie + + + series + series + + + tv + tv + + + animation + animation + + + music + music + + + game + game + + + audiobook + audiobook + + + podcast + podcast + + + book + book + + + archive + archive + + + picture + picture + + + software + software + + + other + other + diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index d26ce5e..e4658e8 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -849,6 +849,58 @@ have added categories edition have added categories edition + + movie + movie + + + series + series + + + tv + tv + + + animation + animation + + + music + music + + + game + game + + + audiobook + audiobook + + + podcast + podcast + + + book + book + + + archive + archive + + + picture + picture + + + software + software + + + other + other + diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index a253a32..a9ea8be 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -849,6 +849,58 @@ have added categories edition have added categories edition + + movie + movie + + + series + series + + + tv + tv + + + animation + animation + + + music + music + + + game + game + + + audiobook + audiobook + + + podcast + podcast + + + book + book + + + archive + archive + + + picture + picture + + + software + software + + + other + other + diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index e24ce1d..a5f441d 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -849,6 +849,58 @@ have added categories edition have added categories edition + + movie + movie + + + series + series + + + tv + tv + + + animation + animation + + + music + music + + + game + game + + + audiobook + audiobook + + + podcast + podcast + + + book + book + + + archive + archive + + + picture + picture + + + software + software + + + other + other + diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index 6bc5976..55a2fc0 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -849,6 +849,58 @@ have added categories edition have added categories edition + + movie + movie + + + series + series + + + tv + tv + + + animation + animation + + + music + music + + + game + game + + + audiobook + audiobook + + + podcast + podcast + + + book + book + + + archive + archive + + + picture + picture + + + software + software + + + other + other + diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index 9fa5a88..bb9127f 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -849,6 +849,58 @@ have added categories edition have added categories edition + + movie + movie + + + series + series + + + tv + tv + + + animation + animation + + + music + music + + + game + game + + + audiobook + audiobook + + + podcast + podcast + + + book + book + + + archive + archive + + + picture + picture + + + software + software + + + other + other + diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index b4cffab..4a27c88 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -849,6 +849,58 @@ have added categories edition have added categories edition + + movie + movie + + + series + series + + + tv + tv + + + animation + animation + + + music + music + + + game + game + + + audiobook + audiobook + + + podcast + podcast + + + book + book + + + archive + archive + + + picture + picture + + + software + software + + + other + other + diff --git a/translations/messages+intl-icu.ja.xlf b/translations/messages+intl-icu.ja.xlf index 45b196f..d94fbba 100644 --- a/translations/messages+intl-icu.ja.xlf +++ b/translations/messages+intl-icu.ja.xlf @@ -849,6 +849,58 @@ have added categories edition have added categories edition + + movie + movie + + + series + series + + + tv + tv + + + animation + animation + + + music + music + + + game + game + + + audiobook + audiobook + + + podcast + podcast + + + book + book + + + archive + archive + + + picture + picture + + + software + software + + + other + other + diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index ffa30a5..dfaece0 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -849,6 +849,58 @@ have added categories edition have added categories edition + + movie + movie + + + series + series + + + tv + tv + + + animation + animation + + + music + music + + + game + game + + + audiobook + audiobook + + + podcast + podcast + + + book + book + + + archive + archive + + + picture + picture + + + software + software + + + other + other + diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index 963f4df..b2f07df 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -849,6 +849,58 @@ have added categories edition have added categories edition + + movie + movie + + + series + series + + + tv + tv + + + animation + animation + + + music + music + + + game + game + + + audiobook + audiobook + + + podcast + podcast + + + book + book + + + archive + archive + + + picture + picture + + + software + software + + + other + other + diff --git a/translations/messages+intl-icu.nl.xlf b/translations/messages+intl-icu.nl.xlf index b3640ec..85f3f3f 100644 --- a/translations/messages+intl-icu.nl.xlf +++ b/translations/messages+intl-icu.nl.xlf @@ -849,6 +849,58 @@ have added categories edition have added categories edition + + movie + movie + + + series + series + + + tv + tv + + + animation + animation + + + music + music + + + game + game + + + audiobook + audiobook + + + podcast + podcast + + + book + book + + + archive + archive + + + picture + picture + + + software + software + + + other + other + diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index bd71936..80f6e6a 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -849,6 +849,58 @@ have added categories edition have added categories edition + + movie + movie + + + series + series + + + tv + tv + + + animation + animation + + + music + music + + + game + game + + + audiobook + audiobook + + + podcast + podcast + + + book + book + + + archive + archive + + + picture + picture + + + software + software + + + other + other + diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index d8f40a7..f046b79 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -849,6 +849,58 @@ have added categories edition have added categories edition + + movie + movie + + + series + series + + + tv + tv + + + animation + animation + + + music + music + + + game + game + + + audiobook + audiobook + + + podcast + podcast + + + book + book + + + archive + archive + + + picture + picture + + + software + software + + + other + other + diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index e96055f..81d2f09 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -799,55 +799,107 @@ Categories - Categories + Категории At least one category required - At least one category required + Необходимо указать минимум одну категорию Content category - Content category + Категория содержимого This torrent have selected categories - This torrent have selected categories + Этот торрент содержит выбранные категории Edit categories - Edit categories + Редактировать категории Edit categories for torrent - Edit categories for torrent + Редактировать категории для торрента Locale - Locale + Локаль Category - Category + Категория Torrent categories - Torrent categories + Категории торрента have deleted categories edition - have deleted categories edition + удалил редакцию категорий have disapproved categories edition - have disapproved categories edition + отклонил редакцию категорий have approved categories edition - have approved categories edition + утвердил редакцию категорий have added categories edition - have added categories edition + добавил редакцию категорий + + + movie + фильм + + + series + сериал + + + tv + ТВ шоу + + + animation + анимация + + + music + музыка + + + game + игра + + + audiobook + аудиокнига + + + podcast + подкаст + + + book + книга + + + archive + архив + + + picture + изображение + + + software + программа + + + other + другое diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 7b48cf8..8322f03 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -799,55 +799,107 @@ Categories - Categories + Категорії At least one category required - At least one category required + Потрібно вказати щонайменше одну категорію Content category - Content category + Категорія вмісту This torrent have selected categories - This torrent have selected categories + Цей торрент має виділені категорії Edit categories - Edit categories + Змінити категорії Edit categories for torrent - Edit categories for torrent + Редагувати категорії для торенту Locale - Locale + Локаль Category - Category + Категорія Torrent categories - Torrent categories + Категорії торенту have deleted categories edition - have deleted categories edition + видалив редакцію категорій have disapproved categories edition - have disapproved categories edition + відхилив редакцію категорій have approved categories edition - have approved categories edition + затвердив редакцію категорій have added categories edition - have added categories edition + додав редакцію категорій + + + movie + кіно + + + series + серіал + + + tv + ТБ шоу + + + animation + анімація + + + music + музика + + + game + гра + + + audiobook + аудіокнига + + + podcast + подкаст + + + book + книга + + + archive + архів + + + picture + зображення + + + software + програма + + + other + інше From b96ed08694e1f89a7606fa610bd0b7da87e1e38a Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 4 Nov 2023 15:02:38 +0200 Subject: [PATCH 149/185] apply Bencode library update --- src/Controller/TorrentController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index e577e4a..4b49411 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -204,7 +204,9 @@ class TorrentController extends AbstractController 'private' => $file->isPrivate(), 'source' => $file->getSource(), 'comment' => $file->getComment(), - 'tree' => $file->getFileTree(), + 'tree' => $file->getFileTree( + \Rhilip\Bencode\TorrentFile::FILETREE_SORT_NATURAL // #34 @TODO cyrillic + ), //'trackers' => $file->getAnnounceList(), 'hash' => [ From 77616c3c8a865b35c338f3229c70c066c48dd907 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 11 Nov 2023 04:17:57 +0200 Subject: [PATCH 150/185] fix sensitive access condition and disable on direct request #37 --- src/Controller/TorrentController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 4b49411..31b7c10 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -57,10 +57,13 @@ class TorrentController extends AbstractController } // Sensitive filter - if (!$user->isModerator() && $user->isSensitive()) + // @TODO add blur effect or sensitive notice instead of 404 on direct request #37 + /* + if (!$user->isModerator() && $user->isSensitive() && $torrent->isSensitive()) { throw $this->createNotFoundException(); } + */ // Access filter if (!$user->isModerator() && $user->getId() != $torrent->getUserId() && From 7a1fa122714c413906156976745ba55d4a2d125e Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 13 Nov 2023 08:24:12 +0200 Subject: [PATCH 151/185] fix locales sort order --- templates/default/user/settings.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/default/user/settings.html.twig b/templates/default/user/settings.html.twig index b7312e6..49fcbed 100644 --- a/templates/default/user/settings.html.twig +++ b/templates/default/user/settings.html.twig @@ -87,9 +87,9 @@ {% endif %} + + + + {% if file.source %} {% endif %} @@ -248,7 +250,9 @@ {{ 'Software' | trans }} {% endif %} @@ -258,7 +262,9 @@ {{ 'Comment' | trans }} {% endif %} From 9d596de6104fbb8293d69f04a8e4949252108c34 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 8 Dec 2023 04:10:51 +0200 Subject: [PATCH 170/185] update version --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index ee85b83..b9936ac 100644 --- a/.env +++ b/.env @@ -48,7 +48,7 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 # YGGtracker # Application version, used for API and media cache -APP_VERSION=2.6.0 +APP_VERSION=2.6.1 # Application name APP_NAME=YGGtracker From 3c6b1d6ab76f05fad7fccd86df4fd403c44599a6 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 8 Dec 2023 20:06:47 +0200 Subject: [PATCH 171/185] allow markdown from whitelist only --- templates/default/torrent/info.html.twig | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index a7aadd9..2877ae7 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -238,9 +238,8 @@ {{ 'Source' | trans }} {% endif %} @@ -250,9 +249,8 @@ {{ 'Software' | trans }} {% endif %} @@ -262,9 +260,8 @@ {{ 'Comment' | trans }} {% endif %} From 2f4dbff90df52bacc5696fdafa7e8c6cbca1602a Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 8 Dec 2023 20:18:28 +0200 Subject: [PATCH 172/185] add trim filters --- templates/default/torrent/info.html.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index 2877ae7..87dcdb1 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -239,7 +239,7 @@ {% endif %} @@ -250,7 +250,7 @@ {% endif %} @@ -261,7 +261,7 @@ {% endif %} From 7eb02d06cce937e216c757d68e6be7079ce0d9b3 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 8 Dec 2023 20:18:53 +0200 Subject: [PATCH 173/185] update version --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index b9936ac..a580afb 100644 --- a/.env +++ b/.env @@ -48,7 +48,7 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 # YGGtracker # Application version, used for API and media cache -APP_VERSION=2.6.1 +APP_VERSION=2.6.2 # Application name APP_NAME=YGGtracker From 10181a04f1a77c50473d6fb71e431950175fbd68 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 10 Dec 2023 01:55:49 +0200 Subject: [PATCH 174/185] hide header description #32 --- templates/default/layout.html.twig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/default/layout.html.twig b/templates/default/layout.html.twig index b4c9100..99c0eeb 100644 --- a/templates/default/layout.html.twig +++ b/templates/default/layout.html.twig @@ -16,12 +16,14 @@
- + {#32
{{ 'Upload any torrent - download with Yggdrasil' | trans | format(path('torrent_submit')) | raw }}
+ #} {% block header_search %} {{ render(controller( 'App\\Controller\\SearchController::module', From bff196207195b4416e4c33dc3c829699d1cfacbb Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 10 Dec 2023 22:15:59 +0200 Subject: [PATCH 175/185] undefined variable --- src/Controller/SearchController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Controller/SearchController.php b/src/Controller/SearchController.php index caa3848..8cb63bc 100644 --- a/src/Controller/SearchController.php +++ b/src/Controller/SearchController.php @@ -24,6 +24,7 @@ class SearchController extends AbstractController // Defaults $locales = []; $categories = []; + $sensitive = []; // Request $query = $request->get('query') ? urldecode($request->get('query')) : ''; @@ -65,7 +66,7 @@ class SearchController extends AbstractController $keywords, [$locale], $request->get('categories') ? $request->get('categories') : $user->getCategories(), - $sensitive, + $request->get('sensitive') ? null : false, !$user->isModerator() ? true : null, !$user->isModerator() ? true : null, ) @@ -94,7 +95,7 @@ class SearchController extends AbstractController $keywords, $request->get('locales') ? $request->get('locales') : $user->getLocales(), [$category], - $sensitive, + $request->get('sensitive') ? null : false, !$user->isModerator() ? true : null, !$user->isModerator() ? true : null, ) From 6c775f822cb0a733df642e220af53c8ab72f840b Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 23 Dec 2023 07:56:54 +0200 Subject: [PATCH 176/185] fix torrent description filters --- templates/default/torrent/info.html.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index 87dcdb1..e915211 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -239,7 +239,7 @@
{% endif %} @@ -250,7 +250,7 @@ {% endif %} @@ -261,7 +261,7 @@ {% endif %} From e780c5b4b584e0e9c010cc1e72f293f5715a3efb Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 23 Dec 2023 08:18:25 +0200 Subject: [PATCH 177/185] fix description variables --- templates/default/torrent/info.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index e915211..dda2a72 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -239,7 +239,7 @@ {% endif %} @@ -250,7 +250,7 @@ {% endif %} From 95addf0c48502041c822c192a6c0d19e0344bc74 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 1 Feb 2024 16:59:14 +0200 Subject: [PATCH 178/185] add crawler --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index a580afb..a59ee2e 100644 --- a/.env +++ b/.env @@ -88,7 +88,7 @@ APP_POSTERS=1 APP_TRACKERS=http://[201:23b4:991a:634d:8359:4521:5576:15b7]:2023/announce|http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/announce|http://[316:c51a:62a3:8b9::5]/announce # List of crawlers where ignored in actions and activity features -APP_CRAWLERS=201:23b4:991a:634d:8359:4521:5576:15b7|30a:5fad::e|202:f2bc:f800:7cc4:c109:7857:5cae:6630 +APP_CRAWLERS=201:23b4:991a:634d:8359:4521:5576:15b7|30a:5fad::e|202:f2bc:f800:7cc4:c109:7857:5cae:6630|200:1554:e730:4030:605b:47be:6fb6:7b11 # Max torrent filesize for uploads (check upload_max_filesize in the php.ini) APP_TORRENT_FILE_SIZE_MAX=1024000 From 1281acea22225c5468bc2bfcd3811e7084af8b8f Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 5 Aug 2025 21:27:26 +0300 Subject: [PATCH 179/185] remove deprecated info --- README.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/README.md b/README.md index 5246d41..1e46e6d 100644 --- a/README.md +++ b/README.md @@ -85,15 +85,6 @@ git checkout main git checkout -b my-pr-branch-name ``` -#### Donate to contributors - -* @d47081: - - + ![wakatime](https://wakatime.com/badge/user/0b7fe6c1-b091-4c98-b930-75cfee17c7a5/project/059ec567-2c65-4c65-a48e-51dcc366f1a0.svg) - + [BTC](https://www.blockchain.com/explorer/addresses/btc/bc1qngdf2kwty6djjqpk0ynkpq9wmlrmtm7e0c534y) | [LTC](https://live.blockcypher.com/ltc/address/LUSiqzKsfB1vBLvpu515DZktG9ioKqLyj7) | [XMR](835gSR1Uvka19gnWPkU2pyRozZugRZSPHDuFL6YajaAqjEtMwSPr4jafM8idRuBWo7AWD3pwFQSYRMRW9XezqrK4BEXBgXE) | [ZEPH](ZEPHsADHXqnhfWhXrRcXnyBQMucE3NM7Ng5ZVB99XwA38PTnbjLKpCwcQVgoie8EJuWozKgBiTmDFW4iY7fNEgSEWyAy4dotqtX) - + Support our server by order [Linux VPS](https://www.yourserver.se/portal/aff.php?aff=610) - + Inspiration by [SomaFM Deep Space One](https://somafm.com/deepspaceone/) - #### License * Engine sources [MIT License](https://github.com/YGGverse/YGGtracker/blob/main/LICENSE) From 09811cd801207de20e935a0d0045ad7d1a4066c3 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 5 Aug 2025 21:30:28 +0300 Subject: [PATCH 180/185] add reference to btracker project --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 1e46e6d..c56d795 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,9 @@ YGGtracker is catalog, open tracker and social network with many features that a Engine uses IPv6 `0200::/7` addresses to identify users without registration. +> [!INFO] +> Take a look at [βtracker](https://github.com/yggverse/btracker) - the modern BitTorrent aggregation catalog written in Rust! + #### [Showcase](https://github.com/YGGverse/YGGtracker/wiki/Showcase) ![Pasted image 1](https://github.com/YGGverse/YGGtracker/assets/108541346/962f7850-01e1-4add-9dbe-c11b80108a75) From ee9b7be6ac14036a9e0f06649c18da45e2c60b47 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 5 Aug 2025 21:30:58 +0300 Subject: [PATCH 181/185] fix github markdown --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c56d795..349a917 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ YGGtracker is catalog, open tracker and social network with many features that a Engine uses IPv6 `0200::/7` addresses to identify users without registration. -> [!INFO] +> [!TIP] > Take a look at [βtracker](https://github.com/yggverse/btracker) - the modern BitTorrent aggregation catalog written in Rust! #### [Showcase](https://github.com/YGGverse/YGGtracker/wiki/Showcase) From 5a1ada42e70ace77f116e8462fe0d9f79f3aa3e5 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 5 Aug 2025 21:42:17 +0300 Subject: [PATCH 182/185] update readme --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 349a917..4bed054 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,14 @@ # YGGtracker -[![Crowdin](https://badges.crowdin.net/yggtracker/localized.svg)](https://crowdin.com/project/yggtracker) +> [!NOTE] +> Take a look at [βtracker](https://github.com/yggverse/btracker) - the modern aggregation alternative written in Rust! -BitTorrent Network for Yggdrasil +Social-oriented BitTorrent catalog for the [Yggdrasil network](https://github.com/yggdrasil-network) -YGGtracker is catalog, open tracker and social network with many features that allow to convert, filter and download any torrent in [Yggdrasil network](https://github.com/yggdrasil-network) by community. +YGGtracker is a manually operated catalog and social network that allows users to share their torrents in the local network. Engine uses IPv6 `0200::/7` addresses to identify users without registration. -> [!TIP] -> Take a look at [βtracker](https://github.com/yggverse/btracker) - the modern BitTorrent aggregation catalog written in Rust! - #### [Showcase](https://github.com/YGGverse/YGGtracker/wiki/Showcase) ![Pasted image 1](https://github.com/YGGverse/YGGtracker/assets/108541346/962f7850-01e1-4add-9dbe-c11b80108a75) @@ -73,7 +71,7 @@ Custom settings could be provided in the `/.env.local` file by overwriting defau #### Localization -Join community translations by [Crowdin](https://crowdin.com/project/yggtracker) +[![Crowdin](https://badges.crowdin.net/yggtracker/localized.svg)](https://crowdin.com/project/yggtracker) #### API From 7bcc52fcaec613f9c9200c5d8a72ccdeb6d25014 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 5 Aug 2025 21:44:31 +0300 Subject: [PATCH 183/185] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4bed054..375ea37 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ > [!NOTE] > Take a look at [βtracker](https://github.com/yggverse/btracker) - the modern aggregation alternative written in Rust! -Social-oriented BitTorrent catalog for the [Yggdrasil network](https://github.com/yggdrasil-network) +A social-oriented BitTorrent catalog for the [Yggdrasil](https://github.com/yggdrasil-network) network, written in the Symfony framework. YGGtracker is a manually operated catalog and social network that allows users to share their torrents in the local network. From 085e6174d91abd5cd8c32457a98b46f89166c0c2 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 5 Aug 2025 21:45:08 +0300 Subject: [PATCH 184/185] update readme --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 375ea37..544c7ba 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,7 @@ A social-oriented BitTorrent catalog for the [Yggdrasil](https://github.com/yggdrasil-network) network, written in the Symfony framework. -YGGtracker is a manually operated catalog and social network that allows users to share their torrents in the local network. - -Engine uses IPv6 `0200::/7` addresses to identify users without registration. +YGGtracker is a manually operated catalog and social network that allows users to share their torrents in the local network. Engine uses IPv6 `0200::/7` addresses to identify users without registration. #### [Showcase](https://github.com/YGGverse/YGGtracker/wiki/Showcase) From d72bda1e71266e3f7f1f83ba51aec1f11365709b Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 5 Aug 2025 21:46:49 +0300 Subject: [PATCH 185/185] remove deprecated info --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 544c7ba..6ab362a 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,6 @@ YGGtracker is a manually operated catalog and social network that allows users t ![Pasted image 1](https://github.com/YGGverse/YGGtracker/assets/108541346/962f7850-01e1-4add-9dbe-c11b80108a75) -#### Instances - -* `http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/` | [tracker.ygg](http://tracker.ygg) - + `ftp://[201:23b4:991a:634d:8359:4521:5576:15b7]:21/yggtracker/` - wanted torrents - #### Installation ```
@@ -90,19 +90,19 @@
- {{ 'Approved' | trans }} + {{ 'Enabled' | trans }} - {% if torrent.approved %} + {% if torrent.status %} {{ 'Yes' | trans }} - + {% else %} {{ 'No' | trans }} - + @@ -110,6 +110,30 @@ {% endif %}
+ {{ 'Approved' | trans }} + + {% if torrent.approved %} + {{ 'Yes' | trans }} + + + + + + {% else %} + {{ 'No' | trans }} + + + + + + {% endif %} +
diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 12cfcdc..c0824d8 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -39,6 +39,14 @@ {{ 'wanted' | trans }} {% endif %} + {% if torrent.status == false %} + + + + + + + {% endif %} {% if torrent.approved == false %} @@ -47,7 +55,7 @@ {% endif %} {% if torrent.sensitive == true %} - + diff --git a/templates/default/user/settings.html.twig b/templates/default/user/settings.html.twig index ad7fb65..857c555 100644 --- a/templates/default/user/settings.html.twig +++ b/templates/default/user/settings.html.twig @@ -65,34 +65,39 @@
- {{ 'Locales' | trans }} +
+ {{ 'Locales' | trans }} +
+ {% for locale in locales %} -
+
{% if locale in user.locales %} {% else %} {% endif %} -
{% endfor %}
- {{ 'Hide sensitive' | trans }} + + {{ 'Sensitive' | trans }} -
+
+
{% if user.sensitive %} - + {% else %} - + {% endif %} +
+ {{ group }} + {% for key, value in event %} - + {% if value in user.events %} {% else %} {% endif %} - @@ -136,10 +143,13 @@ {% if user.yggdrasil %} - + {% else %} - + {% endif %} +
+ {{ 'Posters' | trans }} + +
+ {% if user.posters %} + + {% else %} + + {% endif %} + +
+
{{ 'Search' | trans }} From 706ea40eecac7ac61ba1842065fcefdf27f89e08 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 30 Oct 2023 05:14:46 +0200 Subject: [PATCH 118/185] add poster event support #18 --- src/Controller/ActivityController.php | 213 ++++++++++++++++++ src/Controller/TorrentController.php | 14 -- src/Entity/Activity.php | 5 + src/Service/ActivityService.php | 203 +++++++++++++++++ .../event/torrent/poster/add.html.twig | 39 ++++ .../event/torrent/poster/add.rss.twig | 26 +++ .../torrent/poster/approve/add.html.twig | 39 ++++ .../event/torrent/poster/approve/add.rss.twig | 26 +++ .../torrent/poster/approve/delete.html.twig | 39 ++++ .../torrent/poster/approve/delete.rss.twig | 26 +++ .../event/torrent/poster/delete.html.twig | 39 ++++ .../event/torrent/poster/delete.rss.twig | 26 +++ 12 files changed, 681 insertions(+), 14 deletions(-) create mode 100644 templates/default/activity/event/torrent/poster/add.html.twig create mode 100644 templates/default/activity/event/torrent/poster/add.rss.twig create mode 100644 templates/default/activity/event/torrent/poster/approve/add.html.twig create mode 100644 templates/default/activity/event/torrent/poster/approve/add.rss.twig create mode 100644 templates/default/activity/event/torrent/poster/approve/delete.html.twig create mode 100644 templates/default/activity/event/torrent/poster/approve/delete.rss.twig create mode 100644 templates/default/activity/event/torrent/poster/delete.html.twig create mode 100644 templates/default/activity/event/torrent/poster/delete.rss.twig diff --git a/src/Controller/ActivityController.php b/src/Controller/ActivityController.php index 06bdec1..5bdec65 100644 --- a/src/Controller/ActivityController.php +++ b/src/Controller/ActivityController.php @@ -1329,6 +1329,219 @@ class ActivityController extends AbstractController break; + /// Torrent Poster + case $activity::EVENT_TORRENT_POSTER_ADD: + + // Init torrent + if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) + { + throw $this->createNotFoundException(); + } + + return $this->render( + 'default/activity/event/torrent/poster/add' . $extension, + [ + 'id' => $activity->getId(), + 'added' => $activity->getAdded(), + 'user' => + [ + 'id' => $activity->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $activity->getUserId() + )->getAddress() + ) + ], + 'torrent' => + [ + 'id' => $torrent->getId(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), + 'name' => $torrentService->readTorrentFileByTorrentId( + $torrent->getId() + )->getName(), + 'poster' => [ + 'id' => $activity->getData()['torrentPosterId'], + 'exist' => $torrentService->getTorrentPoster( + $activity->getData()['torrentPosterId'] // could be deleted by moderator, remove links + ) + ] + ], + 'session' => + [ + 'user' => + [ + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), + ] + ] + ] + ); + + break; + + case $activity::EVENT_TORRENT_POSTER_DELETE: + + // Init torrent + if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) + { + throw $this->createNotFoundException(); + } + + return $this->render( + 'default/activity/event/torrent/poster/delete' . $extension, + [ + 'id' => $activity->getId(), + 'added' => $activity->getAdded(), + 'user' => + [ + 'id' => $activity->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $activity->getUserId() + )->getAddress() + ) + ], + 'torrent' => + [ + 'id' => $torrent->getId(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), + 'name' => $torrentService->readTorrentFileByTorrentId( + $torrent->getId() + )->getName(), + 'poster' => [ + 'id' => $activity->getData()['torrentPosterId'], + 'exist' => $torrentService->getTorrentPoster( + $activity->getData()['torrentPosterId'] // could be deleted by moderator, remove links + ) + ] + ], + 'session' => + [ + 'user' => + [ + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), + ] + ] + ] + ); + + break; + + case $activity::EVENT_TORRENT_POSTER_APPROVE_ADD: + + // Init torrent + if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) + { + throw $this->createNotFoundException(); + } + + return $this->render( + 'default/activity/event/torrent/poster/approve/add' . $extension, + [ + 'id' => $activity->getId(), + 'added' => $activity->getAdded(), + 'user' => + [ + 'id' => $activity->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $activity->getUserId() + )->getAddress() + ) + ], + 'torrent' => + [ + 'id' => $torrent->getId(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), + 'name' => $torrentService->readTorrentFileByTorrentId( + $torrent->getId() + )->getName(), + 'poster' => [ + 'id' => $activity->getData()['torrentPosterId'], + 'exist' => $torrentService->getTorrentPoster( + $activity->getData()['torrentPosterId'] // could be deleted by moderator, remove links + ) + ] + ], + 'session' => + [ + 'user' => + [ + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), + ] + ] + ] + ); + + break; + + case $activity::EVENT_TORRENT_POSTER_APPROVE_DELETE: + + // Init torrent + if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) + { + throw $this->createNotFoundException(); + } + + return $this->render( + 'default/activity/event/torrent/poster/approve/delete' . $extension, + [ + 'id' => $activity->getId(), + 'added' => $activity->getAdded(), + 'user' => + [ + 'id' => $activity->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $activity->getUserId() + )->getAddress() + ) + ], + 'torrent' => + [ + 'id' => $torrent->getId(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), + 'name' => $torrentService->readTorrentFileByTorrentId( + $torrent->getId() + )->getName(), + 'poster' => [ + 'id' => $activity->getData()['torrentPosterId'], + 'exist' => $torrentService->getTorrentPoster( + $activity->getData()['torrentPosterId'] // could be deleted by moderator, remove links + ) + ] + ], + 'session' => + [ + 'user' => + [ + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), + ] + ] + ] + ); + + break; + /// Torrent star case $activity::EVENT_TORRENT_STAR_ADD: diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index f5c02d9..d4bb509 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -1979,14 +1979,12 @@ class TorrentController extends AbstractController ); // Add activity event - /* @TODO $activityService->addEventTorrentPosterAdd( $user->getId(), $torrent->getId(), time(), $torrentPoster->getId() ); - */ // Redirect to info page created return $this->redirectToRoute( @@ -2068,26 +2066,22 @@ class TorrentController extends AbstractController // Add activity event if (!$torrentPoster->isApproved()) { - /* @TODO $activityService->addEventTorrentPosterApproveAdd( $user->getId(), $torrent->getId(), time(), $torrentPoster->getId() ); - */ } else { - /* @TODO $activityService->addEventTorrentPosterApproveDelete( $user->getId(), $torrent->getId(), time(), $torrentPoster->getId() ); - */ } // Update approved @@ -2157,14 +2151,12 @@ class TorrentController extends AbstractController } // Add activity event - /* @TODO $activityService->addEventTorrentPosterDelete( $user->getId(), $torrent->getId(), time(), $torrentPoster->getId() ); - */ // Update approved $torrentService->deleteTorrentPoster( @@ -2182,12 +2174,6 @@ class TorrentController extends AbstractController ); } - - - - - - // Torrent star #[Route( '/{_locale}/torrent/{torrentId}/star/toggle', diff --git a/src/Entity/Activity.php b/src/Entity/Activity.php index 233ab46..1102a03 100644 --- a/src/Entity/Activity.php +++ b/src/Entity/Activity.php @@ -62,6 +62,11 @@ class Activity public const EVENT_TORRENT_STATUS_ADD = 1800; public const EVENT_TORRENT_STATUS_DELETE = 1801; + public const EVENT_TORRENT_POSTER_ADD = 2800; + public const EVENT_TORRENT_POSTER_DELETE = 2801; + public const EVENT_TORRENT_POSTER_APPROVE_ADD = 2810; + public const EVENT_TORRENT_POSTER_APPROVE_DELETE = 2811; + // ... #[ORM\Column] diff --git a/src/Service/ActivityService.php b/src/Service/ActivityService.php index d7dfb5a..89c99e7 100644 --- a/src/Service/ActivityService.php +++ b/src/Service/ActivityService.php @@ -56,6 +56,11 @@ class ActivityService Activity::EVENT_TORRENT_SENSITIVE_APPROVE_ADD, Activity::EVENT_TORRENT_SENSITIVE_APPROVE_DELETE, + Activity::EVENT_TORRENT_POSTER_ADD, + Activity::EVENT_TORRENT_POSTER_DELETE, + Activity::EVENT_TORRENT_POSTER_APPROVE_ADD, + Activity::EVENT_TORRENT_POSTER_APPROVE_DELETE, + Activity::EVENT_TORRENT_STAR_ADD, Activity::EVENT_TORRENT_STAR_DELETE, @@ -321,6 +326,55 @@ class ActivityService break; + /// Torrent poster + case Activity::EVENT_TORRENT_POSTER_ADD: + + $events + [ + $this->translatorInterface->trans('Torrent poster') + ] + [ + $this->translatorInterface->trans('Added') + ] = $code; + + break; + + case Activity::EVENT_TORRENT_POSTER_DELETE: + + $events + [ + $this->translatorInterface->trans('Torrent poster') + ] + [ + $this->translatorInterface->trans('Deleted') + ] = $code; + + break; + + case Activity::EVENT_TORRENT_POSTER_APPROVE_ADD: + + $events + [ + $this->translatorInterface->trans('Torrent poster') + ] + [ + $this->translatorInterface->trans('Approved') + ] = $code; + + break; + + case Activity::EVENT_TORRENT_POSTER_APPROVE_DELETE: + + $events + [ + $this->translatorInterface->trans('Torrent poster') + ] + [ + $this->translatorInterface->trans('Disapproved') + ] = $code; + + break; + /// Torrent stars case Activity::EVENT_TORRENT_STAR_ADD: @@ -1397,4 +1451,153 @@ class ActivityService return $activity; } + + /// Torrent poster + public function addEventTorrentPosterAdd( + int $userId, + int $torrentId, + int $added, + int $torrentPosterId, + ): ?Activity + { + $activity = new Activity(); + + $activity->setEvent( + Activity::EVENT_TORRENT_POSTER_ADD + ); + + $activity->setUserId( + $userId + ); + + $activity->setTorrentId( + $torrentId + ); + + $activity->setAdded( + $added + ); + + $activity->setData( + [ + 'torrentPosterId' => $torrentPosterId + ] + ); + + $this->entityManagerInterface->persist($activity); + $this->entityManagerInterface->flush(); + + return $activity; + } + + public function addEventTorrentPosterDelete( + int $userId, + int $torrentId, + int $added, + int $torrentPosterId, + ): ?Activity + { + $activity = new Activity(); + + $activity->setEvent( + Activity::EVENT_TORRENT_POSTER_DELETE + ); + + $activity->setUserId( + $userId + ); + + $activity->setTorrentId( + $torrentId + ); + + $activity->setAdded( + $added + ); + + $activity->setData( + [ + 'torrentPosterId' => $torrentPosterId + ] + ); + + $this->entityManagerInterface->persist($activity); + $this->entityManagerInterface->flush(); + + return $activity; + } + + public function addEventTorrentPosterApproveAdd( + int $userId, + int $torrentId, + int $added, + int $torrentPosterId, + ): ?Activity + { + $activity = new Activity(); + + $activity->setEvent( + Activity::EVENT_TORRENT_POSTER_APPROVE_ADD + ); + + $activity->setUserId( + $userId + ); + + $activity->setTorrentId( + $torrentId + ); + + $activity->setAdded( + $added + ); + + $activity->setData( + [ + 'torrentPosterId' => $torrentPosterId + ] + ); + + $this->entityManagerInterface->persist($activity); + $this->entityManagerInterface->flush(); + + return $activity; + } + + public function addEventTorrentPosterApproveDelete( + int $userId, + int $torrentId, + int $added, + int $torrentPosterId, + ): ?Activity + { + $activity = new Activity(); + + $activity->setEvent( + Activity::EVENT_TORRENT_POSTER_APPROVE_DELETE + ); + + $activity->setUserId( + $userId + ); + + $activity->setTorrentId( + $torrentId + ); + + $activity->setAdded( + $added + ); + + $activity->setData( + [ + 'torrentPosterId' => $torrentPosterId + ] + ); + + $this->entityManagerInterface->persist($activity); + $this->entityManagerInterface->flush(); + + return $activity; + } } \ No newline at end of file diff --git a/templates/default/activity/event/torrent/poster/add.html.twig b/templates/default/activity/event/torrent/poster/add.html.twig new file mode 100644 index 0000000..519a6f0 --- /dev/null +++ b/templates/default/activity/event/torrent/poster/add.html.twig @@ -0,0 +1,39 @@ +
+
+ + {{ 'identicon' | trans }} + + {{ 'have added poster edition' | trans }} + {% if torrent.poster.exist %} + + #{{ torrent.poster.id }} + + {% else %} + #{{ torrent.poster.id }} + {% endif %} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + + {{ torrent.name }} + + {% if torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% endif %} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} + {% else %} + + {{ torrent.name }} + + {% endif %} + {% endif %} +
+
+ {{ added | format_ago }} +
+
\ No newline at end of file diff --git a/templates/default/activity/event/torrent/poster/add.rss.twig b/templates/default/activity/event/torrent/poster/add.rss.twig new file mode 100644 index 0000000..348e851 --- /dev/null +++ b/templates/default/activity/event/torrent/poster/add.rss.twig @@ -0,0 +1,26 @@ + + + {{ 'User' | trans }} + #{{ user.id }} + {{ 'have added poster edition' | trans }} + #{{ torrent.poster.id }} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + {{ torrent.name }} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} + {% else %} + {{ torrent.name }} + {% endif %} + {% endif %} + + #{{ user.id }} + {{ added | date('D, d M Y h:i:s O') }} + {{ url('torrent_poster_edit', { torrentId : torrent.id, torrentPosterId : torrent.poster.id }) }}#activity-{{ id }} + {{ url('torrent_poster_edit', { torrentId : torrent.id, torrentPosterId : torrent.poster.id }) }}#activity + \ No newline at end of file diff --git a/templates/default/activity/event/torrent/poster/approve/add.html.twig b/templates/default/activity/event/torrent/poster/approve/add.html.twig new file mode 100644 index 0000000..35685c0 --- /dev/null +++ b/templates/default/activity/event/torrent/poster/approve/add.html.twig @@ -0,0 +1,39 @@ +
+
+ + {{ 'identicon' | trans }} + + {{ 'have approved poster edition' | trans }} + {% if torrent.poster.exist %} + + #{{ torrent.poster.id }} + + {% else %} + #{{ torrent.poster.id }} + {% endif %} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + + {{ torrent.name }} + + {% if torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% endif %} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} + {% else %} + + {{ torrent.name }} + + {% endif %} + {% endif %} +
+
+ {{ added | format_ago }} +
+
\ No newline at end of file diff --git a/templates/default/activity/event/torrent/poster/approve/add.rss.twig b/templates/default/activity/event/torrent/poster/approve/add.rss.twig new file mode 100644 index 0000000..3a75b3d --- /dev/null +++ b/templates/default/activity/event/torrent/poster/approve/add.rss.twig @@ -0,0 +1,26 @@ + + + {{ 'User' | trans }} + #{{ user.id }} + {{ 'have approved poster edition' | trans }} + #{{ torrent.poster.id }} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + {{ torrent.name }} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} + {% else %} + {{ torrent.name }} + {% endif %} + {% endif %} + + #{{ user.id }} + {{ added | date('D, d M Y h:i:s O') }} + {{ url('torrent_poster_edit', { torrentId : torrent.id, torrentPosterId : torrent.poster.id }) }}#activity-{{ id }} + {{ url('torrent_poster_edit', { torrentId : torrent.id, torrentPosterId : torrent.poster.id }) }}#activity + \ No newline at end of file diff --git a/templates/default/activity/event/torrent/poster/approve/delete.html.twig b/templates/default/activity/event/torrent/poster/approve/delete.html.twig new file mode 100644 index 0000000..483a79f --- /dev/null +++ b/templates/default/activity/event/torrent/poster/approve/delete.html.twig @@ -0,0 +1,39 @@ +
+
+ + {{ 'identicon' | trans }} + + {{ 'have disapproved poster edition' | trans }} + {% if torrent.poster.exist %} + + #{{ torrent.poster.id }} + + {% else %} + #{{ torrent.poster.id }} + {% endif %} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + + {{ torrent.name }} + + {% if torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% endif %} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} + {% else %} + + {{ torrent.name }} + + {% endif %} + {% endif %} +
+
+ {{ added | format_ago }} +
+
\ No newline at end of file diff --git a/templates/default/activity/event/torrent/poster/approve/delete.rss.twig b/templates/default/activity/event/torrent/poster/approve/delete.rss.twig new file mode 100644 index 0000000..42d6527 --- /dev/null +++ b/templates/default/activity/event/torrent/poster/approve/delete.rss.twig @@ -0,0 +1,26 @@ + + + {{ 'User' | trans }} + #{{ user.id }} + {{ 'have disapproved poster edition' | trans }} + #{{ torrent.poster.id }} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + {{ torrent.name }} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} + {% else %} + {{ torrent.name }} + {% endif %} + {% endif %} + + #{{ user.id }} + {{ added | date('D, d M Y h:i:s O') }} + {{ url('torrent_poster_edit', { torrentId : torrent.id, torrentPosterId : torrent.poster.id }) }}#activity-{{ id }} + {{ url('torrent_poster_edit', { torrentId : torrent.id, torrentPosterId : torrent.poster.id }) }}#activity + \ No newline at end of file diff --git a/templates/default/activity/event/torrent/poster/delete.html.twig b/templates/default/activity/event/torrent/poster/delete.html.twig new file mode 100644 index 0000000..1b920a7 --- /dev/null +++ b/templates/default/activity/event/torrent/poster/delete.html.twig @@ -0,0 +1,39 @@ +
+
+ + {{ 'identicon' | trans }} + + {{ 'have deleted poster edition' | trans }} + {% if torrent.poster.exist %} + + #{{ torrent.poster.id }} + + {% else %} + #{{ torrent.sensitive.id }} + {% endif %} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + + {{ torrent.name }} + + {% if torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% endif %} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} + {% else %} + + {{ torrent.name }} + + {% endif %} + {% endif %} +
+
+ {{ added | format_ago }} +
+
\ No newline at end of file diff --git a/templates/default/activity/event/torrent/poster/delete.rss.twig b/templates/default/activity/event/torrent/poster/delete.rss.twig new file mode 100644 index 0000000..4b7bf6a --- /dev/null +++ b/templates/default/activity/event/torrent/poster/delete.rss.twig @@ -0,0 +1,26 @@ + + + {{ 'User' | trans }} + #{{ user.id }} + {{ 'have deleted poster edition' | trans }} + #{{ torrent.poster.id }} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + {{ torrent.name }} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} + {% else %} + {{ torrent.name }} + {% endif %} + {% endif %} + + #{{ user.id }} + {{ added | date('D, d M Y h:i:s O') }} + {{ url('torrent_poster_edit', { torrentId : torrent.id }) }}#activity-{{ id }} + {{ url('torrent_poster_edit', { torrentId : torrent.id }) }}#activity + \ No newline at end of file From 1b8deb439b89ce20d30fe89b48bdb886a746ad60 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 30 Oct 2023 05:36:01 +0200 Subject: [PATCH 119/185] update strings translation #18 --- translations/messages+intl-icu.cs.xlf | 48 +++++++++++++++++++++++++++ translations/messages+intl-icu.de.xlf | 48 +++++++++++++++++++++++++++ translations/messages+intl-icu.en.xlf | 48 +++++++++++++++++++++++++++ translations/messages+intl-icu.eo.xlf | 48 +++++++++++++++++++++++++++ translations/messages+intl-icu.es.xlf | 48 +++++++++++++++++++++++++++ translations/messages+intl-icu.fr.xlf | 48 +++++++++++++++++++++++++++ translations/messages+intl-icu.he.xlf | 48 +++++++++++++++++++++++++++ translations/messages+intl-icu.it.xlf | 48 +++++++++++++++++++++++++++ translations/messages+intl-icu.ka.xlf | 48 +++++++++++++++++++++++++++ translations/messages+intl-icu.lv.xlf | 48 +++++++++++++++++++++++++++ translations/messages+intl-icu.nl.xlf | 48 +++++++++++++++++++++++++++ translations/messages+intl-icu.pl.xlf | 48 +++++++++++++++++++++++++++ translations/messages+intl-icu.pt.xlf | 48 +++++++++++++++++++++++++++ translations/messages+intl-icu.ru.xlf | 48 +++++++++++++++++++++++++++ translations/messages+intl-icu.uk.xlf | 48 +++++++++++++++++++++++++++ 15 files changed, 720 insertions(+) diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index 933e632..a2923f7 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -737,6 +737,54 @@ disabled disabled + + Torrent poster + Torrent poster + + + Poster file out of size limit + Poster file out of size limit + + + Image file not supported + Image file not supported + + + Poster file required + Poster file required + + + Edit torrent poster + Edit torrent poster + + + Edit poster for torrent + Edit poster for torrent + + + Poster + Poster + + + Posters + Posters + + + have deleted poster edition + have deleted poster edition + + + have disapproved poster edition + have disapproved poster edition + + + have approved poster edition + have approved poster edition + + + have added poster edition + have added poster edition + diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index 449e2f8..2d2c5e6 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -737,6 +737,54 @@ disabled disabled + + Torrent poster + Torrent poster + + + Poster file out of size limit + Poster file out of size limit + + + Image file not supported + Image file not supported + + + Poster file required + Poster file required + + + Edit torrent poster + Edit torrent poster + + + Edit poster for torrent + Edit poster for torrent + + + Poster + Poster + + + Posters + Posters + + + have deleted poster edition + have deleted poster edition + + + have disapproved poster edition + have disapproved poster edition + + + have approved poster edition + have approved poster edition + + + have added poster edition + have added poster edition + diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index d3e21bd..8f5cbac 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -737,6 +737,54 @@ disabled disabled + + Torrent poster + Torrent poster + + + Poster file out of size limit + Poster file out of size limit + + + Image file not supported + Image file not supported + + + Poster file required + Poster file required + + + Edit torrent poster + Edit torrent poster + + + Edit poster for torrent + Edit poster for torrent + + + Poster + Poster + + + Posters + Posters + + + have deleted poster edition + have deleted poster edition + + + have disapproved poster edition + have disapproved poster edition + + + have approved poster edition + have approved poster edition + + + have added poster edition + have added poster edition + diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index 8745b05..9c608d5 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -737,6 +737,54 @@ disabled disabled + + Torrent poster + Torrent poster + + + Poster file out of size limit + Poster file out of size limit + + + Image file not supported + Image file not supported + + + Poster file required + Poster file required + + + Edit torrent poster + Edit torrent poster + + + Edit poster for torrent + Edit poster for torrent + + + Poster + Poster + + + Posters + Posters + + + have deleted poster edition + have deleted poster edition + + + have disapproved poster edition + have disapproved poster edition + + + have approved poster edition + have approved poster edition + + + have added poster edition + have added poster edition + diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index 71ce44b..4ec3a15 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -737,6 +737,54 @@ disabled disabled + + Torrent poster + Torrent poster + + + Poster file out of size limit + Poster file out of size limit + + + Image file not supported + Image file not supported + + + Poster file required + Poster file required + + + Edit torrent poster + Edit torrent poster + + + Edit poster for torrent + Edit poster for torrent + + + Poster + Poster + + + Posters + Posters + + + have deleted poster edition + have deleted poster edition + + + have disapproved poster edition + have disapproved poster edition + + + have approved poster edition + have approved poster edition + + + have added poster edition + have added poster edition + diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index db0cd5c..5a629ab 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -737,6 +737,54 @@ disabled disabled + + Torrent poster + Torrent poster + + + Poster file out of size limit + Poster file out of size limit + + + Image file not supported + Image file not supported + + + Poster file required + Poster file required + + + Edit torrent poster + Edit torrent poster + + + Edit poster for torrent + Edit poster for torrent + + + Poster + Poster + + + Posters + Posters + + + have deleted poster edition + have deleted poster edition + + + have disapproved poster edition + have disapproved poster edition + + + have approved poster edition + have approved poster edition + + + have added poster edition + have added poster edition + diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index 259eb03..7456447 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -737,6 +737,54 @@ disabled disabled + + Torrent poster + Torrent poster + + + Poster file out of size limit + Poster file out of size limit + + + Image file not supported + Image file not supported + + + Poster file required + Poster file required + + + Edit torrent poster + Edit torrent poster + + + Edit poster for torrent + Edit poster for torrent + + + Poster + Poster + + + Posters + Posters + + + have deleted poster edition + have deleted poster edition + + + have disapproved poster edition + have disapproved poster edition + + + have approved poster edition + have approved poster edition + + + have added poster edition + have added poster edition + diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index 9a26fd3..94deac0 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -737,6 +737,54 @@ disabled disabled + + Torrent poster + Torrent poster + + + Poster file out of size limit + Poster file out of size limit + + + Image file not supported + Image file not supported + + + Poster file required + Poster file required + + + Edit torrent poster + Edit torrent poster + + + Edit poster for torrent + Edit poster for torrent + + + Poster + Poster + + + Posters + Posters + + + have deleted poster edition + have deleted poster edition + + + have disapproved poster edition + have disapproved poster edition + + + have approved poster edition + have approved poster edition + + + have added poster edition + have added poster edition + diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index 8b3eb39..3f88c2f 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -737,6 +737,54 @@ disabled disabled + + Torrent poster + Torrent poster + + + Poster file out of size limit + Poster file out of size limit + + + Image file not supported + Image file not supported + + + Poster file required + Poster file required + + + Edit torrent poster + Edit torrent poster + + + Edit poster for torrent + Edit poster for torrent + + + Poster + Poster + + + Posters + Posters + + + have deleted poster edition + have deleted poster edition + + + have disapproved poster edition + have disapproved poster edition + + + have approved poster edition + have approved poster edition + + + have added poster edition + have added poster edition + diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index 6822945..cd818ad 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -737,6 +737,54 @@ disabled disabled + + Torrent poster + Torrent poster + + + Poster file out of size limit + Poster file out of size limit + + + Image file not supported + Image file not supported + + + Poster file required + Poster file required + + + Edit torrent poster + Edit torrent poster + + + Edit poster for torrent + Edit poster for torrent + + + Poster + Poster + + + Posters + Posters + + + have deleted poster edition + have deleted poster edition + + + have disapproved poster edition + have disapproved poster edition + + + have approved poster edition + have approved poster edition + + + have added poster edition + have added poster edition + diff --git a/translations/messages+intl-icu.nl.xlf b/translations/messages+intl-icu.nl.xlf index a1e2e4b..30aeb5d 100644 --- a/translations/messages+intl-icu.nl.xlf +++ b/translations/messages+intl-icu.nl.xlf @@ -737,6 +737,54 @@ disabled disabled + + Torrent poster + Torrent poster + + + Poster file out of size limit + Poster file out of size limit + + + Image file not supported + Image file not supported + + + Poster file required + Poster file required + + + Edit torrent poster + Edit torrent poster + + + Edit poster for torrent + Edit poster for torrent + + + Poster + Poster + + + Posters + Posters + + + have deleted poster edition + have deleted poster edition + + + have disapproved poster edition + have disapproved poster edition + + + have approved poster edition + have approved poster edition + + + have added poster edition + have added poster edition + diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index a03fc20..122f6a8 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -737,6 +737,54 @@ disabled disabled + + Torrent poster + Torrent poster + + + Poster file out of size limit + Poster file out of size limit + + + Image file not supported + Image file not supported + + + Poster file required + Poster file required + + + Edit torrent poster + Edit torrent poster + + + Edit poster for torrent + Edit poster for torrent + + + Poster + Poster + + + Posters + Posters + + + have deleted poster edition + have deleted poster edition + + + have disapproved poster edition + have disapproved poster edition + + + have approved poster edition + have approved poster edition + + + have added poster edition + have added poster edition + diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index f70bf14..014ba81 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -737,6 +737,54 @@ disabled disabled + + Torrent poster + Torrent poster + + + Poster file out of size limit + Poster file out of size limit + + + Image file not supported + Image file not supported + + + Poster file required + Poster file required + + + Edit torrent poster + Edit torrent poster + + + Edit poster for torrent + Edit poster for torrent + + + Poster + Poster + + + Posters + Posters + + + have deleted poster edition + have deleted poster edition + + + have disapproved poster edition + have disapproved poster edition + + + have approved poster edition + have approved poster edition + + + have added poster edition + have added poster edition + diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index 5a27f8b..f708ded 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -737,6 +737,54 @@ disabled отключено + + Torrent poster + Постер торрента + + + Poster file out of size limit + Размер файла постера превышает максимальный размер + + + Image file not supported + Формат изображения не поддерживается + + + Poster file required + Требуется указать файл постера + + + Edit torrent poster + Редактировать постер торрента + + + Edit poster for torrent + Редактировать постер для торрента + + + Poster + Постер + + + Posters + Постеры + + + have deleted poster edition + удалил редакцию постера + + + have disapproved poster edition + отклонил редакцию постера + + + have approved poster edition + утвердил редакцию постера + + + have added poster edition + добавил редакцию постера + diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 43f735c..6360fc9 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -737,6 +737,54 @@ disabled вимкнено + + Torrent poster + Постер торента + + + Poster file out of size limit + Розмір файлу постера перевищує ліміти + + + Image file not supported + Формат зображення не підтримується + + + Poster file required + Необхідно вказати файл постера + + + Edit torrent poster + Редагувати постер торента + + + Edit poster for torrent + Редагувати постер для торента + + + Poster + Постер + + + Posters + Постери + + + have deleted poster edition + видалив редакцію постера + + + have disapproved poster edition + відхилив редакцію постера + + + have approved poster edition + додав редакцію постера + + + have added poster edition + додав редакцію постера + From ed3803df95f3f38c2ca9122ec9408b30e83943b6 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 30 Oct 2023 05:37:26 +0200 Subject: [PATCH 120/185] update version --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 7864012..9d51a78 100644 --- a/.env +++ b/.env @@ -48,7 +48,7 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 # YGGtracker # Application version, used for API and media cache -APP_VERSION='2.3.0' +APP_VERSION='2.4.0' # Application name APP_NAME=YGGtracker From 8742c91f9fe8a5584dc018bc18eb53e4b2f397a5 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 30 Oct 2023 07:00:38 +0200 Subject: [PATCH 121/185] fix poster sub-directories initiation #18 --- src/Service/TorrentService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index 90ea870..1424848 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -293,7 +293,7 @@ class TorrentService public function getStorageFilepathByTorrentPosterId(int $torrentPosterId): string { return sprintf( - '%s/var/posters/%s', + '%s/var/posters/%s.original', $this->kernelInterface->getProjectDir(), implode('/', str_split($torrentPosterId)) ); @@ -302,7 +302,7 @@ class TorrentService public function getStorageFilepathByTorrentId(int $torrentId): string { return sprintf( - '%s/var/torrents/%s.torrent', // @TODO remove extension as not required in background storage + '%s/var/torrents/%s.torrent', $this->kernelInterface->getProjectDir(), implode('/', str_split($torrentId)) ); From 99ea7976997d123e3fa1ddd84f49feb13115671e Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 30 Oct 2023 19:12:09 +0200 Subject: [PATCH 122/185] fix torrent poster update on last poster delete #18 --- src/Service/TorrentService.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index 1424848..1e52555 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -1209,10 +1209,17 @@ class TorrentService $torrent->setTorrentPosterId( $torrentPoster->getId() ); - - $this->entityManagerInterface->persist($torrent); - $this->entityManagerInterface->flush(); } + + else + { + $torrent->setTorrentPosterId( + null + ); + } + + $this->entityManagerInterface->persist($torrent); + $this->entityManagerInterface->flush(); } } From 446da9eb0bab53f0d1a59ac7399962ddee29ee5e Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 30 Oct 2023 19:32:58 +0200 Subject: [PATCH 123/185] fix method data type #18 --- src/Entity/Torrent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Entity/Torrent.php b/src/Entity/Torrent.php index 0252a8e..e29c448 100644 --- a/src/Entity/Torrent.php +++ b/src/Entity/Torrent.php @@ -215,7 +215,7 @@ class Torrent return $this->torrentPosterId; } - public function setTorrentPosterId(int $torrentPosterId): static + public function setTorrentPosterId(?int $torrentPosterId): static { $this->torrentPosterId = $torrentPosterId; From cef76daa497d11f7968fe1a4cff96a619b809e77 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 30 Oct 2023 19:40:49 +0200 Subject: [PATCH 124/185] fix deleted event id info #18 --- .../default/activity/event/torrent/poster/delete.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/activity/event/torrent/poster/delete.html.twig b/templates/default/activity/event/torrent/poster/delete.html.twig index 1b920a7..c3c7293 100644 --- a/templates/default/activity/event/torrent/poster/delete.html.twig +++ b/templates/default/activity/event/torrent/poster/delete.html.twig @@ -9,7 +9,7 @@ #{{ torrent.poster.id }} {% else %} - #{{ torrent.sensitive.id }} + #{{ torrent.poster.id }} {% endif %} {{ 'for torrent' | trans }} {% if session.user.moderator or session.user.owner %} From cfeeabee7236feaf7122f3e5d38126840abb58c5 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 30 Oct 2023 21:04:11 +0200 Subject: [PATCH 125/185] fix posters event translation #18 --- src/Service/ActivityService.php | 8 ++++---- translations/messages+intl-icu.cs.xlf | 8 ++++---- translations/messages+intl-icu.de.xlf | 8 ++++---- translations/messages+intl-icu.en.xlf | 8 ++++---- translations/messages+intl-icu.eo.xlf | 8 ++++---- translations/messages+intl-icu.es.xlf | 8 ++++---- translations/messages+intl-icu.fr.xlf | 8 ++++---- translations/messages+intl-icu.he.xlf | 8 ++++---- translations/messages+intl-icu.it.xlf | 8 ++++---- translations/messages+intl-icu.ka.xlf | 8 ++++---- translations/messages+intl-icu.lv.xlf | 8 ++++---- translations/messages+intl-icu.nl.xlf | 8 ++++---- translations/messages+intl-icu.pl.xlf | 8 ++++---- translations/messages+intl-icu.pt.xlf | 8 ++++---- translations/messages+intl-icu.ru.xlf | 8 ++++---- translations/messages+intl-icu.uk.xlf | 8 ++++---- 16 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/Service/ActivityService.php b/src/Service/ActivityService.php index 89c99e7..75b37e8 100644 --- a/src/Service/ActivityService.php +++ b/src/Service/ActivityService.php @@ -331,7 +331,7 @@ class ActivityService $events [ - $this->translatorInterface->trans('Torrent poster') + $this->translatorInterface->trans('Torrent posters') ] [ $this->translatorInterface->trans('Added') @@ -343,7 +343,7 @@ class ActivityService $events [ - $this->translatorInterface->trans('Torrent poster') + $this->translatorInterface->trans('Torrent posters') ] [ $this->translatorInterface->trans('Deleted') @@ -355,7 +355,7 @@ class ActivityService $events [ - $this->translatorInterface->trans('Torrent poster') + $this->translatorInterface->trans('Torrent posters') ] [ $this->translatorInterface->trans('Approved') @@ -367,7 +367,7 @@ class ActivityService $events [ - $this->translatorInterface->trans('Torrent poster') + $this->translatorInterface->trans('Torrent posters') ] [ $this->translatorInterface->trans('Disapproved') diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index a2923f7..0e6b880 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -737,10 +737,6 @@ disabled disabled - - Torrent poster - Torrent poster - Poster file out of size limit Poster file out of size limit @@ -785,6 +781,10 @@ have added poster edition have added poster edition + + Torrent posters + Torrent posters + diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index 2d2c5e6..e054970 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -737,10 +737,6 @@ disabled disabled - - Torrent poster - Torrent poster - Poster file out of size limit Poster file out of size limit @@ -785,6 +781,10 @@ have added poster edition have added poster edition + + Torrent posters + Torrent posters + diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index 8f5cbac..40887c2 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -737,10 +737,6 @@ disabled disabled - - Torrent poster - Torrent poster - Poster file out of size limit Poster file out of size limit @@ -785,6 +781,10 @@ have added poster edition have added poster edition + + Torrent posters + Torrent posters + diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index 9c608d5..5588b10 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -737,10 +737,6 @@ disabled disabled - - Torrent poster - Torrent poster - Poster file out of size limit Poster file out of size limit @@ -785,6 +781,10 @@ have added poster edition have added poster edition + + Torrent posters + Torrent posters + diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index 4ec3a15..a671f50 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -737,10 +737,6 @@ disabled disabled - - Torrent poster - Torrent poster - Poster file out of size limit Poster file out of size limit @@ -785,6 +781,10 @@ have added poster edition have added poster edition + + Torrent posters + Torrent posters + diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index 5a629ab..15523b2 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -737,10 +737,6 @@ disabled disabled - - Torrent poster - Torrent poster - Poster file out of size limit Poster file out of size limit @@ -785,6 +781,10 @@ have added poster edition have added poster edition + + Torrent posters + Torrent posters + diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index 7456447..94c676e 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -737,10 +737,6 @@ disabled disabled - - Torrent poster - Torrent poster - Poster file out of size limit Poster file out of size limit @@ -785,6 +781,10 @@ have added poster edition have added poster edition + + Torrent posters + Torrent posters + diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index 94deac0..3bdedf9 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -737,10 +737,6 @@ disabled disabled - - Torrent poster - Torrent poster - Poster file out of size limit Poster file out of size limit @@ -785,6 +781,10 @@ have added poster edition have added poster edition + + Torrent posters + Torrent posters + diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index 3f88c2f..fae2e18 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -737,10 +737,6 @@ disabled disabled - - Torrent poster - Torrent poster - Poster file out of size limit Poster file out of size limit @@ -785,6 +781,10 @@ have added poster edition have added poster edition + + Torrent posters + Torrent posters + diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index cd818ad..258d87a 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -737,10 +737,6 @@ disabled disabled - - Torrent poster - Torrent poster - Poster file out of size limit Poster file out of size limit @@ -785,6 +781,10 @@ have added poster edition have added poster edition + + Torrent posters + Torrent posters + diff --git a/translations/messages+intl-icu.nl.xlf b/translations/messages+intl-icu.nl.xlf index 30aeb5d..61fc25e 100644 --- a/translations/messages+intl-icu.nl.xlf +++ b/translations/messages+intl-icu.nl.xlf @@ -737,10 +737,6 @@ disabled disabled - - Torrent poster - Torrent poster - Poster file out of size limit Poster file out of size limit @@ -785,6 +781,10 @@ have added poster edition have added poster edition + + Torrent posters + Torrent posters + diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index 122f6a8..62c2af8 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -737,10 +737,6 @@ disabled disabled - - Torrent poster - Torrent poster - Poster file out of size limit Poster file out of size limit @@ -785,6 +781,10 @@ have added poster edition have added poster edition + + Torrent posters + Torrent posters + diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index 014ba81..aff889c 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -737,10 +737,6 @@ disabled disabled - - Torrent poster - Torrent poster - Poster file out of size limit Poster file out of size limit @@ -785,6 +781,10 @@ have added poster edition have added poster edition + + Torrent posters + Torrent posters + diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index f708ded..7024d07 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -737,10 +737,6 @@ disabled отключено - - Torrent poster - Постер торрента - Poster file out of size limit Размер файла постера превышает максимальный размер @@ -785,6 +781,10 @@ have added poster edition добавил редакцию постера + + Torrent posters + Постеры торрентов + diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 6360fc9..dc81dee 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -737,10 +737,6 @@ disabled вимкнено - - Torrent poster - Постер торента - Poster file out of size limit Розмір файлу постера перевищує ліміти @@ -785,6 +781,10 @@ have added poster edition додав редакцію постера + + Torrent posters + Постери торентів + From 5c76a17df5c1f1538287c7dc4411463fe038f15c Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 31 Oct 2023 02:06:58 +0200 Subject: [PATCH 126/185] implement poster position settings #18 --- migrations/Version20231030225418.php | 31 +++++++ public/asset/default/css/framework.css | 4 - src/Controller/TorrentController.php | 92 +++++++++++++++---- src/Entity/TorrentPoster.php | 15 +++ src/Service/TorrentService.php | 2 + .../default/torrent/edit/poster.html.twig | 43 ++++++++- templates/default/torrent/info.html.twig | 2 +- templates/default/torrent/list.html.twig | 2 +- translations/messages+intl-icu.cs.xlf | 12 +++ translations/messages+intl-icu.de.xlf | 12 +++ translations/messages+intl-icu.en.xlf | 12 +++ translations/messages+intl-icu.eo.xlf | 12 +++ translations/messages+intl-icu.es.xlf | 12 +++ translations/messages+intl-icu.fr.xlf | 12 +++ translations/messages+intl-icu.he.xlf | 12 +++ translations/messages+intl-icu.it.xlf | 12 +++ translations/messages+intl-icu.ka.xlf | 12 +++ translations/messages+intl-icu.lv.xlf | 12 +++ translations/messages+intl-icu.nl.xlf | 12 +++ translations/messages+intl-icu.pl.xlf | 12 +++ translations/messages+intl-icu.pt.xlf | 12 +++ translations/messages+intl-icu.ru.xlf | 12 +++ translations/messages+intl-icu.uk.xlf | 12 +++ 23 files changed, 342 insertions(+), 29 deletions(-) create mode 100644 migrations/Version20231030225418.php diff --git a/migrations/Version20231030225418.php b/migrations/Version20231030225418.php new file mode 100644 index 0000000..e43e71d --- /dev/null +++ b/migrations/Version20231030225418.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE torrent_poster ADD COLUMN position BOOLEAN NOT NULL DEFAULT "center"'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE torrent_poster DROP COLUMN position'); + } +} diff --git a/public/asset/default/css/framework.css b/public/asset/default/css/framework.css index 1c31c9c..0ca71e6 100644 --- a/public/asset/default/css/framework.css +++ b/public/asset/default/css/framework.css @@ -510,10 +510,6 @@ a:visited.background-color-hover-night-light:hover { /* responsive rules */ -.height-148-px { - height: 148px; -} - .width-100 { width: 100%; } diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index d4bb509..7511ff8 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -109,12 +109,19 @@ class TorrentController extends AbstractController // Poster if ($user->isPosters() && $torrent->getTorrentPosterId()) { - $poster = $request->getScheme() . '://' . - $request->getHttpHost() . - $request->getBasePath() . - $torrentService->getImageUriByTorrentPosterId( - $torrent->getTorrentPosterId() - ); + $torrentPoster = $torrentService->getTorrentPoster( + $torrent->getTorrentPosterId() + ); + + $poster = [ + 'position' => $torrentPoster->getPosition(), + 'url' => $request->getScheme() . '://' . + $request->getHttpHost() . + $request->getBasePath() . + $torrentService->getImageUriByTorrentPosterId( + $torrentPoster->getId() + ) + ]; } else @@ -304,12 +311,19 @@ class TorrentController extends AbstractController // Poster if ($user->isPosters() && $torrent->getTorrentPosterId()) { - $poster = $request->getScheme() . '://' . - $request->getHttpHost() . - $request->getBasePath() . - $torrentService->getImageUriByTorrentPosterId( - $torrent->getTorrentPosterId() - ); + $torrentPoster = $torrentService->getTorrentPoster( + $torrent->getTorrentPosterId() + ); + + $poster = [ + 'position' => $torrentPoster->getPosition(), + 'url' => $request->getScheme() . '://' . + $request->getHttpHost() . + $request->getBasePath() . + $torrentService->getImageUriByTorrentPosterId( + $torrentPoster->getId() + ) + ]; } else @@ -484,12 +498,19 @@ class TorrentController extends AbstractController // Poster if ($user->isPosters() && $torrent->getTorrentPosterId()) { - $poster = $request->getScheme() . '://' . - $request->getHttpHost() . - $request->getBasePath() . - $torrentService->getImageUriByTorrentPosterId( - $torrent->getTorrentPosterId() - ); + $torrentPoster = $torrentService->getTorrentPoster( + $torrent->getTorrentPosterId() + ); + + $poster = [ + 'position' => $torrentPoster->getPosition(), + 'url' => $request->getScheme() . '://' . + $request->getHttpHost() . + $request->getBasePath() . + $torrentService->getImageUriByTorrentPosterId( + $torrentPoster->getId() + ) + ]; } else @@ -1905,6 +1926,16 @@ class TorrentController extends AbstractController } } + // Init position + $position = in_array( + $request->get('position'), + [ + 'center', + 'top', + 'bottom' + ] + ) ? $request->get('position') : 'center'; + // Init edition history $editions = []; foreach ($torrentService->findTorrentPosterByTorrentId($torrent->getId()) as $torrentPosterEdition) @@ -1913,6 +1944,7 @@ class TorrentController extends AbstractController [ 'id' => $torrentPosterEdition->getId(), 'added' => $torrentPosterEdition->getAdded(), + 'position' => $torrentPosterEdition->getPosition(), 'approved' => $torrentPosterEdition->isApproved(), 'active' => $torrentPosterEdition->getId() == $torrentPosterCurrent['id'], 'user' => @@ -1940,13 +1972,28 @@ class TorrentController extends AbstractController 'poster' => [ 'error' => [] + ], + 'position' => + [ + 'error' => [], + 'attribute' => + [ + 'value' => $position + ] ] ]; // Process request if ($request->isMethod('post')) { - if ($file = $request->files->get('poster')) + if ($request->get('id') && $torrentService->getTorrentPoster($request->get('id'))) + { + $filename = $torrentService->getStorageFilepathByTorrentPosterId( + $request->get('id') + ); + } + + else if ($file = $request->files->get('poster')) { //// Validate poster file if (filesize($file->getPathName()) > $this->getParameter('app.torrent.poster.size.max')) @@ -1959,11 +2006,15 @@ class TorrentController extends AbstractController { $form['poster']['error'][] = $translator->trans('Image file not supported'); } + + $filename = $file->getPathName(); } else { $form['poster']['error'][] = $translator->trans('Poster file required'); + + $filename = false; } // Request is valid @@ -1971,7 +2022,8 @@ class TorrentController extends AbstractController { // Save data $torrentPoster = $torrentService->addTorrentPoster( - $file->getPathName(), + $filename, + $position, $torrent->getId(), $user->getId(), time(), diff --git a/src/Entity/TorrentPoster.php b/src/Entity/TorrentPoster.php index 495fae3..b25c481 100644 --- a/src/Entity/TorrentPoster.php +++ b/src/Entity/TorrentPoster.php @@ -28,6 +28,9 @@ class TorrentPoster #[ORM\Column(length: 32)] private ?string $md5file = null; + #[ORM\Column(length: 255)] + private ?string $position = null; + public function getId(): ?int { return $this->id; @@ -99,4 +102,16 @@ class TorrentPoster return $this; } + + public function getPosition(): ?string + { + return $this->position; + } + + public function setPosition(string $position): static + { + $this->position = $position; + + return $this; + } } diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index 1e52555..0a5b3bf 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -1126,6 +1126,7 @@ class TorrentService public function addTorrentPoster( string $filename, + string $position, int $torrentId, int $userId, int $added, @@ -1139,6 +1140,7 @@ class TorrentService $torrentPoster->setUserId($userId); $torrentPoster->setAdded($added); $torrentPoster->setApproved($approved); + $torrentPoster->setPosition($position); $torrentPoster->setMd5file( md5_file($filename) ); diff --git a/templates/default/torrent/edit/poster.html.twig b/templates/default/torrent/edit/poster.html.twig index a987a22..e4ed5e9 100644 --- a/templates/default/torrent/edit/poster.html.twig +++ b/templates/default/torrent/edit/poster.html.twig @@ -17,18 +17,32 @@ {% endfor %} +
+ + + + + + +
{% for edition in editions %} -
+
{% if edition.active %} {{ edition.added | format_ago }} {% else %} @@ -79,6 +93,29 @@ {% endif %} {% endif %}
+ {% if edition.active %} +
+ +
+ + + + + + +
+
+
+ +
+
+ {% endif %}
{% endfor %} {% endblock %} diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index 1004759..3488f23 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -30,7 +30,7 @@ {% endblock %} {% block main_content %}
+ {% if torrent.poster %}style="background-image:url('{{ torrent.poster.url }}');background-position:{{ torrent.poster.position }}"{% endif %}>

{{ file.name }} {#{{ 'Torrent' | trans }} #{{ torrent.id }}#} diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 404f3eb..a84e6a8 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -25,7 +25,7 @@ {% if torrents %} {% for torrent in torrents %}
+ {% if torrent.poster %}style="background-image:url('{{ torrent.poster.url }}');background-position:{{ torrent.poster.position }}"{% endif %}>

diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index 0e6b880..49c610a 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -785,6 +785,18 @@ Torrent posters Torrent posters + + Center + Center + + + Top + Top + + + Bottom + Bottom + diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index e054970..1baf706 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -785,6 +785,18 @@ Torrent posters Torrent posters + + Center + Center + + + Top + Top + + + Bottom + Bottom + diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index 40887c2..345cd14 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -785,6 +785,18 @@ Torrent posters Torrent posters + + Center + Center + + + Top + Top + + + Bottom + Bottom + diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index 5588b10..73c15c1 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -785,6 +785,18 @@ Torrent posters Torrent posters + + Center + Center + + + Top + Top + + + Bottom + Bottom + diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index a671f50..d759331 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -785,6 +785,18 @@ Torrent posters Torrent posters + + Center + Center + + + Top + Top + + + Bottom + Bottom + diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index 15523b2..f2a251f 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -785,6 +785,18 @@ Torrent posters Torrent posters + + Center + Center + + + Top + Top + + + Bottom + Bottom + diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index 94c676e..39a42e3 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -785,6 +785,18 @@ Torrent posters Torrent posters + + Center + Center + + + Top + Top + + + Bottom + Bottom + diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index 3bdedf9..6c16e22 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -785,6 +785,18 @@ Torrent posters Torrent posters + + Center + Center + + + Top + Top + + + Bottom + Bottom + diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index fae2e18..8c5f53e 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -785,6 +785,18 @@ Torrent posters Torrent posters + + Center + Center + + + Top + Top + + + Bottom + Bottom + diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index 258d87a..1bfc3af 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -785,6 +785,18 @@ Torrent posters Torrent posters + + Center + Center + + + Top + Top + + + Bottom + Bottom + diff --git a/translations/messages+intl-icu.nl.xlf b/translations/messages+intl-icu.nl.xlf index 61fc25e..7eb6e86 100644 --- a/translations/messages+intl-icu.nl.xlf +++ b/translations/messages+intl-icu.nl.xlf @@ -785,6 +785,18 @@ Torrent posters Torrent posters + + Center + Center + + + Top + Top + + + Bottom + Bottom + diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index 62c2af8..fc015e5 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -785,6 +785,18 @@ Torrent posters Torrent posters + + Center + Center + + + Top + Top + + + Bottom + Bottom + diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index aff889c..356f38d 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -785,6 +785,18 @@ Torrent posters Torrent posters + + Center + Center + + + Top + Top + + + Bottom + Bottom + diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index 7024d07..6861445 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -785,6 +785,18 @@ Torrent posters Постеры торрентов + + Center + Центр + + + Top + Верх + + + Bottom + Низ + diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index dc81dee..59dc5d8 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -785,6 +785,18 @@ Torrent posters Постери торентів + + Center + Центр + + + Top + Верх + + + Bottom + Низ + From 69309b9a98a1fae0ce35cb97653a6765708da64f Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 31 Oct 2023 20:20:26 +0200 Subject: [PATCH 127/185] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0d6d65e..5dd91cf 100644 --- a/README.md +++ b/README.md @@ -107,8 +107,8 @@ git checkout -b my-pr-branch-name * [Symfony Framework](https://symfony.com) * [SVG icons](https://icons.getbootstrap.com) * [Scrapper](https://github.com/medariox/scrapeer) / [Composer Edition](https://github.com/YGGverse/scrapeer) -* [Bencode Library](https://github.com/Rhilip/Bencode) -* [Transliteration Library](https://github.com/ashtokalo/php-translit) +* [Bencode](https://github.com/Rhilip/Bencode) +* [Transliteration](https://github.com/ashtokalo/php-translit) * [Identicons](https://github.com/dmester/jdenticon-php) #### Support From 3589d2eef4669b6aa095ab7a18029d4a059f3bb0 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 31 Oct 2023 23:05:48 +0200 Subject: [PATCH 128/185] set new users as sensitive by default --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 9d51a78..92541c2 100644 --- a/.env +++ b/.env @@ -69,7 +69,7 @@ APP_THEME=default APP_THEMES=default # Default sensitive status for new users -APP_SENSITIVE=0 +APP_SENSITIVE=1 # Default approved status for new users APP_APPROVED=0 From 514b1ebc5db45e12fb0fffc351f8a5dec3df4664 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 1 Nov 2023 05:11:25 +0200 Subject: [PATCH 129/185] fix event message --- .../default/activity/event/torrent/download/file/add.html.twig | 2 +- .../activity/event/torrent/download/magnet/add.html.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/default/activity/event/torrent/download/file/add.html.twig b/templates/default/activity/event/torrent/download/file/add.html.twig index f71609a..1e0e5e3 100644 --- a/templates/default/activity/event/torrent/download/file/add.html.twig +++ b/templates/default/activity/event/torrent/download/file/add.html.twig @@ -11,7 +11,7 @@ {{ torrent.name }} {% if torrent.approved == false %} - #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + ({{ 'waiting for approve' | trans }}) {% endif %} {% else %} {% if torrent.status == false %} diff --git a/templates/default/activity/event/torrent/download/magnet/add.html.twig b/templates/default/activity/event/torrent/download/magnet/add.html.twig index 1545e69..edfc68c 100644 --- a/templates/default/activity/event/torrent/download/magnet/add.html.twig +++ b/templates/default/activity/event/torrent/download/magnet/add.html.twig @@ -11,7 +11,7 @@ {{ torrent.name }} {% if torrent.approved == false %} - #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + ({{ 'waiting for approve' | trans }}) {% endif %} {% else %} {% if torrent.status == false %} From 986f6678f8ce7ea38cbfe8d7b6f25b1a1dddec9b Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 1 Nov 2023 23:23:43 +0200 Subject: [PATCH 130/185] add new locale --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 92541c2..0cfd47b 100644 --- a/.env +++ b/.env @@ -57,7 +57,7 @@ APP_NAME=YGGtracker APP_LOCALE=en # Supported locales for interface and content filters -APP_LOCALES=en|cs|nl|eo|fr|ka|de|he|it|lv|pl|pt|ru|es|uk +APP_LOCALES=en|cs|nl|eo|fr|ja|ka|de|he|it|lv|pl|pt|ru|es|uk # Items per page on pagination APP_PAGINATION=10 From e788744a0f244177a842954e9b00159eac4a06b1 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 2 Nov 2023 01:38:55 +0200 Subject: [PATCH 131/185] add configuration tip for upload_max_filesize --- .env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 0cfd47b..dfa68bc 100644 --- a/.env +++ b/.env @@ -86,10 +86,10 @@ APP_TRACKERS=http://[201:23b4:991a:634d:8359:4521:5576:15b7]:2023/announce|http: # List of crawlers where ignored in actions and activity features APP_CRAWLERS=201:23b4:991a:634d:8359:4521:5576:15b7|30a:5fad::e -# Max torrent filesize for uploads +# Max torrent filesize for uploads (check upload_max_filesize in the php.ini) APP_TORRENT_FILE_SIZE_MAX=1024000 -# Max torrent poster filesize for uploads +# Max torrent poster filesize for uploads (check upload_max_filesize in the php.ini) APP_TORRENT_POSTER_FILE_SIZE_MAX=10240000 # Store wanted torrent files in /app/var/ftp by /app/crontab/torrent/scrape/{key} From 4f2879fdef7f249ef744dccf19736e45ffb8f70d Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 2 Nov 2023 19:15:01 +0200 Subject: [PATCH 132/185] set users approved by default --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index dfa68bc..b7750ba 100644 --- a/.env +++ b/.env @@ -72,7 +72,7 @@ APP_THEMES=default APP_SENSITIVE=1 # Default approved status for new users -APP_APPROVED=0 +APP_APPROVED=1 # Default Yggdrasil filters status for new users APP_YGGDRASIL=1 From 258d206f2ee701ac968849b548476ce1100478a4 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 3 Nov 2023 13:44:49 +0200 Subject: [PATCH 133/185] unify torrent filenames to prevent encoding issues on FTP connection --- src/Controller/TorrentController.php | 47 +++++++++++----------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 7511ff8..2fdbe6b 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -2538,11 +2538,8 @@ class TorrentController extends AbstractController $response->headers->set( 'Content-Disposition', sprintf( - 'attachment; filename="wanted#%s.%s.torrent";', - $torrent->getId(), - mb_strtolower( - $file->getName() - ) + 'attachment; filename="wanted#%s.torrent";', + $torrent->getId() ) ); @@ -2784,10 +2781,9 @@ class TorrentController extends AbstractController $torrentService->copyToFtpStorage( $torrent->getId(), sprintf( - '%s/torrents/wanted/all/wanted#%s.%s.torrent', + '%s/torrents/wanted/all/wanted#%s.torrent', $this->getParameter('app.torrent.wanted.ftp.folder'), - $torrent->getId(), - $file->getName() + $torrent->getId() ) ); @@ -2797,10 +2793,9 @@ class TorrentController extends AbstractController $torrentService->copyToFtpStorage( $torrent->getId(), sprintf( - '%s/torrents/wanted/sensitive/yes/wanted#%s.%s.torrent', + '%s/torrents/wanted/sensitive/yes/wanted#%s.torrent', $this->getParameter('app.torrent.wanted.ftp.folder'), - $torrent->getId(), - $file->getName() + $torrent->getId() ) ); } @@ -2810,10 +2805,9 @@ class TorrentController extends AbstractController $torrentService->copyToFtpStorage( $torrent->getId(), sprintf( - '%s/torrents/wanted/sensitive/no/wanted#%s.%s.torrent', + '%s/torrents/wanted/sensitive/no/wanted#%s.torrent', $this->getParameter('app.torrent.wanted.ftp.folder'), - $torrent->getId(), - $file->getName() + $torrent->getId() ) ); } @@ -2824,11 +2818,10 @@ class TorrentController extends AbstractController $torrentService->copyToFtpStorage( $torrent->getId(), sprintf( - '%s/torrents/wanted/locale/%s/wanted#%s.%s.torrent', + '%s/torrents/wanted/locale/%s/wanted#%s.torrent', $this->getParameter('app.torrent.wanted.ftp.folder'), $locale, - $torrent->getId(), - $file->getName() + $torrent->getId() ) ); } @@ -2841,29 +2834,26 @@ class TorrentController extends AbstractController /// All $torrentService->removeFromFtpStorage( sprintf( - '%s/torrents/wanted/all/wanted#%s.%s.torrent', + '%s/torrents/wanted/all/wanted#%s.torrent', $this->getParameter('app.torrent.wanted.ftp.folder'), - $torrent->getId(), - $file->getName() + $torrent->getId() ) ); /// Sensitive $torrentService->removeFromFtpStorage( sprintf( - '%s/torrents/wanted/sensitive/yes/wanted#%s.%s.torrent', + '%s/torrents/wanted/sensitive/yes/wanted#%s.torrent', $this->getParameter('app.torrent.wanted.ftp.folder'), - $torrent->getId(), - $file->getName() + $torrent->getId() ) ); $torrentService->removeFromFtpStorage( sprintf( - '%s/torrents/wanted/sensitive/no/wanted#%s.%s.torrent', + '%s/torrents/wanted/sensitive/no/wanted#%s.torrent', $this->getParameter('app.torrent.wanted.ftp.folder'), - $torrent->getId(), - $file->getName() + $torrent->getId() ) ); @@ -2872,11 +2862,10 @@ class TorrentController extends AbstractController { $torrentService->removeFromFtpStorage( sprintf( - '%s/torrents/wanted/locale/%s/wanted#%s.%s.torrent', + '%s/torrents/wanted/locale/%s/wanted#%s.torrent', $this->getParameter('app.torrent.wanted.ftp.folder'), $locale, - $torrent->getId(), - $file->getName() + $torrent->getId() ) ); } From 2e4129927d1465e162bb1fa28cc363c643925346 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 3 Nov 2023 13:59:50 +0200 Subject: [PATCH 134/185] set app IDs in the filename postfix, remove lowercase --- src/Controller/TorrentController.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 2fdbe6b..5bc0b04 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -2416,14 +2416,10 @@ class TorrentController extends AbstractController $response->headers->set( 'Content-Disposition', sprintf( - 'attachment; filename="%s#%s.%s.torrent";', - mb_strtolower( - $this->getParameter('app.name') - ), - $torrent->getId(), - mb_strtolower( - $file->getName() - ) + 'attachment; filename="%s [%s#%s].torrent";', + $file->getName(), + $this->getParameter('app.name'), + $torrent->getId() ) ); From 7796aba342f2b7b87b50be1d0d5e17b6da158f97 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 3 Nov 2023 14:06:15 +0200 Subject: [PATCH 135/185] append torrent filename to the manual wanted downloads --- src/Controller/TorrentController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 5bc0b04..9b22608 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -2534,7 +2534,8 @@ class TorrentController extends AbstractController $response->headers->set( 'Content-Disposition', sprintf( - 'attachment; filename="wanted#%s.torrent";', + 'attachment; filename="%s [wanted#%s].torrent";', + $file->getName(), $torrent->getId() ) ); From ad5b075878a4843b9670a09867528c013d3bf1f4 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 3 Nov 2023 14:54:12 +0200 Subject: [PATCH 136/185] add poster settings to the user profile page --- src/Controller/UserController.php | 1 + templates/default/user/info.html.twig | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index d6dea1f..a408a11 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -222,6 +222,7 @@ class UserController extends AbstractController 'moderator' => $userTarget->isModerator(), 'approved' => $userTarget->isApproved(), 'status' => $userTarget->isStatus(), + 'posters' => $userTarget->isPosters(), 'sensitive' => $userTarget->isSensitive(), 'yggdrasil' => $userTarget->isYggdrasil(), 'locale' => $userTarget->getLocale(), diff --git a/templates/default/user/info.html.twig b/templates/default/user/info.html.twig index a3632ab..8d660d2 100644 --- a/templates/default/user/info.html.twig +++ b/templates/default/user/info.html.twig @@ -175,6 +175,18 @@ {% for i, locale in user.locales %}{% if i > 0 %},{% endif %} {{ locale|locale_name(locale)|u.title }}{% endfor %}

+ {{ 'Posters' | trans }} + + {% if user.posters %} + {{ 'Yes' | trans }} + {% else %} + {{ 'No' | trans }} + {% endif %} +
{{ 'Sensitive' | trans }} From 6dcbd6de401732501c612433f5b71a861da2c6c9 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 3 Nov 2023 15:35:46 +0200 Subject: [PATCH 137/185] make description links clickable #30 --- composer.json | 4 +++- src/Twig/AppExtension.php | 18 ++++++++++++++++++ templates/default/torrent/info.html.twig | 4 ++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index a91504c..0126d61 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,7 @@ "doctrine/doctrine-migrations-bundle": "^3.2", "doctrine/orm": "^2.16", "jdenticon/jdenticon": "^1.0", + "league/commonmark": "^2.4", "phpdocumentor/reflection-docblock": "^5.3", "phpstan/phpdoc-parser": "^1.24", "rhilip/bencode": "^2.3", @@ -45,8 +46,9 @@ "symfony/validator": "6.3.*", "symfony/web-link": "6.3.*", "symfony/yaml": "6.3.*", - "twig/extra-bundle": "^2.12|^3.0", + "twig/extra-bundle": "^3.7", "twig/intl-extra": "^3.7", + "twig/markdown-extra": "^3.7", "twig/string-extra": "^3.7", "twig/twig": "^2.12|^3.0", "yggverse/scrapeer": "^0.5.4" diff --git a/src/Twig/AppExtension.php b/src/Twig/AppExtension.php index 6cf5813..6d4e987 100644 --- a/src/Twig/AppExtension.php +++ b/src/Twig/AppExtension.php @@ -39,6 +39,13 @@ class AppExtension extends AbstractExtension 'formatAgo' ] ), + new TwigFilter( + 'url_to_markdown', + [ + $this, + 'urlToMarkdown' + ] + ), ]; } @@ -135,6 +142,17 @@ class AppExtension extends AbstractExtension } } + public function urlToMarkdown( + string $text + ) : string + { + return preg_replace( + '~(https?://(?:www\.)?[^\s]+)~i', + '[$1]($1)', + $text + ); + } + private function plural(int $number, array $texts) { $cases = [2, 0, 1, 1, 1, 2]; diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index 3488f23..5aebc08 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -226,7 +226,7 @@ {{ 'Source' | trans }} - {{ file.source }} + {{ file.source | url_to_markdown | markdown_to_html }}
- {{ file.comment | nl2br }} + {{ file.comment | url_to_markdown | markdown_to_html }}
- {% for i, locale in user.locales %}{% if i > 0 %},{% endif %} {{ locale|locale_name(locale)|u.title }}{% endfor %} + {% for i, locale in user.locales | sort %}{% if i > 0 %},{% endif %} {{ locale | locale_name(locale) | u.title }}{% endfor %} +
+ {{ 'Categories' | trans }} + + {% for i, category in user.categories | sort %}{% if i > 0 %},{% endif %} {{ category | u.title }}{% endfor %}
{% for locale in locales %}
- {% if locale in user.locales %} + {% if locale in user.locales | sort %} {% else %} @@ -102,10 +102,31 @@
+ +
+ {{ 'Categories' | trans }} +
+
+ {% for category in categories | sort %} +
+ {% if category in user.categories %} + + {% else %} + + {% endif %} + +
+ {% endfor %} +
{{ 'Sensitive' | trans }} +
{% if user.sensitive %} diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index 345cd14..3085a7b 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -797,6 +797,38 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + From 0247e0e0640201087d943c0130ce5fce065cad78 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 4 Nov 2023 06:35:09 +0200 Subject: [PATCH 142/185] add new localization --- translations/messages+intl-icu.ja.xlf | 802 ++++++++++++++++++++++++++ 1 file changed, 802 insertions(+) create mode 100644 translations/messages+intl-icu.ja.xlf diff --git a/translations/messages+intl-icu.ja.xlf b/translations/messages+intl-icu.ja.xlf new file mode 100644 index 0000000..0aafa20 --- /dev/null +++ b/translations/messages+intl-icu.ja.xlf @@ -0,0 +1,802 @@ + + + +
+ +
+ + + Users + Users + + + Joined + Joined + + + Approved + Approved + + + Disapproved + Disapproved + + + User statuses + User statuses + + + Enabled + Enabled + + + Disabled + Disabled + + + User moderators + User moderators + + + Added + Added + + + Removed + Removed + + + User stars + User stars + + + Torrents + Torrents + + + Torrent locales + Torrent locales + + + Deleted + Deleted + + + Torrent sensitive + Torrent sensitive + + + Torrent stars + Torrent stars + + + Torrent downloads + Torrent downloads + + + Files + Files + + + Magnet links + Magnet links + + + Access denied + Access denied + + + At least one locale required + At least one locale required + + + Torrent file out of size limit + Torrent file out of size limit + + + Torrent file already exists + Torrent file already exists + + + Could not parse torrent file + Could not parse torrent file + + + Torrent file required + Torrent file required + + + B + B + + + Kb + Kb + + + Mb + Mb + + + Gb + Gb + + + Tb + Tb + + + Pb + Pb + + + Eb + Eb + + + Zb + Zb + + + Yb + Yb + + + now + now + + + Keyword, file, hash... + Keyword, file, hash... + + + Search + Search + + + Recent uploads + Recent uploads + + + Active leechers waiting for seeders + Active leechers waiting for seeders + + + wanted + wanted + + + Waiting for approve + Waiting for approve + + + Size + Size + + + Seeders + Seeders + + + Peers + Peers + + + Leechers + Leechers + + + Open magnet link + Open magnet link + + + Total + Total + + + Download torrent file + Download torrent file + + + Star + Star + + + Nothing found + Nothing found + + + * share new torrent file to change it + * share new torrent file to change it + + + Submit + Submit + + + Submit torrent + Submit torrent + + + Content language + Content language + + + This torrent contains selected languages + This torrent contains selected languages + + + Sensitive + Sensitive + + + Mark torrent content as sensitive + Mark torrent content as sensitive + + + Edit locales + Edit locales + + + Torrent + Torrent + + + Edit locales for torrent + Edit locales for torrent + + + cancel + cancel + + + by + by + + + identicon + identicon + + + Delete + Delete + + + Disapprove + Disapprove + + + Approve + Approve + + + Edit sensitive status + Edit sensitive status + + + Edit sensitive status for torrent + Edit sensitive status for torrent + + + Page + Page + + + Moderation + Moderation + + + Yes + Yes + + + Toggle + Toggle + + + No + No + + + Common + Common + + + ID + ID + + + MD5 + MD5 + + + Info hash v1 + Info hash v1 + + + Info hash v2 + Info hash v2 + + + Created + Created + + + Pieces + Pieces + + + Source + Source + + + Software + Software + + + Comment + Comment + + + Contributors + Contributors + + + Scrape + Scrape + + + Trackers + Trackers + + + Filtered by settings + Filtered by settings + + + Edit + Edit + + + Locales + Locales + + + Recent activity + Recent activity + + + Back + Back + + + Next + Next + + + Settings + Settings + + + Interface + Interface + + + Theme + Theme + + + Language + Language + + + Join translation + Join translation + + + Activity + Activity + + + Downloads + Downloads + + + Yggdrasil only + Yggdrasil only + + + Save + Save + + + Home + Home + + + Profile + Profile + + + User + User + + + Bookmark + Bookmark + + + Address + Address + + + Address hidden for others + Address hidden for others + + + Access + Access + + + Status + Status + + + Active + Active + + + Moderator + Moderator + + + Languages + Languages + + + Events subscribed + Events subscribed + + + undefined event + undefined event + + + have downloaded torrent file + have downloaded torrent file + + + waiting for approve + waiting for approve + + + sensitive + sensitive + + + have downloaded magnet link + have downloaded magnet link + + + have disapproved torrent + have disapproved torrent + + + have approved torrent + have approved torrent + + + have added torrent + have added torrent + + + have deleted locales edition + have deleted locales edition + + + for torrent + for torrent + + + have disapproved locales edition + have disapproved locales edition + + + have approved locales edition + have approved locales edition + + + have added locales edition + have added locales edition + + + have removed star from torrent + have removed star from torrent + + + have added star for torrent + have added star for torrent + + + have deleted sensitive edition + have deleted sensitive edition + + + have disapproved sensitive edition + have disapproved sensitive edition + + + have approved sensitive edition + have approved sensitive edition + + + have added sensitive edition + have added sensitive edition + + + have disabled + have disabled + + + have disabled user + have disabled user + + + have enabled + have enabled + + + have enabled user + have enabled user + + + have disapproved + have disapproved + + + have disapproved user + have disapproved user + + + have approved + have approved + + + have approved user + have approved user + + + have joined + have joined + + + have removed moderator permissions from + have removed moderator permissions from + + + have removed moderator permissions from user + have removed moderator permissions from user + + + have granted moderator permissions to + have granted moderator permissions to + + + have granted moderator permissions to user + have granted moderator permissions to user + + + have removed star from + have removed star from + + + have removed star from user + have removed star from user + + + have added star for + have added star for + + + have added star for user + have added star for user + + + Error + Error + + + Oops! + Oops! + + + Internal server error + Internal server error + + + Report + Report + + + Not found + Not found + + + Page not found! + Page not found! + + + BitTorrent protocol version 2 + BitTorrent protocol version 2 + + + BitTorrent protocol version 1 + BitTorrent protocol version 1 + + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago + + + Search results + Search results + + + <a href="%s">Upload</a> any torrent - download with Yggdrasil + Upload any torrent - download with Yggdrasil]]> + + + Wanted + Wanted + + + Seeders wanted for torrent + Seeders wanted for torrent + + + Hide + Hide + + + have disabled torrent + have disabled torrent + + + have enabled torrent + have enabled torrent + + + disabled + disabled + + + Poster file out of size limit + Poster file out of size limit + + + Image file not supported + Image file not supported + + + Poster file required + Poster file required + + + Edit torrent poster + Edit torrent poster + + + Edit poster for torrent + Edit poster for torrent + + + Poster + Poster + + + Posters + Posters + + + have deleted poster edition + have deleted poster edition + + + have disapproved poster edition + have disapproved poster edition + + + have approved poster edition + have approved poster edition + + + have added poster edition + have added poster edition + + + Torrent posters + Torrent posters + + + Center + Center + + + Top + Top + + + Bottom + Bottom + + +
+
From 2e9b11973378c346ac424e4d915162807f4a81b3 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 4 Nov 2023 07:03:53 +0200 Subject: [PATCH 143/185] fix comma separator --- templates/default/torrent/info.html.twig | 6 ++++-- templates/default/user/info.html.twig | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index 9560e68..10f8721 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -344,7 +344,8 @@
{% if torrent.locales %}
- {% for i, locale in torrent.locales | sort %}{% if i > 0 %},{% endif %} {{ locale | locale_name(locale) | u.title }}{% endfor %} + {% set i = 0 %} + {% for locale in torrent.locales | sort %}{% if i > 0 %},{% endif %} {{ locale | locale_name(locale) | u.title }}{% set i = i + 1 %}{% endfor %}
{% endif %}
@@ -360,7 +361,8 @@
{% if torrent.categories %}
- {% for i, category in torrent.categories | sort %}{% if i > 0 %},{% endif %} {{ category | u.title }}{% endfor %} + {% set i = 0 %} + {% for category in torrent.categories | sort %}{% if i > 0 %},{% endif %} {{ category | u.title }}{% set i = i + 1 %}{% endfor %}
{% endif %}
diff --git a/templates/default/user/info.html.twig b/templates/default/user/info.html.twig index 5893fd3..dcc72cf 100644 --- a/templates/default/user/info.html.twig +++ b/templates/default/user/info.html.twig @@ -172,7 +172,8 @@ {{ 'Languages' | trans }}
- {% for i, locale in user.locales | sort %}{% if i > 0 %},{% endif %} {{ locale | locale_name(locale) | u.title }}{% endfor %} + {% set i = 0 %} + {% for locale in user.locales | sort %}{% if i > 0 %},{% endif %} {{ locale | locale_name(locale) | u.title }}{% set i = i + 1 %}{% endfor %}
- {% for i, category in user.categories | sort %}{% if i > 0 %},{% endif %} {{ category | u.title }}{% endfor %} + {% set i = 0 %} + {% for category in user.categories | sort %}{% if i > 0 %},{% endif %} {{ category | u.title }}{% set i = i + 1 %}{% endfor %}
{% set i = 0 %} - {% for category in user.categories | sort %}{% if i > 0 %},{% endif %} {{ category | u.title }}{% set i = i + 1 %}{% endfor %} + {% for category in user.categories | sort %}{% if i > 0 %},{% endif %} {{ category | trans_category | u.title }}{% set i = i + 1 %}{% endfor %}
- {% for locale in locales %} + {% for locale in locales | sort %}
- {% if locale in user.locales | sort %} + {% if locale in user.locales %} {% else %} From 5a0342a99884ab2f70242abef83b45ab2ebcb7f8 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 13 Nov 2023 09:35:04 +0200 Subject: [PATCH 152/185] init extended search feature #35 --- src/Controller/SearchController.php | 102 +++++++++++++++++++++- src/Controller/TorrentController.php | 16 ++-- templates/default/layout.html.twig | 3 +- templates/default/search/module.html.twig | 58 ++++++++++++ 4 files changed, 166 insertions(+), 13 deletions(-) diff --git a/src/Controller/SearchController.php b/src/Controller/SearchController.php index e515162..fbb029f 100644 --- a/src/Controller/SearchController.php +++ b/src/Controller/SearchController.php @@ -14,15 +14,111 @@ use App\Service\ActivityService; class SearchController extends AbstractController { public function module( - ?string $query, - ?string $type + Request $request, + UserService $userService, + ActivityService $activityService ): Response { + // Defaults + $locales = []; + $categories = []; + + // Extended search + if ($request->get('filter')) + { + // Init user + $user = $this->initUser( + $request, + $userService, + $activityService + ); + + // Locales + foreach (explode('|', $this->getParameter('app.locales')) as $locale) + { + if ($request->get('locales')) + { + $locales[] = + [ + 'value' => $locale, + 'checked' => in_array($locale, (array) $request->get('locales')) ? true : false, + ]; + } + + else + { + $locales[] = + [ + 'value' => $locale, + 'checked' => in_array($locale, $user->getLocales()) ? true : false, + ]; + } + } + + // Categories + foreach (explode('|', $this->getParameter('app.categories')) as $category) + { + if ($request->get('categories')) + { + $categories[] = + [ + 'value' => $category, + 'checked' => in_array($category, (array) $request->get('categories')) ? true : false, + ]; + } + + else + { + $categories[] = + [ + 'value' => $category, + 'checked' => in_array($category, $user->getCategories()) ? true : false, + ]; + } + } + } + return $this->render( 'default/search/module.html.twig', [ - 'query' => $query ? urldecode($query) : '', + 'query' => $request->get('query') ? urldecode($request->get('query')) : '', + 'filter' => $request->get('filter'), + 'sensitive' => $request->get('sensitive'), + 'locales' => $locales, + 'categories' => $categories, ] ); } + + private function initUser( + Request $request, + UserService $userService, + ActivityService $activityService + ): ?\App\Entity\User + { + // Init user + if (!$user = $userService->findUserByAddress($request->getClientIp())) + { + $user = $userService->addUser( + $request->getClientIp(), + time(), + $this->getParameter('app.locale'), + explode('|', $this->getParameter('app.locales')), + $activityService->getEventCodes(), + $this->getParameter('app.theme'), + $this->getParameter('app.sensitive'), + $this->getParameter('app.yggdrasil'), + $this->getParameter('app.posters'), + $this->getParameter('app.approved') + ); + + // Add user join event + $activityService->addEventUserAdd( + $user->getId(), + time() + ); + } + + return $user; + } } \ No newline at end of file diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 31b7c10..0da8c26 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -265,22 +265,22 @@ class TorrentController extends AbstractController // Get total torrents $total = $torrentService->findTorrentsTotal( - $user->getId(), + $request->get('filter') ? 0 : $user->getId(), $query, - $user->getLocales(), - $user->getCategories(), - $user->isSensitive() ? false : null, + $request->get('filter') ? (array) $request->get('locales') : $user->getLocales(), + $request->get('filter') ? (array) $request->get('categories') : $user->getCategories(), + $request->get('filter') ? ($request->get('sensitive') ? null : false) : ($user->isSensitive() ? false : null), !$user->isModerator() ? true : null, !$user->isModerator() ? true : null, ); $torrents = []; foreach ($torrentService->findTorrents( - $user->getId(), + $request->get('filter') ? 0 : $user->getId(), $query, - $user->getLocales(), - $user->getCategories(), - $user->isSensitive() ? false : null, + $request->get('filter') ? (array) $request->get('locales') : $user->getLocales(), + $request->get('filter') ? (array) $request->get('categories') : $user->getCategories(), + $request->get('filter') ? ($request->get('sensitive') ? null : false) : ($user->isSensitive() ? false : null), !$user->isModerator() ? true : null, !$user->isModerator() ? true : null, $this->getParameter('app.pagination'), diff --git a/templates/default/layout.html.twig b/templates/default/layout.html.twig index 2e25d05..b4c9100 100644 --- a/templates/default/layout.html.twig +++ b/templates/default/layout.html.twig @@ -26,8 +26,7 @@ {{ render(controller( 'App\\Controller\\SearchController::module', { - query : app.request.get('query'), - type : app.request.get('type') + request: app.request } )) }} {% endblock %} diff --git a/templates/default/search/module.html.twig b/templates/default/search/module.html.twig index 6677ce5..6653baf 100644 --- a/templates/default/search/module.html.twig +++ b/templates/default/search/module.html.twig @@ -1,4 +1,62 @@
+ {% if filter %} + +
+
+

+ {{ 'Locales' | trans }} +

+
+
+ {% for locale in locales | sort %} +
+ {% if locale.checked %} + + {% else %} + + {% endif %} + +
+ {% endfor %} +
+
+

+ {{ 'Categories' | trans }} +

+
+
+ {% for category in categories | sort %} +
+ {% if category.checked %} + + {% else %} + + {% endif %} + +
+ {% endfor %} +
+
+

+ {{ 'other' | trans | u.title }} +

+
+
+ {% if sensitive %} + + {% else %} + + {% endif %} + +
+
+ {% endif %}
\ No newline at end of file From 1ae5d324c2d4f8a3e73b8911d50a174fe07bf0cd Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 13 Nov 2023 09:39:10 +0200 Subject: [PATCH 153/185] remove h2 tag from filter headers #35 --- templates/default/search/module.html.twig | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/templates/default/search/module.html.twig b/templates/default/search/module.html.twig index 6653baf..e968a6f 100644 --- a/templates/default/search/module.html.twig +++ b/templates/default/search/module.html.twig @@ -4,10 +4,8 @@ {% if filter %}
-
-

- {{ 'Locales' | trans }} -

+
+ {{ 'Locales' | trans }}
{% for locale in locales | sort %} @@ -23,10 +21,8 @@
{% endfor %}
-
-

- {{ 'Categories' | trans }} -

+
+ {{ 'Categories' | trans }}
{% for category in categories | sort %} @@ -42,10 +38,8 @@
{% endfor %}
-
-

- {{ 'other' | trans | u.title }} -

+
+ {{ 'other' | trans | u.title }}
{% if sensitive %} From deb35d5013b8777a1bb97dd5827f5dec19a2748c Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 13 Nov 2023 10:11:48 +0200 Subject: [PATCH 154/185] add filter attributes support for pagination and tag links #35 --- templates/default/torrent/list.html.twig | 25 ++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index a84e6a8..52e66ae 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -80,7 +80,11 @@ {% if torrent.keywords %}
{% for keyword, quantity in torrent.keywords %} - + #{{ keyword }} {% endfor %} @@ -169,17 +173,30 @@ {% if query %} {% if pagination.page > 1 %} {% if pagination.page == 2 %} - + {{ 'Back' | trans | lower }} {% else %} - + {{ 'Back' | trans | lower }} {% endif %} {% endif %} {% if pagination.page < pagination.pages %} - + {{ 'Next' | trans | lower }} {% endif %} From 002a41da878ced0aab37c4fb01b0a10d5875182b Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 13 Nov 2023 10:37:16 +0200 Subject: [PATCH 155/185] add filter link #35 --- templates/default/torrent/list.html.twig | 13 +++++++++++++ translations/messages+intl-icu.cs.xlf | 8 ++++++++ translations/messages+intl-icu.de.xlf | 8 ++++++++ translations/messages+intl-icu.en.xlf | 8 ++++++++ translations/messages+intl-icu.eo.xlf | 8 ++++++++ translations/messages+intl-icu.es.xlf | 8 ++++++++ translations/messages+intl-icu.fr.xlf | 8 ++++++++ translations/messages+intl-icu.he.xlf | 8 ++++++++ translations/messages+intl-icu.it.xlf | 8 ++++++++ translations/messages+intl-icu.ja.xlf | 8 ++++++++ translations/messages+intl-icu.ka.xlf | 8 ++++++++ translations/messages+intl-icu.lv.xlf | 8 ++++++++ translations/messages+intl-icu.nl.xlf | 8 ++++++++ translations/messages+intl-icu.pl.xlf | 8 ++++++++ translations/messages+intl-icu.pt.xlf | 8 ++++++++ translations/messages+intl-icu.ru.xlf | 8 ++++++++ translations/messages+intl-icu.uk.xlf | 8 ++++++++ 17 files changed, 141 insertions(+) diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 52e66ae..9ea36aa 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -5,6 +5,19 @@ {% if query %}

{{ 'Search results' | trans }}

+ {% if app.request.get('filter') %} + + + + + + {% else %} + + + + + + {% endif %} diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index b34a837..e40a671 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -901,6 +901,14 @@ other other + + Hide filter + Hide filter + + + Show filter + Show filter + diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index 2137691..812f8a6 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -901,6 +901,14 @@ other other + + Hide filter + Hide filter + + + Show filter + Show filter + diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index e4658e8..0a0423b 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -901,6 +901,14 @@ other other + + Hide filter + Hide filter + + + Show filter + Show filter + diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index a9ea8be..e0cdbef 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -901,6 +901,14 @@ other other + + Hide filter + Hide filter + + + Show filter + Show filter + diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index a5f441d..9e1edee 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -901,6 +901,14 @@ other other + + Hide filter + Hide filter + + + Show filter + Show filter + diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index 55a2fc0..82dd5c3 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -901,6 +901,14 @@ other other + + Hide filter + Hide filter + + + Show filter + Show filter + diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index bb9127f..faad62a 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -901,6 +901,14 @@ other other + + Hide filter + Hide filter + + + Show filter + Show filter + diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index 4a27c88..6411b4c 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -901,6 +901,14 @@ other other + + Hide filter + Hide filter + + + Show filter + Show filter + diff --git a/translations/messages+intl-icu.ja.xlf b/translations/messages+intl-icu.ja.xlf index d94fbba..ccacd9a 100644 --- a/translations/messages+intl-icu.ja.xlf +++ b/translations/messages+intl-icu.ja.xlf @@ -901,6 +901,14 @@ other other + + Hide filter + Hide filter + + + Show filter + Show filter + diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index dfaece0..a13adb1 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -901,6 +901,14 @@ other other + + Hide filter + Hide filter + + + Show filter + Show filter + diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index b2f07df..23be2cd 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -901,6 +901,14 @@ other other + + Hide filter + Hide filter + + + Show filter + Show filter + diff --git a/translations/messages+intl-icu.nl.xlf b/translations/messages+intl-icu.nl.xlf index 85f3f3f..da9f1cb 100644 --- a/translations/messages+intl-icu.nl.xlf +++ b/translations/messages+intl-icu.nl.xlf @@ -901,6 +901,14 @@ other other + + Hide filter + Hide filter + + + Show filter + Show filter + diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index 80f6e6a..b44a926 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -901,6 +901,14 @@ other other + + Hide filter + Hide filter + + + Show filter + Show filter + diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index f046b79..abc2faf 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -901,6 +901,14 @@ other other + + Hide filter + Hide filter + + + Show filter + Show filter + diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index 81d2f09..7f4c64b 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -901,6 +901,14 @@ other другое + + Hide filter + Скрыть фильтр + + + Show filter + Показать фильтр + diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 8322f03..49159d2 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -901,6 +901,14 @@ other інше + + Hide filter + Приховати фільтр + + + Show filter + Показати фільтр + From e3503bc4bdba530f98adf3d5fffdf9f9a48a5275 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 13 Nov 2023 10:50:41 +0200 Subject: [PATCH 156/185] add rel/nofollow to the filter link #35 --- templates/default/torrent/list.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 9ea36aa..941b1c9 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -6,13 +6,13 @@

{{ 'Search results' | trans }}

{% if app.request.get('filter') %} -
+ {% else %} - + From 55230343079a330987fcb60d2a1d856360146030 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 13 Nov 2023 11:23:37 +0200 Subject: [PATCH 157/185] add search filters counter #35 --- src/Controller/SearchController.php | 87 ++++++++++++++++------- templates/default/search/module.html.twig | 55 ++++++++------ 2 files changed, 97 insertions(+), 45 deletions(-) diff --git a/src/Controller/SearchController.php b/src/Controller/SearchController.php index fbb029f..caa3848 100644 --- a/src/Controller/SearchController.php +++ b/src/Controller/SearchController.php @@ -9,6 +9,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Request; use App\Service\UserService; +use App\Service\TorrentService; use App\Service\ActivityService; class SearchController extends AbstractController @@ -16,6 +17,7 @@ class SearchController extends AbstractController public function module( Request $request, UserService $userService, + TorrentService $torrentService, ActivityService $activityService ): Response { @@ -23,8 +25,12 @@ class SearchController extends AbstractController $locales = []; $categories = []; + // Request + $query = $request->get('query') ? urldecode($request->get('query')) : ''; + $filter = $request->get('filter') ? true : false; + // Extended search - if ($request->get('filter')) + if ($filter) { // Init user $user = $this->initUser( @@ -33,26 +39,37 @@ class SearchController extends AbstractController $activityService ); + // Keywords + $keywords = explode(' ', $query); + // Locales foreach (explode('|', $this->getParameter('app.locales')) as $locale) { + if ($request->get('locales')) { - $locales[] = - [ - 'value' => $locale, - 'checked' => in_array($locale, (array) $request->get('locales')) ? true : false, - ]; + $checked = in_array($locale, (array) $request->get('locales')); } else { - $locales[] = - [ - 'value' => $locale, - 'checked' => in_array($locale, $user->getLocales()) ? true : false, - ]; + $checked = in_array($locale, $user->getLocales()); } + + $locales[] = + [ + 'value' => $locale, + 'checked' => $checked, + 'total' => $torrentService->findTorrentsTotal( + 0, + $keywords, + [$locale], + $request->get('categories') ? $request->get('categories') : $user->getCategories(), + $sensitive, + !$user->isModerator() ? true : null, + !$user->isModerator() ? true : null, + ) + ]; } // Categories @@ -60,30 +77,52 @@ class SearchController extends AbstractController { if ($request->get('categories')) { - $categories[] = - [ - 'value' => $category, - 'checked' => in_array($category, (array) $request->get('categories')) ? true : false, - ]; + $checked = in_array($category, (array) $request->get('categories')); } else { - $categories[] = - [ - 'value' => $category, - 'checked' => in_array($category, $user->getCategories()) ? true : false, - ]; + $checked = in_array($category, $user->getCategories()); } + + $categories[] = + [ + 'value' => $category, + 'checked' => $checked, + 'total' => $torrentService->findTorrentsTotal( + 0, + $keywords, + $request->get('locales') ? $request->get('locales') : $user->getLocales(), + [$category], + $sensitive, + !$user->isModerator() ? true : null, + !$user->isModerator() ? true : null, + ) + ]; } + + // Sensitive + $sensitive = + [ + 'checked' => $request->get('sensitive'), + 'total' => $torrentService->findTorrentsTotal( + 0, + $keywords, + $request->get('locales') ? $request->get('locales') : $user->getLocales(), + $request->get('categories') ? $request->get('categories') : $user->getCategories(), + true, + !$user->isModerator() ? true : null, + !$user->isModerator() ? true : null, + ) + ]; } return $this->render( 'default/search/module.html.twig', [ - 'query' => $request->get('query') ? urldecode($request->get('query')) : '', - 'filter' => $request->get('filter'), - 'sensitive' => $request->get('sensitive'), + 'query' => $query, + 'filter' => $filter, + 'sensitive' => $sensitive, 'locales' => $locales, 'categories' => $categories, ] diff --git a/templates/default/search/module.html.twig b/templates/default/search/module.html.twig index e968a6f..8b1b99b 100644 --- a/templates/default/search/module.html.twig +++ b/templates/default/search/module.html.twig @@ -9,16 +9,21 @@
{% for locale in locales | sort %} -
- {% if locale.checked %} - - {% else %} - - {% endif %} - -
+ {#{% if locale.total %}#} +
+ {% if locale.checked %} + + {% else %} + + {% endif %} + +
+ {#{% endif %}#} {% endfor %}
@@ -26,29 +31,37 @@
{% for category in categories | sort %} -
- {% if category.checked %} - - {% else %} - - {% endif %} - -
+ {#{% if category.total %}#} +
+ {% if category.checked %} + + {% else %} + + {% endif %} + +
+ {#{% endif %}#} {% endfor %}
{{ 'other' | trans | u.title }}
- {% if sensitive %} + {% if sensitive.checked %} {% else %} {% endif %}
From 3ce3dfe77b909ffc6f4efebed8990c92040e2211 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 13 Nov 2023 19:38:05 +0200 Subject: [PATCH 158/185] fix contributors list by integrate new features --- src/Service/TorrentService.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index abb902e..c0c3d52 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -323,6 +323,11 @@ class TorrentService { $contributors = []; + foreach ($this->findTorrentCategoriesByTorrentId($torrent->getId()) as $torrentCategory) + { + $contributors[] = $torrentCategory->getUserId(); + } + foreach ($this->findTorrentLocalesByTorrentId($torrent->getId()) as $torrentLocale) { $contributors[] = $torrentLocale->getUserId(); @@ -333,6 +338,11 @@ class TorrentService $contributors[] = $torrentSensitive->getUserId(); } + foreach ($this->findTorrentPosterByTorrentId($torrent->getId()) as $torrentPoster) + { + $contributors[] = $torrentPoster->getUserId(); + } + $contributors[] = $torrent->getUserId(); return array_unique($contributors); From 7177cdb4fe3f811392518fb10557bdbeedc1c7c7 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 15 Nov 2023 09:52:49 +0200 Subject: [PATCH 159/185] add torrent private info --- templates/default/torrent/info.html.twig | 12 ++++++++++++ translations/messages+intl-icu.cs.xlf | 4 ++++ translations/messages+intl-icu.de.xlf | 4 ++++ translations/messages+intl-icu.en.xlf | 4 ++++ translations/messages+intl-icu.eo.xlf | 4 ++++ translations/messages+intl-icu.es.xlf | 4 ++++ translations/messages+intl-icu.fr.xlf | 4 ++++ translations/messages+intl-icu.he.xlf | 4 ++++ translations/messages+intl-icu.it.xlf | 4 ++++ translations/messages+intl-icu.ja.xlf | 4 ++++ translations/messages+intl-icu.ka.xlf | 4 ++++ translations/messages+intl-icu.lv.xlf | 4 ++++ translations/messages+intl-icu.nl.xlf | 4 ++++ translations/messages+intl-icu.pl.xlf | 4 ++++ translations/messages+intl-icu.pt.xlf | 4 ++++ translations/messages+intl-icu.ru.xlf | 4 ++++ translations/messages+intl-icu.uk.xlf | 4 ++++ 17 files changed, 76 insertions(+) diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index 4d530ab..5a1bdf5 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -220,6 +220,18 @@
+ {{ 'Private' | trans }} + + {% if file.private %} + {{ 'Yes' | trans }} + {% else %} + {{ 'No' | trans }} + {% endif %} +
diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index e40a671..e661df7 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -909,6 +909,10 @@ Show filter Show filter + + Private + Private + diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index 812f8a6..754006d 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -909,6 +909,10 @@ Show filter Show filter + + Private + Private + diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index 0a0423b..cbd0dc2 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -909,6 +909,10 @@ Show filter Show filter + + Private + Private + diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index e0cdbef..5e611d1 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -909,6 +909,10 @@ Show filter Show filter + + Private + Private + diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index 9e1edee..9638ae5 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -909,6 +909,10 @@ Show filter Show filter + + Private + Private + diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index 82dd5c3..daae954 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -909,6 +909,10 @@ Show filter Show filter + + Private + Private + diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index faad62a..a324b84 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -909,6 +909,10 @@ Show filter Show filter + + Private + Private + diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index 6411b4c..e31236c 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -909,6 +909,10 @@ Show filter Show filter + + Private + Private + diff --git a/translations/messages+intl-icu.ja.xlf b/translations/messages+intl-icu.ja.xlf index ccacd9a..56c715b 100644 --- a/translations/messages+intl-icu.ja.xlf +++ b/translations/messages+intl-icu.ja.xlf @@ -909,6 +909,10 @@ Show filter Show filter + + Private + Private + diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index a13adb1..944c10a 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -909,6 +909,10 @@ Show filter Show filter + + Private + Private + diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index 23be2cd..814cec1 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -909,6 +909,10 @@ Show filter Show filter + + Private + Private + diff --git a/translations/messages+intl-icu.nl.xlf b/translations/messages+intl-icu.nl.xlf index da9f1cb..cb827de 100644 --- a/translations/messages+intl-icu.nl.xlf +++ b/translations/messages+intl-icu.nl.xlf @@ -909,6 +909,10 @@ Show filter Show filter + + Private + Private + diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index b44a926..b9debc7 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -909,6 +909,10 @@ Show filter Show filter + + Private + Private + diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index abc2faf..bc8dc0f 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -909,6 +909,10 @@ Show filter Show filter + + Private + Private + diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index 7f4c64b..a452819 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -909,6 +909,10 @@ Show filter Показать фильтр + + Private + Приватный + diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 49159d2..ffea2ef 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -909,6 +909,10 @@ Show filter Показати фільтр + + Private + Приватний + From 8aff756e30ef544a660d0106c262d4797b57c6fe Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 18 Nov 2023 09:27:33 +0200 Subject: [PATCH 160/185] apply search filter for RSS #35 --- src/Controller/TorrentController.php | 16 ++++++++-------- templates/default/torrent/list.html.twig | 24 +++++++++++++++++------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 0da8c26..38205db 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -632,11 +632,11 @@ class TorrentController extends AbstractController // Get total torrents $total = $torrentService->findTorrentsTotal( - $user->getId(), + $request->get('filter') ? 0 : $user->getId(), $query, - $user->getLocales(), - $user->getCategories(), - $user->isSensitive() ? false : null, + $request->get('filter') ? (array) $request->get('locales') : $user->getLocales(), + $request->get('filter') ? (array) $request->get('categories') : $user->getCategories(), + $request->get('filter') ? ($request->get('sensitive') ? null : false) : ($user->isSensitive() ? false : null), !$user->isModerator() ? true : null, !$user->isModerator() ? true : null, ); @@ -644,11 +644,11 @@ class TorrentController extends AbstractController // Create torrents list $torrents = []; foreach ($torrentService->findTorrents( - $user->getId(), + $request->get('filter') ? 0 : $user->getId(), $query, - $user->getLocales(), - $user->getCategories(), - $user->isSensitive() ? false : null, + $request->get('filter') ? (array) $request->get('locales') : $user->getLocales(), + $request->get('filter') ? (array) $request->get('categories') : $user->getCategories(), + $request->get('filter') ? ($request->get('sensitive') ? null : false) : ($user->isSensitive() ? false : null), !$user->isModerator() ? true : null, !$user->isModerator() ? true : null, $this->getParameter('app.pagination'), diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 941b1c9..10187cb 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -11,18 +11,27 @@ + + + + + {% else %} + + + + + {% endif %} - - - - - {% else %}

{{ 'Recent uploads' | trans }}

@@ -186,7 +195,7 @@ {% if query %} {% if pagination.page > 1 %} {% if pagination.page == 2 %} - {% if torrent.status %} {{ 'Yes' | trans }} - + {% else %} {{ 'No' | trans }} - + @@ -119,14 +119,14 @@
{% if torrent.approved %} {{ 'Yes' | trans }} - + {% else %} {{ 'No' | trans }} - + @@ -346,7 +346,7 @@ {% endfor %}
- + From 9081acebb31b75f98ed8b21b0ea8572fd1fce780 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 1 Dec 2023 15:57:00 +0200 Subject: [PATCH 164/185] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5dd91cf..5246d41 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ Engine uses IPv6 `0200::/7` addresses to identify users without registration. #### Instances -* `http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/` - + `ftp://[201:23b4:991a:634d:8359:4521:5576:15b7]:21/yggtracker/` +* `http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/` | [tracker.ygg](http://tracker.ygg) + + `ftp://[201:23b4:991a:634d:8359:4521:5576:15b7]:21/yggtracker/` - wanted torrents #### Installation From f5d4c19eb91ce65a1400450c99dc0ae0f3424745 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 3 Dec 2023 02:11:08 +0200 Subject: [PATCH 165/185] add new crawler --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 9dac3a8..0ee2aaf 100644 --- a/.env +++ b/.env @@ -88,7 +88,7 @@ APP_POSTERS=1 APP_TRACKERS=http://[201:23b4:991a:634d:8359:4521:5576:15b7]:2023/announce|http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/announce|http://[316:c51a:62a3:8b9::5]/announce # List of crawlers where ignored in actions and activity features -APP_CRAWLERS=201:23b4:991a:634d:8359:4521:5576:15b7|30a:5fad::e +APP_CRAWLERS=201:23b4:991a:634d:8359:4521:5576:15b7|30a:5fad::e|202:f2bc:f800:7cc4:c109:7857:5cae:6630 # Max torrent filesize for uploads (check upload_max_filesize in the php.ini) APP_TORRENT_FILE_SIZE_MAX=1024000 From 27e598fdedd5ccbf40d89211cec5d4fbf70884f3 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 3 Dec 2023 02:22:53 +0200 Subject: [PATCH 166/185] add rel/nofollow for wanted links --- templates/default/torrent/list.html.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/default/torrent/list.html.twig b/templates/default/torrent/list.html.twig index 10187cb..93e27d1 100644 --- a/templates/default/torrent/list.html.twig +++ b/templates/default/torrent/list.html.twig @@ -58,7 +58,8 @@ {% if torrent.scrape.leechers > 0 and torrent.scrape.seeders == 0 %} + title="{{ 'Active leechers waiting for seeders' | trans }}" + rel="nofollow"> {{ 'wanted' | trans }} {% endif %} From 9814a56135c510c50efe14a15b7811c5a9a6fc11 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 7 Dec 2023 02:30:15 +0200 Subject: [PATCH 167/185] composer update --- composer.lock | 785 +++++++++++++++++++++++++------------------------- 1 file changed, 398 insertions(+), 387 deletions(-) diff --git a/composer.lock b/composer.lock index 605e0af..efca9a6 100644 --- a/composer.lock +++ b/composer.lock @@ -472,16 +472,16 @@ }, { "name": "doctrine/dbal", - "version": "3.7.1", + "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "5b7bd66c9ff58c04c5474ab85edce442f8081cb2" + "reference": "0ac3c270590e54910715e9a1a044cc368df282b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/5b7bd66c9ff58c04c5474ab85edce442f8081cb2", - "reference": "5b7bd66c9ff58c04c5474ab85edce442f8081cb2", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/0ac3c270590e54910715e9a1a044cc368df282b2", + "reference": "0ac3c270590e54910715e9a1a044cc368df282b2", "shasum": "" }, "require": { @@ -497,7 +497,7 @@ "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", "jetbrains/phpstorm-stubs": "2023.1", - "phpstan/phpstan": "1.10.35", + "phpstan/phpstan": "1.10.42", "phpstan/phpstan-strict-rules": "^1.5", "phpunit/phpunit": "9.6.13", "psalm/plugin-phpunit": "0.18.4", @@ -565,7 +565,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.7.1" + "source": "https://github.com/doctrine/dbal/tree/3.7.2" }, "funding": [ { @@ -581,7 +581,7 @@ "type": "tidelift" } ], - "time": "2023-10-06T05:06:20+00:00" + "time": "2023-11-19T08:06:58+00:00" }, { "name": "doctrine/deprecations", @@ -632,56 +632,59 @@ }, { "name": "doctrine/doctrine-bundle", - "version": "2.10.2", + "version": "2.11.1", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineBundle.git", - "reference": "f28b1f78de3a2938ff05cfe751233097624cc756" + "reference": "4089f1424b724786c062aea50aae5f773449b94b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/f28b1f78de3a2938ff05cfe751233097624cc756", - "reference": "f28b1f78de3a2938ff05cfe751233097624cc756", + "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/4089f1424b724786c062aea50aae5f773449b94b", + "reference": "4089f1424b724786c062aea50aae5f773449b94b", "shasum": "" }, "require": { "doctrine/cache": "^1.11 || ^2.0", - "doctrine/dbal": "^3.6.0", + "doctrine/dbal": "^3.7.0 || ^4.0", "doctrine/persistence": "^2.2 || ^3", "doctrine/sql-formatter": "^1.0.1", "php": "^7.4 || ^8.0", - "symfony/cache": "^5.4 || ^6.0", - "symfony/config": "^5.4 || ^6.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/dependency-injection": "^5.4 || ^6.0", + "symfony/cache": "^5.4 || ^6.0 || ^7.0", + "symfony/config": "^5.4 || ^6.0 || ^7.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0", "symfony/deprecation-contracts": "^2.1 || ^3", - "symfony/doctrine-bridge": "^5.4.19 || ^6.0.7", - "symfony/framework-bundle": "^5.4 || ^6.0", + "symfony/doctrine-bridge": "^5.4.19 || ^6.0.7 || ^7.0", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-php80": "^1.15", "symfony/service-contracts": "^1.1.1 || ^2.0 || ^3" }, "conflict": { "doctrine/annotations": ">=3.0", - "doctrine/orm": "<2.11 || >=3.0", + "doctrine/orm": "<2.14 || >=4.0", "twig/twig": "<1.34 || >=2.0 <2.4" }, "require-dev": { "doctrine/annotations": "^1 || ^2", - "doctrine/coding-standard": "^9.0", + "doctrine/coding-standard": "^12", "doctrine/deprecations": "^1.0", - "doctrine/orm": "^2.11 || ^3.0", + "doctrine/orm": "^2.14 || ^3.0", "friendsofphp/proxy-manager-lts": "^1.0", "phpunit/phpunit": "^9.5.26 || ^10.0", "psalm/plugin-phpunit": "^0.18.4", "psalm/plugin-symfony": "^4", "psr/log": "^1.1.4 || ^2.0 || ^3.0", - "symfony/phpunit-bridge": "^6.1", - "symfony/property-info": "^5.4 || ^6.0", - "symfony/proxy-manager-bridge": "^5.4 || ^6.0", - "symfony/security-bundle": "^5.4 || ^6.0", - "symfony/twig-bridge": "^5.4 || ^6.0", - "symfony/validator": "^5.4 || ^6.0", - "symfony/web-profiler-bundle": "^5.4 || ^6.0", - "symfony/yaml": "^5.4 || ^6.0", + "symfony/phpunit-bridge": "^6.1 || ^7.0", + "symfony/property-info": "^5.4 || ^6.0 || ^7.0", + "symfony/proxy-manager-bridge": "^5.4 || ^6.0 || ^7.0", + "symfony/security-bundle": "^5.4 || ^6.0 || ^7.0", + "symfony/string": "^5.4 || ^6.0 || ^7.0", + "symfony/twig-bridge": "^5.4 || ^6.0 || ^7.0", + "symfony/validator": "^5.4 || ^6.0 || ^7.0", + "symfony/var-exporter": "^5.4 || ^6.2 || ^7.0", + "symfony/web-profiler-bundle": "^5.4 || ^6.0 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0", "twig/twig": "^1.34 || ^2.12 || ^3.0", "vimeo/psalm": "^4.30" }, @@ -728,7 +731,7 @@ ], "support": { "issues": "https://github.com/doctrine/DoctrineBundle/issues", - "source": "https://github.com/doctrine/DoctrineBundle/tree/2.10.2" + "source": "https://github.com/doctrine/DoctrineBundle/tree/2.11.1" }, "funding": [ { @@ -744,38 +747,44 @@ "type": "tidelift" } ], - "time": "2023-08-06T09:31:40+00:00" + "time": "2023-11-15T20:01:50+00:00" }, { "name": "doctrine/doctrine-migrations-bundle", - "version": "3.2.4", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineMigrationsBundle.git", - "reference": "94e6b0fe1a50901d52f59dbb9b4b0737718b2c1e" + "reference": "1dd42906a5fb9c5960723e2ebb45c68006493835" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/94e6b0fe1a50901d52f59dbb9b4b0737718b2c1e", - "reference": "94e6b0fe1a50901d52f59dbb9b4b0737718b2c1e", + "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/1dd42906a5fb9c5960723e2ebb45c68006493835", + "reference": "1dd42906a5fb9c5960723e2ebb45c68006493835", "shasum": "" }, "require": { - "doctrine/doctrine-bundle": "~1.0|~2.0", + "doctrine/doctrine-bundle": "^2.4", "doctrine/migrations": "^3.2", "php": "^7.2|^8.0", - "symfony/framework-bundle": "~3.4|~4.0|~5.0|~6.0" + "symfony/deprecation-contracts": "^2.1 || ^3", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "doctrine/orm": "^2.6", - "doctrine/persistence": "^1.3||^2.0", + "doctrine/coding-standard": "^12", + "doctrine/orm": "^2.6 || ^3", + "doctrine/persistence": "^2.0 || ^3 ", "phpstan/phpstan": "^1.4", "phpstan/phpstan-deprecation-rules": "^1", "phpstan/phpstan-phpunit": "^1", "phpstan/phpstan-strict-rules": "^1.1", + "phpstan/phpstan-symfony": "^1.3", "phpunit/phpunit": "^8.5|^9.5", - "vimeo/psalm": "^4.22" + "psalm/plugin-phpunit": "^0.18.4", + "psalm/plugin-symfony": "^3 || ^5", + "symfony/phpunit-bridge": "^6.3 || ^7", + "symfony/var-exporter": "^5.4 || ^6 || ^7", + "vimeo/psalm": "^4.30 || ^5.15" }, "type": "symfony-bundle", "autoload": { @@ -813,7 +822,7 @@ ], "support": { "issues": "https://github.com/doctrine/DoctrineMigrationsBundle/issues", - "source": "https://github.com/doctrine/DoctrineMigrationsBundle/tree/3.2.4" + "source": "https://github.com/doctrine/DoctrineMigrationsBundle/tree/3.3.0" }, "funding": [ { @@ -829,7 +838,7 @@ "type": "tidelift" } ], - "time": "2023-06-02T08:19:26+00:00" + "time": "2023-11-13T19:44:41+00:00" }, { "name": "doctrine/event-manager", @@ -1163,47 +1172,47 @@ }, { "name": "doctrine/migrations", - "version": "3.6.0", + "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/doctrine/migrations.git", - "reference": "e542ad8bcd606d7a18d0875babb8a6d963c9c059" + "reference": "47af29eef49f29ebee545947e8b2a4b3be318c8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/migrations/zipball/e542ad8bcd606d7a18d0875babb8a6d963c9c059", - "reference": "e542ad8bcd606d7a18d0875babb8a6d963c9c059", + "url": "https://api.github.com/repos/doctrine/migrations/zipball/47af29eef49f29ebee545947e8b2a4b3be318c8a", + "reference": "47af29eef49f29ebee545947e8b2a4b3be318c8a", "shasum": "" }, "require": { "composer-runtime-api": "^2", - "doctrine/dbal": "^3.5.1", + "doctrine/dbal": "^3.5.1 || ^4", "doctrine/deprecations": "^0.5.3 || ^1", "doctrine/event-manager": "^1.2 || ^2.0", "php": "^8.1", "psr/log": "^1.1.3 || ^2 || ^3", - "symfony/console": "^4.4.16 || ^5.4 || ^6.0", - "symfony/stopwatch": "^4.4 || ^5.4 || ^6.0", - "symfony/var-exporter": "^6.2" + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0", + "symfony/var-exporter": "^6.2 || ^7.0" }, "conflict": { - "doctrine/orm": "<2.12" + "doctrine/orm": "<2.12 || >=4" }, "require-dev": { - "doctrine/coding-standard": "^9", - "doctrine/orm": "^2.13", + "doctrine/coding-standard": "^12", + "doctrine/orm": "^2.13 || ^3", "doctrine/persistence": "^2 || ^3", "doctrine/sql-formatter": "^1.0", "ext-pdo_sqlite": "*", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-deprecation-rules": "^1", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.1", - "phpstan/phpstan-symfony": "^1.1", - "phpunit/phpunit": "^9.5.24", - "symfony/cache": "^4.4 || ^5.4 || ^6.0", - "symfony/process": "^4.4 || ^5.4 || ^6.0", - "symfony/yaml": "^4.4 || ^5.4 || ^6.0" + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-deprecation-rules": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpstan/phpstan-strict-rules": "^1.4", + "phpstan/phpstan-symfony": "^1.3", + "phpunit/phpunit": "^10.3", + "symfony/cache": "^5.4 || ^6.0 || ^7.0", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, "suggest": { "doctrine/sql-formatter": "Allows to generate formatted SQL with the diff command.", @@ -1245,7 +1254,7 @@ ], "support": { "issues": "https://github.com/doctrine/migrations/issues", - "source": "https://github.com/doctrine/migrations/tree/3.6.0" + "source": "https://github.com/doctrine/migrations/tree/3.7.2" }, "funding": [ { @@ -1261,20 +1270,20 @@ "type": "tidelift" } ], - "time": "2023-02-15T18:49:46+00:00" + "time": "2023-12-05T11:35:05+00:00" }, { "name": "doctrine/orm", - "version": "2.16.2", + "version": "2.17.1", "source": { "type": "git", "url": "https://github.com/doctrine/orm.git", - "reference": "17500f56eaa930f5cd14d765bc2cd851c7d37cc0" + "reference": "1a4fe6e0bb67762370937a7e6cee3da40a9122d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/17500f56eaa930f5cd14d765bc2cd851c7d37cc0", - "reference": "17500f56eaa930f5cd14d765bc2cd851c7d37cc0", + "url": "https://api.github.com/repos/doctrine/orm/zipball/1a4fe6e0bb67762370937a7e6cee3da40a9122d1", + "reference": "1a4fe6e0bb67762370937a7e6cee3da40a9122d1", "shasum": "" }, "require": { @@ -1292,7 +1301,7 @@ "ext-ctype": "*", "php": "^7.1 || ^8.0", "psr/cache": "^1 || ^2 || ^3", - "symfony/console": "^4.2 || ^5.0 || ^6.0", + "symfony/console": "^4.2 || ^5.0 || ^6.0 || ^7.0", "symfony/polyfill-php72": "^1.23", "symfony/polyfill-php80": "^1.16" }, @@ -1303,14 +1312,14 @@ "doctrine/annotations": "^1.13 || ^2", "doctrine/coding-standard": "^9.0.2 || ^12.0", "phpbench/phpbench": "^0.16.10 || ^1.0", - "phpstan/phpstan": "~1.4.10 || 1.10.28", + "phpstan/phpstan": "~1.4.10 || 1.10.35", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", "psr/log": "^1 || ^2 || ^3", "squizlabs/php_codesniffer": "3.7.2", "symfony/cache": "^4.4 || ^5.4 || ^6.0", "symfony/var-exporter": "^4.4 || ^5.4 || ^6.2", "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0", - "vimeo/psalm": "4.30.0 || 5.14.1" + "vimeo/psalm": "4.30.0 || 5.15.0" }, "suggest": { "ext-dom": "Provides support for XSD validation for XML mapping files", @@ -1360,9 +1369,9 @@ ], "support": { "issues": "https://github.com/doctrine/orm/issues", - "source": "https://github.com/doctrine/orm/tree/2.16.2" + "source": "https://github.com/doctrine/orm/tree/2.17.1" }, - "time": "2023-08-27T18:21:56+00:00" + "time": "2023-11-17T06:25:40+00:00" }, { "name": "doctrine/persistence", @@ -2237,16 +2246,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.24.2", + "version": "1.24.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "bcad8d995980440892759db0c32acae7c8e79442" + "reference": "6bd0c26f3786cd9b7c359675cb789e35a8e07496" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442", - "reference": "bcad8d995980440892759db0c32acae7c8e79442", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/6bd0c26f3786cd9b7c359675cb789e35a8e07496", + "reference": "6bd0c26f3786cd9b7c359675cb789e35a8e07496", "shasum": "" }, "require": { @@ -2278,9 +2287,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.4" }, - "time": "2023-09-26T12:28:12+00:00" + "time": "2023-11-26T18:29:22+00:00" }, { "name": "psr/cache", @@ -2590,22 +2599,23 @@ }, { "name": "rhilip/bencode", - "version": "v2.3.3", + "version": "v2.4.2", "source": { "type": "git", "url": "https://github.com/Rhilip/Bencode.git", - "reference": "fd37d13bb745352d40879dbbfa6da85af91e49f1" + "reference": "d5b51d02f73017834c53aa76aff2403fb753ac97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Rhilip/Bencode/zipball/fd37d13bb745352d40879dbbfa6da85af91e49f1", - "reference": "fd37d13bb745352d40879dbbfa6da85af91e49f1", + "url": "https://api.github.com/repos/Rhilip/Bencode/zipball/d5b51d02f73017834c53aa76aff2403fb753ac97", + "reference": "d5b51d02f73017834c53aa76aff2403fb753ac97", "shasum": "" }, "require": { "php": "^7.3|^8.0" }, "require-dev": { + "ext-json": "*", "phpunit/phpunit": "^9.0" }, "suggest": { @@ -2635,22 +2645,22 @@ ], "support": { "issues": "https://github.com/Rhilip/Bencode/issues", - "source": "https://github.com/Rhilip/Bencode/tree/v2.3.3" + "source": "https://github.com/Rhilip/Bencode/tree/v2.4.2" }, - "time": "2023-05-27T01:47:00+00:00" + "time": "2023-11-05T11:24:41+00:00" }, { "name": "symfony/asset", - "version": "v6.3.0", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/asset.git", - "reference": "b77a4cc8e266b7e0db688de740f9ee7253aa411c" + "reference": "b2382a403f2111836301623d89e9af3d84989525" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/asset/zipball/b77a4cc8e266b7e0db688de740f9ee7253aa411c", - "reference": "b77a4cc8e266b7e0db688de740f9ee7253aa411c", + "url": "https://api.github.com/repos/symfony/asset/zipball/b2382a403f2111836301623d89e9af3d84989525", + "reference": "b2382a403f2111836301623d89e9af3d84989525", "shasum": "" }, "require": { @@ -2690,7 +2700,7 @@ "description": "Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/asset/tree/v6.3.0" + "source": "https://github.com/symfony/asset/tree/v6.3.8" }, "funding": [ { @@ -2706,20 +2716,20 @@ "type": "tidelift" } ], - "time": "2023-04-21T14:41:17+00:00" + "time": "2023-10-31T08:07:48+00:00" }, { "name": "symfony/cache", - "version": "v6.3.6", + "version": "v6.3.9", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "84aff8d948d6292d2b5a01ac622760be44dddc72" + "reference": "8c6e84272e4febbb1fed3c5b9f3c722537c2bd55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/84aff8d948d6292d2b5a01ac622760be44dddc72", - "reference": "84aff8d948d6292d2b5a01ac622760be44dddc72", + "url": "https://api.github.com/repos/symfony/cache/zipball/8c6e84272e4febbb1fed3c5b9f3c722537c2bd55", + "reference": "8c6e84272e4febbb1fed3c5b9f3c722537c2bd55", "shasum": "" }, "require": { @@ -2786,7 +2796,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v6.3.6" + "source": "https://github.com/symfony/cache/tree/v6.3.9" }, "funding": [ { @@ -2802,20 +2812,20 @@ "type": "tidelift" } ], - "time": "2023-10-17T14:44:58+00:00" + "time": "2023-11-24T13:24:35+00:00" }, { "name": "symfony/cache-contracts", - "version": "v3.3.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/cache-contracts.git", - "reference": "ad945640ccc0ae6e208bcea7d7de4b39b569896b" + "reference": "1d74b127da04ffa87aa940abe15446fa89653778" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/ad945640ccc0ae6e208bcea7d7de4b39b569896b", - "reference": "ad945640ccc0ae6e208bcea7d7de4b39b569896b", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/1d74b127da04ffa87aa940abe15446fa89653778", + "reference": "1d74b127da04ffa87aa940abe15446fa89653778", "shasum": "" }, "require": { @@ -2862,7 +2872,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/cache-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/cache-contracts/tree/v3.4.0" }, "funding": [ { @@ -2878,7 +2888,7 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2023-09-25T12:52:38+00:00" }, { "name": "symfony/clock", @@ -2955,16 +2965,16 @@ }, { "name": "symfony/config", - "version": "v6.3.2", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "b47ca238b03e7b0d7880ffd1cf06e8d637ca1467" + "reference": "b7a63887960359e5b59b15826fa9f9be10acbe88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/b47ca238b03e7b0d7880ffd1cf06e8d637ca1467", - "reference": "b47ca238b03e7b0d7880ffd1cf06e8d637ca1467", + "url": "https://api.github.com/repos/symfony/config/zipball/b7a63887960359e5b59b15826fa9f9be10acbe88", + "reference": "b7a63887960359e5b59b15826fa9f9be10acbe88", "shasum": "" }, "require": { @@ -3010,7 +3020,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v6.3.2" + "source": "https://github.com/symfony/config/tree/v6.3.8" }, "funding": [ { @@ -3026,20 +3036,20 @@ "type": "tidelift" } ], - "time": "2023-07-19T20:22:16+00:00" + "time": "2023-11-09T08:28:21+00:00" }, { "name": "symfony/console", - "version": "v6.3.4", + "version": "v6.3.9", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6" + "reference": "0566dbd051f8648d980592c7849f5d90d2c7c60c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/eca495f2ee845130855ddf1cf18460c38966c8b6", - "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6", + "url": "https://api.github.com/repos/symfony/console/zipball/0566dbd051f8648d980592c7849f5d90d2c7c60c", + "reference": "0566dbd051f8648d980592c7849f5d90d2c7c60c", "shasum": "" }, "require": { @@ -3100,7 +3110,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.3.4" + "source": "https://github.com/symfony/console/tree/v6.3.9" }, "funding": [ { @@ -3116,7 +3126,7 @@ "type": "tidelift" } ], - "time": "2023-08-16T10:10:12+00:00" + "time": "2023-11-20T16:36:29+00:00" }, { "name": "symfony/crowdin-translation-provider", @@ -3193,16 +3203,16 @@ }, { "name": "symfony/dependency-injection", - "version": "v6.3.5", + "version": "v6.3.10", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "2ed62b3bf98346e1f45529a7b6be2196739bb993" + "reference": "51383a1d9d7e93d5c3c76ddc32672de1b3e82c77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/2ed62b3bf98346e1f45529a7b6be2196739bb993", - "reference": "2ed62b3bf98346e1f45529a7b6be2196739bb993", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/51383a1d9d7e93d5c3c76ddc32672de1b3e82c77", + "reference": "51383a1d9d7e93d5c3c76ddc32672de1b3e82c77", "shasum": "" }, "require": { @@ -3254,7 +3264,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.3.5" + "source": "https://github.com/symfony/dependency-injection/tree/v6.3.10" }, "funding": [ { @@ -3270,11 +3280,11 @@ "type": "tidelift" } ], - "time": "2023-09-25T16:46:40+00:00" + "time": "2023-12-01T14:25:58+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.3.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", @@ -3321,7 +3331,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" }, "funding": [ { @@ -3341,16 +3351,16 @@ }, { "name": "symfony/doctrine-bridge", - "version": "v6.3.7", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-bridge.git", - "reference": "c8af292f733cc28149485639177c5f2b67dff200" + "reference": "8842d289d41320a0f725e996b4e58d84af398a9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/c8af292f733cc28149485639177c5f2b67dff200", - "reference": "c8af292f733cc28149485639177c5f2b67dff200", + "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/8842d289d41320a0f725e996b4e58d84af398a9e", + "reference": "8842d289d41320a0f725e996b4e58d84af398a9e", "shasum": "" }, "require": { @@ -3431,7 +3441,7 @@ "description": "Provides integration for Doctrine with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/doctrine-bridge/tree/v6.3.7" + "source": "https://github.com/symfony/doctrine-bridge/tree/v6.3.8" }, "funding": [ { @@ -3447,20 +3457,20 @@ "type": "tidelift" } ], - "time": "2023-10-28T23:11:45+00:00" + "time": "2023-10-31T08:07:48+00:00" }, { "name": "symfony/doctrine-messenger", - "version": "v6.3.7", + "version": "v6.3.10", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-messenger.git", - "reference": "b8dab85f66ffd5e4275eaf7558f9db8f4586dd41" + "reference": "b225f860450a34291bc5983f87d57fb7b9ef18b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-messenger/zipball/b8dab85f66ffd5e4275eaf7558f9db8f4586dd41", - "reference": "b8dab85f66ffd5e4275eaf7558f9db8f4586dd41", + "url": "https://api.github.com/repos/symfony/doctrine-messenger/zipball/b225f860450a34291bc5983f87d57fb7b9ef18b8", + "reference": "b225f860450a34291bc5983f87d57fb7b9ef18b8", "shasum": "" }, "require": { @@ -3503,7 +3513,7 @@ "description": "Symfony Doctrine Messenger Bridge", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/doctrine-messenger/tree/v6.3.7" + "source": "https://github.com/symfony/doctrine-messenger/tree/v6.3.10" }, "funding": [ { @@ -3519,7 +3529,7 @@ "type": "tidelift" } ], - "time": "2023-10-26T18:15:14+00:00" + "time": "2023-12-01T09:24:52+00:00" }, { "name": "symfony/dotenv", @@ -3751,7 +3761,7 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.3.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", @@ -3807,7 +3817,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.0" }, "funding": [ { @@ -4018,16 +4028,16 @@ }, { "name": "symfony/flex", - "version": "v2.4.1", + "version": "v2.4.2", "source": { "type": "git", "url": "https://github.com/symfony/flex.git", - "reference": "ae6dea68771c5fca9d172e0c0910bdd06199f6f4" + "reference": "67ee785f1aedada76461de7a7ec10cd7f8ff8d36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/flex/zipball/ae6dea68771c5fca9d172e0c0910bdd06199f6f4", - "reference": "ae6dea68771c5fca9d172e0c0910bdd06199f6f4", + "url": "https://api.github.com/repos/symfony/flex/zipball/67ee785f1aedada76461de7a7ec10cd7f8ff8d36", + "reference": "67ee785f1aedada76461de7a7ec10cd7f8ff8d36", "shasum": "" }, "require": { @@ -4063,7 +4073,7 @@ "description": "Composer plugin for Symfony", "support": { "issues": "https://github.com/symfony/flex/issues", - "source": "https://github.com/symfony/flex/tree/v2.4.1" + "source": "https://github.com/symfony/flex/tree/v2.4.2" }, "funding": [ { @@ -4079,20 +4089,20 @@ "type": "tidelift" } ], - "time": "2023-10-30T18:35:17+00:00" + "time": "2023-12-05T14:09:35+00:00" }, { "name": "symfony/form", - "version": "v6.3.7", + "version": "v6.3.10", "source": { "type": "git", "url": "https://github.com/symfony/form.git", - "reference": "e6743d188f168643cb247f65cbad09ddb1dfcfe5" + "reference": "5afc7334b9d60dd0799612faf3d103b25bc60ae4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/form/zipball/e6743d188f168643cb247f65cbad09ddb1dfcfe5", - "reference": "e6743d188f168643cb247f65cbad09ddb1dfcfe5", + "url": "https://api.github.com/repos/symfony/form/zipball/5afc7334b9d60dd0799612faf3d103b25bc60ae4", + "reference": "5afc7334b9d60dd0799612faf3d103b25bc60ae4", "shasum": "" }, "require": { @@ -4160,7 +4170,7 @@ "description": "Allows to easily create, process and reuse HTML forms", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/form/tree/v6.3.7" + "source": "https://github.com/symfony/form/tree/v6.3.10" }, "funding": [ { @@ -4176,20 +4186,20 @@ "type": "tidelift" } ], - "time": "2023-10-28T23:11:45+00:00" + "time": "2023-11-30T11:08:22+00:00" }, { "name": "symfony/framework-bundle", - "version": "v6.3.7", + "version": "v6.3.9", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "dba20792c726c30d455626eddfb2db008f64085f" + "reference": "f83d20092e98c3ae8b5874b8f0787546c5c61cda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/dba20792c726c30d455626eddfb2db008f64085f", - "reference": "dba20792c726c30d455626eddfb2db008f64085f", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/f83d20092e98c3ae8b5874b8f0787546c5c61cda", + "reference": "f83d20092e98c3ae8b5874b8f0787546c5c61cda", "shasum": "" }, "require": { @@ -4304,7 +4314,7 @@ "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v6.3.7" + "source": "https://github.com/symfony/framework-bundle/tree/v6.3.9" }, "funding": [ { @@ -4320,20 +4330,20 @@ "type": "tidelift" } ], - "time": "2023-10-26T18:15:14+00:00" + "time": "2023-11-24T10:25:33+00:00" }, { "name": "symfony/http-client", - "version": "v6.3.7", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "cd67fcaf4524ec6ae5d9b2d9497682d7ad3ce57d" + "reference": "0314e2d49939a9831929d6fc81c01c6df137fd0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/cd67fcaf4524ec6ae5d9b2d9497682d7ad3ce57d", - "reference": "cd67fcaf4524ec6ae5d9b2d9497682d7ad3ce57d", + "url": "https://api.github.com/repos/symfony/http-client/zipball/0314e2d49939a9831929d6fc81c01c6df137fd0a", + "reference": "0314e2d49939a9831929d6fc81c01c6df137fd0a", "shasum": "" }, "require": { @@ -4396,7 +4406,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.3.7" + "source": "https://github.com/symfony/http-client/tree/v6.3.8" }, "funding": [ { @@ -4412,20 +4422,20 @@ "type": "tidelift" } ], - "time": "2023-10-29T12:41:36+00:00" + "time": "2023-11-06T18:31:59+00:00" }, { "name": "symfony/http-client-contracts", - "version": "v3.3.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "3b66325d0176b4ec826bffab57c9037d759c31fb" + "reference": "1ee70e699b41909c209a0c930f11034b93578654" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/3b66325d0176b4ec826bffab57c9037d759c31fb", - "reference": "3b66325d0176b4ec826bffab57c9037d759c31fb", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/1ee70e699b41909c209a0c930f11034b93578654", + "reference": "1ee70e699b41909c209a0c930f11034b93578654", "shasum": "" }, "require": { @@ -4474,7 +4484,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/http-client-contracts/tree/v3.4.0" }, "funding": [ { @@ -4490,20 +4500,20 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2023-07-30T20:28:31+00:00" }, { "name": "symfony/http-foundation", - "version": "v6.3.7", + "version": "v6.3.9", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "59d1837d5d992d16c2628cd0d6b76acf8d69b33e" + "reference": "49a04fd3a21edc9ce503ab78e9f342805fefe780" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/59d1837d5d992d16c2628cd0d6b76acf8d69b33e", - "reference": "59d1837d5d992d16c2628cd0d6b76acf8d69b33e", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/49a04fd3a21edc9ce503ab78e9f342805fefe780", + "reference": "49a04fd3a21edc9ce503ab78e9f342805fefe780", "shasum": "" }, "require": { @@ -4551,7 +4561,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.3.7" + "source": "https://github.com/symfony/http-foundation/tree/v6.3.9" }, "funding": [ { @@ -4567,20 +4577,20 @@ "type": "tidelift" } ], - "time": "2023-10-28T23:55:27+00:00" + "time": "2023-11-20T16:36:29+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.3.7", + "version": "v6.3.10", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "6d4098095f93279d9536a0e9124439560cc764d0" + "reference": "8d8e7aa60593fd0a2e3c1cea08cc687314841b61" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/6d4098095f93279d9536a0e9124439560cc764d0", - "reference": "6d4098095f93279d9536a0e9124439560cc764d0", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/8d8e7aa60593fd0a2e3c1cea08cc687314841b61", + "reference": "8d8e7aa60593fd0a2e3c1cea08cc687314841b61", "shasum": "" }, "require": { @@ -4664,7 +4674,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.3.7" + "source": "https://github.com/symfony/http-kernel/tree/v6.3.10" }, "funding": [ { @@ -4680,7 +4690,7 @@ "type": "tidelift" } ], - "time": "2023-10-29T14:31:45+00:00" + "time": "2023-12-01T16:57:27+00:00" }, { "name": "symfony/intl", @@ -4846,16 +4856,16 @@ }, { "name": "symfony/messenger", - "version": "v6.3.7", + "version": "v6.3.9", "source": { "type": "git", "url": "https://github.com/symfony/messenger.git", - "reference": "a0a8860ca625116c474c9c1f5570bd7ec752c599" + "reference": "096b151f955d5ac56cc61a3ca0e16b38ff093805" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/messenger/zipball/a0a8860ca625116c474c9c1f5570bd7ec752c599", - "reference": "a0a8860ca625116c474c9c1f5570bd7ec752c599", + "url": "https://api.github.com/repos/symfony/messenger/zipball/096b151f955d5ac56cc61a3ca0e16b38ff093805", + "reference": "096b151f955d5ac56cc61a3ca0e16b38ff093805", "shasum": "" }, "require": { @@ -4913,7 +4923,7 @@ "description": "Helps applications send and receive messages to/from other applications or via message queues", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/messenger/tree/v6.3.7" + "source": "https://github.com/symfony/messenger/tree/v6.3.9" }, "funding": [ { @@ -4929,7 +4939,7 @@ "type": "tidelift" } ], - "time": "2023-10-26T18:15:14+00:00" + "time": "2023-11-22T19:13:10+00:00" }, { "name": "symfony/mime", @@ -5017,16 +5027,16 @@ }, { "name": "symfony/monolog-bridge", - "version": "v6.3.1", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/monolog-bridge.git", - "reference": "04b04b8e465e0fa84940e5609b6796a8b4e51bf1" + "reference": "2bbfc8bd9d6f966b69eda20c66762580a0410c78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/04b04b8e465e0fa84940e5609b6796a8b4e51bf1", - "reference": "04b04b8e465e0fa84940e5609b6796a8b4e51bf1", + "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/2bbfc8bd9d6f966b69eda20c66762580a0410c78", + "reference": "2bbfc8bd9d6f966b69eda20c66762580a0410c78", "shasum": "" }, "require": { @@ -5075,7 +5085,7 @@ "description": "Provides integration for Monolog with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/monolog-bridge/tree/v6.3.1" + "source": "https://github.com/symfony/monolog-bridge/tree/v6.3.8" }, "funding": [ { @@ -5091,34 +5101,34 @@ "type": "tidelift" } ], - "time": "2023-06-08T11:13:32+00:00" + "time": "2023-10-31T08:07:48+00:00" }, { "name": "symfony/monolog-bundle", - "version": "v3.8.0", + "version": "v3.10.0", "source": { "type": "git", "url": "https://github.com/symfony/monolog-bundle.git", - "reference": "a41bbcdc1105603b6d73a7d9a43a3788f8e0fb7d" + "reference": "414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/a41bbcdc1105603b6d73a7d9a43a3788f8e0fb7d", - "reference": "a41bbcdc1105603b6d73a7d9a43a3788f8e0fb7d", + "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181", + "reference": "414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181", "shasum": "" }, "require": { - "monolog/monolog": "^1.22 || ^2.0 || ^3.0", - "php": ">=7.1.3", - "symfony/config": "~4.4 || ^5.0 || ^6.0", - "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0", - "symfony/http-kernel": "~4.4 || ^5.0 || ^6.0", - "symfony/monolog-bridge": "~4.4 || ^5.0 || ^6.0" + "monolog/monolog": "^1.25.1 || ^2.0 || ^3.0", + "php": ">=7.2.5", + "symfony/config": "^5.4 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0", + "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0", + "symfony/monolog-bridge": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { - "symfony/console": "~4.4 || ^5.0 || ^6.0", - "symfony/phpunit-bridge": "^5.2 || ^6.0", - "symfony/yaml": "~4.4 || ^5.0 || ^6.0" + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/phpunit-bridge": "^6.3 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, "type": "symfony-bundle", "extra": { @@ -5156,7 +5166,7 @@ ], "support": { "issues": "https://github.com/symfony/monolog-bundle/issues", - "source": "https://github.com/symfony/monolog-bundle/tree/v3.8.0" + "source": "https://github.com/symfony/monolog-bundle/tree/v3.10.0" }, "funding": [ { @@ -5172,7 +5182,7 @@ "type": "tidelift" } ], - "time": "2022-05-10T14:24:36+00:00" + "time": "2023-11-06T17:08:13+00:00" }, { "name": "symfony/notifier", @@ -5321,16 +5331,16 @@ }, { "name": "symfony/password-hasher", - "version": "v6.3.5", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/password-hasher.git", - "reference": "278d3a49715073879f75e372ad80b8cfeca949d3" + "reference": "82161c4bebf77900372083ec6e484b5f055b0cba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/password-hasher/zipball/278d3a49715073879f75e372ad80b8cfeca949d3", - "reference": "278d3a49715073879f75e372ad80b8cfeca949d3", + "url": "https://api.github.com/repos/symfony/password-hasher/zipball/82161c4bebf77900372083ec6e484b5f055b0cba", + "reference": "82161c4bebf77900372083ec6e484b5f055b0cba", "shasum": "" }, "require": { @@ -5373,7 +5383,7 @@ "password" ], "support": { - "source": "https://github.com/symfony/password-hasher/tree/v6.3.5" + "source": "https://github.com/symfony/password-hasher/tree/v6.3.8" }, "funding": [ { @@ -5389,7 +5399,7 @@ "type": "tidelift" } ], - "time": "2023-09-25T17:05:16+00:00" + "time": "2023-11-06T10:58:05+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -6033,16 +6043,16 @@ }, { "name": "symfony/property-info", - "version": "v6.3.0", + "version": "v6.3.9", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "7f3a03716112269741fe2a809f8f791a371d1fcd" + "reference": "664ae7ad443d7cc591ff3e15496b954e4cefe729" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/7f3a03716112269741fe2a809f8f791a371d1fcd", - "reference": "7f3a03716112269741fe2a809f8f791a371d1fcd", + "url": "https://api.github.com/repos/symfony/property-info/zipball/664ae7ad443d7cc591ff3e15496b954e4cefe729", + "reference": "664ae7ad443d7cc591ff3e15496b954e4cefe729", "shasum": "" }, "require": { @@ -6096,7 +6106,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v6.3.0" + "source": "https://github.com/symfony/property-info/tree/v6.3.9" }, "funding": [ { @@ -6112,20 +6122,20 @@ "type": "tidelift" } ], - "time": "2023-05-19T08:06:44+00:00" + "time": "2023-11-24T11:57:32+00:00" }, { "name": "symfony/routing", - "version": "v6.3.5", + "version": "v6.3.10", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "82616e59acd3e3d9c916bba798326cb7796d7d31" + "reference": "cb7404232d49dd11cc971b832fcbd49e7c22b049" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/82616e59acd3e3d9c916bba798326cb7796d7d31", - "reference": "82616e59acd3e3d9c916bba798326cb7796d7d31", + "url": "https://api.github.com/repos/symfony/routing/zipball/cb7404232d49dd11cc971b832fcbd49e7c22b049", + "reference": "cb7404232d49dd11cc971b832fcbd49e7c22b049", "shasum": "" }, "require": { @@ -6179,7 +6189,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.3.5" + "source": "https://github.com/symfony/routing/tree/v6.3.10" }, "funding": [ { @@ -6195,7 +6205,7 @@ "type": "tidelift" } ], - "time": "2023-09-20T16:05:51+00:00" + "time": "2023-12-01T14:25:58+00:00" }, { "name": "symfony/runtime", @@ -6278,16 +6288,16 @@ }, { "name": "symfony/security-bundle", - "version": "v6.3.7", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/security-bundle.git", - "reference": "8ece4fd6e242acbabad4461feae7c52fe1982c48" + "reference": "57889ebb1ac3403d550c787c4fde127261abacb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-bundle/zipball/8ece4fd6e242acbabad4461feae7c52fe1982c48", - "reference": "8ece4fd6e242acbabad4461feae7c52fe1982c48", + "url": "https://api.github.com/repos/symfony/security-bundle/zipball/57889ebb1ac3403d550c787c4fde127261abacb6", + "reference": "57889ebb1ac3403d550c787c4fde127261abacb6", "shasum": "" }, "require": { @@ -6369,7 +6379,7 @@ "description": "Provides a tight integration of the Security component into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-bundle/tree/v6.3.7" + "source": "https://github.com/symfony/security-bundle/tree/v6.3.8" }, "funding": [ { @@ -6385,7 +6395,7 @@ "type": "tidelift" } ], - "time": "2023-10-26T18:15:14+00:00" + "time": "2023-11-09T09:33:10+00:00" }, { "name": "symfony/security-core", @@ -6542,16 +6552,16 @@ }, { "name": "symfony/security-http", - "version": "v6.3.6", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/security-http.git", - "reference": "573ef96ab62d509ac953362fa61f9d1bd283f3a7" + "reference": "19f7b5f5d20879a976d6d376e359bc975dfc6002" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-http/zipball/573ef96ab62d509ac953362fa61f9d1bd283f3a7", - "reference": "573ef96ab62d509ac953362fa61f9d1bd283f3a7", + "url": "https://api.github.com/repos/symfony/security-http/zipball/19f7b5f5d20879a976d6d376e359bc975dfc6002", + "reference": "19f7b5f5d20879a976d6d376e359bc975dfc6002", "shasum": "" }, "require": { @@ -6610,7 +6620,7 @@ "description": "Symfony Security Component - HTTP Integration", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-http/tree/v6.3.6" + "source": "https://github.com/symfony/security-http/tree/v6.3.8" }, "funding": [ { @@ -6626,20 +6636,20 @@ "type": "tidelift" } ], - "time": "2023-10-13T10:26:24+00:00" + "time": "2023-11-09T21:20:12+00:00" }, { "name": "symfony/serializer", - "version": "v6.3.7", + "version": "v6.3.10", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "641472dd3d6dc3c4d0fdd1496ebd1b55c72e43d9" + "reference": "6eee0fd95f5caa1e77cab29552620ebf8e5b1a5f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/641472dd3d6dc3c4d0fdd1496ebd1b55c72e43d9", - "reference": "641472dd3d6dc3c4d0fdd1496ebd1b55c72e43d9", + "url": "https://api.github.com/repos/symfony/serializer/zipball/6eee0fd95f5caa1e77cab29552620ebf8e5b1a5f", + "reference": "6eee0fd95f5caa1e77cab29552620ebf8e5b1a5f", "shasum": "" }, "require": { @@ -6704,7 +6714,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v6.3.7" + "source": "https://github.com/symfony/serializer/tree/v6.3.10" }, "funding": [ { @@ -6720,20 +6730,20 @@ "type": "tidelift" } ], - "time": "2023-10-26T18:15:14+00:00" + "time": "2023-12-01T14:25:58+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.3.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" + "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b3313c2dbffaf71c8de2934e2ea56ed2291a3838", + "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838", "shasum": "" }, "require": { @@ -6786,7 +6796,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.4.0" }, "funding": [ { @@ -6802,7 +6812,7 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2023-07-30T20:28:31+00:00" }, { "name": "symfony/stopwatch", @@ -6868,16 +6878,16 @@ }, { "name": "symfony/string", - "version": "v6.3.5", + "version": "v6.3.9", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "13d76d0fb049051ed12a04bef4f9de8715bea339" + "reference": "56427887aeaf540e9bbd121ad6c43f14ad3ce136" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/13d76d0fb049051ed12a04bef4f9de8715bea339", - "reference": "13d76d0fb049051ed12a04bef4f9de8715bea339", + "url": "https://api.github.com/repos/symfony/string/zipball/56427887aeaf540e9bbd121ad6c43f14ad3ce136", + "reference": "56427887aeaf540e9bbd121ad6c43f14ad3ce136", "shasum": "" }, "require": { @@ -6934,7 +6944,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.3.5" + "source": "https://github.com/symfony/string/tree/v6.3.9" }, "funding": [ { @@ -6950,7 +6960,7 @@ "type": "tidelift" } ], - "time": "2023-09-18T10:38:32+00:00" + "time": "2023-11-28T20:40:29+00:00" }, { "name": "symfony/translation", @@ -7049,16 +7059,16 @@ }, { "name": "symfony/translation-contracts", - "version": "v3.3.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "02c24deb352fb0d79db5486c0c79905a85e37e86" + "reference": "dee0c6e5b4c07ce851b462530088e64b255ac9c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/02c24deb352fb0d79db5486c0c79905a85e37e86", - "reference": "02c24deb352fb0d79db5486c0c79905a85e37e86", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/dee0c6e5b4c07ce851b462530088e64b255ac9c5", + "reference": "dee0c6e5b4c07ce851b462530088e64b255ac9c5", "shasum": "" }, "require": { @@ -7107,7 +7117,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.4.0" }, "funding": [ { @@ -7123,20 +7133,20 @@ "type": "tidelift" } ], - "time": "2023-05-30T17:17:10+00:00" + "time": "2023-07-25T15:08:44+00:00" }, { "name": "symfony/twig-bridge", - "version": "v6.3.5", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", - "reference": "18f2cbe1d46ad43c4d3bd45e5e6279172068e064" + "reference": "c51407623959a626784ff302419026f56dc4e1ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/18f2cbe1d46ad43c4d3bd45e5e6279172068e064", - "reference": "18f2cbe1d46ad43c4d3bd45e5e6279172068e064", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/c51407623959a626784ff302419026f56dc4e1ba", + "reference": "c51407623959a626784ff302419026f56dc4e1ba", "shasum": "" }, "require": { @@ -7215,7 +7225,7 @@ "description": "Provides integration for Twig with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bridge/tree/v6.3.5" + "source": "https://github.com/symfony/twig-bridge/tree/v6.3.8" }, "funding": [ { @@ -7231,20 +7241,20 @@ "type": "tidelift" } ], - "time": "2023-09-12T06:57:20+00:00" + "time": "2023-11-09T21:20:12+00:00" }, { "name": "symfony/twig-bundle", - "version": "v6.3.0", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/twig-bundle.git", - "reference": "d0cd4d1675c0582d27c2e8bb0dc27c0303d8e3ea" + "reference": "82429320fe931dd50825ec08140c54b3a315bf79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/d0cd4d1675c0582d27c2e8bb0dc27c0303d8e3ea", - "reference": "d0cd4d1675c0582d27c2e8bb0dc27c0303d8e3ea", + "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/82429320fe931dd50825ec08140c54b3a315bf79", + "reference": "82429320fe931dd50825ec08140c54b3a315bf79", "shasum": "" }, "require": { @@ -7300,7 +7310,7 @@ "description": "Provides a tight integration of Twig into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bundle/tree/v6.3.0" + "source": "https://github.com/symfony/twig-bundle/tree/v6.3.8" }, "funding": [ { @@ -7316,20 +7326,20 @@ "type": "tidelift" } ], - "time": "2023-05-06T09:53:41+00:00" + "time": "2023-10-31T08:07:48+00:00" }, { "name": "symfony/validator", - "version": "v6.3.7", + "version": "v6.3.9", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "9cc736663fa5839b9710ac2c303bb0b951014fc1" + "reference": "c118889931856af47b0732b609f3ac2ddccd1da6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/9cc736663fa5839b9710ac2c303bb0b951014fc1", - "reference": "9cc736663fa5839b9710ac2c303bb0b951014fc1", + "url": "https://api.github.com/repos/symfony/validator/zipball/c118889931856af47b0732b609f3ac2ddccd1da6", + "reference": "c118889931856af47b0732b609f3ac2ddccd1da6", "shasum": "" }, "require": { @@ -7396,7 +7406,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v6.3.7" + "source": "https://github.com/symfony/validator/tree/v6.3.9" }, "funding": [ { @@ -7412,20 +7422,20 @@ "type": "tidelift" } ], - "time": "2023-10-28T23:11:45+00:00" + "time": "2023-11-29T07:44:47+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.3.6", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "999ede244507c32b8e43aebaa10e9fce20de7c97" + "reference": "81acabba9046550e89634876ca64bfcd3c06aa0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/999ede244507c32b8e43aebaa10e9fce20de7c97", - "reference": "999ede244507c32b8e43aebaa10e9fce20de7c97", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/81acabba9046550e89634876ca64bfcd3c06aa0a", + "reference": "81acabba9046550e89634876ca64bfcd3c06aa0a", "shasum": "" }, "require": { @@ -7480,7 +7490,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.3.6" + "source": "https://github.com/symfony/var-dumper/tree/v6.3.8" }, "funding": [ { @@ -7496,20 +7506,20 @@ "type": "tidelift" } ], - "time": "2023-10-12T18:45:56+00:00" + "time": "2023-11-08T10:42:36+00:00" }, { "name": "symfony/var-exporter", - "version": "v6.3.6", + "version": "v6.3.10", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "374d289c13cb989027274c86206ddc63b16a2441" + "reference": "7bfcf232a9c7e4acad00e96774e340eb86d10bf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/374d289c13cb989027274c86206ddc63b16a2441", - "reference": "374d289c13cb989027274c86206ddc63b16a2441", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/7bfcf232a9c7e4acad00e96774e340eb86d10bf0", + "reference": "7bfcf232a9c7e4acad00e96774e340eb86d10bf0", "shasum": "" }, "require": { @@ -7554,7 +7564,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.3.6" + "source": "https://github.com/symfony/var-exporter/tree/v6.3.10" }, "funding": [ { @@ -7570,7 +7580,7 @@ "type": "tidelift" } ], - "time": "2023-10-13T09:16:49+00:00" + "time": "2023-11-29T16:00:50+00:00" }, { "name": "symfony/web-link", @@ -7657,16 +7667,16 @@ }, { "name": "symfony/yaml", - "version": "v6.3.7", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "9758b6c69d179936435d0ffb577c3708d57e38a8" + "reference": "3493af8a8dad7fa91c77fa473ba23ecd95334a92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/9758b6c69d179936435d0ffb577c3708d57e38a8", - "reference": "9758b6c69d179936435d0ffb577c3708d57e38a8", + "url": "https://api.github.com/repos/symfony/yaml/zipball/3493af8a8dad7fa91c77fa473ba23ecd95334a92", + "reference": "3493af8a8dad7fa91c77fa473ba23ecd95334a92", "shasum": "" }, "require": { @@ -7709,7 +7719,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.3.7" + "source": "https://github.com/symfony/yaml/tree/v6.3.8" }, "funding": [ { @@ -7725,31 +7735,31 @@ "type": "tidelift" } ], - "time": "2023-10-28T23:31:00+00:00" + "time": "2023-11-06T10:58:05+00:00" }, { "name": "twig/extra-bundle", - "version": "v3.7.1", + "version": "v3.8.0", "source": { "type": "git", "url": "https://github.com/twigphp/twig-extra-bundle.git", - "reference": "f10baafe6eb0ecd615d52d5cbfb713a39f68e8f3" + "reference": "32807183753de0388c8e59f7ac2d13bb47311140" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/twig-extra-bundle/zipball/f10baafe6eb0ecd615d52d5cbfb713a39f68e8f3", - "reference": "f10baafe6eb0ecd615d52d5cbfb713a39f68e8f3", + "url": "https://api.github.com/repos/twigphp/twig-extra-bundle/zipball/32807183753de0388c8e59f7ac2d13bb47311140", + "reference": "32807183753de0388c8e59f7ac2d13bb47311140", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/framework-bundle": "^5.4|^6.0", - "symfony/twig-bundle": "^5.4|^6.0", - "twig/twig": "^2.7|^3.0" + "symfony/framework-bundle": "^5.4|^6.0|^7.0", + "symfony/twig-bundle": "^5.4|^6.0|^7.0", + "twig/twig": "^3.0" }, "require-dev": { "league/commonmark": "^1.0|^2.0", - "symfony/phpunit-bridge": "^5.4|^6.3", + "symfony/phpunit-bridge": "^6.4|^7.0", "twig/cache-extra": "^3.0", "twig/cssinliner-extra": "^2.12|^3.0", "twig/html-extra": "^2.12|^3.0", @@ -7787,7 +7797,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.7.1" + "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.8.0" }, "funding": [ { @@ -7799,29 +7809,29 @@ "type": "tidelift" } ], - "time": "2023-07-29T15:34:56+00:00" + "time": "2023-11-21T14:02:01+00:00" }, { "name": "twig/intl-extra", - "version": "v3.7.1", + "version": "v3.8.0", "source": { "type": "git", "url": "https://github.com/twigphp/intl-extra.git", - "reference": "4f4fe572f635534649cc069e1dafe4a8ad63774d" + "reference": "7b3db67c700735f473a265a97e1adaeba3e6ca0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/intl-extra/zipball/4f4fe572f635534649cc069e1dafe4a8ad63774d", - "reference": "4f4fe572f635534649cc069e1dafe4a8ad63774d", + "url": "https://api.github.com/repos/twigphp/intl-extra/zipball/7b3db67c700735f473a265a97e1adaeba3e6ca0c", + "reference": "7b3db67c700735f473a265a97e1adaeba3e6ca0c", "shasum": "" }, "require": { - "php": ">=7.1.3", - "symfony/intl": "^5.4|^6.0", - "twig/twig": "^2.7|^3.0" + "php": ">=7.2.5", + "symfony/intl": "^5.4|^6.0|^7.0", + "twig/twig": "^3.0" }, "require-dev": { - "symfony/phpunit-bridge": "^5.4|^6.3" + "symfony/phpunit-bridge": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -7851,7 +7861,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/intl-extra/tree/v3.7.1" + "source": "https://github.com/twigphp/intl-extra/tree/v3.8.0" }, "funding": [ { @@ -7863,32 +7873,32 @@ "type": "tidelift" } ], - "time": "2023-07-29T15:34:56+00:00" + "time": "2023-11-21T17:27:48+00:00" }, { "name": "twig/markdown-extra", - "version": "v3.7.1", + "version": "v3.8.0", "source": { "type": "git", "url": "https://github.com/twigphp/markdown-extra.git", - "reference": "83dfa86a0379f784ea30bdb9c15a356b8aabf780" + "reference": "b6e4954ab60030233df5d293886b5404558daac8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/83dfa86a0379f784ea30bdb9c15a356b8aabf780", - "reference": "83dfa86a0379f784ea30bdb9c15a356b8aabf780", + "url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/b6e4954ab60030233df5d293886b5404558daac8", + "reference": "b6e4954ab60030233df5d293886b5404558daac8", "shasum": "" }, "require": { - "php": ">=7.1.3", - "twig/twig": "^2.7|^3.0" + "php": ">=7.2.5", + "twig/twig": "^3.0" }, "require-dev": { "erusev/parsedown": "^1.7", "league/commonmark": "^1.0|^2.0", "league/html-to-markdown": "^4.8|^5.0", "michelf/php-markdown": "^1.8|^2.0", - "symfony/phpunit-bridge": "^5.4|^6.3" + "symfony/phpunit-bridge": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -7919,7 +7929,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/markdown-extra/tree/v3.7.1" + "source": "https://github.com/twigphp/markdown-extra/tree/v3.8.0" }, "funding": [ { @@ -7931,30 +7941,30 @@ "type": "tidelift" } ], - "time": "2023-07-29T15:34:56+00:00" + "time": "2023-11-21T14:02:01+00:00" }, { "name": "twig/string-extra", - "version": "v3.7.1", + "version": "v3.8.0", "source": { "type": "git", "url": "https://github.com/twigphp/string-extra.git", - "reference": "7230d630a25e91cd91a2bd8e2f0e872962507eab" + "reference": "b0c9037d96baff79abe368dc092a59b726517548" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/string-extra/zipball/7230d630a25e91cd91a2bd8e2f0e872962507eab", - "reference": "7230d630a25e91cd91a2bd8e2f0e872962507eab", + "url": "https://api.github.com/repos/twigphp/string-extra/zipball/b0c9037d96baff79abe368dc092a59b726517548", + "reference": "b0c9037d96baff79abe368dc092a59b726517548", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/string": "^5.4|^6.0", + "symfony/string": "^5.4|^6.0|^7.0", "symfony/translation-contracts": "^1.1|^2|^3", - "twig/twig": "^2.7|^3.0" + "twig/twig": "^3.0" }, "require-dev": { - "symfony/phpunit-bridge": "^5.4|^6.3" + "symfony/phpunit-bridge": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -7986,7 +7996,7 @@ "unicode" ], "support": { - "source": "https://github.com/twigphp/string-extra/tree/v3.7.1" + "source": "https://github.com/twigphp/string-extra/tree/v3.8.0" }, "funding": [ { @@ -7998,30 +8008,31 @@ "type": "tidelift" } ], - "time": "2023-07-29T15:34:56+00:00" + "time": "2023-11-21T14:02:01+00:00" }, { "name": "twig/twig", - "version": "v3.7.1", + "version": "v3.8.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554" + "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/a0ce373a0ca3bf6c64b9e3e2124aca502ba39554", - "reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/9d15f0ac07f44dc4217883ec6ae02fd555c6f71d", + "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php80": "^1.22" }, "require-dev": { "psr/container": "^1.0|^2.0", - "symfony/phpunit-bridge": "^5.4.9|^6.3" + "symfony/phpunit-bridge": "^5.4.9|^6.3|^7.0" }, "type": "library", "autoload": { @@ -8057,7 +8068,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.7.1" + "source": "https://github.com/twigphp/Twig/tree/v3.8.0" }, "funding": [ { @@ -8069,7 +8080,7 @@ "type": "tidelift" } ], - "time": "2023-08-28T11:09:02+00:00" + "time": "2023-11-21T18:54:41+00:00" }, { "name": "webmozart/assert", @@ -8786,16 +8797,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.13", + "version": "9.6.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be" + "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/05017b80304e0eb3f31d90194a563fd53a6021f1", + "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1", "shasum": "" }, "require": { @@ -8869,7 +8880,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.15" }, "funding": [ { @@ -8885,7 +8896,7 @@ "type": "tidelift" } ], - "time": "2023-09-19T05:39:22+00:00" + "time": "2023-12-01T16:55:19+00:00" }, { "name": "sebastian/cli-parser", @@ -9853,16 +9864,16 @@ }, { "name": "symfony/browser-kit", - "version": "v6.3.2", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "ca4a988488f61ac18f8f845445eabdd36f89aa8d" + "reference": "e270297dbee59168274c2b535ab1bccd593e6ffe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/ca4a988488f61ac18f8f845445eabdd36f89aa8d", - "reference": "ca4a988488f61ac18f8f845445eabdd36f89aa8d", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/e270297dbee59168274c2b535ab1bccd593e6ffe", + "reference": "e270297dbee59168274c2b535ab1bccd593e6ffe", "shasum": "" }, "require": { @@ -9901,7 +9912,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v6.3.2" + "source": "https://github.com/symfony/browser-kit/tree/v6.3.8" }, "funding": [ { @@ -9917,7 +9928,7 @@ "type": "tidelift" } ], - "time": "2023-07-06T06:56:43+00:00" + "time": "2023-10-31T08:07:48+00:00" }, { "name": "symfony/css-selector", @@ -10060,16 +10071,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v6.3.4", + "version": "v6.3.9", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "3fdd2a3d5fdc363b2e8dbf817f9726a4d013cbd1" + "reference": "b7065c123ae977a008568a3d016a17a110df7a8e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/3fdd2a3d5fdc363b2e8dbf817f9726a4d013cbd1", - "reference": "3fdd2a3d5fdc363b2e8dbf817f9726a4d013cbd1", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/b7065c123ae977a008568a3d016a17a110df7a8e", + "reference": "b7065c123ae977a008568a3d016a17a110df7a8e", "shasum": "" }, "require": { @@ -10107,7 +10118,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v6.3.4" + "source": "https://github.com/symfony/dom-crawler/tree/v6.3.9" }, "funding": [ { @@ -10123,20 +10134,20 @@ "type": "tidelift" } ], - "time": "2023-08-01T07:43:40+00:00" + "time": "2023-11-20T16:36:29+00:00" }, { "name": "symfony/maker-bundle", - "version": "v1.51.1", + "version": "v1.52.0", "source": { "type": "git", "url": "https://github.com/symfony/maker-bundle.git", - "reference": "0890fd3cf1e2a5221f9b3c6ee1769c537aef683d" + "reference": "112f9466c94a46ca33dc441eee59a12cd1790757" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/0890fd3cf1e2a5221f9b3c6ee1769c537aef683d", - "reference": "0890fd3cf1e2a5221f9b3c6ee1769c537aef683d", + "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/112f9466c94a46ca33dc441eee59a12cd1790757", + "reference": "112f9466c94a46ca33dc441eee59a12cd1790757", "shasum": "" }, "require": { @@ -10199,7 +10210,7 @@ ], "support": { "issues": "https://github.com/symfony/maker-bundle/issues", - "source": "https://github.com/symfony/maker-bundle/tree/v1.51.1" + "source": "https://github.com/symfony/maker-bundle/tree/v1.52.0" }, "funding": [ { @@ -10215,20 +10226,20 @@ "type": "tidelift" } ], - "time": "2023-09-18T18:17:31+00:00" + "time": "2023-10-31T18:23:49+00:00" }, { "name": "symfony/phpunit-bridge", - "version": "v6.3.6", + "version": "v6.4.1", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "c6f1df6a76c2c12bd14a0a5bf7c556dd935efe1d" + "reference": "cca5373a41d45edbeaf38b7b67f376da2205ff95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/c6f1df6a76c2c12bd14a0a5bf7c556dd935efe1d", - "reference": "c6f1df6a76c2c12bd14a0a5bf7c556dd935efe1d", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/cca5373a41d45edbeaf38b7b67f376da2205ff95", + "reference": "cca5373a41d45edbeaf38b7b67f376da2205ff95", "shasum": "" }, "require": { @@ -10239,7 +10250,7 @@ }, "require-dev": { "symfony/deprecation-contracts": "^2.5|^3.0", - "symfony/error-handler": "^5.4|^6.0", + "symfony/error-handler": "^5.4|^6.0|^7.0", "symfony/polyfill-php81": "^1.27" }, "bin": [ @@ -10280,7 +10291,7 @@ "description": "Provides utilities for PHPUnit, especially user deprecation notices management", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/phpunit-bridge/tree/v6.3.6" + "source": "https://github.com/symfony/phpunit-bridge/tree/v6.4.1" }, "funding": [ { @@ -10296,26 +10307,26 @@ "type": "tidelift" } ], - "time": "2023-10-12T15:02:41+00:00" + "time": "2023-12-01T09:25:07+00:00" }, { "name": "symfony/web-profiler-bundle", - "version": "v6.3.6", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/web-profiler-bundle.git", - "reference": "249cb2486597d3ab810d8bcc8e4db5ad0fc3e3bd" + "reference": "4167c20cbdbb1152007fa731718c8c0362f28617" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/249cb2486597d3ab810d8bcc8e4db5ad0fc3e3bd", - "reference": "249cb2486597d3ab810d8bcc8e4db5ad0fc3e3bd", + "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/4167c20cbdbb1152007fa731718c8c0362f28617", + "reference": "4167c20cbdbb1152007fa731718c8c0362f28617", "shasum": "" }, "require": { "php": ">=8.1", "symfony/config": "^5.4|^6.0", - "symfony/framework-bundle": "^5.4|^6.0", + "symfony/framework-bundle": "^5.4|^6.0,<6.4", "symfony/http-kernel": "^6.3", "symfony/routing": "^5.4|^6.0", "symfony/twig-bundle": "^5.4|^6.0", @@ -10361,7 +10372,7 @@ "dev" ], "support": { - "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.3.6" + "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.3.8" }, "funding": [ { @@ -10377,20 +10388,20 @@ "type": "tidelift" } ], - "time": "2023-10-11T18:18:20+00:00" + "time": "2023-10-31T14:41:59+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", "shasum": "" }, "require": { @@ -10419,7 +10430,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.2" }, "funding": [ { @@ -10427,7 +10438,7 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2023-11-20T00:12:19+00:00" } ], "aliases": [], From fe608cff8f47e57223d561547ac5a34417a6d7f2 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 8 Dec 2023 02:19:01 +0200 Subject: [PATCH 168/185] update version --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 0ee2aaf..ee85b83 100644 --- a/.env +++ b/.env @@ -48,7 +48,7 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 # YGGtracker # Application version, used for API and media cache -APP_VERSION='2.5.0' +APP_VERSION=2.6.0 # Application name APP_NAME=YGGtracker From 6603790abaa6cf6d3c4826997e6c768c416c0da5 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 8 Dec 2023 04:09:38 +0200 Subject: [PATCH 169/185] disable markdown as unsafe for remote content without additional filters implementation --- templates/default/torrent/info.html.twig | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index c674b7f..a7aadd9 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -238,7 +238,9 @@ {{ 'Source' | trans }}
- {{ file.source | url_to_markdown | markdown_to_html }} + {# disable markdown as unsafe for unfiltered content #} + {#{{ file.source | url_to_markdown | markdown_to_html }}#} + {{ file.source }}
- {{ file.software | url_to_markdown | markdown_to_html }} + {# disable markdown as unsafe for unfiltered content #} + {#{{ file.software | url_to_markdown | markdown_to_html }}#} + {{ file.software }}
- {{ file.comment | url_to_markdown | markdown_to_html }} + {# disable markdown as unsafe for unfiltered content #} + {#{{ file.comment | url_to_markdown | markdown_to_html }}#} + {{ file.comment }}
- {# disable markdown as unsafe for unfiltered content #} - {#{{ file.source | url_to_markdown | markdown_to_html }}#} - {{ file.source }} + {# strip all tags then apply whitelist markdown filters to prevent ping from remote #} + {{ file.source | striptags | markdown_to_html | striptags | url_to_markdown | markdown_to_html }}
- {# disable markdown as unsafe for unfiltered content #} - {#{{ file.software | url_to_markdown | markdown_to_html }}#} - {{ file.software }} + {# strip all tags then apply whitelist markdown filters to prevent ping from remote #} + {{ file.software | striptags | markdown_to_html | striptags | url_to_markdown | markdown_to_html }}
- {# disable markdown as unsafe for unfiltered content #} - {#{{ file.comment | url_to_markdown | markdown_to_html }}#} - {{ file.comment }} + {# strip all tags then apply whitelist markdown filters to prevent ping from remote #} + {{ file.comment | striptags | markdown_to_html | striptags | url_to_markdown | markdown_to_html }}
{# strip all tags then apply whitelist markdown filters to prevent ping from remote #} - {{ file.source | striptags | markdown_to_html | striptags | url_to_markdown | markdown_to_html }} + {{ file.source | trim | striptags | markdown_to_html | striptags | url_to_markdown | markdown_to_html }}
{# strip all tags then apply whitelist markdown filters to prevent ping from remote #} - {{ file.software | striptags | markdown_to_html | striptags | url_to_markdown | markdown_to_html }} + {{ file.software | trim | striptags | markdown_to_html | striptags | url_to_markdown | markdown_to_html }}
{# strip all tags then apply whitelist markdown filters to prevent ping from remote #} - {{ file.comment | striptags | markdown_to_html | striptags | url_to_markdown | markdown_to_html }} + {{ file.comment | trim | striptags | markdown_to_html | striptags | url_to_markdown | markdown_to_html }}
{# strip all tags then apply whitelist markdown filters to prevent ping from remote #} - {{ file.source | trim | striptags | markdown_to_html | striptags | url_to_markdown | markdown_to_html }} + {{ file.comment | trim | striptags | url_to_markdown | markdown_to_html | nl2br }}
{# strip all tags then apply whitelist markdown filters to prevent ping from remote #} - {{ file.software | trim | striptags | markdown_to_html | striptags | url_to_markdown | markdown_to_html }} + {{ file.comment | trim | striptags | url_to_markdown | markdown_to_html | nl2br }}
{# strip all tags then apply whitelist markdown filters to prevent ping from remote #} - {{ file.comment | trim | striptags | markdown_to_html | striptags | url_to_markdown | markdown_to_html }} + {{ file.comment | trim | striptags | url_to_markdown | markdown_to_html | nl2br }}
{# strip all tags then apply whitelist markdown filters to prevent ping from remote #} - {{ file.comment | trim | striptags | url_to_markdown | markdown_to_html | nl2br }} + {{ file.source | trim | striptags | url_to_markdown | markdown_to_html | nl2br }}
{# strip all tags then apply whitelist markdown filters to prevent ping from remote #} - {{ file.comment | trim | striptags | url_to_markdown | markdown_to_html | nl2br }} + {{ file.software | trim | striptags | url_to_markdown | markdown_to_html | nl2br }}