mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-18 21:55:12 -04:00
Compare commits
469 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f67d2813a | |||
| 9a7a5fdc38 | |||
| f1fdec6822 | |||
| 5464b23329 | |||
| 4c99971882 | |||
| cc7769b601 | |||
| cb2ed7daf9 | |||
| 78508094c8 | |||
| b0f755a30c | |||
| 9d1384792a | |||
| ea17116998 | |||
| 2c23681fc5 | |||
| 17aa2832ea | |||
| 5f3a329ef2 | |||
| 96f49da79e | |||
| c7dfde0ce9 | |||
| 8cf32020f7 | |||
| a5ed5a0e60 | |||
| 3279936fc9 | |||
| 8abccc709e | |||
| 76f30e7682 | |||
| ab289b3e42 | |||
| ef7e04065c | |||
| d1084039b3 | |||
| 7bada440d2 | |||
| 803c4752db | |||
| c0777474c0 | |||
| 66dcea5604 | |||
| a2a12d2450 | |||
| 39593bd5a8 | |||
| 45d8a8a4e6 | |||
| a4546c77ce | |||
| d69bf6360a | |||
| da9ce5b5c3 | |||
| e092098101 | |||
| 1a89a79b74 | |||
| cb6bf49922 | |||
| 4bcaba0be0 | |||
| 220ef723c7 | |||
| 9c599a6be4 | |||
| 715ce1fc6c | |||
| 8c3a192dd0 | |||
| d22bf93dfd | |||
| 886054fdf8 | |||
| 4188510586 | |||
| fedebca5e1 | |||
| e2ce6437e9 | |||
| bdae60bac9 | |||
| 2d6c818aec | |||
| a1d19852dc | |||
| 104c95f28f | |||
| 55fa1ec637 | |||
| b27a3d8272 | |||
| 089d450b46 | |||
| 358ac7434d | |||
| 9cd505fd8a | |||
| 20ac2687df | |||
| 9f075c09a2 | |||
| 3793538ba4 | |||
| 4c4b16d234 | |||
| f5790bec2e | |||
| 6c0d08de56 | |||
| ba344756b1 | |||
| dfda86aca3 | |||
| df6f83ed69 | |||
| 218d92a1ac | |||
| df2b529d01 | |||
| 0ef42dbb4d | |||
| 1a428197b2 | |||
| 09d7983845 | |||
| 6e01f3187a | |||
| 468436b9f7 | |||
| 76c288a6e4 | |||
| f95f67a7ca | |||
| 11864247eb | |||
| 74509ea7c9 | |||
| 948fe0a6dc | |||
| a4257cbcde | |||
| 2929c3c898 | |||
| 2c5f2187c8 | |||
| 401ef88971 | |||
| 4fb3754048 | |||
| 596efe8fb0 | |||
| 076a4f2574 | |||
| 9561371a47 | |||
| 16254cf5f9 | |||
| 649a03e5a0 | |||
| dd21d9b521 | |||
| 68b895d2ad | |||
| 634016ae1b | |||
| 83c6751847 | |||
| 04bb0c51b1 | |||
| d2e9621de9 | |||
| cb673ddc42 | |||
| 440618f2b6 | |||
| ae79d45664 | |||
| 1877ccb513 | |||
| b3098f2e4c | |||
| 3e0af062c1 | |||
| 858f85c50d | |||
| 938848be65 | |||
| 615f5899cc | |||
| 5a6b1313e8 | |||
| ab7debb34b | |||
| eee21de795 | |||
| 15fabbe7d0 | |||
| 6aef48c6e7 | |||
| b29bc923fc | |||
| b223e9b0cc | |||
| 77a982a7da | |||
| ab3dc765b4 | |||
| 0261201360 | |||
| 1da3954879 | |||
| 742dd5ff54 | |||
| a85406e3b7 | |||
| 73cdaf3d44 | |||
| e26fa2dbf4 | |||
| 64be68a22d | |||
| 478a185968 | |||
| 4ff5d11a03 | |||
| 6000952b76 | |||
| 5fee2c4cd9 | |||
| 21d553cf1b | |||
| 782b2d3761 | |||
| e1da3eee80 | |||
| 09af2da6b9 | |||
| e3e9094d42 | |||
| 94634234ff | |||
| a48d6029d9 | |||
| 9cc150b105 | |||
| 6a97d99876 | |||
| c957168040 | |||
| 61bc35b3fa | |||
| a84210c452 | |||
| 8af6ea1d8f | |||
| 1a894ac583 | |||
| 4f6e05414c | |||
| 5096a088d4 | |||
| 6581bddba3 | |||
| 292af28d42 | |||
| 37a6d03d52 | |||
| fe35d450f0 | |||
| 6a9e27bc06 | |||
| a989bf82ea | |||
| ccc8d8002f | |||
| eaaf8db486 | |||
| c32fa7a84b | |||
| 57e21a78ee | |||
| 9cdf5d18d8 | |||
| 41b0a1211b | |||
| 1b8f09f2ce | |||
| 2f85de6b69 | |||
| b2ef9d5b0a | |||
| c80262d75b | |||
| 2a312d93ec | |||
| e09df2fff3 | |||
| f0c7d13b20 | |||
| 4dac60bef9 | |||
| 5aefb46790 | |||
| 41b043e551 | |||
| 5447fad1fc | |||
| 6a1e01abbd | |||
| 2803ad5ba0 | |||
| 8fa8a13036 | |||
| 41ce79ccce | |||
| 14ae062db2 | |||
| d55a38da4a | |||
| ab289cfc86 | |||
| 12671e9905 | |||
| a33023b8c6 | |||
| a3e134ce0b | |||
| ee7c821cab | |||
| ee4cf93aee | |||
| 2cacfba81f | |||
| 02e420580e | |||
| d99398d3f8 | |||
| 9ea8335aa0 | |||
| 52a91a50b2 | |||
| 680bf46e25 | |||
| d279c97f15 | |||
| 7d5d338c8e | |||
| 721ae1cac0 | |||
| 3881c9d753 | |||
| 131b344119 | |||
| d226e52881 | |||
| 583815b4f7 | |||
| f0a8d22e84 | |||
| 50c6f15e12 | |||
| 2e3a95f389 | |||
| 3d52096eb4 | |||
| e981cacbda | |||
| 218371a318 | |||
| 30fd7c8c2a | |||
| 96d2d61fa0 | |||
| 17ff86aaea | |||
| 7f8c1ace14 | |||
| dc0edb7bc1 | |||
| 2ac996c9f9 | |||
| 2ebabd69b5 | |||
| b3738f1602 | |||
| 882152b911 | |||
| a25e79031f | |||
| cc85060b1b | |||
| 00bd9c241a | |||
| 1283e06f95 | |||
| ab0108778a | |||
| 099b04f718 | |||
| ecdc0a51a9 | |||
| 6c7c37affe | |||
| 45d378a2d9 | |||
| 007601cb19 | |||
| 5f0d6e2fdd | |||
| ede9879c99 | |||
| 7287abc77c | |||
| 8c653b5c09 | |||
| 15c6b3c308 | |||
| 9676447c74 | |||
| 5d35f1dcc7 | |||
| 858f16195e | |||
| a1a5dd574e | |||
| a5ecc2dc9f | |||
| 7d46660583 | |||
| 22cbf40e3c | |||
| 25821c758f | |||
| 6153737a78 | |||
| 07adb45d63 | |||
| 02bc40b9b6 | |||
| 83e7e30e4f | |||
| ae870fd46a | |||
| 33b7ba8725 | |||
| dd2567a85f | |||
| 264ff8f885 | |||
| 629c6a8891 | |||
| 0ce2f96789 | |||
| cd7d1571db | |||
| 4558f55282 | |||
| 21589fda57 | |||
| 3496263cd2 | |||
| 1bb1ec6106 | |||
| 2bfb838933 | |||
| 9eb291f578 | |||
| 8cf892124c | |||
| 47fb886930 | |||
| 5034a211cb | |||
| ed1364b6ff | |||
| 71e18b616d | |||
| f7bf21df68 | |||
| d764e3405d | |||
| 16baceb784 | |||
| 5d2b80d15a | |||
| a20a81f424 | |||
| ebb66e9086 | |||
| cb8797693e | |||
| 255c6335ae | |||
| 155cd53dcd | |||
| ae70a96c10 | |||
| 16c0daf090 | |||
| 34c78c5a9d | |||
| dd5b108ffd | |||
| 0b83986255 | |||
| 2bd25fb6f3 | |||
| 0f5eb5d3a3 | |||
| c9434c61e3 | |||
| ee969b7a06 | |||
| cfdf88a1e2 | |||
| 70a5dae293 | |||
| b53f8d4552 | |||
| 9668e91b21 | |||
| 49857693c0 | |||
| 850315ad1c | |||
| 86124d4319 | |||
| 4f28d583d7 | |||
| 01f3930211 | |||
| 7c7114c87a | |||
| ef8e6d774b | |||
| 2960fc37d9 | |||
| 8bddf753bb | |||
| cff24b3fd4 | |||
| 031d81330d | |||
| 6201b42fbd | |||
| 7022054dd7 | |||
| c9b663247c | |||
| 0b0a0cfa5b | |||
| 3c0fea8b7c | |||
| ac97952fd7 | |||
| c3e40c0564 | |||
| ce615a77c2 | |||
| 0f6dfe389c | |||
| 25d94a9286 | |||
| 52a690b41a | |||
| 56c8c3d6c6 | |||
| 5cee8990b3 | |||
| 9679e88717 | |||
| f4203993ba | |||
| 4be0715fe3 | |||
| f9c9d4a0e0 | |||
| bf47380f7b | |||
| e27a46f578 | |||
| af4e69f8fb | |||
| 1b2106d4f0 | |||
| bdfbda3805 | |||
| cb98b10468 | |||
| ae1bc8366c | |||
| 67eeb4373c | |||
| 9d40a64be4 | |||
| 20cc146d82 | |||
| 8beff32117 | |||
| 8b7c488173 | |||
| 1dabbc94f8 | |||
| 52667b979b | |||
| 14f9a75a73 | |||
| ed17d91a7b | |||
| f54280b888 | |||
| 7890ef6f9d | |||
| df8e4e5acb | |||
| 1b36951879 | |||
| d8d5170ab8 | |||
| a443a87603 | |||
| df18ee77e7 | |||
| 426159b452 | |||
| 8704bef69a | |||
| 0f1b01adab | |||
| 4dbf5aa9f4 | |||
| e1264d7cda | |||
| d4bbb2e14a | |||
| a2395dccb5 | |||
| df89450428 | |||
| 7b5e1f40ba | |||
| fe142b8a1c | |||
| 8c7f73ed16 | |||
| a4ae800603 | |||
| e5d7a21714 | |||
| 67355ec07b | |||
| 43d56f6817 | |||
| 515f4dff8b | |||
| c3aa377ed5 | |||
| fbc3c09094 | |||
| b88f8e5fde | |||
| aaf4c73c83 | |||
| 7c38ec2baa | |||
| dcfdd49119 | |||
| badb9dee61 | |||
| 12ca705556 | |||
| a0d0e3e232 | |||
| e12cd68772 | |||
| 9dc117191e | |||
| fdaca64d60 | |||
| 6d134750ff | |||
| bbf9945b49 | |||
| b66a85269f | |||
| 81e9c29d54 | |||
| 3df33e1a86 | |||
| c19802c471 | |||
| 36c8806f88 | |||
| 0d69a42ae0 | |||
| fc482d4808 | |||
| fab4bd5ead | |||
| 9c243c7e0d | |||
| c107011659 | |||
| c690e9a50a | |||
| c4b0ecdafe | |||
| f2a709f725 | |||
| 01a9799ce8 | |||
| 8ac68e8946 | |||
| 6cb787c17b | |||
| 51259ceb30 | |||
| 92cf329174 | |||
| 257c9ab248 | |||
| cad42fd005 | |||
| d7927f60fe | |||
| 26a657fa77 | |||
| 7fa4daae9b | |||
| e1b063eaa5 | |||
| 75f00436ec | |||
| 343d7088c9 | |||
| 709dfe453b | |||
| 3130fac106 | |||
| 28004dfae1 | |||
| 9b34c89bc8 | |||
| 28e90acd0d | |||
| 9d11d7e17f | |||
| 2cbdb5bcba | |||
| 118bfb8c28 | |||
| 942477ecf9 | |||
| 4b4589ed27 | |||
| bd0609639e | |||
| ccdad3a44c | |||
| d99da0481b | |||
| da1965b18e | |||
| 493114f4e8 | |||
| 6969326092 | |||
| 95f899131d | |||
| 0ba4f3e692 | |||
| a7c00a0fd7 | |||
| c84ff60ec9 | |||
| b3f6f54e6e | |||
| ed272aaf74 | |||
| c0b10f889b | |||
| bbfb92bbd8 | |||
| 793de05e3d | |||
| 1b1f9d16be | |||
| 051dea30c2 | |||
| 75d8a3d1d0 | |||
| edf41e2ead | |||
| c15c71386d | |||
| 71a19efd9a | |||
| 2c6c0fcc81 | |||
| 203e2dbb10 | |||
| 6169fc2fa3 | |||
| 768ce14afb | |||
| 31d32e8c30 | |||
| 7a61761b2b | |||
| 3963807c96 | |||
| e0f6726a3d | |||
| dd25bff3d6 | |||
| d834c4292e | |||
| 7e8272ec2b | |||
| 62548f32fe | |||
| db9f061564 | |||
| b37d8799a0 | |||
| 4366530409 | |||
| c7959f735e | |||
| be3ee00e1f | |||
| dace1982d6 | |||
| 980bd35f95 | |||
| 4b2f81bee8 | |||
| 30eb481c65 | |||
| 29f1c36f54 | |||
| f1c01343bf | |||
| bae79b22ad | |||
| 229d879f86 | |||
| d1cee950a4 | |||
| 7e32b54547 | |||
| b1f7d30021 | |||
| c41a7e0ccc | |||
| 42c533386b | |||
| bdae7a2cdc | |||
| 5e8d3542f4 | |||
| d9d2aa8493 | |||
| 09bf1500d6 | |||
| 34464160cb | |||
| bada5fe309 | |||
| b088febbc4 | |||
| 1a307b8e21 | |||
| 32db2af0ea | |||
| e602862102 | |||
| bd5336e4c4 | |||
| c664eaa9b5 | |||
| b7e57f0c08 | |||
| c06bf0e4ea | |||
| c6db30c35a | |||
| 75c30dd318 | |||
| 6e7bf55dbd | |||
| eb642dd2f9 | |||
| 19a196e2c7 | |||
| 93ec6cf89b | |||
| 52c6b56a4c | |||
| 82688d8a55 | |||
| c81cbc801a | |||
| 993d189c61 | |||
| 1901af5a51 | |||
| c1b399be39 | |||
| 2100e96570 | |||
| 3ff144421d | |||
| f37ccba3f9 | |||
| 181cb2e0fe | |||
| 93c81bb7d3 | |||
| 7dd289b5f9 | |||
| 09cef8cf94 |
@@ -0,0 +1,13 @@
|
|||||||
|
// This file is used to open the backend and frontend in the same workspace, which is necessary as
|
||||||
|
// the frontend has vscode settings that are distinct from the backend
|
||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{
|
||||||
|
"path": ".."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../frontend"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"settings": {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
|
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
|
||||||
|
{
|
||||||
|
"name": "Prowlarr",
|
||||||
|
"image": "mcr.microsoft.com/devcontainers/dotnet:1-6.0",
|
||||||
|
"features": {
|
||||||
|
"ghcr.io/devcontainers/features/node:1": {
|
||||||
|
"nodeGypDependencies": true,
|
||||||
|
"version": "16",
|
||||||
|
"nvmVersion": "latest"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"forwardPorts": [9696],
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"extensions": ["esbenp.prettier-vscode"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
|
# package ecosystems to update and where the package manifests are located.
|
||||||
|
# Please see the documentation for more information:
|
||||||
|
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||||
|
# https://containers.dev/guide/dependabot
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "devcontainers"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
+20
-8
@@ -1,19 +1,31 @@
|
|||||||
'Area: API':
|
'Area: API':
|
||||||
- src/Prowlarr.Api.V1/**/*
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- src/Prowlarr.Api.V1/**/*
|
||||||
|
|
||||||
'Area: Db-migration':
|
'Area: Db-migration':
|
||||||
- src/NzbDrone.Core/Datastore/Migration/*
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- src/NzbDrone.Core/Datastore/Migration/*
|
||||||
|
|
||||||
'Area: Download Clients':
|
'Area: Download Clients':
|
||||||
- src/NzbDrone.Core/Download/Clients/**/*
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- src/NzbDrone.Core/Download/Clients/**/*
|
||||||
|
|
||||||
'Area: Indexer':
|
'Area: Indexer':
|
||||||
- src/NzbDrone.Core/Indexers/**/*
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- src/NzbDrone.Core/Indexers/**/*
|
||||||
|
|
||||||
'Area: Notifications':
|
'Area: Notifications':
|
||||||
- src/NzbDrone.Core/Notifications/**/*
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- src/NzbDrone.Core/Notifications/**/*
|
||||||
|
|
||||||
'Area: UI':
|
'Area: UI':
|
||||||
- frontend/**/*
|
- changed-files:
|
||||||
- package.json
|
- any-glob-to-any-file:
|
||||||
- yarn.lock
|
- frontend/**/*
|
||||||
|
- package.json
|
||||||
|
- yarn.lock
|
||||||
@@ -18,6 +18,6 @@ jobs:
|
|||||||
action:
|
action:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: dessant/label-actions@v3
|
- uses: dessant/label-actions@v4
|
||||||
with:
|
with:
|
||||||
process-only: 'issues, prs'
|
process-only: 'issues, prs'
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/labeler@v4
|
- uses: actions/labeler@v5
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
lock:
|
lock:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: dessant/lock-threads@v4
|
- uses: dessant/lock-threads@v5
|
||||||
with:
|
with:
|
||||||
github-token: ${{ github.token }}
|
github-token: ${{ github.token }}
|
||||||
issue-inactive-days: '90'
|
issue-inactive-days: '90'
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ coverage*.xml
|
|||||||
coverage*.json
|
coverage*.json
|
||||||
setup/Output/
|
setup/Output/
|
||||||
*.~is
|
*.~is
|
||||||
|
.mono
|
||||||
|
|
||||||
# VS outout folders
|
# VS outout folders
|
||||||
bin
|
bin
|
||||||
|
|||||||
Vendored
+7
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"ms-dotnettools.csdevkit",
|
||||||
|
"ms-vscode-remote.remote-containers"
|
||||||
|
]
|
||||||
|
}
|
||||||
Vendored
+26
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
// Use IntelliSense to find out which attributes exist for C# debugging
|
||||||
|
// Use hover for the description of the existing attributes
|
||||||
|
// For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md
|
||||||
|
"name": "Run Prowlarr",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "launch",
|
||||||
|
"preLaunchTask": "build dotnet",
|
||||||
|
// If you have changed target frameworks, make sure to update the program path.
|
||||||
|
"program": "${workspaceFolder}/_output/net6.0/Prowlarr",
|
||||||
|
"args": [],
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
|
||||||
|
"console": "integratedTerminal",
|
||||||
|
"stopAtEntry": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": ".NET Core Attach",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "attach"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Vendored
+44
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "build dotnet",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"msbuild",
|
||||||
|
"-restore",
|
||||||
|
"${workspaceFolder}/src/Prowlarr.sln",
|
||||||
|
"-p:GenerateFullPaths=true",
|
||||||
|
"-p:Configuration=Debug",
|
||||||
|
"-p:Platform=Posix",
|
||||||
|
"-consoleloggerparameters:NoSummary;ForceNoAlign"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "publish",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"publish",
|
||||||
|
"${workspaceFolder}/src/Prowlarr.sln",
|
||||||
|
"-property:GenerateFullPaths=true",
|
||||||
|
"-consoleloggerparameters:NoSummary;ForceNoAlign"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "watch",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"watch",
|
||||||
|
"run",
|
||||||
|
"--project",
|
||||||
|
"${workspaceFolder}/src/Prowlarr.sln"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
[](https://dev.azure.com/Prowlarr/Prowlarr/_build/latest?definitionId=1&branchName=develop)
|
[](https://dev.azure.com/Prowlarr/Prowlarr/_build/latest?definitionId=1&branchName=develop)
|
||||||
[](https://translate.servarr.com/engage/prowlarr/?utm_source=widget)
|
[](https://translate.servarr.com/engage/prowlarr/?utm_source=widget)
|
||||||
[](https://wiki.servarr.com/prowlarr/installation#docker)
|
[](https://wiki.servarr.com/prowlarr/installation/docker)
|
||||||

|

|
||||||
[](#backers)
|
[](#backers)
|
||||||
[](#sponsors)
|
[](#sponsors)
|
||||||
|
|||||||
+14
-18
@@ -9,18 +9,18 @@ variables:
|
|||||||
testsFolder: './_tests'
|
testsFolder: './_tests'
|
||||||
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
|
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
|
||||||
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
|
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
|
||||||
majorVersion: '1.9.2'
|
majorVersion: '1.21.2'
|
||||||
minorVersion: $[counter('minorVersion', 1)]
|
minorVersion: $[counter('minorVersion', 1)]
|
||||||
prowlarrVersion: '$(majorVersion).$(minorVersion)'
|
prowlarrVersion: '$(majorVersion).$(minorVersion)'
|
||||||
buildName: '$(Build.SourceBranchName).$(prowlarrVersion)'
|
buildName: '$(Build.SourceBranchName).$(prowlarrVersion)'
|
||||||
sentryOrg: 'servarr'
|
sentryOrg: 'servarr'
|
||||||
sentryUrl: 'https://sentry.servarr.com'
|
sentryUrl: 'https://sentry.servarr.com'
|
||||||
dotnetVersion: '6.0.413'
|
dotnetVersion: '6.0.424'
|
||||||
nodeVersion: '16.X'
|
nodeVersion: '20.X'
|
||||||
innoVersion: '6.2.0'
|
innoVersion: '6.2.2'
|
||||||
windowsImage: 'windows-2022'
|
windowsImage: 'windows-2022'
|
||||||
linuxImage: 'ubuntu-20.04'
|
linuxImage: 'ubuntu-20.04'
|
||||||
macImage: 'macOS-11'
|
macImage: 'macOS-12'
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branches:
|
branches:
|
||||||
@@ -166,10 +166,10 @@ stages:
|
|||||||
pool:
|
pool:
|
||||||
vmImage: $(imageName)
|
vmImage: $(imageName)
|
||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: UseNode@1
|
||||||
displayName: Set Node.js version
|
displayName: Set Node.js version
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: $(nodeVersion)
|
version: $(nodeVersion)
|
||||||
- checkout: self
|
- checkout: self
|
||||||
submodules: true
|
submodules: true
|
||||||
fetchDepth: 1
|
fetchDepth: 1
|
||||||
@@ -1075,10 +1075,10 @@ stages:
|
|||||||
pool:
|
pool:
|
||||||
vmImage: $(imageName)
|
vmImage: $(imageName)
|
||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: UseNode@1
|
||||||
displayName: Set Node.js version
|
displayName: Set Node.js version
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: $(nodeVersion)
|
version: $(nodeVersion)
|
||||||
- checkout: self
|
- checkout: self
|
||||||
submodules: true
|
submodules: true
|
||||||
fetchDepth: 1
|
fetchDepth: 1
|
||||||
@@ -1169,7 +1169,7 @@ stages:
|
|||||||
submodules: true
|
submodules: true
|
||||||
- powershell: Set-Service SCardSvr -StartupType Manual
|
- powershell: Set-Service SCardSvr -StartupType Manual
|
||||||
displayName: Enable Windows Test Service
|
displayName: Enable Windows Test Service
|
||||||
- task: SonarCloudPrepare@1
|
- task: SonarCloudPrepare@2
|
||||||
condition: eq(variables['System.PullRequest.IsFork'], 'False')
|
condition: eq(variables['System.PullRequest.IsFork'], 'False')
|
||||||
inputs:
|
inputs:
|
||||||
SonarCloud: 'SonarCloud'
|
SonarCloud: 'SonarCloud'
|
||||||
@@ -1187,25 +1187,21 @@ stages:
|
|||||||
./build.sh --backend -f net6.0 -r win-x64
|
./build.sh --backend -f net6.0 -r win-x64
|
||||||
TEST_DIR=_tests/net6.0/win-x64/publish/ ./test.sh Windows Unit Coverage
|
TEST_DIR=_tests/net6.0/win-x64/publish/ ./test.sh Windows Unit Coverage
|
||||||
displayName: Coverage Unit Tests
|
displayName: Coverage Unit Tests
|
||||||
- task: SonarCloudAnalyze@1
|
- task: SonarCloudAnalyze@2
|
||||||
condition: eq(variables['System.PullRequest.IsFork'], 'False')
|
condition: eq(variables['System.PullRequest.IsFork'], 'False')
|
||||||
displayName: Publish SonarCloud Results
|
displayName: Publish SonarCloud Results
|
||||||
- task: reportgenerator@4
|
- task: reportgenerator@5
|
||||||
displayName: Generate Coverage Report
|
displayName: Generate Coverage Report
|
||||||
inputs:
|
inputs:
|
||||||
reports: '$(Build.SourcesDirectory)/CoverageResults/**/coverage.opencover.xml'
|
reports: '$(Build.SourcesDirectory)/CoverageResults/**/coverage.opencover.xml'
|
||||||
targetdir: '$(Build.SourcesDirectory)/CoverageResults/combined'
|
targetdir: '$(Build.SourcesDirectory)/CoverageResults/combined'
|
||||||
reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges'
|
reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges'
|
||||||
- task: PublishCodeCoverageResults@1
|
publishCodeCoverageResults: true
|
||||||
displayName: Publish Coverage Report
|
|
||||||
inputs:
|
|
||||||
codeCoverageTool: 'cobertura'
|
|
||||||
summaryFileLocation: './CoverageResults/combined/Cobertura.xml'
|
|
||||||
reportDirectory: './CoverageResults/combined/'
|
|
||||||
|
|
||||||
- stage: Report_Out
|
- stage: Report_Out
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- Analyze
|
- Analyze
|
||||||
|
- Installer
|
||||||
- Unit_Test
|
- Unit_Test
|
||||||
- Integration
|
- Integration
|
||||||
- Automation
|
- Automation
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ InstallInno()
|
|||||||
ProgressStart "Installing portable Inno Setup"
|
ProgressStart "Installing portable Inno Setup"
|
||||||
|
|
||||||
rm -rf _inno
|
rm -rf _inno
|
||||||
curl -s --output innosetup.exe "https://files.jrsoftware.org/is/6/innosetup-${INNOVERSION:-6.2.0}.exe"
|
curl -s --output innosetup.exe "https://files.jrsoftware.org/is/6/innosetup-${INNOVERSION:-6.2.2}.exe"
|
||||||
mkdir _inno
|
mkdir _inno
|
||||||
./innosetup.exe //portable=1 //silent //currentuser //dir=.\\_inno
|
./innosetup.exe //portable=1 //silent //currentuser //dir=.\\_inno
|
||||||
rm innosetup.exe
|
rm innosetup.exe
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
FRAMEWORK="net6.0"
|
||||||
PLATFORM=$1
|
PLATFORM=$1
|
||||||
|
|
||||||
if [ "$PLATFORM" = "Windows" ]; then
|
if [ "$PLATFORM" = "Windows" ]; then
|
||||||
@@ -21,17 +25,23 @@ slnFile=src/Prowlarr.sln
|
|||||||
|
|
||||||
platform=Posix
|
platform=Posix
|
||||||
|
|
||||||
|
if [ "$PLATFORM" = "Windows" ]; then
|
||||||
|
application=Prowlarr.Console.dll
|
||||||
|
else
|
||||||
|
application=Prowlarr.dll
|
||||||
|
fi
|
||||||
|
|
||||||
dotnet clean $slnFile -c Debug
|
dotnet clean $slnFile -c Debug
|
||||||
dotnet clean $slnFile -c Release
|
dotnet clean $slnFile -c Release
|
||||||
|
|
||||||
dotnet msbuild -restore $slnFile -p:Configuration=Debug -p:Platform=$platform -p:RuntimeIdentifiers=$RUNTIME -t:PublishAllRids
|
dotnet msbuild -restore $slnFile -p:Configuration=Debug -p:Platform=$platform -p:RuntimeIdentifiers=$RUNTIME -t:PublishAllRids
|
||||||
|
|
||||||
dotnet new tool-manifest
|
dotnet new tool-manifest
|
||||||
dotnet tool install --version 6.5.0 Swashbuckle.AspNetCore.Cli
|
dotnet tool install --version 6.6.2 Swashbuckle.AspNetCore.Cli
|
||||||
|
|
||||||
dotnet tool run swagger tofile --output ./src/Prowlarr.Api.V1/openapi.json "$outputFolder/net6.0/$RUNTIME/prowlarr.console.dll" v1 &
|
dotnet tool run swagger tofile --output ./src/Prowlarr.Api.V1/openapi.json "$outputFolder/$FRAMEWORK/$RUNTIME/$application" v1 &
|
||||||
|
|
||||||
sleep 30
|
sleep 45
|
||||||
|
|
||||||
kill %1
|
kill %1
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ const loose = true;
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
plugins: [
|
plugins: [
|
||||||
|
'@babel/plugin-transform-logical-assignment-operators',
|
||||||
|
|
||||||
// Stage 1
|
// Stage 1
|
||||||
'@babel/plugin-proposal-export-default-from',
|
'@babel/plugin-proposal-export-default-from',
|
||||||
['@babel/plugin-transform-optional-chaining', { loose }],
|
['@babel/plugin-transform-optional-chaining', { loose }],
|
||||||
|
|||||||
@@ -12,11 +12,10 @@ function App({ store, history }) {
|
|||||||
<DocumentTitle title={window.Prowlarr.instanceName}>
|
<DocumentTitle title={window.Prowlarr.instanceName}>
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<ConnectedRouter history={history}>
|
<ConnectedRouter history={history}>
|
||||||
<ApplyTheme>
|
<ApplyTheme />
|
||||||
<PageConnector>
|
<PageConnector>
|
||||||
<AppRoutes app={App} />
|
<AppRoutes app={App} />
|
||||||
</PageConnector>
|
</PageConnector>
|
||||||
</ApplyTheme>
|
|
||||||
</ConnectedRouter>
|
</ConnectedRouter>
|
||||||
</Provider>
|
</Provider>
|
||||||
</DocumentTitle>
|
</DocumentTitle>
|
||||||
|
|||||||
@@ -65,12 +65,12 @@ function AppUpdatedModalContent(props) {
|
|||||||
return (
|
return (
|
||||||
<ModalContent onModalClose={onModalClose}>
|
<ModalContent onModalClose={onModalClose}>
|
||||||
<ModalHeader>
|
<ModalHeader>
|
||||||
{translate('AppUpdated', { appName: 'Prowlarr' })}
|
{translate('AppUpdated')}
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
|
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
<div>
|
<div>
|
||||||
<InlineMarkdown data={translate('AppUpdatedVersion', { appName: 'Prowlarr', version })} blockClassName={styles.version} />
|
<InlineMarkdown data={translate('AppUpdatedVersion', { version })} blockClassName={styles.version} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Fragment, useCallback, useEffect } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import themes from 'Styles/Themes';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
(state) => state.settings.ui.item.theme || window.Prowlarr.theme,
|
|
||||||
(
|
|
||||||
theme
|
|
||||||
) => {
|
|
||||||
return {
|
|
||||||
theme
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function ApplyTheme({ theme, children }) {
|
|
||||||
// Update the CSS Variables
|
|
||||||
|
|
||||||
const updateCSSVariables = useCallback(() => {
|
|
||||||
const arrayOfVariableKeys = Object.keys(themes[theme]);
|
|
||||||
const arrayOfVariableValues = Object.values(themes[theme]);
|
|
||||||
|
|
||||||
// Loop through each array key and set the CSS Variables
|
|
||||||
arrayOfVariableKeys.forEach((cssVariableKey, index) => {
|
|
||||||
// Based on our snippet from MDN
|
|
||||||
document.documentElement.style.setProperty(
|
|
||||||
`--${cssVariableKey}`,
|
|
||||||
arrayOfVariableValues[index]
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}, [theme]);
|
|
||||||
|
|
||||||
// On Component Mount and Component Update
|
|
||||||
useEffect(() => {
|
|
||||||
updateCSSVariables(theme);
|
|
||||||
}, [updateCSSVariables, theme]);
|
|
||||||
|
|
||||||
return <Fragment>{children}</Fragment>;
|
|
||||||
}
|
|
||||||
|
|
||||||
ApplyTheme.propTypes = {
|
|
||||||
theme: PropTypes.string.isRequired,
|
|
||||||
children: PropTypes.object.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps)(ApplyTheme);
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
import React, { Fragment, ReactNode, useCallback, useEffect } from 'react';
|
||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
import { createSelector } from 'reselect';
|
||||||
|
import themes from 'Styles/Themes';
|
||||||
|
import AppState from './State/AppState';
|
||||||
|
|
||||||
|
interface ApplyThemeProps {
|
||||||
|
children: ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createThemeSelector() {
|
||||||
|
return createSelector(
|
||||||
|
(state: AppState) => state.settings.ui.item.theme || window.Prowlarr.theme,
|
||||||
|
(theme) => {
|
||||||
|
return theme;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function ApplyTheme({ children }: ApplyThemeProps) {
|
||||||
|
const theme = useSelector(createThemeSelector());
|
||||||
|
|
||||||
|
const updateCSSVariables = useCallback(() => {
|
||||||
|
Object.entries(themes[theme]).forEach(([key, value]) => {
|
||||||
|
document.documentElement.style.setProperty(`--${key}`, value);
|
||||||
|
});
|
||||||
|
}, [theme]);
|
||||||
|
|
||||||
|
// On Component Mount and Component Update
|
||||||
|
useEffect(() => {
|
||||||
|
updateCSSVariables();
|
||||||
|
}, [updateCSSVariables, theme]);
|
||||||
|
|
||||||
|
return <Fragment>{children}</Fragment>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ApplyTheme;
|
||||||
@@ -28,11 +28,11 @@ function ConnectionLostModal(props) {
|
|||||||
|
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
<div>
|
<div>
|
||||||
{translate('ConnectionLostToBackend', { appName: 'Prowlarr' })}
|
{translate('ConnectionLostToBackend')}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.automatic}>
|
<div className={styles.automatic}>
|
||||||
{translate('ConnectionLostReconnect', { appName: 'Prowlarr' })}
|
{translate('ConnectionLostReconnect')}
|
||||||
</div>
|
</div>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
<ModalFooter>
|
<ModalFooter>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import SortDirection from 'Helpers/Props/SortDirection';
|
import SortDirection from 'Helpers/Props/SortDirection';
|
||||||
|
import { FilterBuilderProp } from './AppState';
|
||||||
|
|
||||||
export interface Error {
|
export interface Error {
|
||||||
responseJSON: {
|
responseJSON: {
|
||||||
@@ -20,6 +21,10 @@ export interface PagedAppSectionState {
|
|||||||
pageSize: number;
|
pageSize: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface AppSectionFilterState<T> {
|
||||||
|
filterBuilderProps: FilterBuilderProp<T>[];
|
||||||
|
}
|
||||||
|
|
||||||
export interface AppSectionSchemaState<T> {
|
export interface AppSectionSchemaState<T> {
|
||||||
isSchemaFetching: boolean;
|
isSchemaFetching: boolean;
|
||||||
isSchemaPopulated: boolean;
|
isSchemaPopulated: boolean;
|
||||||
|
|||||||
@@ -42,7 +42,16 @@ export interface CustomFilter {
|
|||||||
filers: PropertyFilter[];
|
filers: PropertyFilter[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface AppSectionState {
|
||||||
|
dimensions: {
|
||||||
|
isSmallScreen: boolean;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
interface AppState {
|
interface AppState {
|
||||||
|
app: AppSectionState;
|
||||||
commands: CommandAppState;
|
commands: CommandAppState;
|
||||||
history: HistoryAppState;
|
history: HistoryAppState;
|
||||||
indexerHistory: IndexerHistoryAppState;
|
indexerHistory: IndexerHistoryAppState;
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import AppSectionState from 'App/State/AppSectionState';
|
import AppSectionState, {
|
||||||
|
AppSectionFilterState,
|
||||||
|
} from 'App/State/AppSectionState';
|
||||||
import Column from 'Components/Table/Column';
|
import Column from 'Components/Table/Column';
|
||||||
import History from 'typings/History';
|
import History from 'typings/History';
|
||||||
|
|
||||||
interface HistoryAppState extends AppSectionState<History> {
|
interface HistoryAppState
|
||||||
|
extends AppSectionState<History>,
|
||||||
|
AppSectionFilterState<History> {
|
||||||
pageSize: number;
|
pageSize: number;
|
||||||
columns: Column[];
|
columns: Column[];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import AppSectionState, {
|
|||||||
AppSectionItemState,
|
AppSectionItemState,
|
||||||
AppSectionSaveState,
|
AppSectionSaveState,
|
||||||
} from 'App/State/AppSectionState';
|
} from 'App/State/AppSectionState';
|
||||||
|
import { IndexerCategory } from 'Indexer/Indexer';
|
||||||
import Application from 'typings/Application';
|
import Application from 'typings/Application';
|
||||||
import DownloadClient from 'typings/DownloadClient';
|
import DownloadClient from 'typings/DownloadClient';
|
||||||
import Notification from 'typings/Notification';
|
import Notification from 'typings/Notification';
|
||||||
@@ -25,6 +26,11 @@ export interface DownloadClientAppState
|
|||||||
AppSectionDeleteState,
|
AppSectionDeleteState,
|
||||||
AppSectionSaveState {}
|
AppSectionSaveState {}
|
||||||
|
|
||||||
|
export interface IndexerCategoryAppState
|
||||||
|
extends AppSectionState<IndexerCategory>,
|
||||||
|
AppSectionDeleteState,
|
||||||
|
AppSectionSaveState {}
|
||||||
|
|
||||||
export interface NotificationAppState
|
export interface NotificationAppState
|
||||||
extends AppSectionState<Notification>,
|
extends AppSectionState<Notification>,
|
||||||
AppSectionDeleteState {}
|
AppSectionDeleteState {}
|
||||||
@@ -35,6 +41,7 @@ interface SettingsAppState {
|
|||||||
appProfiles: AppProfileAppState;
|
appProfiles: AppProfileAppState;
|
||||||
applications: ApplicationAppState;
|
applications: ApplicationAppState;
|
||||||
downloadClients: DownloadClientAppState;
|
downloadClients: DownloadClientAppState;
|
||||||
|
indexerCategories: IndexerCategoryAppState;
|
||||||
notifications: NotificationAppState;
|
notifications: NotificationAppState;
|
||||||
ui: UiSettingsAppState;
|
ui: UiSettingsAppState;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ export interface CommandBody {
|
|||||||
lastStartTime: string;
|
lastStartTime: string;
|
||||||
trigger: string;
|
trigger: string;
|
||||||
suppressMessages: boolean;
|
suppressMessages: boolean;
|
||||||
seriesId?: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Command extends ModelBase {
|
interface Command extends ModelBase {
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ class StackedBarChart extends Component {
|
|||||||
size: 14,
|
size: 14,
|
||||||
family: defaultFontFamily
|
family: defaultFontFamily
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
mode: 'index',
|
||||||
|
position: 'average'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class DescriptionListItem extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
|
className,
|
||||||
titleClassName,
|
titleClassName,
|
||||||
descriptionClassName,
|
descriptionClassName,
|
||||||
title,
|
title,
|
||||||
@@ -17,7 +18,7 @@ class DescriptionListItem extends Component {
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className={className}>
|
||||||
<DescriptionListItemTitle
|
<DescriptionListItemTitle
|
||||||
className={titleClassName}
|
className={titleClassName}
|
||||||
>
|
>
|
||||||
@@ -35,6 +36,7 @@ class DescriptionListItem extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DescriptionListItem.propTypes = {
|
DescriptionListItem.propTypes = {
|
||||||
|
className: PropTypes.string,
|
||||||
titleClassName: PropTypes.string,
|
titleClassName: PropTypes.string,
|
||||||
descriptionClassName: PropTypes.string,
|
descriptionClassName: PropTypes.string,
|
||||||
title: PropTypes.string,
|
title: PropTypes.string,
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
import { createSelector } from 'reselect';
|
||||||
|
import AppState from 'App/State/AppState';
|
||||||
|
import { IndexerCategory } from 'Indexer/Indexer';
|
||||||
|
import FilterBuilderRowValue from './FilterBuilderRowValue';
|
||||||
|
import FilterBuilderRowValueProps from './FilterBuilderRowValueProps';
|
||||||
|
|
||||||
|
const indexerCategoriesSelector = createSelector(
|
||||||
|
(state: AppState) => state.settings.indexerCategories,
|
||||||
|
(categories) => categories.items
|
||||||
|
);
|
||||||
|
|
||||||
|
function CategoryFilterBuilderRowValue(props: FilterBuilderRowValueProps) {
|
||||||
|
const categories: IndexerCategory[] = useSelector(indexerCategoriesSelector);
|
||||||
|
|
||||||
|
const tagList = categories.reduce(
|
||||||
|
(acc: { id: number; name: string }[], element) => {
|
||||||
|
acc.push({
|
||||||
|
id: element.id,
|
||||||
|
name: `${element.name} (${element.id})`,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (element.subCategories && element.subCategories.length > 0) {
|
||||||
|
element.subCategories.forEach((subCat) => {
|
||||||
|
acc.push({
|
||||||
|
id: subCat.id,
|
||||||
|
name: `${subCat.name} (${subCat.id})`,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return acc;
|
||||||
|
},
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
|
return <FilterBuilderRowValue {...props} tagList={tagList} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default CategoryFilterBuilderRowValue;
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { maxBy } from 'lodash';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import FormInputGroup from 'Components/Form/FormInputGroup';
|
import FormInputGroup from 'Components/Form/FormInputGroup';
|
||||||
@@ -50,7 +51,7 @@ class FilterBuilderModalContent extends Component {
|
|||||||
if (id) {
|
if (id) {
|
||||||
dispatchSetFilter({ selectedFilterKey: id });
|
dispatchSetFilter({ selectedFilterKey: id });
|
||||||
} else {
|
} else {
|
||||||
const last = customFilters[customFilters.length -1];
|
const last = maxBy(customFilters, 'id');
|
||||||
dispatchSetFilter({ selectedFilterKey: last.id });
|
dispatchSetFilter({ selectedFilterKey: last.id });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +109,7 @@ class FilterBuilderModalContent extends Component {
|
|||||||
this.setState({
|
this.setState({
|
||||||
labelErrors: [
|
labelErrors: [
|
||||||
{
|
{
|
||||||
message: 'Label is required'
|
message: translate('LabelIsRequired')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
@@ -146,13 +147,13 @@ class FilterBuilderModalContent extends Component {
|
|||||||
return (
|
return (
|
||||||
<ModalContent onModalClose={onModalClose}>
|
<ModalContent onModalClose={onModalClose}>
|
||||||
<ModalHeader>
|
<ModalHeader>
|
||||||
Custom Filter
|
{translate('CustomFilter')}
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
|
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
<div className={styles.labelContainer}>
|
<div className={styles.labelContainer}>
|
||||||
<div className={styles.label}>
|
<div className={styles.label}>
|
||||||
Label
|
{translate('Label')}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.labelInputContainer}>
|
<div className={styles.labelInputContainer}>
|
||||||
|
|||||||
@@ -3,10 +3,13 @@ import React, { Component } from 'react';
|
|||||||
import SelectInput from 'Components/Form/SelectInput';
|
import SelectInput from 'Components/Form/SelectInput';
|
||||||
import IconButton from 'Components/Link/IconButton';
|
import IconButton from 'Components/Link/IconButton';
|
||||||
import { filterBuilderTypes, filterBuilderValueTypes, icons } from 'Helpers/Props';
|
import { filterBuilderTypes, filterBuilderValueTypes, icons } from 'Helpers/Props';
|
||||||
|
import sortByProp from 'Utilities/Array/sortByProp';
|
||||||
import AppProfileFilterBuilderRowValueConnector from './AppProfileFilterBuilderRowValueConnector';
|
import AppProfileFilterBuilderRowValueConnector from './AppProfileFilterBuilderRowValueConnector';
|
||||||
import BoolFilterBuilderRowValue from './BoolFilterBuilderRowValue';
|
import BoolFilterBuilderRowValue from './BoolFilterBuilderRowValue';
|
||||||
|
import CategoryFilterBuilderRowValue from './CategoryFilterBuilderRowValue';
|
||||||
import DateFilterBuilderRowValue from './DateFilterBuilderRowValue';
|
import DateFilterBuilderRowValue from './DateFilterBuilderRowValue';
|
||||||
import FilterBuilderRowValueConnector from './FilterBuilderRowValueConnector';
|
import FilterBuilderRowValueConnector from './FilterBuilderRowValueConnector';
|
||||||
|
import HistoryEventTypeFilterBuilderRowValue from './HistoryEventTypeFilterBuilderRowValue';
|
||||||
import IndexerFilterBuilderRowValueConnector from './IndexerFilterBuilderRowValueConnector';
|
import IndexerFilterBuilderRowValueConnector from './IndexerFilterBuilderRowValueConnector';
|
||||||
import PrivacyFilterBuilderRowValue from './PrivacyFilterBuilderRowValue';
|
import PrivacyFilterBuilderRowValue from './PrivacyFilterBuilderRowValue';
|
||||||
import ProtocolFilterBuilderRowValue from './ProtocolFilterBuilderRowValue';
|
import ProtocolFilterBuilderRowValue from './ProtocolFilterBuilderRowValue';
|
||||||
@@ -55,9 +58,15 @@ function getRowValueConnector(selectedFilterBuilderProp) {
|
|||||||
case filterBuilderValueTypes.BOOL:
|
case filterBuilderValueTypes.BOOL:
|
||||||
return BoolFilterBuilderRowValue;
|
return BoolFilterBuilderRowValue;
|
||||||
|
|
||||||
|
case filterBuilderValueTypes.CATEGORY:
|
||||||
|
return CategoryFilterBuilderRowValue;
|
||||||
|
|
||||||
case filterBuilderValueTypes.DATE:
|
case filterBuilderValueTypes.DATE:
|
||||||
return DateFilterBuilderRowValue;
|
return DateFilterBuilderRowValue;
|
||||||
|
|
||||||
|
case filterBuilderValueTypes.HISTORY_EVENT_TYPE:
|
||||||
|
return HistoryEventTypeFilterBuilderRowValue;
|
||||||
|
|
||||||
case filterBuilderValueTypes.INDEXER:
|
case filterBuilderValueTypes.INDEXER:
|
||||||
return IndexerFilterBuilderRowValueConnector;
|
return IndexerFilterBuilderRowValueConnector;
|
||||||
|
|
||||||
@@ -204,7 +213,7 @@ class FilterBuilderRow extends Component {
|
|||||||
key: name,
|
key: name,
|
||||||
value: typeof label === 'function' ? label() : label
|
value: typeof label === 'function' ? label() : label
|
||||||
};
|
};
|
||||||
}).sort((a, b) => a.value.localeCompare(b.value));
|
}).sort(sortByProp('value'));
|
||||||
|
|
||||||
const ValueComponent = getRowValueConnector(selectedFilterBuilderProp);
|
const ValueComponent = getRowValueConnector(selectedFilterBuilderProp);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
|
|||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import { filterBuilderTypes } from 'Helpers/Props';
|
import { filterBuilderTypes } from 'Helpers/Props';
|
||||||
import * as filterTypes from 'Helpers/Props/filterTypes';
|
import * as filterTypes from 'Helpers/Props/filterTypes';
|
||||||
import sortByName from 'Utilities/Array/sortByName';
|
import sortByProp from 'Utilities/Array/sortByProp';
|
||||||
import FilterBuilderRowValue from './FilterBuilderRowValue';
|
import FilterBuilderRowValue from './FilterBuilderRowValue';
|
||||||
|
|
||||||
function createTagListSelector() {
|
function createTagListSelector() {
|
||||||
@@ -38,7 +38,7 @@ function createTagListSelector() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
}, []).sort(sortByName);
|
}, []).sort(sortByProp('name'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return _.uniqBy(items, 'id');
|
return _.uniqBy(items, 'id');
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { FilterBuilderProp } from 'App/State/AppState';
|
||||||
|
|
||||||
|
interface FilterBuilderRowOnChangeProps {
|
||||||
|
name: string;
|
||||||
|
value: unknown[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface FilterBuilderRowValueProps {
|
||||||
|
filterType?: string;
|
||||||
|
filterValue: string | number | object | string[] | number[] | object[];
|
||||||
|
selectedFilterBuilderProp: FilterBuilderProp<unknown>;
|
||||||
|
sectionItem: unknown[];
|
||||||
|
onChange: (payload: FilterBuilderRowOnChangeProps) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default FilterBuilderRowValueProps;
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import translate from 'Utilities/String/translate';
|
||||||
|
import FilterBuilderRowValue from './FilterBuilderRowValue';
|
||||||
|
import FilterBuilderRowValueProps from './FilterBuilderRowValueProps';
|
||||||
|
|
||||||
|
const EVENT_TYPE_OPTIONS = [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
get name() {
|
||||||
|
return translate('Grabbed');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
get name() {
|
||||||
|
return translate('IndexerRss');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
get name() {
|
||||||
|
return translate('IndexerQuery');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
get name() {
|
||||||
|
return translate('IndexerAuth');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
function HistoryEventTypeFilterBuilderRowValue(
|
||||||
|
props: FilterBuilderRowValueProps
|
||||||
|
) {
|
||||||
|
return <FilterBuilderRowValue {...props} tagList={EVENT_TYPE_OPTIONS} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HistoryEventTypeFilterBuilderRowValue;
|
||||||
@@ -37,8 +37,8 @@ class CustomFilter extends Component {
|
|||||||
dispatchSetFilter
|
dispatchSetFilter
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
// Assume that delete and then unmounting means the delete was successful.
|
// Assume that delete and then unmounting means the deletion was successful.
|
||||||
// Moving this check to a ancestor would be more accurate, but would have
|
// Moving this check to an ancestor would be more accurate, but would have
|
||||||
// more boilerplate.
|
// more boilerplate.
|
||||||
if (this.state.isDeleting && id === selectedFilterKey) {
|
if (this.state.isDeleting && id === selectedFilterKey) {
|
||||||
dispatchSetFilter({ selectedFilterKey: 'all' });
|
dispatchSetFilter({ selectedFilterKey: 'all' });
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import ModalBody from 'Components/Modal/ModalBody';
|
|||||||
import ModalContent from 'Components/Modal/ModalContent';
|
import ModalContent from 'Components/Modal/ModalContent';
|
||||||
import ModalFooter from 'Components/Modal/ModalFooter';
|
import ModalFooter from 'Components/Modal/ModalFooter';
|
||||||
import ModalHeader from 'Components/Modal/ModalHeader';
|
import ModalHeader from 'Components/Modal/ModalHeader';
|
||||||
|
import sortByProp from 'Utilities/Array/sortByProp';
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import CustomFilter from './CustomFilter';
|
import CustomFilter from './CustomFilter';
|
||||||
import styles from './CustomFiltersModalContent.css';
|
import styles from './CustomFiltersModalContent.css';
|
||||||
@@ -30,22 +31,24 @@ function CustomFiltersModalContent(props) {
|
|||||||
|
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
{
|
{
|
||||||
customFilters.map((customFilter) => {
|
customFilters
|
||||||
return (
|
.sort((a, b) => sortByProp(a, b, 'label'))
|
||||||
<CustomFilter
|
.map((customFilter) => {
|
||||||
key={customFilter.id}
|
return (
|
||||||
id={customFilter.id}
|
<CustomFilter
|
||||||
label={customFilter.label}
|
key={customFilter.id}
|
||||||
filters={customFilter.filters}
|
id={customFilter.id}
|
||||||
selectedFilterKey={selectedFilterKey}
|
label={customFilter.label}
|
||||||
isDeleting={isDeleting}
|
filters={customFilter.filters}
|
||||||
deleteError={deleteError}
|
selectedFilterKey={selectedFilterKey}
|
||||||
dispatchSetFilter={dispatchSetFilter}
|
isDeleting={isDeleting}
|
||||||
dispatchDeleteCustomFilter={dispatchDeleteCustomFilter}
|
deleteError={deleteError}
|
||||||
onEditPress={onEditCustomFilter}
|
dispatchSetFilter={dispatchSetFilter}
|
||||||
/>
|
dispatchDeleteCustomFilter={dispatchDeleteCustomFilter}
|
||||||
);
|
onEditPress={onEditCustomFilter}
|
||||||
})
|
/>
|
||||||
|
);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
<div className={styles.addButtonContainer}>
|
<div className={styles.addButtonContainer}>
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ import React, { Component } from 'react';
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
|
import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
|
||||||
import sortByName from 'Utilities/Array/sortByName';
|
import sortByProp from 'Utilities/Array/sortByProp';
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import SelectInput from './SelectInput';
|
import SelectInput from './SelectInput';
|
||||||
|
|
||||||
function createMapStateToProps() {
|
function createMapStateToProps() {
|
||||||
return createSelector(
|
return createSelector(
|
||||||
createSortedSectionSelector('settings.appProfiles', sortByName),
|
createSortedSectionSelector('settings.appProfiles', sortByProp('name')),
|
||||||
(state, { includeNoChange }) => includeNoChange,
|
(state, { includeNoChange }) => includeNoChange,
|
||||||
(state, { includeMixed }) => includeMixed,
|
(state, { includeMixed }) => includeMixed,
|
||||||
(appProfiles, includeNoChange, includeMixed) => {
|
(appProfiles, includeNoChange, includeMixed) => {
|
||||||
@@ -24,16 +24,20 @@ function createMapStateToProps() {
|
|||||||
if (includeNoChange) {
|
if (includeNoChange) {
|
||||||
values.unshift({
|
values.unshift({
|
||||||
key: 'noChange',
|
key: 'noChange',
|
||||||
value: translate('NoChange'),
|
get value() {
|
||||||
disabled: true
|
return translate('NoChange');
|
||||||
|
},
|
||||||
|
isDisabled: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (includeMixed) {
|
if (includeMixed) {
|
||||||
values.unshift({
|
values.unshift({
|
||||||
key: 'mixed',
|
key: 'mixed',
|
||||||
value: '(Mixed)',
|
get value() {
|
||||||
disabled: true
|
return `(${translate('Mixed')})`;
|
||||||
|
},
|
||||||
|
isDisabled: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import SelectInput from './SelectInput';
|
|
||||||
|
|
||||||
const availabilityOptions = [
|
|
||||||
{ key: 'announced', value: 'Announced' },
|
|
||||||
{ key: 'inCinemas', value: 'In Cinemas' },
|
|
||||||
{ key: 'released', value: 'Released' },
|
|
||||||
{ key: 'preDB', value: 'PreDB' }
|
|
||||||
];
|
|
||||||
|
|
||||||
function AvailabilitySelectInput(props) {
|
|
||||||
const values = [...availabilityOptions];
|
|
||||||
|
|
||||||
const {
|
|
||||||
includeNoChange,
|
|
||||||
includeMixed
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
if (includeNoChange) {
|
|
||||||
values.unshift({
|
|
||||||
key: 'noChange',
|
|
||||||
value: 'No Change',
|
|
||||||
disabled: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (includeMixed) {
|
|
||||||
values.unshift({
|
|
||||||
key: 'mixed',
|
|
||||||
value: '(Mixed)',
|
|
||||||
disabled: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<SelectInput
|
|
||||||
{...props}
|
|
||||||
values={values}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
AvailabilitySelectInput.propTypes = {
|
|
||||||
includeNoChange: PropTypes.bool.isRequired,
|
|
||||||
includeMixed: PropTypes.bool.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
AvailabilitySelectInput.defaultProps = {
|
|
||||||
includeNoChange: false,
|
|
||||||
includeMixed: false
|
|
||||||
};
|
|
||||||
|
|
||||||
export default AvailabilitySelectInput;
|
|
||||||
@@ -3,7 +3,8 @@ import React, { Component } from 'react';
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import { fetchDownloadClients } from 'Store/Actions/settingsActions';
|
import { fetchDownloadClients } from 'Store/Actions/settingsActions';
|
||||||
import sortByName from 'Utilities/Array/sortByName';
|
import sortByProp from 'Utilities/Array/sortByProp';
|
||||||
|
import translate from 'Utilities/String/translate';
|
||||||
import EnhancedSelectInput from './EnhancedSelectInput';
|
import EnhancedSelectInput from './EnhancedSelectInput';
|
||||||
|
|
||||||
function createMapStateToProps() {
|
function createMapStateToProps() {
|
||||||
@@ -21,16 +22,17 @@ function createMapStateToProps() {
|
|||||||
|
|
||||||
const values = items
|
const values = items
|
||||||
.filter((downloadClient) => downloadClient.protocol === protocolFilter)
|
.filter((downloadClient) => downloadClient.protocol === protocolFilter)
|
||||||
.sort(sortByName)
|
.sort(sortByProp('name'))
|
||||||
.map((downloadClient) => ({
|
.map((downloadClient) => ({
|
||||||
key: downloadClient.id,
|
key: downloadClient.id,
|
||||||
value: downloadClient.name
|
value: downloadClient.name,
|
||||||
|
hint: `(${downloadClient.id})`
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (includeAny) {
|
if (includeAny) {
|
||||||
values.unshift({
|
values.unshift({
|
||||||
key: 0,
|
key: 0,
|
||||||
value: '(Any)'
|
value: `(${translate('Any')})`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -271,26 +271,29 @@ class EnhancedSelectInput extends Component {
|
|||||||
this.setState({ isOpen: !this.state.isOpen });
|
this.setState({ isOpen: !this.state.isOpen });
|
||||||
};
|
};
|
||||||
|
|
||||||
onSelect = (value) => {
|
onSelect = (newValue) => {
|
||||||
if (Array.isArray(this.props.value)) {
|
const { name, value, values, onChange } = this.props;
|
||||||
let newValue = null;
|
|
||||||
const index = this.props.value.indexOf(value);
|
if (Array.isArray(value)) {
|
||||||
|
let arrayValue = null;
|
||||||
|
const index = value.indexOf(newValue);
|
||||||
|
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
newValue = this.props.values.map((v) => v.key).filter((v) => (v === value) || this.props.value.includes(v));
|
arrayValue = values.map((v) => v.key).filter((v) => (v === newValue) || value.includes(v));
|
||||||
} else {
|
} else {
|
||||||
newValue = [...this.props.value];
|
arrayValue = [...value];
|
||||||
newValue.splice(index, 1);
|
arrayValue.splice(index, 1);
|
||||||
}
|
}
|
||||||
this.props.onChange({
|
onChange({
|
||||||
name: this.props.name,
|
name,
|
||||||
value: newValue
|
value: arrayValue
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.setState({ isOpen: false });
|
this.setState({ isOpen: false });
|
||||||
|
|
||||||
this.props.onChange({
|
onChange({
|
||||||
name: this.props.name,
|
name,
|
||||||
value
|
value: newValue
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -485,7 +488,7 @@ class EnhancedSelectInput extends Component {
|
|||||||
values.map((v, index) => {
|
values.map((v, index) => {
|
||||||
const hasParent = v.parentKey !== undefined;
|
const hasParent = v.parentKey !== undefined;
|
||||||
const depth = hasParent ? 1 : 0;
|
const depth = hasParent ? 1 : 0;
|
||||||
const parentSelected = hasParent && value.includes(v.parentKey);
|
const parentSelected = hasParent && Array.isArray(value) && value.includes(v.parentKey);
|
||||||
return (
|
return (
|
||||||
<OptionComponent
|
<OptionComponent
|
||||||
key={v.key}
|
key={v.key}
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ function getSelectOptions(items) {
|
|||||||
key: option.value,
|
key: option.value,
|
||||||
value: option.name,
|
value: option.name,
|
||||||
hint: option.hint,
|
hint: option.hint,
|
||||||
parentKey: option.parentValue
|
parentKey: option.parentValue,
|
||||||
|
isDisabled: option.isDisabled
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -147,7 +148,7 @@ EnhancedSelectInputConnector.propTypes = {
|
|||||||
provider: PropTypes.string.isRequired,
|
provider: PropTypes.string.isRequired,
|
||||||
providerData: PropTypes.object.isRequired,
|
providerData: PropTypes.object.isRequired,
|
||||||
name: PropTypes.string.isRequired,
|
name: PropTypes.string.isRequired,
|
||||||
value: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])).isRequired,
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number)]).isRequired,
|
||||||
values: PropTypes.arrayOf(PropTypes.object).isRequired,
|
values: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
selectOptionsProviderAction: PropTypes.string,
|
selectOptionsProviderAction: PropTypes.string,
|
||||||
onChange: PropTypes.func.isRequired,
|
onChange: PropTypes.func.isRequired,
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
.validationFailures {
|
.validationFailures {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.details {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|||||||
+1
@@ -1,6 +1,7 @@
|
|||||||
// This file is automatically generated.
|
// This file is automatically generated.
|
||||||
// Please do not change this file!
|
// Please do not change this file!
|
||||||
interface CssExports {
|
interface CssExports {
|
||||||
|
'details': string;
|
||||||
'validationFailures': string;
|
'validationFailures': string;
|
||||||
}
|
}
|
||||||
export const cssExports: CssExports;
|
export const cssExports: CssExports;
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Alert from 'Components/Alert';
|
import Alert from 'Components/Alert';
|
||||||
import { kinds } from 'Helpers/Props';
|
import Icon from 'Components/Icon';
|
||||||
|
import Tooltip from 'Components/Tooltip/Tooltip';
|
||||||
|
import { icons, kinds, tooltipPositions } from 'Helpers/Props';
|
||||||
import styles from './Form.css';
|
import styles from './Form.css';
|
||||||
|
|
||||||
function Form(props) {
|
function Form(props) {
|
||||||
@@ -26,6 +28,18 @@ function Form(props) {
|
|||||||
kind={kinds.DANGER}
|
kind={kinds.DANGER}
|
||||||
>
|
>
|
||||||
{error.errorMessage}
|
{error.errorMessage}
|
||||||
|
|
||||||
|
{
|
||||||
|
error.detailedDescription ?
|
||||||
|
<Tooltip
|
||||||
|
className={styles.details}
|
||||||
|
anchor={<Icon name={icons.INFO} />}
|
||||||
|
tooltip={error.detailedDescription}
|
||||||
|
kind={kinds.INVERSE}
|
||||||
|
position={tooltipPositions.TOP}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
</Alert>
|
</Alert>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
@@ -39,6 +53,18 @@ function Form(props) {
|
|||||||
kind={kinds.WARNING}
|
kind={kinds.WARNING}
|
||||||
>
|
>
|
||||||
{warning.errorMessage}
|
{warning.errorMessage}
|
||||||
|
|
||||||
|
{
|
||||||
|
warning.detailedDescription ?
|
||||||
|
<Tooltip
|
||||||
|
className={styles.details}
|
||||||
|
anchor={<Icon name={icons.INFO} />}
|
||||||
|
tooltip={warning.detailedDescription}
|
||||||
|
kind={kinds.INVERSE}
|
||||||
|
position={tooltipPositions.TOP}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
</Alert>
|
</Alert>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { inputTypes, kinds } from 'Helpers/Props';
|
|||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import AppProfileSelectInputConnector from './AppProfileSelectInputConnector';
|
import AppProfileSelectInputConnector from './AppProfileSelectInputConnector';
|
||||||
import AutoCompleteInput from './AutoCompleteInput';
|
import AutoCompleteInput from './AutoCompleteInput';
|
||||||
import AvailabilitySelectInput from './AvailabilitySelectInput';
|
|
||||||
import CaptchaInputConnector from './CaptchaInputConnector';
|
import CaptchaInputConnector from './CaptchaInputConnector';
|
||||||
import CardigannCaptchaInputConnector from './CardigannCaptchaInputConnector';
|
import CardigannCaptchaInputConnector from './CardigannCaptchaInputConnector';
|
||||||
import CheckInput from './CheckInput';
|
import CheckInput from './CheckInput';
|
||||||
@@ -37,9 +36,6 @@ function getComponent(type) {
|
|||||||
case inputTypes.AUTO_COMPLETE:
|
case inputTypes.AUTO_COMPLETE:
|
||||||
return AutoCompleteInput;
|
return AutoCompleteInput;
|
||||||
|
|
||||||
case inputTypes.AVAILABILITY_SELECT:
|
|
||||||
return AvailabilitySelectInput;
|
|
||||||
|
|
||||||
case inputTypes.CAPTCHA:
|
case inputTypes.CAPTCHA:
|
||||||
return CaptchaInputConnector;
|
return CaptchaInputConnector;
|
||||||
|
|
||||||
@@ -260,6 +256,7 @@ FormInputGroup.propTypes = {
|
|||||||
name: PropTypes.string.isRequired,
|
name: PropTypes.string.isRequired,
|
||||||
value: PropTypes.any,
|
value: PropTypes.any,
|
||||||
values: PropTypes.arrayOf(PropTypes.any),
|
values: PropTypes.arrayOf(PropTypes.any),
|
||||||
|
isFloat: PropTypes.bool,
|
||||||
type: PropTypes.string.isRequired,
|
type: PropTypes.string.isRequired,
|
||||||
kind: PropTypes.oneOf(kinds.all),
|
kind: PropTypes.oneOf(kinds.all),
|
||||||
min: PropTypes.number,
|
min: PropTypes.number,
|
||||||
|
|||||||
@@ -2,8 +2,10 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
margin-right: $formLabelRightMarginWidth;
|
margin-right: $formLabelRightMarginWidth;
|
||||||
|
padding-top: 8px;
|
||||||
|
min-height: 35px;
|
||||||
|
text-align: end;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
line-height: 35px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.hasError {
|
.hasError {
|
||||||
|
|||||||
@@ -4,14 +4,14 @@ import React, { Component } from 'react';
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
|
import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
|
||||||
import sortByName from 'Utilities/Array/sortByName';
|
import sortByProp from 'Utilities/Array/sortByProp';
|
||||||
import titleCase from 'Utilities/String/titleCase';
|
import titleCase from 'Utilities/String/titleCase';
|
||||||
import EnhancedSelectInput from './EnhancedSelectInput';
|
import EnhancedSelectInput from './EnhancedSelectInput';
|
||||||
|
|
||||||
function createMapStateToProps() {
|
function createMapStateToProps() {
|
||||||
return createSelector(
|
return createSelector(
|
||||||
(state, { value }) => value,
|
(state, { value }) => value,
|
||||||
createSortedSectionSelector('indexers', sortByName),
|
createSortedSectionSelector('indexers', sortByProp('name')),
|
||||||
(value, indexers) => {
|
(value, indexers) => {
|
||||||
const values = [];
|
const values = [];
|
||||||
const groupedIndexers = map(groupBy(indexers.items, 'protocol'), (val, key) => ({ protocol: key, indexers: val }));
|
const groupedIndexers = map(groupBy(indexers.items, 'protocol'), (val, key) => ({ protocol: key, indexers: val }));
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
.message {
|
||||||
|
composes: alert from '~Components/Alert.css';
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--linkColor);
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: var(--linkHoverColor);
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// This file is automatically generated.
|
// This file is automatically generated.
|
||||||
// Please do not change this file!
|
// Please do not change this file!
|
||||||
interface CssExports {
|
interface CssExports {
|
||||||
'input': string;
|
'message': string;
|
||||||
}
|
}
|
||||||
export const cssExports: CssExports;
|
export const cssExports: CssExports;
|
||||||
export default cssExports;
|
export default cssExports;
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
import Alert from 'Components/Alert';
|
||||||
|
import { kinds } from 'Helpers/Props';
|
||||||
|
import styles from './InfoInput.css';
|
||||||
|
|
||||||
class InfoInput extends Component {
|
class InfoInput extends Component {
|
||||||
|
|
||||||
@@ -7,12 +10,15 @@ class InfoInput extends Component {
|
|||||||
// Render
|
// Render
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const { value } = this.props;
|
||||||
value
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span dangerouslySetInnerHTML={{ __html: value }} />
|
<Alert
|
||||||
|
kind={kinds.INFO}
|
||||||
|
className={styles.message}
|
||||||
|
>
|
||||||
|
<span dangerouslySetInnerHTML={{ __html: value }} />
|
||||||
|
</Alert>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
.input {
|
|
||||||
composes: input from '~Components/Form/TextInput.css';
|
|
||||||
|
|
||||||
font-family: $passwordFamily;
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import TextInput from './TextInput';
|
import TextInput from './TextInput';
|
||||||
import styles from './PasswordInput.css';
|
|
||||||
|
|
||||||
// Prevent a user from copying (or cutting) the password from the input
|
// Prevent a user from copying (or cutting) the password from the input
|
||||||
function onCopy(e) {
|
function onCopy(e) {
|
||||||
@@ -13,17 +11,14 @@ function PasswordInput(props) {
|
|||||||
return (
|
return (
|
||||||
<TextInput
|
<TextInput
|
||||||
{...props}
|
{...props}
|
||||||
|
type="password"
|
||||||
onCopy={onCopy}
|
onCopy={onCopy}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
PasswordInput.propTypes = {
|
PasswordInput.propTypes = {
|
||||||
className: PropTypes.string.isRequired
|
...TextInput.props
|
||||||
};
|
|
||||||
|
|
||||||
PasswordInput.defaultProps = {
|
|
||||||
className: styles.input
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PasswordInput;
|
export default PasswordInput;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
import sortByProp from 'Utilities/Array/sortByProp';
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import FilterMenuItem from './FilterMenuItem';
|
import FilterMenuItem from './FilterMenuItem';
|
||||||
import MenuContent from './MenuContent';
|
import MenuContent from './MenuContent';
|
||||||
@@ -40,18 +41,26 @@ class FilterMenuContent extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
customFilters.map((filter) => {
|
customFilters.length > 0 ?
|
||||||
return (
|
<MenuItemSeparator /> :
|
||||||
<FilterMenuItem
|
null
|
||||||
key={filter.id}
|
}
|
||||||
filterKey={filter.id}
|
|
||||||
selectedFilterKey={selectedFilterKey}
|
{
|
||||||
onPress={onFilterSelect}
|
customFilters
|
||||||
>
|
.sort(sortByProp('label'))
|
||||||
{filter.label}
|
.map((filter) => {
|
||||||
</FilterMenuItem>
|
return (
|
||||||
);
|
<FilterMenuItem
|
||||||
})
|
key={filter.id}
|
||||||
|
filterKey={filter.id}
|
||||||
|
selectedFilterKey={selectedFilterKey}
|
||||||
|
onPress={onFilterSelect}
|
||||||
|
>
|
||||||
|
{filter.label}
|
||||||
|
</FilterMenuItem>
|
||||||
|
);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import React from 'react';
|
|||||||
import Icon from 'Components/Icon';
|
import Icon from 'Components/Icon';
|
||||||
import Link from 'Components/Link/Link';
|
import Link from 'Components/Link/Link';
|
||||||
import { icons } from 'Helpers/Props';
|
import { icons } from 'Helpers/Props';
|
||||||
|
import translate from 'Utilities/String/translate';
|
||||||
import styles from './ModalContent.css';
|
import styles from './ModalContent.css';
|
||||||
|
|
||||||
function ModalContent(props) {
|
function ModalContent(props) {
|
||||||
@@ -28,6 +29,7 @@ function ModalContent(props) {
|
|||||||
<Icon
|
<Icon
|
||||||
name={icons.CLOSE}
|
name={icons.CLOSE}
|
||||||
size={18}
|
size={18}
|
||||||
|
title={translate('Close')}
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ class PageHeader extends Component {
|
|||||||
aria-label="Donate"
|
aria-label="Donate"
|
||||||
to="https://prowlarr.com/donate"
|
to="https://prowlarr.com/donate"
|
||||||
size={14}
|
size={14}
|
||||||
|
title={translate('Donate')}
|
||||||
/>
|
/>
|
||||||
<IconButton
|
<IconButton
|
||||||
className={styles.translate}
|
className={styles.translate}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ function PageHeaderActionsMenu(props) {
|
|||||||
<MenuButton className={styles.menuButton} aria-label="Menu Button">
|
<MenuButton className={styles.menuButton} aria-label="Menu Button">
|
||||||
<Icon
|
<Icon
|
||||||
name={icons.INTERACTIVE}
|
name={icons.INTERACTIVE}
|
||||||
|
title={translate('Menu')}
|
||||||
/>
|
/>
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { kinds } from 'Helpers/Props';
|
import { kinds } from 'Helpers/Props';
|
||||||
|
import sortByProp from 'Utilities/Array/sortByProp';
|
||||||
import Label from './Label';
|
import Label from './Label';
|
||||||
import styles from './TagList.css';
|
import styles from './TagList.css';
|
||||||
|
|
||||||
function TagList({ tags, tagList }) {
|
function TagList({ tags, tagList }) {
|
||||||
const sortedTags = tags
|
const sortedTags = tags
|
||||||
.map((tagId) => tagList.find((tag) => tag.id === tagId))
|
.map((tagId) => tagList.find((tag) => tag.id === tagId))
|
||||||
.filter((t) => t !== undefined)
|
.filter((tag) => !!tag)
|
||||||
.sort((a, b) => a.label.localeCompare(b.label));
|
.sort(sortByProp('label'));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.tags}>
|
<div className={styles.tags}>
|
||||||
|
|||||||
@@ -25,14 +25,3 @@
|
|||||||
font-family: 'Ubuntu Mono';
|
font-family: 'Ubuntu Mono';
|
||||||
src: url('UbuntuMono-Regular.eot?#iefix&v=1.3.0') format('embedded-opentype'), url('UbuntuMono-Regular.woff?v=1.3.0') format('woff'), url('UbuntuMono-Regular.ttf?v=1.3.0') format('truetype');
|
src: url('UbuntuMono-Regular.eot?#iefix&v=1.3.0') format('embedded-opentype'), url('UbuntuMono-Regular.woff?v=1.3.0') format('woff'), url('UbuntuMono-Regular.ttf?v=1.3.0') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* text-security-disc
|
|
||||||
*/
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-weight: normal;
|
|
||||||
font-style: normal;
|
|
||||||
font-family: 'text-security-disc';
|
|
||||||
src: url('text-security-disc.woff?v=1.3.0') format('woff'), url('text-security-disc.ttf?v=1.3.0') format('truetype');
|
|
||||||
}
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,7 @@
|
|||||||
|
enum DownloadProtocol {
|
||||||
|
Unknown = 'unknown',
|
||||||
|
Usenet = 'usenet',
|
||||||
|
Torrent = 'torrent',
|
||||||
|
}
|
||||||
|
|
||||||
|
export default DownloadProtocol;
|
||||||
@@ -34,7 +34,8 @@ function AuthenticationRequiredModalContent(props) {
|
|||||||
authenticationMethod,
|
authenticationMethod,
|
||||||
authenticationRequired,
|
authenticationRequired,
|
||||||
username,
|
username,
|
||||||
password
|
password,
|
||||||
|
passwordConfirmation
|
||||||
} = settings;
|
} = settings;
|
||||||
|
|
||||||
const authenticationEnabled = authenticationMethod && authenticationMethod.value !== 'none';
|
const authenticationEnabled = authenticationMethod && authenticationMethod.value !== 'none';
|
||||||
@@ -63,7 +64,7 @@ function AuthenticationRequiredModalContent(props) {
|
|||||||
className={styles.authRequiredAlert}
|
className={styles.authRequiredAlert}
|
||||||
kind={kinds.WARNING}
|
kind={kinds.WARNING}
|
||||||
>
|
>
|
||||||
{translate('AuthenticationRequiredWarning', { appName: 'Prowlarr' })}
|
{translate('AuthenticationRequiredWarning')}
|
||||||
</Alert>
|
</Alert>
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -76,7 +77,7 @@ function AuthenticationRequiredModalContent(props) {
|
|||||||
type={inputTypes.SELECT}
|
type={inputTypes.SELECT}
|
||||||
name="authenticationMethod"
|
name="authenticationMethod"
|
||||||
values={authenticationMethodOptions}
|
values={authenticationMethodOptions}
|
||||||
helpText={translate('AuthenticationMethodHelpText', { appName: 'Prowlarr' })}
|
helpText={translate('AuthenticationMethodHelpText')}
|
||||||
helpTextWarning={authenticationMethod.value === 'none' ? translate('AuthenticationMethodHelpTextWarning') : undefined}
|
helpTextWarning={authenticationMethod.value === 'none' ? translate('AuthenticationMethodHelpTextWarning') : undefined}
|
||||||
helpLink="https://wiki.servarr.com/prowlarr/faq#forced-authentication"
|
helpLink="https://wiki.servarr.com/prowlarr/faq#forced-authentication"
|
||||||
onChange={onInputChange}
|
onChange={onInputChange}
|
||||||
@@ -120,6 +121,18 @@ function AuthenticationRequiredModalContent(props) {
|
|||||||
{...password}
|
{...password}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
|
<FormGroup>
|
||||||
|
<FormLabel>{translate('PasswordConfirmation')}</FormLabel>
|
||||||
|
|
||||||
|
<FormInputGroup
|
||||||
|
type={inputTypes.PASSWORD}
|
||||||
|
name="passwordConfirmation"
|
||||||
|
onChange={onInputChange}
|
||||||
|
helpTextWarning={passwordConfirmation?.value ? undefined : translate('AuthenticationRequiredPasswordConfirmationHelpTextWarning')}
|
||||||
|
{...passwordConfirmation}
|
||||||
|
/>
|
||||||
|
</FormGroup>
|
||||||
</div> :
|
</div> :
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
|
export default function useModalOpenState(
|
||||||
|
initialState: boolean
|
||||||
|
): [boolean, () => void, () => void] {
|
||||||
|
const [isOpen, setOpen] = useState(initialState);
|
||||||
|
|
||||||
|
const setModalOpen = useCallback(() => {
|
||||||
|
setOpen(true);
|
||||||
|
}, [setOpen]);
|
||||||
|
|
||||||
|
const setModalClosed = useCallback(() => {
|
||||||
|
setOpen(false);
|
||||||
|
}, [setOpen]);
|
||||||
|
|
||||||
|
return [isOpen, setModalOpen, setModalClosed];
|
||||||
|
}
|
||||||
@@ -2,9 +2,10 @@ export const BOOL = 'bool';
|
|||||||
export const BYTES = 'bytes';
|
export const BYTES = 'bytes';
|
||||||
export const DATE = 'date';
|
export const DATE = 'date';
|
||||||
export const DEFAULT = 'default';
|
export const DEFAULT = 'default';
|
||||||
|
export const HISTORY_EVENT_TYPE = 'historyEventType';
|
||||||
export const INDEXER = 'indexer';
|
export const INDEXER = 'indexer';
|
||||||
export const PROTOCOL = 'protocol';
|
export const PROTOCOL = 'protocol';
|
||||||
export const PRIVACY = 'privacy';
|
export const PRIVACY = 'privacy';
|
||||||
export const APP_PROFILE = 'appProfile';
|
export const APP_PROFILE = 'appProfile';
|
||||||
export const MOVIE_STATUS = 'movieStatus';
|
export const CATEGORY = 'category';
|
||||||
export const TAG = 'tag';
|
export const TAG = 'tag';
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import {
|
|||||||
faChevronCircleRight as fasChevronCircleRight,
|
faChevronCircleRight as fasChevronCircleRight,
|
||||||
faChevronCircleUp as fasChevronCircleUp,
|
faChevronCircleUp as fasChevronCircleUp,
|
||||||
faCircle as fasCircle,
|
faCircle as fasCircle,
|
||||||
|
faCircleDown as fasCircleDown,
|
||||||
faCloud as fasCloud,
|
faCloud as fasCloud,
|
||||||
faCloudDownloadAlt as fasCloudDownloadAlt,
|
faCloudDownloadAlt as fasCloudDownloadAlt,
|
||||||
faCog as fasCog,
|
faCog as fasCog,
|
||||||
@@ -141,6 +142,7 @@ export const CHECK_INDETERMINATE = fasMinus;
|
|||||||
export const CHECK_CIRCLE = fasCheckCircle;
|
export const CHECK_CIRCLE = fasCheckCircle;
|
||||||
export const CHECK_SQUARE = fasSquareCheck;
|
export const CHECK_SQUARE = fasSquareCheck;
|
||||||
export const CIRCLE = fasCircle;
|
export const CIRCLE = fasCircle;
|
||||||
|
export const CIRCLE_DOWN = fasCircleDown;
|
||||||
export const CIRCLE_OUTLINE = farCircle;
|
export const CIRCLE_OUTLINE = farCircle;
|
||||||
export const CLEAR = fasTrashAlt;
|
export const CLEAR = fasTrashAlt;
|
||||||
export const CLIPBOARD = fasCopy;
|
export const CLIPBOARD = fasCopy;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
export const AUTO_COMPLETE = 'autoComplete';
|
export const AUTO_COMPLETE = 'autoComplete';
|
||||||
export const APP_PROFILE_SELECT = 'appProfileSelect';
|
export const APP_PROFILE_SELECT = 'appProfileSelect';
|
||||||
export const AVAILABILITY_SELECT = 'availabilitySelect';
|
|
||||||
export const CAPTCHA = 'captcha';
|
export const CAPTCHA = 'captcha';
|
||||||
export const CARDIGANNCAPTCHA = 'cardigannCaptcha';
|
export const CARDIGANNCAPTCHA = 'cardigannCaptcha';
|
||||||
export const CHECK = 'check';
|
export const CHECK = 'check';
|
||||||
@@ -27,7 +26,6 @@ export const TAG_SELECT = 'tagSelect';
|
|||||||
export const all = [
|
export const all = [
|
||||||
AUTO_COMPLETE,
|
AUTO_COMPLETE,
|
||||||
APP_PROFILE_SELECT,
|
APP_PROFILE_SELECT,
|
||||||
AVAILABILITY_SELECT,
|
|
||||||
CAPTCHA,
|
CAPTCHA,
|
||||||
CARDIGANNCAPTCHA,
|
CARDIGANNCAPTCHA,
|
||||||
CHECK,
|
CHECK,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import React from 'react';
|
|||||||
import DescriptionList from 'Components/DescriptionList/DescriptionList';
|
import DescriptionList from 'Components/DescriptionList/DescriptionList';
|
||||||
import DescriptionListItem from 'Components/DescriptionList/DescriptionListItem';
|
import DescriptionListItem from 'Components/DescriptionList/DescriptionListItem';
|
||||||
import Link from 'Components/Link/Link';
|
import Link from 'Components/Link/Link';
|
||||||
|
import formatDateTime from 'Utilities/Date/formatDateTime';
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import styles from './HistoryDetails.css';
|
import styles from './HistoryDetails.css';
|
||||||
|
|
||||||
@@ -10,7 +11,10 @@ function HistoryDetails(props) {
|
|||||||
const {
|
const {
|
||||||
indexer,
|
indexer,
|
||||||
eventType,
|
eventType,
|
||||||
data
|
date,
|
||||||
|
data,
|
||||||
|
shortDateFormat,
|
||||||
|
timeFormat
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
if (eventType === 'indexerQuery' || eventType === 'indexerRss') {
|
if (eventType === 'indexerQuery' || eventType === 'indexerRss') {
|
||||||
@@ -21,7 +25,10 @@ function HistoryDetails(props) {
|
|||||||
limit,
|
limit,
|
||||||
offset,
|
offset,
|
||||||
source,
|
source,
|
||||||
url
|
host,
|
||||||
|
url,
|
||||||
|
elapsedTime,
|
||||||
|
cached
|
||||||
} = data;
|
} = data;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -86,6 +93,15 @@ function HistoryDetails(props) {
|
|||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
data ?
|
||||||
|
<DescriptionListItem
|
||||||
|
title={translate('Host')}
|
||||||
|
data={host}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
data ?
|
data ?
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
@@ -94,6 +110,24 @@ function HistoryDetails(props) {
|
|||||||
/> :
|
/> :
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
elapsedTime ?
|
||||||
|
<DescriptionListItem
|
||||||
|
title={translate('ElapsedTime')}
|
||||||
|
data={`${elapsedTime}ms${cached === '1' ? ' (cached)' : ''}`}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
date ?
|
||||||
|
<DescriptionListItem
|
||||||
|
title={translate('Date')}
|
||||||
|
data={formatDateTime(date, shortDateFormat, timeFormat, { includeSeconds: true })}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
</DescriptionList>
|
</DescriptionList>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -101,10 +135,19 @@ function HistoryDetails(props) {
|
|||||||
if (eventType === 'releaseGrabbed') {
|
if (eventType === 'releaseGrabbed') {
|
||||||
const {
|
const {
|
||||||
source,
|
source,
|
||||||
|
host,
|
||||||
grabTitle,
|
grabTitle,
|
||||||
url
|
url,
|
||||||
|
publishedDate,
|
||||||
|
infoUrl,
|
||||||
|
downloadClient,
|
||||||
|
downloadClientName,
|
||||||
|
elapsedTime,
|
||||||
|
grabMethod
|
||||||
} = data;
|
} = data;
|
||||||
|
|
||||||
|
const downloadClientNameInfo = downloadClientName ?? downloadClient;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DescriptionList>
|
<DescriptionList>
|
||||||
{
|
{
|
||||||
@@ -125,6 +168,15 @@ function HistoryDetails(props) {
|
|||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
data ?
|
||||||
|
<DescriptionListItem
|
||||||
|
title={translate('Host')}
|
||||||
|
data={host}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
data ?
|
data ?
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
@@ -134,6 +186,33 @@ function HistoryDetails(props) {
|
|||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
infoUrl ?
|
||||||
|
<DescriptionListItem
|
||||||
|
title={translate('InfoUrl')}
|
||||||
|
data={<Link to={infoUrl}>{infoUrl}</Link>}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
publishedDate ?
|
||||||
|
<DescriptionListItem
|
||||||
|
title={translate('PublishedDate')}
|
||||||
|
data={formatDateTime(publishedDate, shortDateFormat, timeFormat, { includeSeconds: true })}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
downloadClientNameInfo ?
|
||||||
|
<DescriptionListItem
|
||||||
|
title={translate('DownloadClient')}
|
||||||
|
data={downloadClientNameInfo}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
data ?
|
data ?
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
@@ -142,11 +221,40 @@ function HistoryDetails(props) {
|
|||||||
/> :
|
/> :
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
elapsedTime ?
|
||||||
|
<DescriptionListItem
|
||||||
|
title={translate('ElapsedTime')}
|
||||||
|
data={`${elapsedTime}ms`}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
grabMethod ?
|
||||||
|
<DescriptionListItem
|
||||||
|
title={translate('Redirected')}
|
||||||
|
data={grabMethod.toLowerCase() === 'redirect' ? translate('Yes') : translate('No')}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
date ?
|
||||||
|
<DescriptionListItem
|
||||||
|
title={translate('Date')}
|
||||||
|
data={formatDateTime(date, shortDateFormat, timeFormat, { includeSeconds: true })}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
</DescriptionList>
|
</DescriptionList>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventType === 'indexerAuth') {
|
if (eventType === 'indexerAuth') {
|
||||||
|
const { elapsedTime } = data;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DescriptionList
|
<DescriptionList
|
||||||
descriptionClassName={styles.description}
|
descriptionClassName={styles.description}
|
||||||
@@ -160,6 +268,24 @@ function HistoryDetails(props) {
|
|||||||
/> :
|
/> :
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
elapsedTime ?
|
||||||
|
<DescriptionListItem
|
||||||
|
title={translate('ElapsedTime')}
|
||||||
|
data={`${elapsedTime}ms`}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
date ?
|
||||||
|
<DescriptionListItem
|
||||||
|
title={translate('Date')}
|
||||||
|
data={formatDateTime(date, shortDateFormat, timeFormat, { includeSeconds: true })}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
</DescriptionList>
|
</DescriptionList>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -171,6 +297,15 @@ function HistoryDetails(props) {
|
|||||||
title={translate('Name')}
|
title={translate('Name')}
|
||||||
data={data.query}
|
data={data.query}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{
|
||||||
|
date ?
|
||||||
|
<DescriptionListItem
|
||||||
|
title={translate('Date')}
|
||||||
|
data={formatDateTime(date, shortDateFormat, timeFormat, { includeSeconds: true })}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
</DescriptionList>
|
</DescriptionList>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -178,6 +313,7 @@ function HistoryDetails(props) {
|
|||||||
HistoryDetails.propTypes = {
|
HistoryDetails.propTypes = {
|
||||||
indexer: PropTypes.object.isRequired,
|
indexer: PropTypes.object.isRequired,
|
||||||
eventType: PropTypes.string.isRequired,
|
eventType: PropTypes.string.isRequired,
|
||||||
|
date: PropTypes.string.isRequired,
|
||||||
data: PropTypes.object.isRequired,
|
data: PropTypes.object.isRequired,
|
||||||
shortDateFormat: PropTypes.string.isRequired,
|
shortDateFormat: PropTypes.string.isRequired,
|
||||||
timeFormat: PropTypes.string.isRequired
|
timeFormat: PropTypes.string.isRequired
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ function HistoryDetailsModal(props) {
|
|||||||
isOpen,
|
isOpen,
|
||||||
eventType,
|
eventType,
|
||||||
indexer,
|
indexer,
|
||||||
|
date,
|
||||||
data,
|
data,
|
||||||
shortDateFormat,
|
shortDateFormat,
|
||||||
timeFormat,
|
timeFormat,
|
||||||
@@ -49,6 +50,7 @@ function HistoryDetailsModal(props) {
|
|||||||
<HistoryDetails
|
<HistoryDetails
|
||||||
eventType={eventType}
|
eventType={eventType}
|
||||||
indexer={indexer}
|
indexer={indexer}
|
||||||
|
date={date}
|
||||||
data={data}
|
data={data}
|
||||||
shortDateFormat={shortDateFormat}
|
shortDateFormat={shortDateFormat}
|
||||||
timeFormat={timeFormat}
|
timeFormat={timeFormat}
|
||||||
@@ -71,6 +73,7 @@ HistoryDetailsModal.propTypes = {
|
|||||||
isOpen: PropTypes.bool.isRequired,
|
isOpen: PropTypes.bool.isRequired,
|
||||||
eventType: PropTypes.string.isRequired,
|
eventType: PropTypes.string.isRequired,
|
||||||
indexer: PropTypes.object.isRequired,
|
indexer: PropTypes.object.isRequired,
|
||||||
|
date: PropTypes.string.isRequired,
|
||||||
data: PropTypes.object.isRequired,
|
data: PropTypes.object.isRequired,
|
||||||
shortDateFormat: PropTypes.string.isRequired,
|
shortDateFormat: PropTypes.string.isRequired,
|
||||||
timeFormat: PropTypes.string.isRequired,
|
timeFormat: PropTypes.string.isRequired,
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import TableOptionsModalWrapper from 'Components/Table/TableOptions/TableOptions
|
|||||||
import TablePager from 'Components/Table/TablePager';
|
import TablePager from 'Components/Table/TablePager';
|
||||||
import { align, icons, kinds } from 'Helpers/Props';
|
import { align, icons, kinds } from 'Helpers/Props';
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
|
import HistoryFilterModal from './HistoryFilterModal';
|
||||||
import HistoryOptionsConnector from './HistoryOptionsConnector';
|
import HistoryOptionsConnector from './HistoryOptionsConnector';
|
||||||
import HistoryRowConnector from './HistoryRowConnector';
|
import HistoryRowConnector from './HistoryRowConnector';
|
||||||
|
|
||||||
@@ -63,6 +64,7 @@ class History extends Component {
|
|||||||
columns,
|
columns,
|
||||||
selectedFilterKey,
|
selectedFilterKey,
|
||||||
filters,
|
filters,
|
||||||
|
customFilters,
|
||||||
totalRecords,
|
totalRecords,
|
||||||
onFilterSelect,
|
onFilterSelect,
|
||||||
onFirstPagePress,
|
onFirstPagePress,
|
||||||
@@ -108,7 +110,8 @@ class History extends Component {
|
|||||||
alignMenu={align.RIGHT}
|
alignMenu={align.RIGHT}
|
||||||
selectedFilterKey={selectedFilterKey}
|
selectedFilterKey={selectedFilterKey}
|
||||||
filters={filters}
|
filters={filters}
|
||||||
customFilters={[]}
|
customFilters={customFilters}
|
||||||
|
filterModalConnectorComponent={HistoryFilterModal}
|
||||||
onFilterSelect={onFilterSelect}
|
onFilterSelect={onFilterSelect}
|
||||||
/>
|
/>
|
||||||
</PageToolbarSection>
|
</PageToolbarSection>
|
||||||
@@ -193,8 +196,9 @@ History.propTypes = {
|
|||||||
indexersError: PropTypes.object,
|
indexersError: PropTypes.object,
|
||||||
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
selectedFilterKey: PropTypes.string.isRequired,
|
selectedFilterKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
||||||
filters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
filters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
|
customFilters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
totalRecords: PropTypes.number,
|
totalRecords: PropTypes.number,
|
||||||
onFilterSelect: PropTypes.func.isRequired,
|
onFilterSelect: PropTypes.func.isRequired,
|
||||||
onFirstPagePress: PropTypes.func.isRequired,
|
onFirstPagePress: PropTypes.func.isRequired,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import * as commandNames from 'Commands/commandNames';
|
|||||||
import withCurrentPage from 'Components/withCurrentPage';
|
import withCurrentPage from 'Components/withCurrentPage';
|
||||||
import { executeCommand } from 'Store/Actions/commandActions';
|
import { executeCommand } from 'Store/Actions/commandActions';
|
||||||
import * as historyActions from 'Store/Actions/historyActions';
|
import * as historyActions from 'Store/Actions/historyActions';
|
||||||
|
import { createCustomFiltersSelector } from 'Store/Selectors/createClientSideCollectionSelector';
|
||||||
import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector';
|
import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector';
|
||||||
import { registerPagePopulator, unregisterPagePopulator } from 'Utilities/pagePopulator';
|
import { registerPagePopulator, unregisterPagePopulator } from 'Utilities/pagePopulator';
|
||||||
import History from './History';
|
import History from './History';
|
||||||
@@ -14,13 +15,15 @@ function createMapStateToProps() {
|
|||||||
return createSelector(
|
return createSelector(
|
||||||
(state) => state.history,
|
(state) => state.history,
|
||||||
(state) => state.indexers,
|
(state) => state.indexers,
|
||||||
|
createCustomFiltersSelector('history'),
|
||||||
createCommandExecutingSelector(commandNames.CLEAR_HISTORY),
|
createCommandExecutingSelector(commandNames.CLEAR_HISTORY),
|
||||||
(history, indexers, isHistoryClearing) => {
|
(history, indexers, customFilters, isHistoryClearing) => {
|
||||||
return {
|
return {
|
||||||
isIndexersFetching: indexers.isFetching,
|
isIndexersFetching: indexers.isFetching,
|
||||||
isIndexersPopulated: indexers.isPopulated,
|
isIndexersPopulated: indexers.isPopulated,
|
||||||
indexersError: indexers.error,
|
indexersError: indexers.error,
|
||||||
isHistoryClearing,
|
isHistoryClearing,
|
||||||
|
customFilters,
|
||||||
...history
|
...history
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,21 +20,22 @@ function getIconName(eventType) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getIconKind(successful) {
|
function getIconKind(successful, redirect) {
|
||||||
switch (successful) {
|
if (redirect) {
|
||||||
case false:
|
return kinds.INFO;
|
||||||
return kinds.DANGER;
|
} else if (!successful) {
|
||||||
default:
|
return kinds.DANGER;
|
||||||
return kinds.DEFAULT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return kinds.DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTooltip(eventType, data, indexer) {
|
function getTooltip(eventType, data, indexer, redirect) {
|
||||||
switch (eventType) {
|
switch (eventType) {
|
||||||
case 'indexerQuery':
|
case 'indexerQuery':
|
||||||
return `Query "${data.query}" sent to ${indexer.name}`;
|
return `Query "${data.query}" sent to ${indexer.name}`;
|
||||||
case 'releaseGrabbed':
|
case 'releaseGrabbed':
|
||||||
return `Release grabbed from ${indexer.name}`;
|
return redirect ? `Release grabbed via redirect from ${indexer.name}` : `Release grabbed from ${indexer.name}`;
|
||||||
case 'indexerAuth':
|
case 'indexerAuth':
|
||||||
return `Auth attempted for ${indexer.name}`;
|
return `Auth attempted for ${indexer.name}`;
|
||||||
case 'indexerRss':
|
case 'indexerRss':
|
||||||
@@ -45,9 +46,12 @@ function getTooltip(eventType, data, indexer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function HistoryEventTypeCell({ eventType, successful, data, indexer }) {
|
function HistoryEventTypeCell({ eventType, successful, data, indexer }) {
|
||||||
|
const { grabMethod } = data;
|
||||||
|
const redirect = grabMethod && grabMethod.toLowerCase() === 'redirect';
|
||||||
|
|
||||||
const iconName = getIconName(eventType);
|
const iconName = getIconName(eventType);
|
||||||
const iconKind = getIconKind(successful);
|
const iconKind = getIconKind(successful, redirect);
|
||||||
const tooltip = getTooltip(eventType, data, indexer);
|
const tooltip = getTooltip(eventType, data, indexer, redirect);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableRowCell
|
<TableRowCell
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
import React, { useCallback } from 'react';
|
||||||
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
|
import { createSelector } from 'reselect';
|
||||||
|
import AppState from 'App/State/AppState';
|
||||||
|
import FilterModal from 'Components/Filter/FilterModal';
|
||||||
|
import { setHistoryFilter } from 'Store/Actions/historyActions';
|
||||||
|
|
||||||
|
function createHistorySelector() {
|
||||||
|
return createSelector(
|
||||||
|
(state: AppState) => state.history.items,
|
||||||
|
(queueItems) => {
|
||||||
|
return queueItems;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function createFilterBuilderPropsSelector() {
|
||||||
|
return createSelector(
|
||||||
|
(state: AppState) => state.history.filterBuilderProps,
|
||||||
|
(filterBuilderProps) => {
|
||||||
|
return filterBuilderProps;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
interface HistoryFilterModalProps {
|
||||||
|
isOpen: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function HistoryFilterModal(props: HistoryFilterModalProps) {
|
||||||
|
const sectionItems = useSelector(createHistorySelector());
|
||||||
|
const filterBuilderProps = useSelector(createFilterBuilderPropsSelector());
|
||||||
|
const customFilterType = 'history';
|
||||||
|
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
|
const dispatchSetFilter = useCallback(
|
||||||
|
(payload: unknown) => {
|
||||||
|
dispatch(setHistoryFilter(payload));
|
||||||
|
},
|
||||||
|
[dispatch]
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FilterModal
|
||||||
|
// TODO: Don't spread all the props
|
||||||
|
{...props}
|
||||||
|
sectionItems={sectionItems}
|
||||||
|
filterBuilderProps={filterBuilderProps}
|
||||||
|
customFilterType={customFilterType}
|
||||||
|
dispatchSetFilter={dispatchSetFilter}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -331,6 +331,21 @@ class HistoryRow extends Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (name === 'host') {
|
||||||
|
return (
|
||||||
|
<TableRowCell
|
||||||
|
key={name}
|
||||||
|
className={styles.indexer}
|
||||||
|
>
|
||||||
|
{
|
||||||
|
data.host ?
|
||||||
|
data.host :
|
||||||
|
null
|
||||||
|
}
|
||||||
|
</TableRowCell>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (name === 'elapsedTime') {
|
if (name === 'elapsedTime') {
|
||||||
return (
|
return (
|
||||||
<TableRowCell
|
<TableRowCell
|
||||||
@@ -355,8 +370,9 @@ class HistoryRow extends Component {
|
|||||||
return (
|
return (
|
||||||
<RelativeDateCell
|
<RelativeDateCell
|
||||||
key={name}
|
key={name}
|
||||||
date={date}
|
|
||||||
className={styles.date}
|
className={styles.date}
|
||||||
|
date={date}
|
||||||
|
includeSeconds={true}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -393,6 +409,7 @@ class HistoryRow extends Component {
|
|||||||
<HistoryDetailsModal
|
<HistoryDetailsModal
|
||||||
isOpen={this.state.isDetailsModalOpen}
|
isOpen={this.state.isDetailsModalOpen}
|
||||||
eventType={eventType}
|
eventType={eventType}
|
||||||
|
date={date}
|
||||||
data={data}
|
data={data}
|
||||||
indexer={indexer}
|
indexer={indexer}
|
||||||
isMarkingAsFailed={isMarkingAsFailed}
|
isMarkingAsFailed={isMarkingAsFailed}
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import Modal from 'Components/Modal/Modal';
|
|
||||||
import AddIndexerModalContentConnector from './AddIndexerModalContentConnector';
|
|
||||||
import styles from './AddIndexerModal.css';
|
|
||||||
|
|
||||||
function AddIndexerModal({ isOpen, onModalClose, onSelectIndexer, ...otherProps }) {
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
isOpen={isOpen}
|
|
||||||
onModalClose={onModalClose}
|
|
||||||
className={styles.modal}
|
|
||||||
>
|
|
||||||
<AddIndexerModalContentConnector
|
|
||||||
{...otherProps}
|
|
||||||
onModalClose={onModalClose}
|
|
||||||
onSelectIndexer={onSelectIndexer}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
AddIndexerModal.propTypes = {
|
|
||||||
isOpen: PropTypes.bool.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired,
|
|
||||||
onSelectIndexer: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default AddIndexerModal;
|
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import React, { useCallback } from 'react';
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import Modal from 'Components/Modal/Modal';
|
||||||
|
import { sizes } from 'Helpers/Props';
|
||||||
|
import { clearIndexerSchema } from 'Store/Actions/indexerActions';
|
||||||
|
import AddIndexerModalContent from './AddIndexerModalContent';
|
||||||
|
import styles from './AddIndexerModal.css';
|
||||||
|
|
||||||
|
interface AddIndexerModalProps {
|
||||||
|
isOpen: boolean;
|
||||||
|
onSelectIndexer(): void;
|
||||||
|
onModalClose(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
function AddIndexerModal({
|
||||||
|
isOpen,
|
||||||
|
onSelectIndexer,
|
||||||
|
onModalClose,
|
||||||
|
...otherProps
|
||||||
|
}: AddIndexerModalProps) {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
|
const onModalClosePress = useCallback(() => {
|
||||||
|
dispatch(clearIndexerSchema());
|
||||||
|
onModalClose();
|
||||||
|
}, [dispatch, onModalClose]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
isOpen={isOpen}
|
||||||
|
size={sizes.EXTRA_LARGE}
|
||||||
|
onModalClose={onModalClosePress}
|
||||||
|
className={styles.modal}
|
||||||
|
>
|
||||||
|
<AddIndexerModalContent
|
||||||
|
{...otherProps}
|
||||||
|
onSelectIndexer={onSelectIndexer}
|
||||||
|
onModalClose={onModalClosePress}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default AddIndexerModal;
|
||||||
@@ -19,12 +19,18 @@
|
|||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert {
|
.notice {
|
||||||
composes: alert from '~Components/Alert.css';
|
composes: alert from '~Components/Alert.css';
|
||||||
|
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.alert {
|
||||||
|
composes: alert from '~Components/Alert.css';
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
.scroller {
|
.scroller {
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ interface CssExports {
|
|||||||
'indexers': string;
|
'indexers': string;
|
||||||
'modalBody': string;
|
'modalBody': string;
|
||||||
'modalFooter': string;
|
'modalFooter': string;
|
||||||
|
'notice': string;
|
||||||
'scroller': string;
|
'scroller': string;
|
||||||
}
|
}
|
||||||
export const cssExports: CssExports;
|
export const cssExports: CssExports;
|
||||||
|
|||||||
@@ -1,318 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import Alert from 'Components/Alert';
|
|
||||||
import EnhancedSelectInput from 'Components/Form/EnhancedSelectInput';
|
|
||||||
import NewznabCategorySelectInputConnector from 'Components/Form/NewznabCategorySelectInputConnector';
|
|
||||||
import TextInput from 'Components/Form/TextInput';
|
|
||||||
import Button from 'Components/Link/Button';
|
|
||||||
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
|
||||||
import ModalBody from 'Components/Modal/ModalBody';
|
|
||||||
import ModalContent from 'Components/Modal/ModalContent';
|
|
||||||
import ModalFooter from 'Components/Modal/ModalFooter';
|
|
||||||
import ModalHeader from 'Components/Modal/ModalHeader';
|
|
||||||
import Scroller from 'Components/Scroller/Scroller';
|
|
||||||
import Table from 'Components/Table/Table';
|
|
||||||
import TableBody from 'Components/Table/TableBody';
|
|
||||||
import { kinds, scrollDirections } from 'Helpers/Props';
|
|
||||||
import getErrorMessage from 'Utilities/Object/getErrorMessage';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import SelectIndexerRowConnector from './SelectIndexerRowConnector';
|
|
||||||
import styles from './AddIndexerModalContent.css';
|
|
||||||
|
|
||||||
const columns = [
|
|
||||||
{
|
|
||||||
name: 'protocol',
|
|
||||||
label: () => translate('Protocol'),
|
|
||||||
isSortable: true,
|
|
||||||
isVisible: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'sortName',
|
|
||||||
label: () => translate('Name'),
|
|
||||||
isSortable: true,
|
|
||||||
isVisible: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'language',
|
|
||||||
label: () => translate('Language'),
|
|
||||||
isSortable: true,
|
|
||||||
isVisible: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'description',
|
|
||||||
label: () => translate('Description'),
|
|
||||||
isSortable: false,
|
|
||||||
isVisible: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'privacy',
|
|
||||||
label: () => translate('Privacy'),
|
|
||||||
isSortable: true,
|
|
||||||
isVisible: true
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
const protocols = [
|
|
||||||
{
|
|
||||||
key: 'torrent',
|
|
||||||
value: 'torrent'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'usenet',
|
|
||||||
value: 'nzb'
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
const privacyLevels = [
|
|
||||||
{
|
|
||||||
key: 'private',
|
|
||||||
get value() {
|
|
||||||
return translate('Private');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'semiPrivate',
|
|
||||||
get value() {
|
|
||||||
return translate('SemiPrivate');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'public',
|
|
||||||
get value() {
|
|
||||||
return translate('Public');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
class AddIndexerModalContent extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
constructor(props, context) {
|
|
||||||
super(props, context);
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
filter: '',
|
|
||||||
filterProtocols: [],
|
|
||||||
filterLanguages: [],
|
|
||||||
filterPrivacyLevels: [],
|
|
||||||
filterCategories: []
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onFilterChange = ({ value }) => {
|
|
||||||
this.setState({ filter: value });
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
indexers,
|
|
||||||
onIndexerSelect,
|
|
||||||
sortKey,
|
|
||||||
sortDirection,
|
|
||||||
isFetching,
|
|
||||||
isPopulated,
|
|
||||||
error,
|
|
||||||
onSortPress,
|
|
||||||
onModalClose
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const languages = Array.from(new Set(indexers.map(({ language }) => language)))
|
|
||||||
.sort((a, b) => a.localeCompare(b))
|
|
||||||
.map((language) => ({ key: language, value: language }));
|
|
||||||
|
|
||||||
const filteredIndexers = indexers.filter((indexer) => {
|
|
||||||
const {
|
|
||||||
filter,
|
|
||||||
filterProtocols,
|
|
||||||
filterLanguages,
|
|
||||||
filterPrivacyLevels,
|
|
||||||
filterCategories
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
if (!indexer.name.toLowerCase().includes(filter.toLocaleLowerCase()) && !indexer.description.toLowerCase().includes(filter.toLocaleLowerCase())) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (filterProtocols.length && !filterProtocols.includes(indexer.protocol)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (filterLanguages.length && !filterLanguages.includes(indexer.language)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (filterPrivacyLevels.length && !filterPrivacyLevels.includes(indexer.privacy)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (filterCategories.length) {
|
|
||||||
const { categories = [] } = indexer.capabilities || {};
|
|
||||||
const flat = ({ id, subCategories = [] }) => [id, ...subCategories.flatMap(flat)];
|
|
||||||
const flatCategories = categories
|
|
||||||
.filter((item) => item.id < 100000)
|
|
||||||
.flatMap(flat);
|
|
||||||
|
|
||||||
if (!filterCategories.every((item) => flatCategories.includes(item))) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
|
|
||||||
const errorMessage = getErrorMessage(error, translate('UnableToLoadIndexers'));
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ModalContent onModalClose={onModalClose}>
|
|
||||||
<ModalHeader>
|
|
||||||
{translate('AddIndexer')}
|
|
||||||
</ModalHeader>
|
|
||||||
|
|
||||||
<ModalBody
|
|
||||||
className={styles.modalBody}
|
|
||||||
scrollDirection={scrollDirections.NONE}
|
|
||||||
>
|
|
||||||
<TextInput
|
|
||||||
className={styles.filterInput}
|
|
||||||
placeholder={translate('FilterPlaceHolder')}
|
|
||||||
name="filter"
|
|
||||||
value={this.state.filter}
|
|
||||||
autoFocus={true}
|
|
||||||
onChange={this.onFilterChange}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className={styles.filterRow}>
|
|
||||||
<div className={styles.filterContainer}>
|
|
||||||
<label className={styles.filterLabel}>{translate('Protocol')}</label>
|
|
||||||
<EnhancedSelectInput
|
|
||||||
name="indexerProtocols"
|
|
||||||
value={this.state.filterProtocols}
|
|
||||||
values={protocols}
|
|
||||||
onChange={({ value }) => this.setState({ filterProtocols: value })}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.filterContainer}>
|
|
||||||
<label className={styles.filterLabel}>{translate('Language')}</label>
|
|
||||||
<EnhancedSelectInput
|
|
||||||
name="indexerLanguages"
|
|
||||||
value={this.state.filterLanguages}
|
|
||||||
values={languages}
|
|
||||||
onChange={({ value }) => this.setState({ filterLanguages: value })}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.filterContainer}>
|
|
||||||
<label className={styles.filterLabel}>{translate('Privacy')}</label>
|
|
||||||
<EnhancedSelectInput
|
|
||||||
name="indexerPrivacyLevels"
|
|
||||||
value={this.state.filterPrivacyLevels}
|
|
||||||
values={privacyLevels}
|
|
||||||
onChange={({ value }) => this.setState({ filterPrivacyLevels: value })}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.filterContainer}>
|
|
||||||
<label className={styles.filterLabel}>{translate('Categories')}</label>
|
|
||||||
<NewznabCategorySelectInputConnector
|
|
||||||
name="indexerCategories"
|
|
||||||
value={this.state.filterCategories}
|
|
||||||
onChange={({ value }) => this.setState({ filterCategories: value })}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Alert
|
|
||||||
kind={kinds.INFO}
|
|
||||||
className={styles.alert}
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
{translate('ProwlarrSupportsAnyIndexer')}
|
|
||||||
</div>
|
|
||||||
</Alert>
|
|
||||||
|
|
||||||
<Scroller
|
|
||||||
className={styles.scroller}
|
|
||||||
autoFocus={false}
|
|
||||||
>
|
|
||||||
{
|
|
||||||
isFetching ? <LoadingIndicator /> : null
|
|
||||||
}
|
|
||||||
{
|
|
||||||
error ? <Alert kind={kinds.DANGER}>{errorMessage}</Alert> : null
|
|
||||||
}
|
|
||||||
{
|
|
||||||
isPopulated && !!indexers.length ?
|
|
||||||
<Table
|
|
||||||
columns={columns}
|
|
||||||
sortKey={sortKey}
|
|
||||||
sortDirection={sortDirection}
|
|
||||||
onSortPress={onSortPress}
|
|
||||||
>
|
|
||||||
<TableBody>
|
|
||||||
{
|
|
||||||
filteredIndexers.map((indexer) => (
|
|
||||||
<SelectIndexerRowConnector
|
|
||||||
key={`${indexer.implementation}-${indexer.name}`}
|
|
||||||
implementation={indexer.implementation}
|
|
||||||
implementationName={indexer.implementationName}
|
|
||||||
{...indexer}
|
|
||||||
onIndexerSelect={onIndexerSelect}
|
|
||||||
/>
|
|
||||||
))
|
|
||||||
}
|
|
||||||
</TableBody>
|
|
||||||
</Table> :
|
|
||||||
null
|
|
||||||
}
|
|
||||||
{
|
|
||||||
isPopulated && !!indexers.length && !filteredIndexers.length ?
|
|
||||||
<Alert
|
|
||||||
kind={kinds.WARNING}
|
|
||||||
>
|
|
||||||
{translate('NoIndexersFound')}
|
|
||||||
</Alert> :
|
|
||||||
null
|
|
||||||
}
|
|
||||||
</Scroller>
|
|
||||||
</ModalBody>
|
|
||||||
|
|
||||||
<ModalFooter className={styles.modalFooter}>
|
|
||||||
<div className={styles.available}>
|
|
||||||
{
|
|
||||||
isPopulated ?
|
|
||||||
translate('CountIndexersAvailable', { count: filteredIndexers.length }) :
|
|
||||||
null
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<Button onPress={onModalClose}>{translate('Close')}</Button>
|
|
||||||
</div>
|
|
||||||
</ModalFooter>
|
|
||||||
</ModalContent>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AddIndexerModalContent.propTypes = {
|
|
||||||
isFetching: PropTypes.bool.isRequired,
|
|
||||||
isPopulated: PropTypes.bool.isRequired,
|
|
||||||
error: PropTypes.object,
|
|
||||||
sortKey: PropTypes.string,
|
|
||||||
sortDirection: PropTypes.string,
|
|
||||||
onSortPress: PropTypes.func.isRequired,
|
|
||||||
indexers: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
onIndexerSelect: PropTypes.func.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default AddIndexerModalContent;
|
|
||||||
@@ -0,0 +1,414 @@
|
|||||||
|
import { some } from 'lodash';
|
||||||
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
|
import { createSelector } from 'reselect';
|
||||||
|
import IndexerAppState from 'App/State/IndexerAppState';
|
||||||
|
import Alert from 'Components/Alert';
|
||||||
|
import EnhancedSelectInput from 'Components/Form/EnhancedSelectInput';
|
||||||
|
import NewznabCategorySelectInputConnector from 'Components/Form/NewznabCategorySelectInputConnector';
|
||||||
|
import TextInput from 'Components/Form/TextInput';
|
||||||
|
import Button from 'Components/Link/Button';
|
||||||
|
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
||||||
|
import ModalBody from 'Components/Modal/ModalBody';
|
||||||
|
import ModalContent from 'Components/Modal/ModalContent';
|
||||||
|
import ModalFooter from 'Components/Modal/ModalFooter';
|
||||||
|
import ModalHeader from 'Components/Modal/ModalHeader';
|
||||||
|
import Scroller from 'Components/Scroller/Scroller';
|
||||||
|
import Table from 'Components/Table/Table';
|
||||||
|
import TableBody from 'Components/Table/TableBody';
|
||||||
|
import { kinds, scrollDirections } from 'Helpers/Props';
|
||||||
|
import Indexer, { IndexerCategory } from 'Indexer/Indexer';
|
||||||
|
import {
|
||||||
|
fetchIndexerSchema,
|
||||||
|
selectIndexerSchema,
|
||||||
|
setIndexerSchemaSort,
|
||||||
|
} from 'Store/Actions/indexerActions';
|
||||||
|
import createAllIndexersSelector from 'Store/Selectors/createAllIndexersSelector';
|
||||||
|
import createClientSideCollectionSelector from 'Store/Selectors/createClientSideCollectionSelector';
|
||||||
|
import { SortCallback } from 'typings/callbacks';
|
||||||
|
import sortByProp from 'Utilities/Array/sortByProp';
|
||||||
|
import getErrorMessage from 'Utilities/Object/getErrorMessage';
|
||||||
|
import translate from 'Utilities/String/translate';
|
||||||
|
import SelectIndexerRow from './SelectIndexerRow';
|
||||||
|
import styles from './AddIndexerModalContent.css';
|
||||||
|
|
||||||
|
const COLUMNS = [
|
||||||
|
{
|
||||||
|
name: 'protocol',
|
||||||
|
label: () => translate('Protocol'),
|
||||||
|
isSortable: true,
|
||||||
|
isVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'sortName',
|
||||||
|
label: () => translate('Name'),
|
||||||
|
isSortable: true,
|
||||||
|
isVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'language',
|
||||||
|
label: () => translate('Language'),
|
||||||
|
isSortable: true,
|
||||||
|
isVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'description',
|
||||||
|
label: () => translate('Description'),
|
||||||
|
isSortable: false,
|
||||||
|
isVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'privacy',
|
||||||
|
label: () => translate('Privacy'),
|
||||||
|
isSortable: true,
|
||||||
|
isVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'categories',
|
||||||
|
label: () => translate('Categories'),
|
||||||
|
isSortable: false,
|
||||||
|
isVisible: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const PROTOCOLS = [
|
||||||
|
{
|
||||||
|
key: 'torrent',
|
||||||
|
value: 'torrent',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'usenet',
|
||||||
|
value: 'nzb',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const PRIVACY_LEVELS = [
|
||||||
|
{
|
||||||
|
key: 'private',
|
||||||
|
get value() {
|
||||||
|
return translate('Private');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'semiPrivate',
|
||||||
|
get value() {
|
||||||
|
return translate('SemiPrivate');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'public',
|
||||||
|
get value() {
|
||||||
|
return translate('Public');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
interface IndexerSchema extends Indexer {
|
||||||
|
isExistingIndexer: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createAddIndexersSelector() {
|
||||||
|
return createSelector(
|
||||||
|
createClientSideCollectionSelector('indexers.schema'),
|
||||||
|
createAllIndexersSelector(),
|
||||||
|
(indexers: IndexerAppState, allIndexers) => {
|
||||||
|
const { isFetching, isPopulated, error, items, sortDirection, sortKey } =
|
||||||
|
indexers;
|
||||||
|
|
||||||
|
const indexerList: IndexerSchema[] = items.map((item) => {
|
||||||
|
const { definitionName } = item;
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
isExistingIndexer: some(allIndexers, { definitionName }),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
isFetching,
|
||||||
|
isPopulated,
|
||||||
|
error,
|
||||||
|
indexers: indexerList,
|
||||||
|
sortKey,
|
||||||
|
sortDirection,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AddIndexerModalContentProps {
|
||||||
|
onSelectIndexer(): void;
|
||||||
|
onModalClose(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
function AddIndexerModalContent(props: AddIndexerModalContentProps) {
|
||||||
|
const { onSelectIndexer, onModalClose } = props;
|
||||||
|
|
||||||
|
const { isFetching, isPopulated, error, indexers, sortKey, sortDirection } =
|
||||||
|
useSelector(createAddIndexersSelector());
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
|
const [filter, setFilter] = useState('');
|
||||||
|
const [filterProtocols, setFilterProtocols] = useState<string[]>([]);
|
||||||
|
const [filterLanguages, setFilterLanguages] = useState<string[]>([]);
|
||||||
|
const [filterPrivacyLevels, setFilterPrivacyLevels] = useState<string[]>([]);
|
||||||
|
const [filterCategories, setFilterCategories] = useState<number[]>([]);
|
||||||
|
|
||||||
|
useEffect(
|
||||||
|
() => {
|
||||||
|
dispatch(fetchIndexerSchema());
|
||||||
|
},
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
|
const onFilterChange = useCallback(
|
||||||
|
({ value }: { value: string }) => {
|
||||||
|
setFilter(value);
|
||||||
|
},
|
||||||
|
[setFilter]
|
||||||
|
);
|
||||||
|
|
||||||
|
const onIndexerSelect = useCallback(
|
||||||
|
({
|
||||||
|
implementation,
|
||||||
|
implementationName,
|
||||||
|
name,
|
||||||
|
}: {
|
||||||
|
implementation: string;
|
||||||
|
implementationName: string;
|
||||||
|
name: string;
|
||||||
|
}) => {
|
||||||
|
dispatch(
|
||||||
|
selectIndexerSchema({
|
||||||
|
implementation,
|
||||||
|
implementationName,
|
||||||
|
name,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
onSelectIndexer();
|
||||||
|
},
|
||||||
|
[dispatch, onSelectIndexer]
|
||||||
|
);
|
||||||
|
|
||||||
|
const onSortPress = useCallback<SortCallback>(
|
||||||
|
(sortKey, sortDirection) => {
|
||||||
|
dispatch(setIndexerSchemaSort({ sortKey, sortDirection }));
|
||||||
|
},
|
||||||
|
[dispatch]
|
||||||
|
);
|
||||||
|
|
||||||
|
const languages = useMemo(
|
||||||
|
() =>
|
||||||
|
Array.from(new Set(indexers.map(({ language }) => language)))
|
||||||
|
.map((language) => ({ key: language, value: language }))
|
||||||
|
.sort(sortByProp('value')),
|
||||||
|
[indexers]
|
||||||
|
);
|
||||||
|
|
||||||
|
const filteredIndexers = useMemo(() => {
|
||||||
|
const flat = ({
|
||||||
|
id,
|
||||||
|
subCategories = [],
|
||||||
|
}: {
|
||||||
|
id: number;
|
||||||
|
subCategories: IndexerCategory[];
|
||||||
|
}): number[] => [id, ...subCategories.flatMap(flat)];
|
||||||
|
|
||||||
|
return indexers.filter((indexer) => {
|
||||||
|
if (
|
||||||
|
filter.length &&
|
||||||
|
!indexer.name.toLowerCase().includes(filter.toLocaleLowerCase()) &&
|
||||||
|
!indexer.description.toLowerCase().includes(filter.toLocaleLowerCase())
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
filterProtocols.length &&
|
||||||
|
!filterProtocols.includes(indexer.protocol)
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
filterLanguages.length &&
|
||||||
|
!filterLanguages.includes(indexer.language)
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
filterPrivacyLevels.length &&
|
||||||
|
!filterPrivacyLevels.includes(indexer.privacy)
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (filterCategories.length) {
|
||||||
|
const { categories = [] } = indexer.capabilities || {};
|
||||||
|
|
||||||
|
const flatCategories = categories
|
||||||
|
.filter((item) => item.id < 100000)
|
||||||
|
.flatMap(flat);
|
||||||
|
|
||||||
|
if (
|
||||||
|
!filterCategories.every((categoryId) =>
|
||||||
|
flatCategories.includes(categoryId)
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}, [
|
||||||
|
indexers,
|
||||||
|
filter,
|
||||||
|
filterProtocols,
|
||||||
|
filterLanguages,
|
||||||
|
filterPrivacyLevels,
|
||||||
|
filterCategories,
|
||||||
|
]);
|
||||||
|
|
||||||
|
const errorMessage = getErrorMessage(
|
||||||
|
error,
|
||||||
|
translate('UnableToLoadIndexers')
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalContent onModalClose={onModalClose}>
|
||||||
|
<ModalHeader>{translate('AddIndexer')}</ModalHeader>
|
||||||
|
|
||||||
|
<ModalBody
|
||||||
|
className={styles.modalBody}
|
||||||
|
scrollDirection={scrollDirections.NONE}
|
||||||
|
>
|
||||||
|
<TextInput
|
||||||
|
className={styles.filterInput}
|
||||||
|
placeholder={translate('FilterPlaceHolder')}
|
||||||
|
name="filter"
|
||||||
|
value={filter}
|
||||||
|
autoFocus={true}
|
||||||
|
onChange={onFilterChange}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div className={styles.filterRow}>
|
||||||
|
<div className={styles.filterContainer}>
|
||||||
|
<label className={styles.filterLabel}>
|
||||||
|
{translate('Protocol')}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<EnhancedSelectInput
|
||||||
|
name="indexerProtocols"
|
||||||
|
value={filterProtocols}
|
||||||
|
values={PROTOCOLS}
|
||||||
|
onChange={({ value }: { value: string[] }) =>
|
||||||
|
setFilterProtocols(value)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.filterContainer}>
|
||||||
|
<label className={styles.filterLabel}>
|
||||||
|
{translate('Language')}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<EnhancedSelectInput
|
||||||
|
name="indexerLanguages"
|
||||||
|
value={filterLanguages}
|
||||||
|
values={languages}
|
||||||
|
onChange={({ value }: { value: string[] }) =>
|
||||||
|
setFilterLanguages(value)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.filterContainer}>
|
||||||
|
<label className={styles.filterLabel}>{translate('Privacy')}</label>
|
||||||
|
<EnhancedSelectInput
|
||||||
|
name="indexerPrivacyLevels"
|
||||||
|
value={filterPrivacyLevels}
|
||||||
|
values={PRIVACY_LEVELS}
|
||||||
|
onChange={({ value }: { value: string[] }) =>
|
||||||
|
setFilterPrivacyLevels(value)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.filterContainer}>
|
||||||
|
<label className={styles.filterLabel}>
|
||||||
|
{translate('Categories')}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<NewznabCategorySelectInputConnector
|
||||||
|
name="indexerCategories"
|
||||||
|
value={filterCategories}
|
||||||
|
onChange={({ value }: { value: number[] }) =>
|
||||||
|
setFilterCategories(value)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Alert kind={kinds.INFO} className={styles.notice}>
|
||||||
|
<div>{translate('ProwlarrSupportsAnyIndexer')}</div>
|
||||||
|
</Alert>
|
||||||
|
|
||||||
|
<Scroller className={styles.scroller} autoFocus={false}>
|
||||||
|
{isFetching ? <LoadingIndicator /> : null}
|
||||||
|
|
||||||
|
{error ? (
|
||||||
|
<Alert kind={kinds.DANGER} className={styles.alert}>
|
||||||
|
{errorMessage}
|
||||||
|
</Alert>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{isPopulated && !!indexers.length ? (
|
||||||
|
<Table
|
||||||
|
columns={COLUMNS}
|
||||||
|
sortKey={sortKey}
|
||||||
|
sortDirection={sortDirection}
|
||||||
|
onSortPress={onSortPress}
|
||||||
|
>
|
||||||
|
<TableBody>
|
||||||
|
{filteredIndexers.map((indexer) => (
|
||||||
|
<SelectIndexerRow
|
||||||
|
{...indexer}
|
||||||
|
key={`${indexer.implementation}-${indexer.name}`}
|
||||||
|
implementation={indexer.implementation}
|
||||||
|
implementationName={indexer.implementationName}
|
||||||
|
onIndexerSelect={onIndexerSelect}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{isPopulated && !!indexers.length && !filteredIndexers.length ? (
|
||||||
|
<Alert kind={kinds.WARNING} className={styles.alert}>
|
||||||
|
{translate('NoIndexersFound')}
|
||||||
|
</Alert>
|
||||||
|
) : null}
|
||||||
|
</Scroller>
|
||||||
|
</ModalBody>
|
||||||
|
|
||||||
|
<ModalFooter className={styles.modalFooter}>
|
||||||
|
<div className={styles.available}>
|
||||||
|
{isPopulated
|
||||||
|
? translate('CountIndexersAvailable', {
|
||||||
|
count: filteredIndexers.length,
|
||||||
|
})
|
||||||
|
: null}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<Button onPress={onModalClose}>{translate('Close')}</Button>
|
||||||
|
</div>
|
||||||
|
</ModalFooter>
|
||||||
|
</ModalContent>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default AddIndexerModalContent;
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import { fetchIndexerSchema, selectIndexerSchema, setIndexerSchemaSort } from 'Store/Actions/indexerActions';
|
|
||||||
import createClientSideCollectionSelector from 'Store/Selectors/createClientSideCollectionSelector';
|
|
||||||
import AddIndexerModalContent from './AddIndexerModalContent';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
createClientSideCollectionSelector('indexers.schema'),
|
|
||||||
(indexers) => {
|
|
||||||
const {
|
|
||||||
isFetching,
|
|
||||||
isPopulated,
|
|
||||||
error,
|
|
||||||
items,
|
|
||||||
sortDirection,
|
|
||||||
sortKey
|
|
||||||
} = indexers;
|
|
||||||
|
|
||||||
return {
|
|
||||||
isFetching,
|
|
||||||
isPopulated,
|
|
||||||
error,
|
|
||||||
indexers: items,
|
|
||||||
sortKey,
|
|
||||||
sortDirection
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
fetchIndexerSchema,
|
|
||||||
selectIndexerSchema,
|
|
||||||
setIndexerSchemaSort
|
|
||||||
};
|
|
||||||
|
|
||||||
class AddIndexerModalContentConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
this.props.fetchIndexerSchema();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onIndexerSelect = ({ implementation, implementationName, name }) => {
|
|
||||||
this.props.selectIndexerSchema({ implementation, implementationName, name });
|
|
||||||
this.props.onSelectIndexer();
|
|
||||||
};
|
|
||||||
|
|
||||||
onSortPress = (sortKey, sortDirection) => {
|
|
||||||
this.props.setIndexerSchemaSort({ sortKey, sortDirection });
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<AddIndexerModalContent
|
|
||||||
{...this.props}
|
|
||||||
onSortPress={this.onSortPress}
|
|
||||||
onIndexerSelect={this.onIndexerSelect}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AddIndexerModalContentConnector.propTypes = {
|
|
||||||
fetchIndexerSchema: PropTypes.func.isRequired,
|
|
||||||
selectIndexerSchema: PropTypes.func.isRequired,
|
|
||||||
setIndexerSchemaSort: PropTypes.func.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired,
|
|
||||||
onSelectIndexer: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(AddIndexerModalContentConnector);
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import Icon from 'Components/Icon';
|
|
||||||
import TableRowCell from 'Components/Table/Cells/TableRowCell';
|
|
||||||
import TableRowButton from 'Components/Table/TableRowButton';
|
|
||||||
import { icons } from 'Helpers/Props';
|
|
||||||
import ProtocolLabel from 'Indexer/Index/Table/ProtocolLabel';
|
|
||||||
import firstCharToUpper from 'Utilities/String/firstCharToUpper';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import styles from './SelectIndexerRow.css';
|
|
||||||
|
|
||||||
class SelectIndexerRow extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onPress = () => {
|
|
||||||
const {
|
|
||||||
implementation,
|
|
||||||
implementationName,
|
|
||||||
name
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
this.props.onIndexerSelect({ implementation, implementationName, name });
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
protocol,
|
|
||||||
privacy,
|
|
||||||
name,
|
|
||||||
language,
|
|
||||||
description,
|
|
||||||
isExistingIndexer
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<TableRowButton onPress={this.onPress}>
|
|
||||||
<TableRowCell className={styles.protocol}>
|
|
||||||
<ProtocolLabel
|
|
||||||
protocol={protocol}
|
|
||||||
/>
|
|
||||||
</TableRowCell>
|
|
||||||
|
|
||||||
<TableRowCell>
|
|
||||||
{name}
|
|
||||||
{
|
|
||||||
isExistingIndexer ?
|
|
||||||
<Icon
|
|
||||||
className={styles.alreadyExistsIcon}
|
|
||||||
name={icons.CHECK_CIRCLE}
|
|
||||||
size={15}
|
|
||||||
title={translate('IndexerAlreadySetup')}
|
|
||||||
/> :
|
|
||||||
null
|
|
||||||
}
|
|
||||||
</TableRowCell>
|
|
||||||
|
|
||||||
<TableRowCell>
|
|
||||||
{language}
|
|
||||||
</TableRowCell>
|
|
||||||
|
|
||||||
<TableRowCell>
|
|
||||||
{description}
|
|
||||||
</TableRowCell>
|
|
||||||
|
|
||||||
<TableRowCell>
|
|
||||||
{translate(firstCharToUpper(privacy))}
|
|
||||||
</TableRowCell>
|
|
||||||
</TableRowButton>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SelectIndexerRow.propTypes = {
|
|
||||||
name: PropTypes.string.isRequired,
|
|
||||||
protocol: PropTypes.string.isRequired,
|
|
||||||
privacy: PropTypes.string.isRequired,
|
|
||||||
language: PropTypes.string.isRequired,
|
|
||||||
description: PropTypes.string.isRequired,
|
|
||||||
implementation: PropTypes.string.isRequired,
|
|
||||||
implementationName: PropTypes.string.isRequired,
|
|
||||||
onIndexerSelect: PropTypes.func.isRequired,
|
|
||||||
isExistingIndexer: PropTypes.bool.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default SelectIndexerRow;
|
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
import React, { useCallback } from 'react';
|
||||||
|
import Icon from 'Components/Icon';
|
||||||
|
import TableRowCell from 'Components/Table/Cells/TableRowCell';
|
||||||
|
import TableRowButton from 'Components/Table/TableRowButton';
|
||||||
|
import { icons } from 'Helpers/Props';
|
||||||
|
import CapabilitiesLabel from 'Indexer/Index/Table/CapabilitiesLabel';
|
||||||
|
import PrivacyLabel from 'Indexer/Index/Table/PrivacyLabel';
|
||||||
|
import ProtocolLabel from 'Indexer/Index/Table/ProtocolLabel';
|
||||||
|
import { IndexerCapabilities, IndexerPrivacy } from 'Indexer/Indexer';
|
||||||
|
import translate from 'Utilities/String/translate';
|
||||||
|
import styles from './SelectIndexerRow.css';
|
||||||
|
|
||||||
|
interface SelectIndexerRowProps {
|
||||||
|
name: string;
|
||||||
|
protocol: string;
|
||||||
|
privacy: IndexerPrivacy;
|
||||||
|
language: string;
|
||||||
|
description: string;
|
||||||
|
capabilities: IndexerCapabilities;
|
||||||
|
implementation: string;
|
||||||
|
implementationName: string;
|
||||||
|
isExistingIndexer: boolean;
|
||||||
|
onIndexerSelect(...args: unknown[]): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
function SelectIndexerRow(props: SelectIndexerRowProps) {
|
||||||
|
const {
|
||||||
|
name,
|
||||||
|
protocol,
|
||||||
|
privacy,
|
||||||
|
language,
|
||||||
|
description,
|
||||||
|
capabilities,
|
||||||
|
implementation,
|
||||||
|
implementationName,
|
||||||
|
isExistingIndexer,
|
||||||
|
onIndexerSelect,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
const onPress = useCallback(() => {
|
||||||
|
onIndexerSelect({ implementation, implementationName, name });
|
||||||
|
}, [implementation, implementationName, name, onIndexerSelect]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TableRowButton onPress={onPress}>
|
||||||
|
<TableRowCell className={styles.protocol}>
|
||||||
|
<ProtocolLabel protocol={protocol} />
|
||||||
|
</TableRowCell>
|
||||||
|
|
||||||
|
<TableRowCell>
|
||||||
|
{name}
|
||||||
|
{isExistingIndexer ? (
|
||||||
|
<Icon
|
||||||
|
className={styles.alreadyExistsIcon}
|
||||||
|
name={icons.CHECK_CIRCLE}
|
||||||
|
size={15}
|
||||||
|
title={translate('IndexerAlreadySetup')}
|
||||||
|
/>
|
||||||
|
) : null}
|
||||||
|
</TableRowCell>
|
||||||
|
|
||||||
|
<TableRowCell>{language}</TableRowCell>
|
||||||
|
|
||||||
|
<TableRowCell>{description}</TableRowCell>
|
||||||
|
|
||||||
|
<TableRowCell>
|
||||||
|
<PrivacyLabel privacy={privacy} />
|
||||||
|
</TableRowCell>
|
||||||
|
|
||||||
|
<TableRowCell>
|
||||||
|
<CapabilitiesLabel capabilities={capabilities} />
|
||||||
|
</TableRowCell>
|
||||||
|
</TableRowButton>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SelectIndexerRow;
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import createExistingIndexerSelector from 'Store/Selectors/createExistingIndexerSelector';
|
|
||||||
import SelectIndexerRow from './SelectIndexerRow';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
createExistingIndexerSelector(),
|
|
||||||
(isExistingIndexer, dimensions) => {
|
|
||||||
return {
|
|
||||||
isExistingIndexer
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps)(SelectIndexerRow);
|
|
||||||
@@ -97,7 +97,7 @@ function EditIndexerModalContent(props) {
|
|||||||
<FormInputGroup
|
<FormInputGroup
|
||||||
type={inputTypes.CHECK}
|
type={inputTypes.CHECK}
|
||||||
name="enable"
|
name="enable"
|
||||||
helpTextWarning={supportsRss.value ? undefined : translate('RSSIsNotSupportedWithThisIndexer')}
|
helpTextWarning={supportsRss.value ? undefined : translate('RssIsNotSupportedWithThisIndexer')}
|
||||||
{...enable}
|
{...enable}
|
||||||
onChange={onInputChange}
|
onChange={onInputChange}
|
||||||
/>
|
/>
|
||||||
@@ -144,6 +144,7 @@ function EditIndexerModalContent(props) {
|
|||||||
}) :
|
}) :
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
<FormGroup
|
<FormGroup
|
||||||
advancedSettings={advancedSettings}
|
advancedSettings={advancedSettings}
|
||||||
isAdvanced={true}
|
isAdvanced={true}
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
import React, {
|
||||||
|
useCallback,
|
||||||
|
useEffect,
|
||||||
|
useMemo,
|
||||||
|
useRef,
|
||||||
|
useState,
|
||||||
|
} from 'react';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { SelectProvider } from 'App/SelectContext';
|
import { SelectProvider } from 'App/SelectContext';
|
||||||
import ClientSideCollectionAppState from 'App/State/ClientSideCollectionAppState';
|
import ClientSideCollectionAppState from 'App/State/ClientSideCollectionAppState';
|
||||||
@@ -22,12 +28,17 @@ import AddIndexerModal from 'Indexer/Add/AddIndexerModal';
|
|||||||
import EditIndexerModalConnector from 'Indexer/Edit/EditIndexerModalConnector';
|
import EditIndexerModalConnector from 'Indexer/Edit/EditIndexerModalConnector';
|
||||||
import NoIndexer from 'Indexer/NoIndexer';
|
import NoIndexer from 'Indexer/NoIndexer';
|
||||||
import { executeCommand } from 'Store/Actions/commandActions';
|
import { executeCommand } from 'Store/Actions/commandActions';
|
||||||
import { cloneIndexer, testAllIndexers } from 'Store/Actions/indexerActions';
|
import {
|
||||||
|
cloneIndexer,
|
||||||
|
fetchIndexers,
|
||||||
|
testAllIndexers,
|
||||||
|
} from 'Store/Actions/indexerActions';
|
||||||
import {
|
import {
|
||||||
setIndexerFilter,
|
setIndexerFilter,
|
||||||
setIndexerSort,
|
setIndexerSort,
|
||||||
setIndexerTableOption,
|
setIndexerTableOption,
|
||||||
} from 'Store/Actions/indexerIndexActions';
|
} from 'Store/Actions/indexerIndexActions';
|
||||||
|
import { fetchIndexerStatus } from 'Store/Actions/indexerStatusActions';
|
||||||
import scrollPositions from 'Store/scrollPositions';
|
import scrollPositions from 'Store/scrollPositions';
|
||||||
import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector';
|
import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector';
|
||||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
||||||
@@ -82,6 +93,11 @@ const IndexerIndex = withScrollPosition((props: IndexerIndexProps) => {
|
|||||||
);
|
);
|
||||||
const [isSelectMode, setIsSelectMode] = useState(false);
|
const [isSelectMode, setIsSelectMode] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
dispatch(fetchIndexers());
|
||||||
|
dispatch(fetchIndexerStatus());
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
const onAddIndexerPress = useCallback(() => {
|
const onAddIndexerPress = useCallback(() => {
|
||||||
setIsAddIndexerModalOpen(true);
|
setIsAddIndexerModalOpen(true);
|
||||||
}, [setIsAddIndexerModalOpen]);
|
}, [setIsAddIndexerModalOpen]);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ const enableOptions = [
|
|||||||
get value() {
|
get value() {
|
||||||
return translate('NoChange');
|
return translate('NoChange');
|
||||||
},
|
},
|
||||||
disabled: true,
|
isDisabled: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'true',
|
key: 'true',
|
||||||
@@ -224,6 +224,7 @@ function EditIndexerModalContent(props: EditIndexerModalContentProps) {
|
|||||||
name="seedRatio"
|
name="seedRatio"
|
||||||
value={seedRatio}
|
value={seedRatio}
|
||||||
helpText={translate('SeedRatioHelpText')}
|
helpText={translate('SeedRatioHelpText')}
|
||||||
|
isFloat={true}
|
||||||
onChange={onInputChange}
|
onChange={onInputChange}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { uniqBy } from 'lodash';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Label from 'Components/Label';
|
import Label from 'Components/Label';
|
||||||
import { IndexerCapabilities } from 'Indexer/Indexer';
|
import { IndexerCapabilities } from 'Indexer/Indexer';
|
||||||
@@ -23,14 +24,18 @@ function CapabilitiesLabel(props: CapabilitiesLabelProps) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const nameList = Array.from(
|
const indexerCategories = uniqBy(filteredList, 'id').sort(
|
||||||
new Set(filteredList.map((item) => item.name).sort())
|
(a, b) => a.id - b.id
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
{nameList.map((category) => {
|
{indexerCategories.map((category) => {
|
||||||
return <Label key={category}>{category}</Label>;
|
return (
|
||||||
|
<Label key={category.id} title={`${category.id}`}>
|
||||||
|
{category.name}
|
||||||
|
</Label>
|
||||||
|
);
|
||||||
})}
|
})}
|
||||||
|
|
||||||
{filteredList.length === 0 ? <Label>{'None'}</Label> : null}
|
{filteredList.length === 0 ? <Label>{'None'}</Label> : null}
|
||||||
|
|||||||
@@ -11,6 +11,12 @@
|
|||||||
flex: 0 0 60px;
|
flex: 0 0 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.id {
|
||||||
|
composes: cell;
|
||||||
|
|
||||||
|
flex: 0 0 60px;
|
||||||
|
}
|
||||||
|
|
||||||
.sortName {
|
.sortName {
|
||||||
composes: cell;
|
composes: cell;
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ interface CssExports {
|
|||||||
'cell': string;
|
'cell': string;
|
||||||
'checkInput': string;
|
'checkInput': string;
|
||||||
'externalLink': string;
|
'externalLink': string;
|
||||||
|
'id': string;
|
||||||
'minimumSeeders': string;
|
'minimumSeeders': string;
|
||||||
'packSeedTime': string;
|
'packSeedTime': string;
|
||||||
'priority': string;
|
'priority': string;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import { useSelect } from 'App/SelectContext';
|
import { useSelect } from 'App/SelectContext';
|
||||||
import Label from 'Components/Label';
|
|
||||||
import IconButton from 'Components/Link/IconButton';
|
import IconButton from 'Components/Link/IconButton';
|
||||||
import RelativeDateCell from 'Components/Table/Cells/RelativeDateCell';
|
import RelativeDateCell from 'Components/Table/Cells/RelativeDateCell';
|
||||||
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
|
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
|
||||||
@@ -15,10 +14,10 @@ import createIndexerIndexItemSelector from 'Indexer/Index/createIndexerIndexItem
|
|||||||
import Indexer from 'Indexer/Indexer';
|
import Indexer from 'Indexer/Indexer';
|
||||||
import IndexerTitleLink from 'Indexer/IndexerTitleLink';
|
import IndexerTitleLink from 'Indexer/IndexerTitleLink';
|
||||||
import { SelectStateInputProps } from 'typings/props';
|
import { SelectStateInputProps } from 'typings/props';
|
||||||
import firstCharToUpper from 'Utilities/String/firstCharToUpper';
|
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import CapabilitiesLabel from './CapabilitiesLabel';
|
import CapabilitiesLabel from './CapabilitiesLabel';
|
||||||
import IndexerStatusCell from './IndexerStatusCell';
|
import IndexerStatusCell from './IndexerStatusCell';
|
||||||
|
import PrivacyLabel from './PrivacyLabel';
|
||||||
import ProtocolLabel from './ProtocolLabel';
|
import ProtocolLabel from './ProtocolLabel';
|
||||||
import styles from './IndexerIndexRow.css';
|
import styles from './IndexerIndexRow.css';
|
||||||
|
|
||||||
@@ -34,7 +33,7 @@ function IndexerIndexRow(props: IndexerIndexRowProps) {
|
|||||||
const { indexerId, columns, isSelectMode, onCloneIndexerPress } = props;
|
const { indexerId, columns, isSelectMode, onCloneIndexerPress } = props;
|
||||||
|
|
||||||
const { indexer, appProfile, status, longDateFormat, timeFormat } =
|
const { indexer, appProfile, status, longDateFormat, timeFormat } =
|
||||||
useSelector(createIndexerIndexItemSelector(props.indexerId));
|
useSelector(createIndexerIndexItemSelector(indexerId));
|
||||||
|
|
||||||
const {
|
const {
|
||||||
id,
|
id,
|
||||||
@@ -148,12 +147,24 @@ function IndexerIndexRow(props: IndexerIndexRowProps) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (name === 'id') {
|
||||||
|
return (
|
||||||
|
<VirtualTableRowCell key={name} className={styles[name]}>
|
||||||
|
<IndexerTitleLink
|
||||||
|
indexerId={indexerId}
|
||||||
|
title={`${indexerId}`}
|
||||||
|
onCloneIndexerPress={onCloneIndexerPress}
|
||||||
|
/>
|
||||||
|
</VirtualTableRowCell>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (name === 'sortName') {
|
if (name === 'sortName') {
|
||||||
return (
|
return (
|
||||||
<VirtualTableRowCell key={name} className={styles[name]}>
|
<VirtualTableRowCell key={name} className={styles[name]}>
|
||||||
<IndexerTitleLink
|
<IndexerTitleLink
|
||||||
indexerId={indexerId}
|
indexerId={indexerId}
|
||||||
indexerName={indexerName}
|
title={indexerName}
|
||||||
onCloneIndexerPress={onCloneIndexerPress}
|
onCloneIndexerPress={onCloneIndexerPress}
|
||||||
/>
|
/>
|
||||||
</VirtualTableRowCell>
|
</VirtualTableRowCell>
|
||||||
@@ -163,7 +174,7 @@ function IndexerIndexRow(props: IndexerIndexRowProps) {
|
|||||||
if (name === 'privacy') {
|
if (name === 'privacy') {
|
||||||
return (
|
return (
|
||||||
<VirtualTableRowCell key={name} className={styles[name]}>
|
<VirtualTableRowCell key={name} className={styles[name]}>
|
||||||
<Label>{translate(firstCharToUpper(privacy))}</Label>
|
<PrivacyLabel privacy={privacy} />
|
||||||
</VirtualTableRowCell>
|
</VirtualTableRowCell>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,12 @@
|
|||||||
flex: 0 0 60px;
|
flex: 0 0 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.id {
|
||||||
|
composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css';
|
||||||
|
|
||||||
|
flex: 0 0 60px;
|
||||||
|
}
|
||||||
|
|
||||||
.sortName {
|
.sortName {
|
||||||
composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css';
|
composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css';
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ interface CssExports {
|
|||||||
'added': string;
|
'added': string;
|
||||||
'appProfileId': string;
|
'appProfileId': string;
|
||||||
'capabilities': string;
|
'capabilities': string;
|
||||||
|
'id': string;
|
||||||
'minimumSeeders': string;
|
'minimumSeeders': string;
|
||||||
'packSeedTime': string;
|
'packSeedTime': string;
|
||||||
'priority': string;
|
'priority': string;
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
.publicLabel {
|
||||||
|
composes: label from '~Components/Label.css';
|
||||||
|
|
||||||
|
border-color: var(--dangerColor);
|
||||||
|
background-color: var(--dangerColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
.semiPrivateLabel {
|
||||||
|
composes: label from '~Components/Label.css';
|
||||||
|
|
||||||
|
border-color: var(--warningColor);
|
||||||
|
background-color: var(--warningColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
.privateLabel {
|
||||||
|
composes: label from '~Components/Label.css';
|
||||||
|
|
||||||
|
border-color: var(--infoColor);
|
||||||
|
background-color: var(--infoColor);
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// This file is automatically generated.
|
||||||
|
// Please do not change this file!
|
||||||
|
interface CssExports {
|
||||||
|
'privateLabel': string;
|
||||||
|
'publicLabel': string;
|
||||||
|
'semiPrivateLabel': string;
|
||||||
|
}
|
||||||
|
export const cssExports: CssExports;
|
||||||
|
export default cssExports;
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import Label from 'Components/Label';
|
||||||
|
import { IndexerPrivacy } from 'Indexer/Indexer';
|
||||||
|
import firstCharToUpper from 'Utilities/String/firstCharToUpper';
|
||||||
|
import translate from 'Utilities/String/translate';
|
||||||
|
import styles from './PrivacyLabel.css';
|
||||||
|
|
||||||
|
interface PrivacyLabelProps {
|
||||||
|
privacy: IndexerPrivacy;
|
||||||
|
}
|
||||||
|
|
||||||
|
function PrivacyLabel({ privacy }: PrivacyLabelProps) {
|
||||||
|
return (
|
||||||
|
<Label className={styles[`${privacy}Label`]}>
|
||||||
|
{translate(firstCharToUpper(privacy))}
|
||||||
|
</Label>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PrivacyLabel;
|
||||||
@@ -24,6 +24,8 @@ export interface IndexerCapabilities extends ModelBase {
|
|||||||
categories: IndexerCategory[];
|
categories: IndexerCategory[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type IndexerPrivacy = 'public' | 'semiPrivate' | 'private';
|
||||||
|
|
||||||
export interface IndexerField extends ModelBase {
|
export interface IndexerField extends ModelBase {
|
||||||
order: number;
|
order: number;
|
||||||
name: string;
|
name: string;
|
||||||
@@ -36,6 +38,7 @@ export interface IndexerField extends ModelBase {
|
|||||||
|
|
||||||
interface Indexer extends ModelBase {
|
interface Indexer extends ModelBase {
|
||||||
name: string;
|
name: string;
|
||||||
|
definitionName: string;
|
||||||
description: string;
|
description: string;
|
||||||
encoding: string;
|
encoding: string;
|
||||||
language: string;
|
language: string;
|
||||||
@@ -47,7 +50,7 @@ interface Indexer extends ModelBase {
|
|||||||
supportsRedirect: boolean;
|
supportsRedirect: boolean;
|
||||||
supportsPagination: boolean;
|
supportsPagination: boolean;
|
||||||
protocol: string;
|
protocol: string;
|
||||||
privacy: string;
|
privacy: IndexerPrivacy;
|
||||||
priority: number;
|
priority: number;
|
||||||
fields: IndexerField[];
|
fields: IndexerField[];
|
||||||
tags: number[];
|
tags: number[];
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import Link from 'Components/Link/Link';
|
import Link from 'Components/Link/Link';
|
||||||
import IndexerInfoModal from './Info/IndexerInfoModal';
|
import IndexerInfoModal from './Info/IndexerInfoModal';
|
||||||
import styles from './IndexerTitleLink.css';
|
import styles from './IndexerTitleLink.css';
|
||||||
|
|
||||||
interface IndexerTitleLinkProps {
|
interface IndexerTitleLinkProps {
|
||||||
indexerName: string;
|
|
||||||
indexerId: number;
|
indexerId: number;
|
||||||
|
title: string;
|
||||||
onCloneIndexerPress(id: number): void;
|
onCloneIndexerPress(id: number): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
function IndexerTitleLink(props: IndexerTitleLinkProps) {
|
function IndexerTitleLink(props: IndexerTitleLinkProps) {
|
||||||
const { indexerName, indexerId, onCloneIndexerPress } = props;
|
const { title, indexerId, onCloneIndexerPress } = props;
|
||||||
|
|
||||||
const [isIndexerInfoModalOpen, setIsIndexerInfoModalOpen] = useState(false);
|
const [isIndexerInfoModalOpen, setIsIndexerInfoModalOpen] = useState(false);
|
||||||
|
|
||||||
@@ -26,7 +25,7 @@ function IndexerTitleLink(props: IndexerTitleLinkProps) {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Link className={styles.link} onPress={onIndexerInfoPress}>
|
<Link className={styles.link} onPress={onIndexerInfoPress}>
|
||||||
{indexerName}
|
{title}
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<IndexerInfoModal
|
<IndexerInfoModal
|
||||||
@@ -39,8 +38,4 @@ function IndexerTitleLink(props: IndexerTitleLinkProps) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
IndexerTitleLink.propTypes = {
|
|
||||||
indexerName: PropTypes.string.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default IndexerTitleLink;
|
export default IndexerTitleLink;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ function IndexerHistoryRow(props: IndexerHistoryRowProps) {
|
|||||||
</div>
|
</div>
|
||||||
</TableRowCell>
|
</TableRowCell>
|
||||||
|
|
||||||
<RelativeDateCell date={date} />
|
<RelativeDateCell date={date} includeSeconds={true} />
|
||||||
|
|
||||||
<TableRowCell className={styles.source}>
|
<TableRowCell className={styles.source}>
|
||||||
{data.source ? data.source : null}
|
{data.source ? data.source : null}
|
||||||
@@ -91,6 +91,7 @@ function IndexerHistoryRow(props: IndexerHistoryRowProps) {
|
|||||||
<HistoryDetailsModal
|
<HistoryDetailsModal
|
||||||
isOpen={isDetailsModalOpen}
|
isOpen={isDetailsModalOpen}
|
||||||
eventType={eventType}
|
eventType={eventType}
|
||||||
|
date={date}
|
||||||
data={data}
|
data={data}
|
||||||
indexer={indexer}
|
indexer={indexer}
|
||||||
shortDateFormat={shortDateFormat}
|
shortDateFormat={shortDateFormat}
|
||||||
|
|||||||
@@ -47,9 +47,3 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: $breakpointExtraSmall) {
|
|
||||||
.modalFooter {
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import React, { useCallback, useState } from 'react';
|
|||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import { Tab, TabList, TabPanel, Tabs } from 'react-tabs';
|
import { Tab, TabList, TabPanel, Tabs } from 'react-tabs';
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
|
import Alert from 'Components/Alert';
|
||||||
import DescriptionList from 'Components/DescriptionList/DescriptionList';
|
import DescriptionList from 'Components/DescriptionList/DescriptionList';
|
||||||
import DescriptionListItem from 'Components/DescriptionList/DescriptionListItem';
|
import DescriptionListItem from 'Components/DescriptionList/DescriptionListItem';
|
||||||
import DescriptionListItemDescription from 'Components/DescriptionList/DescriptionListItemDescription';
|
import DescriptionListItemDescription from 'Components/DescriptionList/DescriptionListItemDescription';
|
||||||
@@ -23,7 +24,8 @@ import TagListConnector from 'Components/TagListConnector';
|
|||||||
import { kinds } from 'Helpers/Props';
|
import { kinds } from 'Helpers/Props';
|
||||||
import DeleteIndexerModal from 'Indexer/Delete/DeleteIndexerModal';
|
import DeleteIndexerModal from 'Indexer/Delete/DeleteIndexerModal';
|
||||||
import EditIndexerModalConnector from 'Indexer/Edit/EditIndexerModalConnector';
|
import EditIndexerModalConnector from 'Indexer/Edit/EditIndexerModalConnector';
|
||||||
import Indexer from 'Indexer/Indexer';
|
import PrivacyLabel from 'Indexer/Index/Table/PrivacyLabel';
|
||||||
|
import Indexer, { IndexerCapabilities } from 'Indexer/Indexer';
|
||||||
import { createIndexerSelectorForHook } from 'Store/Selectors/createIndexerSelector';
|
import { createIndexerSelectorForHook } from 'Store/Selectors/createIndexerSelector';
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import IndexerHistory from './History/IndexerHistory';
|
import IndexerHistory from './History/IndexerHistory';
|
||||||
@@ -63,7 +65,8 @@ function IndexerInfoModalContent(props: IndexerInfoModalContentProps) {
|
|||||||
fields,
|
fields,
|
||||||
tags,
|
tags,
|
||||||
protocol,
|
protocol,
|
||||||
capabilities,
|
privacy,
|
||||||
|
capabilities = {} as IndexerCapabilities,
|
||||||
} = indexer as Indexer;
|
} = indexer as Indexer;
|
||||||
|
|
||||||
const { onModalClose } = props;
|
const { onModalClose } = props;
|
||||||
@@ -159,6 +162,11 @@ function IndexerInfoModalContent(props: IndexerInfoModalContentProps) {
|
|||||||
title={translate('Language')}
|
title={translate('Language')}
|
||||||
data={language ?? '-'}
|
data={language ?? '-'}
|
||||||
/>
|
/>
|
||||||
|
<DescriptionListItem
|
||||||
|
descriptionClassName={styles.description}
|
||||||
|
title={translate('Privacy')}
|
||||||
|
data={privacy ? <PrivacyLabel privacy={privacy} /> : '-'}
|
||||||
|
/>
|
||||||
{vipExpiration ? (
|
{vipExpiration ? (
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
descriptionClassName={styles.description}
|
descriptionClassName={styles.description}
|
||||||
@@ -207,7 +215,7 @@ function IndexerInfoModalContent(props: IndexerInfoModalContentProps) {
|
|||||||
descriptionClassName={styles.description}
|
descriptionClassName={styles.description}
|
||||||
title={translate('RawSearchSupported')}
|
title={translate('RawSearchSupported')}
|
||||||
data={
|
data={
|
||||||
capabilities.supportsRawSearch
|
capabilities?.supportsRawSearch
|
||||||
? translate('Yes')
|
? translate('Yes')
|
||||||
: translate('No')
|
: translate('No')
|
||||||
}
|
}
|
||||||
@@ -216,12 +224,12 @@ function IndexerInfoModalContent(props: IndexerInfoModalContentProps) {
|
|||||||
descriptionClassName={styles.description}
|
descriptionClassName={styles.description}
|
||||||
title={translate('SearchTypes')}
|
title={translate('SearchTypes')}
|
||||||
data={
|
data={
|
||||||
capabilities.searchParams.length === 0 ? (
|
capabilities?.searchParams?.length > 0 ? (
|
||||||
translate('NotSupported')
|
|
||||||
) : (
|
|
||||||
<Label kind={kinds.PRIMARY}>
|
<Label kind={kinds.PRIMARY}>
|
||||||
{capabilities.searchParams[0]}
|
{capabilities.searchParams[0]}
|
||||||
</Label>
|
</Label>
|
||||||
|
) : (
|
||||||
|
translate('NotSupported')
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@@ -229,60 +237,60 @@ function IndexerInfoModalContent(props: IndexerInfoModalContentProps) {
|
|||||||
descriptionClassName={styles.description}
|
descriptionClassName={styles.description}
|
||||||
title={translate('TVSearchTypes')}
|
title={translate('TVSearchTypes')}
|
||||||
data={
|
data={
|
||||||
capabilities.tvSearchParams.length === 0
|
capabilities?.tvSearchParams?.length > 0
|
||||||
? translate('NotSupported')
|
? capabilities.tvSearchParams.map((p) => {
|
||||||
: capabilities.tvSearchParams.map((p) => {
|
|
||||||
return (
|
return (
|
||||||
<Label key={p} kind={kinds.PRIMARY}>
|
<Label key={p} kind={kinds.PRIMARY}>
|
||||||
{p}
|
{p}
|
||||||
</Label>
|
</Label>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
: translate('NotSupported')
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
descriptionClassName={styles.description}
|
descriptionClassName={styles.description}
|
||||||
title={translate('MovieSearchTypes')}
|
title={translate('MovieSearchTypes')}
|
||||||
data={
|
data={
|
||||||
capabilities.movieSearchParams.length === 0
|
capabilities?.movieSearchParams?.length > 0
|
||||||
? translate('NotSupported')
|
? capabilities.movieSearchParams.map((p) => {
|
||||||
: capabilities.movieSearchParams.map((p) => {
|
|
||||||
return (
|
return (
|
||||||
<Label key={p} kind={kinds.PRIMARY}>
|
<Label key={p} kind={kinds.PRIMARY}>
|
||||||
{p}
|
{p}
|
||||||
</Label>
|
</Label>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
: translate('NotSupported')
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
descriptionClassName={styles.description}
|
descriptionClassName={styles.description}
|
||||||
title={translate('BookSearchTypes')}
|
title={translate('BookSearchTypes')}
|
||||||
data={
|
data={
|
||||||
capabilities.bookSearchParams.length === 0
|
capabilities?.bookSearchParams?.length > 0
|
||||||
? translate('NotSupported')
|
? capabilities.bookSearchParams.map((p) => {
|
||||||
: capabilities.bookSearchParams.map((p) => {
|
|
||||||
return (
|
return (
|
||||||
<Label key={p} kind={kinds.PRIMARY}>
|
<Label key={p} kind={kinds.PRIMARY}>
|
||||||
{p}
|
{p}
|
||||||
</Label>
|
</Label>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
: translate('NotSupported')
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
descriptionClassName={styles.description}
|
descriptionClassName={styles.description}
|
||||||
title={translate('MusicSearchTypes')}
|
title={translate('MusicSearchTypes')}
|
||||||
data={
|
data={
|
||||||
capabilities.musicSearchParams.length === 0
|
capabilities?.musicSearchParams?.length > 0
|
||||||
? translate('NotSupported')
|
? capabilities.musicSearchParams.map((p) => {
|
||||||
: capabilities.musicSearchParams.map((p) => {
|
|
||||||
return (
|
return (
|
||||||
<Label key={p} kind={kinds.PRIMARY}>
|
<Label key={p} kind={kinds.PRIMARY}>
|
||||||
{p}
|
{p}
|
||||||
</Label>
|
</Label>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
: translate('NotSupported')
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</DescriptionList>
|
</DescriptionList>
|
||||||
@@ -338,7 +346,11 @@ function IndexerInfoModalContent(props: IndexerInfoModalContentProps) {
|
|||||||
})}
|
})}
|
||||||
</Table>
|
</Table>
|
||||||
</FieldSet>
|
</FieldSet>
|
||||||
) : null}
|
) : (
|
||||||
|
<Alert kind={kinds.INFO}>
|
||||||
|
{translate('NoIndexerCategories')}
|
||||||
|
</Alert>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user