Compare commits

...

135 Commits

Author SHA1 Message Date
bakerboy448
51df1be144 Fixed: Remove Defunct Usenet Indexer NZBXS
closes #594
2021-11-10 17:27:48 -06:00
Qstick
11fad915d5 Drop prefix from issue templates 2021-11-09 22:35:45 -06:00
Qstick
49793a3af0 Rename NzbSearchService to ReleaseSearchService 2021-11-09 22:27:53 -06:00
Qstick
87d6cbd813 Clarified Aria2 RPC Path field
Co-Authored-By: Taloth <Taloth@users.noreply.github.com>
2021-11-09 22:26:30 -06:00
Qstick
5ca8148d3b Bump macOS build agent to 10.15 2021-11-09 22:14:31 -06:00
Qstick
8ebec7c7e1 Fixed: (Applications) Test fails when selecting sub-categories only for sync
Fixes #588
2021-11-09 22:12:56 -06:00
Robin Dadswell
61cff12206 Fixed: Time column is first column on events page
(cherry picked from commit c14ef7bee7477ad5d29498f1cba94267eb11daf0)
2021-11-09 18:55:05 -06:00
Qstick
22412981bb Fixed: (SpeedCD) Incorrect Http Login Method
Fixes #582
2021-11-08 23:29:31 -06:00
Qstick
8e43ea4bbc New: (Indexer) Norbits 2021-11-08 23:17:01 -06:00
bakerboy448
f38d6c5b42 Fixed: (Avistaz) Cleanse PID & Hash from response
Fixes #557
2021-11-08 20:27:32 -06:00
bakerboy448
2054dcc127 Fixed: (TorrentLeech) Drop support for IMDb ID TV Searches
Fixed: (TorrentLeech) Returning unrelated results for Season/Episode Searches

Fixes #474
2021-11-08 20:26:57 -06:00
Robin Dadswell
8d856b2edb New: Added UDP syslog support 2021-11-08 20:25:28 -06:00
Weblate
e07ad14e83 Translated using Weblate (Swedish)
Currently translated at 100.0% (441 of 441 strings)

Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (441 of 441 strings)

Translated using Weblate (Swedish)

Currently translated at 100.0% (441 of 441 strings)

Co-authored-by: Havok Dan <havokdan@yahoo.com.br>
Co-authored-by: LukkiHyde <lucas.bergstrom90@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/pt_BR/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/sv/
Translation: Servarr/Prowlarr
2021-11-08 20:24:51 -06:00
bakerboy448
d585ab5677 Fixed: (RuTracker.Org) Fails to add
Closes #560
2021-11-08 20:24:37 -06:00
zpengcom
6a6697c2c2 Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 100.0% (441 of 441 strings)

Translation: Servarr/Prowlarr
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/zh_CN/
2021-11-05 19:32:30 -05:00
Stéphane Dupont
e859bedef1 Translated using Weblate (French)
Currently translated at 100.0% (441 of 441 strings)

Translation: Servarr/Prowlarr
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/fr/
2021-11-05 19:32:30 -05:00
dobbleg1000
e688dac040 Fixed: (Bakabt) Typo in Search link 2021-11-03 19:15:39 -05:00
Qstick
b309582d91 Fixed: (DanishBytes) Double slash in search urls 2021-10-30 12:01:14 -05:00
bakerboy448
998e214171 New: (DesiTorrents) Add Alt URL .rocks
Closes #562
2021-10-30 11:48:54 -05:00
Qstick
8b0760296a Fixed: Set ContentType for Flaresolverr requests to ensure proper content encoding 2021-10-30 11:40:02 -05:00
Robin Dadswell
44aad1b943 Fixed: Prowl notification priority 2021-10-28 12:48:04 +01:00
Qstick
9ec8990a21 Bump to 0.1.2 2021-10-26 18:05:33 -04:00
Weblate
8ac721a30b Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 96.8% (427 of 441 strings)

Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 96.3% (425 of 441 strings)

Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 96.3% (425 of 441 strings)

Translated using Weblate (French)

Currently translated at 100.0% (441 of 441 strings)

Co-authored-by: Nackophilz <clement.wigy@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: muihiuwev <muihiuwev@outlook.com>
Co-authored-by: yulelong <yulelong@foxmail.com>
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/fr/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/zh_CN/
Translation: Servarr/Prowlarr
2021-10-23 10:31:57 -05:00
bakerboy448
3bbadb516d New: (DesiTorrents) Convert from Gazelle to UNIT3D
Fixes #532
2021-10-17 14:00:57 -05:00
Qstick
f5f0dd6fae New: Support server notifications 2021-10-17 13:10:06 -05:00
Qstick
0cfb7da411 New: (Indexer) BitHDTV 2021-10-17 12:27:23 -05:00
Qstick
b65f4205fc Fixed: Don't delete down indexers if they still exist in DB
Fixes #494
2021-10-17 11:58:48 -05:00
Qstick
3e243eafdd Bump FluentMigrator to 3.3.1 2021-10-16 12:49:55 -05:00
Qstick
327fd08059 New: (RuTracker) Search by Categories 2021-10-15 20:04:59 -05:00
Qstick
827741db17 Fixed: (TVVault) add delay between requests and fix search & download 2021-10-15 20:01:39 -05:00
bakerboy448
c21e323992 New: Improved Logging of Search for ID based searches 2021-10-11 11:00:40 -05:00
Shane M
e49d03ab7b Fixed: (RevolutionTT) Remove [REQ] prefix from torrent title (#545)
[REQ] is an automatically generated prefix added to fulfilled requests, and very often breaks parsing for title matching

Co-authored-by: Shane Moore <vales@users.noreply.github.com>
2021-10-10 19:14:03 -05:00
Nyuels
4347e1cf7a New: (Internet Archive) Add Torrent File Only option. (#459) 2021-10-10 17:21:39 -05:00
Qstick
d7e1043b79 Fixed: (Cardigann) Info field text pulling from DB instead of definition 2021-10-10 17:12:46 -05:00
Weblate
d4bdb73b7c Translated using Weblate (French)
Currently translated at 100.0% (441 of 441 strings)

Co-authored-by: Nackophilz <clement.wigy@gmail.com>
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/fr/
Translation: Servarr/Prowlarr
2021-10-10 17:00:36 -05:00
Dmitry Chepurovskiy
eeebf3ecf0 Fixed: (Anilibria) Fix download torrent link (#529) 2021-10-10 16:58:59 -05:00
Qstick
76d73aa6a9 New: (Indexer) SpeedCD 2021-10-10 14:23:42 -05:00
Qstick
5dfe530cf3 Fixed: (BB) Detect when re-auth needed 2021-10-10 14:06:30 -05:00
Qstick
8b8b5ba1c8 Cleanup cardigann logging 2021-10-10 13:04:12 -05:00
bakerboy448
c5caf22375 New: Support for Prowlarr Definitions v2
New: Support for Updated yml Definitions
Fixes: #298
2021-10-10 13:04:12 -05:00
Qstick
293b32ea0e New: Improve size and number parsing 2021-10-10 13:04:12 -05:00
Qstick
25bb10d62b New: (Cardigann) AllowRawSearch Property 2021-10-10 13:04:12 -05:00
bakerboy448
9eba50d9db New: Log which DB is being migrated
(cherry picked from Sonarr commit 07c95f06d3b9b32aaeb923d4c678f10a2bf1141a)
2021-10-09 09:42:19 -05:00
Qstick
234995cbaf Rename indexer proxied HTTP methods for clarification 2021-10-06 19:33:47 -05:00
Qstick
918071903b New: Raw search engine support in caps 2021-10-06 19:32:22 -05:00
bakerboy448
dcfa3ad48e Update contributing [skip ci] (#528)
* update contributing [skip ci]

sonarr pulls / *arr pulls

* nuke contributing => wiki [skip ci]

* fix wiki link [skip ci]

* fixup! fix wiki link [skip ci] (lint)
2021-10-06 19:08:14 -05:00
dobbleg1000
5dd6cde61a Fixed: (Indexer) Changed BakaBT to default to SFW content
Update Bakabt for Adult Content Bool and change link
2021-10-06 19:07:48 -05:00
Weblate
d18ddcaa50 Update translation files
Updated by "Cleanup translation files" hook in Weblate.

Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/
Translation: Servarr/Prowlarr
2021-10-06 17:58:02 -05:00
bakerboy448
0cca9525a1 Fixed: (Indexers) Download requests not using the configured proxy
Fixes #520
2021-10-06 17:30:37 -05:00
Servarr
3455f3c92a Translations from Weblate
Currently translated at 81.4% (359 of 441 strings)

Translated using Weblate (Arabic)

Currently translated at 81.6% (360 of 441 strings)

Translated using Weblate (Russian)

Currently translated at 81.4% (359 of 441 strings)

Translated using Weblate (Icelandic)

Currently translated at 81.4% (359 of 441 strings)

Translated using Weblate (Danish)

Currently translated at 81.4% (359 of 441 strings)

Translated using Weblate (Slovak)

Currently translated at 10.6% (47 of 441 strings)

Translated using Weblate (German)

Currently translated at 95.4% (421 of 441 strings)

Translated using Weblate (Korean)

Currently translated at 60.3% (266 of 441 strings)

Translated using Weblate (Japanese)

Currently translated at 81.4% (359 of 441 strings)

Translated using Weblate (Catalan)

Currently translated at 2.4% (11 of 441 strings)

Translated using Weblate (Bulgarian)

Currently translated at 75.7% (334 of 441 strings)

Translated using Weblate (Thai)

Currently translated at 81.4% (359 of 441 strings)

Translated using Weblate (Romanian)

Currently translated at 81.8% (361 of 441 strings)

Translated using Weblate (Italian)

Currently translated at 85.7% (378 of 441 strings)

Translated using Weblate (Hindi)

Currently translated at 81.4% (359 of 441 strings)

Translated using Weblate (Spanish)

Currently translated at 83.2% (367 of 441 strings)

Translated using Weblate (Hebrew)

Currently translated at 81.4% (359 of 441 strings)

Translated using Weblate (Portuguese)

Currently translated at 84.1% (371 of 441 strings)

Translated using Weblate (Chinese (Simplified))

Currently translated at 1.1% (5 of 441 strings)

Translated using Weblate (Swedish)

Currently translated at 81.8% (361 of 441 strings)

Translated using Weblate (Czech)

Currently translated at 81.4% (359 of 441 strings)

Translated using Weblate (Greek)

Currently translated at 81.1% (358 of 441 strings)

Translated using Weblate (Norwegian Bokmål)

Currently translated at 12.4% (55 of 441 strings)

Translated using Weblate (Turkish)

Currently translated at 81.6% (360 of 441 strings)

Translated using Weblate (Vietnamese)

Currently translated at 81.4% (359 of 441 strings)

Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 90.9% (401 of 441 strings)

Translated using Weblate (Polish)

Currently translated at 81.4% (359 of 441 strings)

Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Co-authored-by: Anonymous <noreply@weblate.org>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/ar/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/bg/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/ca/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/cs/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/da/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/de/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/el/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/es/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/fi/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/he/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/hi/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/is/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/it/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/ja/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/ko/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/nb_NO/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/pl/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/pt/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/ro/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/ru/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/sk/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/sv/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/th/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/tr/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/vi/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/zh_CN/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/zh_Hans/
Translation: Servarr/Prowlarr

Co-authored-by: Weblate <noreply@weblate.org>
2021-10-05 08:34:23 -05:00
Weblate
af03c17892 Update translation files
Updated by "Cleanup translation files" hook in Weblate.

Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/
Translation: Servarr/Prowlarr
2021-10-02 11:18:49 -04:00
Weblate
6b39fa5ce6 Update translation files
Updated by "Cleanup translation files" hook in Weblate.

Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/
Translation: Servarr/Prowlarr
2021-10-02 10:36:09 -04:00
Servarr
1ee79f16fc Translated using Weblate (Turkish) (#516)
Currently translated at 16.5% (73 of 441 strings)

Translated using Weblate (French)

Currently translated at 99.7% (440 of 441 strings)

Co-authored-by: Francis Peixoto <peixoto.francis@gmail.com>
Co-authored-by: Micky <ad312@pm.me>
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/fr/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/tr/
Translation: Servarr/Prowlarr

Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Francis Peixoto <peixoto.francis@gmail.com>
Co-authored-by: Micky <ad312@pm.me>
2021-10-01 15:17:59 -05:00
bakerboy448
e73f2466cc Fixed (Headphones): Add missing description 2021-10-01 15:17:35 -05:00
Weblate
2e56b7681e Translated using Weblate (Dutch)
Currently translated at 100.0% (441 of 441 strings)

Translated using Weblate (Bulgarian)

Currently translated at 10.2% (45 of 441 strings)

Translated using Weblate (Korean)

Currently translated at 17.9% (79 of 441 strings)

Translated using Weblate (Spanish)

Currently translated at 76.1% (336 of 441 strings)

Co-authored-by: COTMO <moermantom1@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: eslifos <eaaf_01@hotmail.com>
Co-authored-by: keysuck <joshkkim@gmail.com>
Co-authored-by: siankatabg <siankata91@gmail.com>
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/bg/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/es/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/ko/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/nl/
Translation: Servarr/Prowlarr
2021-09-25 22:08:27 -05:00
Jayson Reis
87650c83c6 New: (Indexer) lat-team.com (#505)
* New: (Indexer) Torrent lat-team.com

* Add lat-team to ignore definitions list

* Fix lat-team name
2021-09-25 22:03:42 -05:00
Qstick
34a09af01e New: Advanced settings for Application category control 2021-09-25 09:46:31 -04:00
Qstick
5a3d429d52 Remove unused MovieMonitor input 2021-09-25 09:46:31 -04:00
Qstick
40c49bce9b Fixed: Spinning of Test All Indexer icon
#507
2021-09-23 20:42:17 -05:00
Qstick
063083a1f1 Fixed: Search from header on Search Page
Fixes #511
2021-09-23 20:28:22 -05:00
bakerboy448
dbbc913809 New: (InternetArchive) Add Support for TV Categories
ref API docs `movies: any item where the main media content is video files, like mpeg, mov, avi, etc`
2021-09-19 08:47:59 -05:00
Qstick
f0f2c88c4a Fixed: (qBittorrent) Don't fail if remove torrents is enabled
We don't care about this in Prowlarr

Fixes #499
2021-09-15 22:04:09 -05:00
Weblate
1bfcb99f31 Translated using Weblate (Slovak)
Currently translated at 7.4% (33 of 441 strings)

Added translation using Weblate (Slovak)

Translated using Weblate (Norwegian Bokmål)

Currently translated at 9.2% (41 of 441 strings)

Added translation using Weblate (Norwegian Bokmål)

Translated using Weblate (Portuguese)

Currently translated at 83.6% (369 of 441 strings)

Translated using Weblate (Dutch)

Currently translated at 78.9% (348 of 441 strings)

Co-authored-by: 7even <henning@wikene.no>
Co-authored-by: Samuel Bartík <github.fundal@aleeas.com>
Co-authored-by: Stevie Robinson <stevie.robinson@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: sergioquiterio <serquiterio@gmail.com>
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/nb_NO/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/nl/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/pt/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/sk/
Translation: Servarr/Prowlarr
2021-09-15 21:57:50 -05:00
bakerboy448
4ea0e6c016 add various missing descriptions 2021-09-15 21:57:26 -05:00
bakerboy448
1de845c8f5 (indexers) various - standardized language format with {ISO 639-1}-{ISO 3166-1 alpha-2} 2021-09-15 21:57:26 -05:00
bakerboy448
f3a33cf817 Fixed: Missing Proxy Validation Translations 2021-09-15 21:43:51 -05:00
bakerboy448
593a0e9658 Fixed: (MAM) Don't Parse HTTP Error Responses 2021-09-07 16:03:34 -05:00
Servarr
a854ce6f4e Translated using Weblate (Portuguese (Brazil)) (#484)
Currently translated at 100.0% (441 of 441 strings)

Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 62.5% (276 of 441 strings)

Translated using Weblate (Hungarian)

Currently translated at 100.0% (441 of 441 strings)

Co-authored-by: Csaba <csab0825@gmail.com>
Co-authored-by: Havok Dan <havokdan@yahoo.com.br>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: angelsky11 <angelsky11@gmail.com>
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/hu/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/pt_BR/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/zh_CN/
Translation: Servarr/Prowlarr

Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Csaba <csab0825@gmail.com>
Co-authored-by: Havok Dan <havokdan@yahoo.com.br>
Co-authored-by: angelsky11 <angelsky11@gmail.com>
2021-09-03 14:33:08 -05:00
bakerboy448
043b1a0e46 Fixed: Better Log Cleansing
Ref #280 YGG Comment
2021-08-31 19:51:37 -04:00
bakerboy448
4c7c7e8a62 Fixed: (BTN) Daily Episode Searches failing
Fixes #480
2021-08-31 19:50:46 -04:00
Qstick
89a4c03dd2 Fixed: Translations for Tags setting page
Fixes #471
2021-08-30 22:48:24 -04:00
Qstick
baed2960b6 Fixed: (TorrentSeeds) new Login
Fixes #460
2021-08-30 22:39:05 -04:00
Qstick
e4ef1c3af0 Fixed: Convert DesiTorrents to Gazelle
Fixes #220
2021-08-30 22:20:40 -04:00
bakerboy448
b4f8fb733f Fixed: Indexer Display Issue on Search Page
Fixes #177
2021-08-30 20:47:46 -04:00
bakerboy448
1a6ea21b9f Fixed: Increased Xthor Rate Limit Time
Fixes Logs of #472

> 2021-08-28 05:59:47.8|Error|Xthor|An error occurred while processing indexer feed. https://api.xthor.tk?passkey=(removed)&category=12%2B125%2B104%2B13%2B15%2B14%2B98%2B17%2B16%2B101%2B32%2B110%2B123%2B109%2B34%2B30&accent=1

[v0.1.1.875] System.Exception: Triggered AntiSpam Protection, please delay your requests!
   at NzbDrone.Core.Indexers.Definitions.Xthor.XthorParser.CheckApiState(XthorError state) in D:\a\1\s\src\NzbDrone.Core\Indexers\Definitions\Xthor\XthorParser.cs:line 112
   at NzbDrone.Core.Indexers.Definitions.Xthor.XthorParser.ParseResponse(IndexerResponse indexerResponse) in D:\a\1\s\src\NzbDrone.Core\Indexers\Definitions\Xthor\XthorParser.cs:line 32
   at NzbDrone.Core.Indexers.HttpIndexerBase`1.FetchPage(IndexerRequest request, IParseIndexerResponse parser) in D:\a\1\s\src\NzbDrone.Core\Indexers\HttpIndexerBase.cs:line 321
   at NzbDrone.Core.Indexers.HttpIndexerBase`1.FetchReleases(Func`2 pageableRequestChainSelector, Boolean isRecent) in D:\a\1\s\src\NzbDrone.Core\Indexers\HttpIndexerBase.cs:line 174
RequestUri: https://api.xthor.tk?passkey=(removed)&category=12%2B125%2B104%2B13%2B15%2B14%2B98%2B17%2B16%2B101%2B32%2B110%2B123%2B109%2B34%2B30&accent=1;StatusCode: OK;ContentType: application/json;ContentLength: 133;ContentSample: {
    "error": {
        "code": 8,
        "descr": "Protection Anti-Spam: A.P.I limitee a 1 requete toutes les 2 secondes."
    }
};FeedUrl: https://api.xthor.tk?passkey=(removed)&category=12%2B125%2B104%2B13%2B15%2B14%2B98%2B17%2B16%2B101%2B32%2B110%2B123%2B109%2B34%2B30&accent=1
2021-08-30 19:58:48 -04:00
bakerboy448
16834e0f24 Fixed: (TPB) No Results returned for Torznab searches
Fixed: (TPB) Missing Magnet Download Link
2021-08-30 19:43:20 -04:00
Qstick
658724b315 OpenAPI auto generation test 2021-08-29 23:12:59 -04:00
bakerboy448
a2c8cec27e bug template fix [skip ci] [common] 2021-08-27 20:46:58 -05:00
Nyuels
3c9fbeabaa Fixed: Use Gazelle freelech tokens. (#465) 2021-08-27 18:21:56 -04:00
Weblate
04e84f3a90 Translated using Weblate (Hungarian)
Currently translated at 100.0% (438 of 438 strings)

Translated using Weblate (French)

Currently translated at 97.7% (428 of 438 strings)

Translated using Weblate (Hungarian)

Currently translated at 100.0% (438 of 438 strings)

Co-authored-by: Anonymous <noreply@weblate.org>
Co-authored-by: Csaba <csab0825@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/fr/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/hu/
Translation: Servarr/Prowlarr
2021-08-25 23:23:36 -04:00
Steve Adams
77a76fe5a1 New: HDBits to parse IMDB using parser utils (#454) 2021-08-25 23:22:04 -04:00
ta264
1d20b9d429 Fixed: Don't delete tags used by indexer proxies 2021-08-23 22:12:40 +01:00
bakerboy448
46e1cce632 New: (TorrentLeech) Add VIP Expiration
Closes #419
bonus- sort en.json
2021-08-23 22:20:41 -05:00
Qstick
03f821f484 New: Make VIP Check Generic 2021-08-23 22:35:28 -04:00
Qstick
c72222a696 Mylar code cleanup 2021-08-22 22:24:46 -04:00
bakerboy448
f4cee1d5f4 Fixed: UserAgent Parsing
Fixes #448

New - add user agent parser tests
2021-08-22 15:00:59 -05:00
Qstick
ab7bc85368 fix mass delete 2021-08-22 15:53:30 -04:00
bakerboy448
d50e1d7cc0 update readme [skip ci] 2021-08-22 10:25:37 -05:00
Qstick
ab1545e834 Fixed: Mass Indexer delete fails with 415 2021-08-22 11:04:00 -04:00
Weblate
c8cc48229c Translated using Weblate (French)
Currently translated at 97.9% (429 of 438 strings)

Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (438 of 438 strings)

Co-authored-by: Lizandra Candido da Silva <lizandra.c.s@gmail.com>
Co-authored-by: ProBatou <baptiste2105@hotmail.fr>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/fr/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/pt_BR/
Translation: Servarr/Prowlarr
2021-08-21 23:00:33 -04:00
Steve Adams
b513fac2f7 Fixed: (HDBits) Not parsing the search term for TV (#444)
* Fixing HDBits not parsing the search term

* remove debug vars

* Handle TVDB Properly
2021-08-21 22:59:53 -04:00
Qstick
368e0755a0 Update README.md
[skip ci]
2021-08-21 22:56:50 -04:00
PearsonFlyer
27064cd293 Fixed: Clarify IPT cookie help text (#421)
* Fixed: Clarify IPT cookie help text

* Update src/NzbDrone.Core/Indexers/Definitions/IPTorrents.cs

Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com>

Co-authored-by: PearsonFlyer <PearsonFlyer@github.com>
Co-authored-by: Qstick <qstick@gmail.com>
Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com>
2021-08-21 00:12:39 -04:00
Qstick
1fe8c63d41 Update README.md
[skip ci]
2021-08-20 23:45:24 -04:00
Qstick
b18e226718 Bump to 0.1.1 2021-08-20 23:29:08 -04:00
Qstick
682afc2c75 Fixed: (Rarbg) Blank baseUrl drop-down (#443)
* Fixed: (Rarbg) Blank baseUrl drop-down

* fixup! Using missing
2021-08-20 22:50:59 -04:00
Qstick
1ef43c40c0 Fixed: (BakaBT) Torrent downloads failing
Fixes #442
2021-08-19 23:37:14 -04:00
Robin Dadswell
b46e2c6ad1 New: Renamed Blacklist to Blocklist 2021-08-19 20:08:26 -04:00
Qstick
0a17b7e8ae Fixed: Send Link element in nab response 2021-08-18 22:23:22 -04:00
bakerboy448
b54c7e220e Fixed: Update AppIndexerRegex to support indexer ids over 100
Fixed Update AppIndexerRegex to support /api trailing (Mylar3)
2021-08-18 21:23:22 -04:00
bakerboy448
efb2a5751c Fixed: (Mylar3) Indexer Host needs to include trailing /api 2021-08-18 21:23:22 -04:00
Yukine
2cd0dde4e2 Fixed: (Indexer) AnimeBytes Synonymns & Links are optional 2021-08-17 18:50:32 -04:00
Weblate
de86274b08 Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.0% (434 of 438 strings)

Co-authored-by: Havok Dan <havokdan@yahoo.com.br>
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/pt_BR/
Translation: Servarr/Prowlarr
2021-08-17 18:50:02 -04:00
Qstick
4a957b618e Fixed: Proxy HealthCheck should use Proxy.Test method
Fixes #431
2021-08-17 07:45:20 -04:00
Qstick
891ca0f56b Fixed: (Sonarr) Workaround Sonarr issue with caps and basic search
Fixes #430
2021-08-16 21:09:55 -04:00
Qstick
635fa78da9 Fixed: Cursor Jumps to end in when editing search term
Fixes #290
2021-08-15 22:41:33 -04:00
Qstick
b7731faedc Fixed: (Indexer Proxy) Socks4 and Socks5 not using Credentials 2021-08-15 19:48:14 -04:00
bakerboy448
7c1f5f769d Fixed: Settings Page Translates
New: Indexer Proxies Settings Page Links
- renamed Connect to Notifications
2021-08-15 09:15:07 -05:00
bakerboy448
e8c6103cc7 Fixed: Missing Indexer Proxy Modal translate 2021-08-15 09:15:07 -05:00
Qstick
742c0d02bc New: FlareSolverr Proxy Option 2021-08-15 01:57:00 -04:00
Qstick
7480ebea85 New: Per Indexer Proxies
Fixes #281
2021-08-15 01:57:00 -04:00
Qstick
31886e8d35 New: (Newznab) Parse PosterUrl when available 2021-08-15 00:42:51 -04:00
Qstick
252b9a1b6b Fixed: (Sonarr) Correctly set anime categories 2021-08-14 23:56:37 -04:00
Qstick
77892a3885 New: Sync Indexers with Mylar3 2021-08-14 23:50:47 -04:00
bakerboy448
09d839ffb1 Fixed: Incorrectly Cleansing TorrentLeech Search URL 2021-08-14 21:36:05 -04:00
Weblate
1c15932b90 Translated using Weblate (German)
Currently translated at 98.8% (421 of 426 strings)

Translated using Weblate (German)

Currently translated at 98.3% (419 of 426 strings)

Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (426 of 426 strings)

Translated using Weblate (Portuguese)

Currently translated at 85.4% (364 of 426 strings)

Co-authored-by: Nyuels <nils.faerber@rwth-aachen.de>
Co-authored-by: Nyuels <nyuels@nyuels.de>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Will Segatto <segatto.w@gmail.com>
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/de/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/pt/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/pt_BR/
Translation: Servarr/Prowlarr
2021-08-14 20:25:33 -04:00
Qstick
27c643d2f5 New: (DownloadClient) Aria2 2021-08-14 20:07:54 -04:00
Qstick
9a6391873f Fixed: (HDBits) Unknown Categories on every release
Fixes #365
2021-08-14 17:15:54 -04:00
Qstick
12ae8edc50 New: (Indexer) Binsearch 2021-08-14 15:39:46 -04:00
Qstick
868f779c5d Fixed: (Newznab) Don't die if TV or Music only
Fixes #283
2021-08-13 22:16:19 -04:00
Qstick
204052de9c Bump Dapper to 2.0.90 2021-08-13 21:46:57 -04:00
Qstick
878e269e70 Bump MailKit to 2.14.0 2021-08-13 21:42:26 -04:00
Qstick
1e317dac6b Bump Net5 to 5.0.9 2021-08-13 21:40:34 -04:00
Qstick
305df2fb7b Bump Microsoft.NET.Test.Sdk to 16.11.0 2021-08-13 21:38:31 -04:00
Qstick
3e07a9397c Bump DryIOC to 4.8.1 2021-08-13 21:34:39 -04:00
Qstick
3e2d3c510a Bump AngleSharp to 0.16.0 2021-08-13 21:31:13 -04:00
Qstick
bdcead007c Cleanup: (Rutracker) Purge unused using statements 2021-08-13 21:28:01 -04:00
Qstick
6c5d48621f Fixed: (Indexer) Use Indexer Encoding for Query and Auth
Fixes #370
2021-08-13 21:25:52 -04:00
Qstick
a95465195d New: (Indexer) BB 2021-08-13 18:20:40 -04:00
Qstick
5d5e2042d0 Fixed: Handle response when magnet is empty
Fixes #404
2021-08-13 16:46:48 -04:00
Qstick
5d980a175c Fixed: (DanishBytes) Handle response with null bumped_at
Fixes #384
2021-08-13 16:42:49 -04:00
Qstick
2114db02d8 Fixed: (Rarbg) Advertise IMDB, TMDB, TVDB Search
Fixes #392
2021-08-13 16:00:09 -04:00
Qstick
4bd23a60bd Fixed: Pad seasons parameter for newznab tvsearch 2021-08-13 15:37:25 -04:00
chryzsh
fe324dcc0c Fixed: (Indexer) PTP IMDB search 2021-08-13 07:42:21 -04:00
johnpyp
d5b34e8c03 Fixed: (Indexer) BroadcastheNet - Report TvdbId and RId 2021-08-09 22:40:14 -05:00
290 changed files with 19788 additions and 7293 deletions

View File

@@ -1,5 +1,4 @@
name: Bug Report
title: "[BUG]: "
description: 'Report a new bug, if you are not 100% certain this is a bug please go to our Reddit or Discord first'
labels: ['Type: Bug', 'Status: Needs Triage']
body:
@@ -68,6 +67,7 @@ body:
description: |
Trace Logs (https://wiki.servarr.com/prowlarr/troubleshooting#logging-and-log-files)
Links? References? Anything that will give us more context about the issue you are encountering!
***Generally speaking, all bug reports must have trace logs provided.***
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:

View File

@@ -1,5 +1,4 @@
name: Feature Request
title: "[FEAT]: "
description: 'Suggest an idea for Prowlarr'
labels: ['Type: Feature Request', 'Status: Needs Triage']
body:

View File

@@ -1,55 +1,13 @@
# How to Contribute #
# How to Contribute
We're always looking for people to help make Prowlarr even better, there are a number of ways to contribute.
This file is updated on an ad-hoc basis, for the latest details please see the [contributing wiki page](https://wiki.servarr.com/prowlarr/contributing).
This file has been moved to the wiki for the latest details please see the [contributing wiki page](https://wiki.servarr.com/prowlarr/contributing).
## Documentation ##
Setup guides, FAQ, the more information we have on the [wiki](https://wiki.servarr.com/prowlarr) the better.
## Documentation
## Development ##
Setup guides, [FAQ](https://wiki.servarr.com/prowlarr/faq), the more information we have on the [wiki](https://wiki.servarr.com/prowlarr) the better.
### Tools required ###
- Visual Studio 2019 or higher (https://www.visualstudio.com/vs/). The community version is free and works (https://www.visualstudio.com/downloads/).
- HTML/Javascript editor of choice (VS Code/Sublime Text/Webstorm/Atom/etc)
- [Git](https://git-scm.com/downloads)
- [NodeJS](https://nodejs.org/en/download/) (Node 12.X.X or higher)
- [Yarn](https://yarnpkg.com/)
- .NET Core 5.0.
## Development
### Getting started ###
1. Fork Prowlarr
2. Clone the repository into your development machine. [*info*](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github)
3. Install the required Node Packages `yarn install`
4. Start gulp to monitor your dev environment for any changes that need post processing using `yarn start` command.
5. Build the project in Visual Studio, Setting startup project to `Prowlarr.Console` and framework to `net5.0`
6. Debug the project in Visual Studio
7. Open http://localhost:9696
### Contributing Code ###
- If you're adding a new, already requested feature, please comment on [Github Issues](https://github.com/Prowlarr/Prowlarr/issues "Github Issues") so work is not duplicated (If you want to add something not already on there, please talk to us first)
- Rebase from Prowlarr's develop branch, don't merge
- Make meaningful commits, or squash them
- Feel free to make a pull request before work is complete, this will let us see where its at and make comments/suggest improvements
- Reach out to us on the discord if you have any questions
- Add tests (unit/integration)
- Commit with *nix line endings for consistency (We checkout Windows and commit *nix)
- One feature/bug fix per pull request to keep things clean and easy to understand
- Use 4 spaces instead of tabs, this is the default for VS 2019 and WebStorm (to my knowledge)
### Contributing Indexers ###
- If you're contributing an indexer please phrase your commit as something like: `New: (Indexer) {Indexer Name}`, `New: (Indexer) {Usenet|Torrent} {Indexer Name}`, `New: (Indexer) {Torznab|Newznab} {Indexer Name}`
- If you're updating an indexer please phrase your commit as something like: `Fixed: (Indexer) {Indexer Name} {changes}` e.g. `Fixed: (Indexer) Changed BHD to use API`
### Pull Requesting ###
- Only make pull requests to develop, never master, if you make a PR to master we'll comment on it and close it
- You're probably going to get some comments or questions from us, they will be to ensure consistency and maintainability
- We'll try to respond to pull requests as soon as possible, if its been a day or two, please reach out to us, we may have missed it
- Each PR should come from its own [feature branch](http://martinfowler.com/bliki/FeatureBranch.html) not develop in your fork, it should have a meaningful branch name (what is being added/fixed)
- new-feature (Good)
- fix-bug (Good)
- patch (Bad)
- develop (Bad)
If you have any questions about any of this, please let us know.
See the [Wiki Page](https://wiki.servarr.com/prowlarr/contributing)

View File

@@ -7,17 +7,18 @@
[![Backers on Open Collective](https://opencollective.com/Prowlarr/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/Prowlarr/sponsors/badge.svg)](#sponsors)
Prowlarr is a indexer manager/proxy built on the popular arr .net/reactjs base stack to integrate with your various PVR apps. Prowlarr supports both Torrent Trackers and Usenet Indexers. It integrates seamlessly with Sonarr, Radarr, Lidarr, and Readarr offering complete management of your indexers with no per app Indexer setup required (we do it all).
Prowlarr is an indexer manager/proxy built on the popular arr .net/reactjs base stack to integrate with your various PVR apps. Prowlarr supports management of both Torrent Trackers and Usenet Indexers. It integrates seamlessly with Lidarr, Mylar3, Radarr, Readarr, and Sonarr offering complete management of your indexers with no per app Indexer setup required (we do it all).
## Major Features Include:
- Usenet support for 24 indexers natively, including Headphones VIP, and support for any Newznab compatible indexer via "Generic Newznab"
- Torrent support for over 500 trackers with more added all the time
- Torrent support for any Torznab compatible tracker via "Generic Torznab"
- Indexer Sync to Sonarr/Radarr/Readarr/Lidarr, so no manual configuration of the other applications are required
- Indexer History and Statistics
- Manual Searching of Trackers & Indexers at a category level
- Indexer Sync to Sonarr/Radarr/Readarr/Lidarr/Mylar3, so no manual configuration of the other applications are required
- Indexer history and statistics
- Manual searching of Trackers & Indexers at a category level
- Support for pushing releases directly to your download clients from Prowlarr
- Indexer health and status notifications
- Per Indexer proxy support (SOCKS4, SOCKS5, HTTP, Flaresolverr)
## Support
Note: Prowlarr is currently early in life, thus bugs should be expected
@@ -35,9 +36,13 @@ Note: Prowlarr is currently early in life, thus bugs should be expected
- Request or vote on an existing request for a new tracker/indexer
## Contributors & Developers
This project exists thanks to all the people who contribute. [Contribute](CONTRIBUTING.md).
<a href="https://github.com/Prowlarr/Prowlarr/graphs/contributors"><img src="https://opencollective.com/Prowlarr/contributors.svg?width=890&button=false" /></a>
- [Contribute (GitHub)](CONTRIBUTING.md)
- [Contribution (Wiki Article)](https://wiki.servarr.com/prowlarr/contributing)
- [YML Indexer Defintion (Wiki Article)](https://wiki.servarr.com/prowlarr/cardigann-yml-definition)
This project exists thanks to all the people who contribute.
<a href="https://github.com/Prowlarr/Prowlarr/graphs/contributors"><img src="https://opencollective.com/Prowlarr/contributors.svg?width=890&button=false" /></a>
## Backers

View File

@@ -7,13 +7,13 @@ variables:
outputFolder: './_output'
artifactsFolder: './_artifacts'
testsFolder: './_tests'
majorVersion: '0.1.0'
majorVersion: '0.1.2'
minorVersion: $[counter('minorVersion', 1)]
prowlarrVersion: '$(majorVersion).$(minorVersion)'
buildName: '$(Build.SourceBranchName).$(prowlarrVersion)'
sentryOrg: 'servarr'
sentryUrl: 'https://sentry.servarr.com'
dotnetVersion: '5.0.302'
dotnetVersion: '5.0.400'
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
trigger:
@@ -67,7 +67,7 @@ stages:
enableAnalysis: 'true'
Mac:
osName: 'Mac'
imageName: 'macos-10.14'
imageName: 'macos-10.15'
enableAnalysis: 'false'
Windows:
osName: 'Windows'
@@ -144,7 +144,7 @@ stages:
imageName: 'ubuntu-18.04'
Mac:
osName: 'Mac'
imageName: 'macos-10.14'
imageName: 'macos-10.15'
Windows:
osName: 'Windows'
imageName: 'windows-2019'
@@ -383,7 +383,7 @@ stages:
osName: 'Mac'
testName: 'MacCore'
poolName: 'Azure Pipelines'
imageName: 'macos-10.14'
imageName: 'macos-10.15'
WindowsCore:
osName: 'Windows'
testName: 'WindowsCore'
@@ -510,7 +510,7 @@ stages:
MacCore:
osName: 'Mac'
testName: 'MacCore'
imageName: 'macos-10.14'
imageName: 'macos-10.15'
pattern: 'Prowlarr.*.osx-core-x64.tar.gz'
WindowsCore:
osName: 'Windows'
@@ -686,7 +686,7 @@ stages:
failBuild: false
Mac:
osName: 'Mac'
imageName: 'macos-10.14'
imageName: 'macos-10.15'
pattern: 'Prowlarr.*.osx-core-x64.tar.gz'
failBuild: false
Windows:

View File

@@ -11,6 +11,7 @@ import ApplicationSettingsConnector from 'Settings/Applications/ApplicationSetti
import DevelopmentSettingsConnector from 'Settings/Development/DevelopmentSettingsConnector';
import DownloadClientSettingsConnector from 'Settings/DownloadClients/DownloadClientSettingsConnector';
import GeneralSettingsConnector from 'Settings/General/GeneralSettingsConnector';
import IndexerSettings from 'Settings/Indexers/IndexerSettings';
import NotificationSettings from 'Settings/Notifications/NotificationSettings';
import Settings from 'Settings/Settings';
import TagSettings from 'Settings/Tags/TagSettings';
@@ -90,6 +91,11 @@ function AppRoutes(props) {
component={Settings}
/>
<Route
path="/settings/indexers"
component={IndexerSettings}
/>
<Route
path="/settings/applications"
component={ApplicationSettingsConnector}

View File

@@ -16,7 +16,6 @@ import FormInputHelpText from './FormInputHelpText';
import IndexerFlagsSelectInputConnector from './IndexerFlagsSelectInputConnector';
import InfoInput from './InfoInput';
import KeyValueListInput from './KeyValueListInput';
import MovieMonitoredSelectInput from './MovieMonitoredSelectInput';
import NumberInput from './NumberInput';
import OAuthInputConnector from './OAuthInputConnector';
import PasswordInput from './PasswordInput';
@@ -69,9 +68,6 @@ function getComponent(type) {
case inputTypes.PATH:
return PathInputConnector;
case inputTypes.MOVIE_MONITORED_SELECT:
return MovieMonitoredSelectInput;
case inputTypes.INDEXER_FLAGS_SELECT:
return IndexerFlagsSelectInputConnector;

View File

@@ -11,8 +11,6 @@ class InfoInput extends Component {
value
} = this.props;
console.log(this.props);
return (
<span dangerouslySetInnerHTML={{ __html: value }} />
);

View File

@@ -1,52 +0,0 @@
import PropTypes from 'prop-types';
import React from 'react';
import SelectInput from './SelectInput';
const monitorTypesOptions = [
{ key: 'true', value: 'True' },
{ key: 'false', value: 'False' }
];
function MovieMonitoredSelectInput(props) {
const values = [...monitorTypesOptions];
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}
/>
);
}
MovieMonitoredSelectInput.propTypes = {
includeNoChange: PropTypes.bool.isRequired,
includeMixed: PropTypes.bool.isRequired
};
MovieMonitoredSelectInput.defaultProps = {
includeNoChange: false,
includeMixed: false
};
export default MovieMonitoredSelectInput;

View File

@@ -53,7 +53,8 @@ function getSelectValues(selectOptions) {
result.push({
key: option.value,
value: option.name,
hint: option.hint
hint: option.hint,
parentKey: option.parentValue
});
return result;

View File

@@ -60,7 +60,7 @@ function createMapStateToProps() {
function createMapDispatchToProps(dispatch, props) {
return {
onGoToAddNewMovie(query) {
dispatch(setSearchDefault({ searchQuery: query, searchIndexerIds: [-1, -2] }));
dispatch(setSearchDefault({ searchQuery: query }));
dispatch(push(`${window.Prowlarr.urlBase}/search`));
}
};

View File

@@ -48,6 +48,10 @@ const links = [
title: translate('Settings'),
to: '/settings',
children: [
{
title: translate('Indexers'),
to: '/settings/indexers'
},
{
title: translate('Apps'),
to: '/settings/applications'

View File

@@ -168,9 +168,9 @@ class SignalRConnector extends Component {
this.props.dispatchFetchIndexerStatus();
}
handleMovie = (body) => {
handleIndexer = (body) => {
const action = body.action;
const section = 'movies';
const section = 'indexers';
if (action === 'updated') {
this.props.dispatchUpdateItem({ section, ...body.resource });

View File

@@ -228,4 +228,4 @@ export const UNSAVED_SETTING = farDotCircle;
export const VIEW = fasEye;
export const WARNING = fasExclamationTriangle;
export const WIKI = fasBookReader;
export const BLACKLIST = fasBan;
export const BLOCKLIST = fasBan;

View File

@@ -45,6 +45,7 @@ function EditIndexerModalContent(props) {
supportsRss,
supportsRedirect,
appProfileId,
tags,
fields,
priority
} = item;
@@ -89,7 +90,6 @@ function EditIndexerModalContent(props) {
type={inputTypes.CHECK}
name="enable"
helpTextWarning={supportsRss.value ? undefined : translate('RSSIsNotSupportedWithThisIndexer')}
isDisabled={!supportsRss.value}
{...enable}
onChange={onInputChange}
/>
@@ -152,6 +152,18 @@ function EditIndexerModalContent(props) {
onChange={onInputChange}
/>
</FormGroup>
<FormGroup>
<FormLabel>{translate('Tags')}</FormLabel>
<FormInputGroup
type={inputTypes.TAG}
name="tags"
helpText="Use tags to specify default clients, specify Indexer Proxies, or just to organize your indexers."
{...tags}
onChange={onInputChange}
/>
</FormGroup>
</Form>
}
</ModalBody>

View File

@@ -59,7 +59,6 @@ class EditIndexerModalContentConnector extends Component {
}
onAdvancedSettingsPress = () => {
console.log('settings');
this.props.toggleAdvancedSettings();
}

View File

@@ -270,6 +270,7 @@ class IndexerIndex extends Component {
isSaving,
saveError,
isDeleting,
isTestingAll,
deleteError,
onScroll,
onSortSelect,
@@ -310,7 +311,7 @@ class IndexerIndex extends Component {
<PageToolbarButton
label={'Test All Indexers'}
iconName={icons.TEST}
spinningName={icons.TEST}
isSpinning={isTestingAll}
isDisabled={hasNoIndexer}
onPress={this.props.onTestAllPress}
/>
@@ -489,6 +490,7 @@ IndexerIndex.propTypes = {
isSaving: PropTypes.bool.isRequired,
saveError: PropTypes.object,
isDeleting: PropTypes.bool.isRequired,
isTestingAll: PropTypes.bool.isRequired,
deleteError: PropTypes.object,
onSortSelect: PropTypes.func.isRequired,
onFilterSelect: PropTypes.func.isRequired,

View File

@@ -31,7 +31,7 @@ function IndexerStatusCell(props) {
<Icon
className={styles.statusIcon}
kind={enabled ? enableKind : kinds.DEFAULT}
name={enabled ? enableIcon: icons.BLACKLIST}
name={enabled ? enableIcon: icons.BLOCKLIST}
title={enabled ? enableTitle : 'Indexer is Disabled'}
/>
}

View File

@@ -27,7 +27,7 @@ class SearchFooter extends Component {
this.state = {
searchingReleases: false,
searchQuery: defaultSearchQuery,
searchQuery: defaultSearchQuery || '',
searchIndexerIds: defaultIndexerIds,
searchCategories: defaultCategories
};
@@ -58,12 +58,15 @@ class SearchFooter extends Component {
const {
searchIndexerIds,
searchCategories,
searchQuery
searchCategories
} = this.state;
const newState = {};
if (defaultSearchQuery && defaultSearchQuery !== prevProps.defaultSearchQuery) {
newState.searchQuery = defaultSearchQuery;
}
if (searchIndexerIds !== defaultIndexerIds) {
newState.searchIndexerIds = defaultIndexerIds;
}
@@ -72,10 +75,6 @@ class SearchFooter extends Component {
newState.searchCategories = defaultCategories;
}
if (searchQuery !== defaultSearchQuery) {
newState.searchQuery = defaultSearchQuery;
}
if (prevProps.isFetching && !isFetching && !searchError) {
newState.searchingReleases = false;
}
@@ -92,6 +91,10 @@ class SearchFooter extends Component {
this.props.onSearchPress(this.state.searchQuery, this.state.searchIndexerIds, this.state.searchCategories);
}
onSearchInputChange = ({ value }) => {
this.setState({ searchQuery: value });
}
//
// Render
@@ -121,7 +124,7 @@ class SearchFooter extends Component {
autoFocus={true}
value={searchQuery}
isDisabled={isFetching}
onChange={onInputChange}
onChange={this.onSearchInputChange}
/>
</div>

View File

@@ -0,0 +1,44 @@
.indexerProxy {
composes: card from '~Components/Card.css';
position: relative;
width: 300px;
height: 100px;
}
.underlay {
@add-mixin cover;
}
.overlay {
@add-mixin linkOverlay;
padding: 10px;
}
.name {
text-align: center;
font-weight: lighter;
font-size: 24px;
}
.actions {
margin-top: 20px;
text-align: right;
}
.presetsMenu {
composes: menu from '~Components/Menu/Menu.css';
display: inline-block;
margin: 0 5px;
}
.presetsMenuButton {
composes: button from '~Components/Link/Button.css';
&::after {
margin-left: 5px;
content: '\25BE';
}
}

View File

@@ -0,0 +1,111 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import Button from 'Components/Link/Button';
import Link from 'Components/Link/Link';
import Menu from 'Components/Menu/Menu';
import MenuContent from 'Components/Menu/MenuContent';
import { sizes } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
import AddIndexerProxyPresetMenuItem from './AddIndexerProxyPresetMenuItem';
import styles from './AddIndexerProxyItem.css';
class AddIndexerProxyItem extends Component {
//
// Listeners
onIndexerProxySelect = () => {
const {
implementation
} = this.props;
this.props.onIndexerProxySelect({ implementation });
}
//
// Render
render() {
const {
implementation,
implementationName,
infoLink,
presets,
onIndexerProxySelect
} = this.props;
const hasPresets = !!presets && !!presets.length;
return (
<div
className={styles.indexerProxy}
>
<Link
className={styles.underlay}
onPress={this.onIndexerProxySelect}
/>
<div className={styles.overlay}>
<div className={styles.name}>
{implementationName}
</div>
<div className={styles.actions}>
{
hasPresets &&
<span>
<Button
size={sizes.SMALL}
onPress={this.onIndexerProxySelect}
>
Custom
</Button>
<Menu className={styles.presetsMenu}>
<Button
className={styles.presetsMenuButton}
size={sizes.SMALL}
>
Presets
</Button>
<MenuContent>
{
presets.map((preset) => {
return (
<AddIndexerProxyPresetMenuItem
key={preset.name}
name={preset.name}
implementation={implementation}
onPress={onIndexerProxySelect}
/>
);
})
}
</MenuContent>
</Menu>
</span>
}
<Button
to={infoLink}
size={sizes.SMALL}
>
{translate('MoreInfo')}
</Button>
</div>
</div>
</div>
);
}
}
AddIndexerProxyItem.propTypes = {
implementation: PropTypes.string.isRequired,
implementationName: PropTypes.string.isRequired,
infoLink: PropTypes.string.isRequired,
presets: PropTypes.arrayOf(PropTypes.object),
onIndexerProxySelect: PropTypes.func.isRequired
};
export default AddIndexerProxyItem;

View File

@@ -0,0 +1,25 @@
import PropTypes from 'prop-types';
import React from 'react';
import Modal from 'Components/Modal/Modal';
import AddIndexerProxyModalContentConnector from './AddIndexerProxyModalContentConnector';
function AddIndexerProxyModal({ isOpen, onModalClose, ...otherProps }) {
return (
<Modal
isOpen={isOpen}
onModalClose={onModalClose}
>
<AddIndexerProxyModalContentConnector
{...otherProps}
onModalClose={onModalClose}
/>
</Modal>
);
}
AddIndexerProxyModal.propTypes = {
isOpen: PropTypes.bool.isRequired,
onModalClose: PropTypes.func.isRequired
};
export default AddIndexerProxyModal;

View File

@@ -0,0 +1,5 @@
.indexerProxies {
display: flex;
justify-content: center;
flex-wrap: wrap;
}

View File

@@ -0,0 +1,88 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
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 translate from 'Utilities/String/translate';
import AddIndexerProxyItem from './AddIndexerProxyItem';
import styles from './AddIndexerProxyModalContent.css';
class AddIndexerProxyModalContent extends Component {
//
// Render
render() {
const {
isSchemaFetching,
isSchemaPopulated,
schemaError,
schema,
onIndexerProxySelect,
onModalClose
} = this.props;
return (
<ModalContent onModalClose={onModalClose}>
<ModalHeader>
{translate('AddIndexerProxy')}
</ModalHeader>
<ModalBody>
{
isSchemaFetching &&
<LoadingIndicator />
}
{
!isSchemaFetching && !!schemaError &&
<div>
{translate('UnableToAddANewIndexerProxyPleaseTryAgain')}
</div>
}
{
isSchemaPopulated && !schemaError &&
<div>
<div className={styles.indexerProxies}>
{
schema.map((indexerProxy) => {
return (
<AddIndexerProxyItem
key={indexerProxy.implementation}
implementation={indexerProxy.implementation}
{...indexerProxy}
onIndexerProxySelect={onIndexerProxySelect}
/>
);
})
}
</div>
</div>
}
</ModalBody>
<ModalFooter>
<Button
onPress={onModalClose}
>
{translate('Close')}
</Button>
</ModalFooter>
</ModalContent>
);
}
}
AddIndexerProxyModalContent.propTypes = {
isSchemaFetching: PropTypes.bool.isRequired,
isSchemaPopulated: PropTypes.bool.isRequired,
schemaError: PropTypes.object,
schema: PropTypes.arrayOf(PropTypes.object).isRequired,
onIndexerProxySelect: PropTypes.func.isRequired,
onModalClose: PropTypes.func.isRequired
};
export default AddIndexerProxyModalContent;

View File

@@ -0,0 +1,70 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { fetchIndexerProxySchema, selectIndexerProxySchema } from 'Store/Actions/settingsActions';
import AddIndexerProxyModalContent from './AddIndexerProxyModalContent';
function createMapStateToProps() {
return createSelector(
(state) => state.settings.indexerProxies,
(indexerProxies) => {
const {
isSchemaFetching,
isSchemaPopulated,
schemaError,
schema
} = indexerProxies;
return {
isSchemaFetching,
isSchemaPopulated,
schemaError,
schema
};
}
);
}
const mapDispatchToProps = {
fetchIndexerProxySchema,
selectIndexerProxySchema
};
class AddIndexerProxyModalContentConnector extends Component {
//
// Lifecycle
componentDidMount() {
this.props.fetchIndexerProxySchema();
}
//
// Listeners
onIndexerProxySelect = ({ implementation, name }) => {
this.props.selectIndexerProxySchema({ implementation, presetName: name });
this.props.onModalClose({ indexerProxySelected: true });
}
//
// Render
render() {
return (
<AddIndexerProxyModalContent
{...this.props}
onIndexerProxySelect={this.onIndexerProxySelect}
/>
);
}
}
AddIndexerProxyModalContentConnector.propTypes = {
fetchIndexerProxySchema: PropTypes.func.isRequired,
selectIndexerProxySchema: PropTypes.func.isRequired,
onModalClose: PropTypes.func.isRequired
};
export default connect(createMapStateToProps, mapDispatchToProps)(AddIndexerProxyModalContentConnector);

View File

@@ -0,0 +1,49 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import MenuItem from 'Components/Menu/MenuItem';
class AddIndexerProxyPresetMenuItem extends Component {
//
// Listeners
onPress = () => {
const {
name,
implementation
} = this.props;
this.props.onPress({
name,
implementation
});
}
//
// Render
render() {
const {
name,
implementation,
...otherProps
} = this.props;
return (
<MenuItem
{...otherProps}
onPress={this.onPress}
>
{name}
</MenuItem>
);
}
}
AddIndexerProxyPresetMenuItem.propTypes = {
name: PropTypes.string.isRequired,
implementation: PropTypes.string.isRequired,
onPress: PropTypes.func.isRequired
};
export default AddIndexerProxyPresetMenuItem;

View File

@@ -0,0 +1,27 @@
import PropTypes from 'prop-types';
import React from 'react';
import Modal from 'Components/Modal/Modal';
import { sizes } from 'Helpers/Props';
import EditIndexerProxyModalContentConnector from './EditIndexerProxyModalContentConnector';
function EditIndexerProxyModal({ isOpen, onModalClose, ...otherProps }) {
return (
<Modal
size={sizes.MEDIUM}
isOpen={isOpen}
onModalClose={onModalClose}
>
<EditIndexerProxyModalContentConnector
{...otherProps}
onModalClose={onModalClose}
/>
</Modal>
);
}
EditIndexerProxyModal.propTypes = {
isOpen: PropTypes.bool.isRequired,
onModalClose: PropTypes.func.isRequired
};
export default EditIndexerProxyModal;

View File

@@ -0,0 +1,65 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { clearPendingChanges } from 'Store/Actions/baseActions';
import { cancelSaveIndexerProxy, cancelTestIndexerProxy } from 'Store/Actions/settingsActions';
import EditIndexerProxyModal from './EditIndexerProxyModal';
function createMapDispatchToProps(dispatch, props) {
const section = 'settings.indexerProxies';
return {
dispatchClearPendingChanges() {
dispatch(clearPendingChanges({ section }));
},
dispatchCancelTestIndexerProxy() {
dispatch(cancelTestIndexerProxy({ section }));
},
dispatchCancelSaveIndexerProxy() {
dispatch(cancelSaveIndexerProxy({ section }));
}
};
}
class EditIndexerProxyModalConnector extends Component {
//
// Listeners
onModalClose = () => {
this.props.dispatchClearPendingChanges();
this.props.dispatchCancelTestIndexerProxy();
this.props.dispatchCancelSaveIndexerProxy();
this.props.onModalClose();
}
//
// Render
render() {
const {
dispatchClearPendingChanges,
dispatchCancelTestIndexerProxy,
dispatchCancelSaveIndexerProxy,
...otherProps
} = this.props;
return (
<EditIndexerProxyModal
{...otherProps}
onModalClose={this.onModalClose}
/>
);
}
}
EditIndexerProxyModalConnector.propTypes = {
onModalClose: PropTypes.func.isRequired,
dispatchClearPendingChanges: PropTypes.func.isRequired,
dispatchCancelTestIndexerProxy: PropTypes.func.isRequired,
dispatchCancelSaveIndexerProxy: PropTypes.func.isRequired
};
export default connect(null, createMapDispatchToProps)(EditIndexerProxyModalConnector);

View File

@@ -0,0 +1,11 @@
.deleteButton {
composes: button from '~Components/Link/Button.css';
margin-right: auto;
}
.message {
composes: alert from '~Components/Alert.css';
margin-bottom: 30px;
}

View File

@@ -0,0 +1,175 @@
import PropTypes from 'prop-types';
import React from 'react';
import Alert from 'Components/Alert';
import Form from 'Components/Form/Form';
import FormGroup from 'Components/Form/FormGroup';
import FormInputGroup from 'Components/Form/FormInputGroup';
import FormLabel from 'Components/Form/FormLabel';
import ProviderFieldFormGroup from 'Components/Form/ProviderFieldFormGroup';
import Button from 'Components/Link/Button';
import SpinnerErrorButton from 'Components/Link/SpinnerErrorButton';
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 { inputTypes, kinds } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
import styles from './EditIndexerProxyModalContent.css';
function EditIndexerProxyModalContent(props) {
const {
advancedSettings,
isFetching,
error,
isSaving,
isTesting,
saveError,
item,
onInputChange,
onFieldChange,
onModalClose,
onSavePress,
onTestPress,
onDeleteIndexerProxyPress,
...otherProps
} = props;
const {
id,
implementationName,
name,
tags,
fields,
message
} = item;
return (
<ModalContent onModalClose={onModalClose}>
<ModalHeader>
{`${id ? 'Edit' : 'Add'} Proxy - ${implementationName}`}
</ModalHeader>
<ModalBody>
{
isFetching &&
<LoadingIndicator />
}
{
!isFetching && !!error &&
<div>
{translate('UnableToAddANewIndexerProxyPleaseTryAgain')}
</div>
}
{
!isFetching && !error &&
<Form {...otherProps}>
{
!!message &&
<Alert
className={styles.message}
kind={message.value.type}
>
{message.value.message}
</Alert>
}
<FormGroup>
<FormLabel>{translate('Name')}</FormLabel>
<FormInputGroup
type={inputTypes.TEXT}
name="name"
{...name}
onChange={onInputChange}
/>
</FormGroup>
<FormGroup>
<FormLabel>{translate('Tags')}</FormLabel>
<FormInputGroup
type={inputTypes.TAG}
name="tags"
helpText={translate('TagsHelpText')}
{...tags}
onChange={onInputChange}
/>
</FormGroup>
{
fields.map((field) => {
return (
<ProviderFieldFormGroup
key={field.name}
advancedSettings={advancedSettings}
provider="indexerProxy"
providerData={item}
section="settings.indexerProxies"
{...field}
onChange={onFieldChange}
/>
);
})
}
</Form>
}
</ModalBody>
<ModalFooter>
{
id &&
<Button
className={styles.deleteButton}
kind={kinds.DANGER}
onPress={onDeleteIndexerProxyPress}
>
{translate('Delete')}
</Button>
}
<SpinnerErrorButton
isSpinning={isTesting}
error={saveError}
onPress={onTestPress}
>
{translate('Test')}
</SpinnerErrorButton>
<Button
onPress={onModalClose}
>
{translate('Cancel')}
</Button>
<SpinnerErrorButton
isSpinning={isSaving}
error={saveError}
onPress={onSavePress}
>
{translate('Save')}
</SpinnerErrorButton>
</ModalFooter>
</ModalContent>
);
}
EditIndexerProxyModalContent.propTypes = {
advancedSettings: PropTypes.bool.isRequired,
isFetching: PropTypes.bool.isRequired,
error: PropTypes.object,
isSaving: PropTypes.bool.isRequired,
isTesting: PropTypes.bool.isRequired,
saveError: PropTypes.object,
item: PropTypes.object.isRequired,
onInputChange: PropTypes.func.isRequired,
onFieldChange: PropTypes.func.isRequired,
onModalClose: PropTypes.func.isRequired,
onSavePress: PropTypes.func.isRequired,
onTestPress: PropTypes.func.isRequired,
onDeleteIndexerProxyPress: PropTypes.func
};
export default EditIndexerProxyModalContent;

View File

@@ -0,0 +1,88 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { saveIndexerProxy, setIndexerProxyFieldValue, setIndexerProxyValue, testIndexerProxy } from 'Store/Actions/settingsActions';
import createProviderSettingsSelector from 'Store/Selectors/createProviderSettingsSelector';
import EditIndexerProxyModalContent from './EditIndexerProxyModalContent';
function createMapStateToProps() {
return createSelector(
(state) => state.settings.advancedSettings,
createProviderSettingsSelector('indexerProxies'),
(advancedSettings, indexerProxy) => {
return {
advancedSettings,
...indexerProxy
};
}
);
}
const mapDispatchToProps = {
setIndexerProxyValue,
setIndexerProxyFieldValue,
saveIndexerProxy,
testIndexerProxy
};
class EditIndexerProxyModalContentConnector extends Component {
//
// Lifecycle
componentDidUpdate(prevProps, prevState) {
if (prevProps.isSaving && !this.props.isSaving && !this.props.saveError) {
this.props.onModalClose();
}
}
//
// Listeners
onInputChange = ({ name, value }) => {
this.props.setIndexerProxyValue({ name, value });
}
onFieldChange = ({ name, value }) => {
this.props.setIndexerProxyFieldValue({ name, value });
}
onSavePress = () => {
this.props.saveIndexerProxy({ id: this.props.id });
}
onTestPress = () => {
this.props.testIndexerProxy({ id: this.props.id });
}
//
// Render
render() {
return (
<EditIndexerProxyModalContent
{...this.props}
onSavePress={this.onSavePress}
onTestPress={this.onTestPress}
onInputChange={this.onInputChange}
onFieldChange={this.onFieldChange}
/>
);
}
}
EditIndexerProxyModalContentConnector.propTypes = {
id: PropTypes.number,
isFetching: PropTypes.bool.isRequired,
isSaving: PropTypes.bool.isRequired,
saveError: PropTypes.object,
item: PropTypes.object.isRequired,
setIndexerProxyValue: PropTypes.func.isRequired,
setIndexerProxyFieldValue: PropTypes.func.isRequired,
saveIndexerProxy: PropTypes.func.isRequired,
testIndexerProxy: PropTypes.func.isRequired,
onModalClose: PropTypes.func.isRequired
};
export default connect(createMapStateToProps, mapDispatchToProps)(EditIndexerProxyModalContentConnector);

View File

@@ -0,0 +1,20 @@
.indexerProxies {
display: flex;
flex-wrap: wrap;
}
.addIndexerProxy {
composes: indexerProxy from '~./IndexerProxy.css';
background-color: $cardAlternateBackgroundColor;
color: $gray;
text-align: center;
}
.center {
display: inline-block;
padding: 5px 20px 0;
border: 1px solid $borderColor;
border-radius: 4px;
background-color: $white;
}

View File

@@ -0,0 +1,121 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import Card from 'Components/Card';
import FieldSet from 'Components/FieldSet';
import Icon from 'Components/Icon';
import PageSectionContent from 'Components/Page/PageSectionContent';
import { icons } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
import AddIndexerProxyModal from './AddIndexerProxyModal';
import EditIndexerProxyModalConnector from './EditIndexerProxyModalConnector';
import IndexerProxy from './IndexerProxy';
import styles from './IndexerProxies.css';
class IndexerProxies extends Component {
//
// Lifecycle
constructor(props, context) {
super(props, context);
this.state = {
isAddIndexerProxyModalOpen: false,
isEditIndexerProxyModalOpen: false
};
}
//
// Listeners
onAddIndexerProxyPress = () => {
this.setState({ isAddIndexerProxyModalOpen: true });
}
onAddIndexerProxyModalClose = ({ indexerProxySelected = false } = {}) => {
this.setState({
isAddIndexerProxyModalOpen: false,
isEditIndexerProxyModalOpen: indexerProxySelected
});
}
onEditIndexerProxyModalClose = () => {
this.setState({ isEditIndexerProxyModalOpen: false });
}
//
// Render
render() {
const {
items,
tagList,
indexerList,
onConfirmDeleteIndexerProxy,
...otherProps
} = this.props;
const {
isAddIndexerProxyModalOpen,
isEditIndexerProxyModalOpen
} = this.state;
return (
<FieldSet legend={translate('Indexer Proxies')}>
<PageSectionContent
errorMessage={translate('UnableToLoadIndexerProxies')}
{...otherProps}
>
<div className={styles.indexerProxies}>
{
items.map((item) => {
return (
<IndexerProxy
key={item.id}
{...item}
tagList={tagList}
indexerList={indexerList}
onConfirmDeleteIndexerProxy={onConfirmDeleteIndexerProxy}
/>
);
})
}
<Card
className={styles.addIndexerProxy}
onPress={this.onAddIndexerProxyPress}
>
<div className={styles.center}>
<Icon
name={icons.ADD}
size={45}
/>
</div>
</Card>
</div>
<AddIndexerProxyModal
isOpen={isAddIndexerProxyModalOpen}
onModalClose={this.onAddIndexerProxyModalClose}
/>
<EditIndexerProxyModalConnector
isOpen={isEditIndexerProxyModalOpen}
onModalClose={this.onEditIndexerProxyModalClose}
/>
</PageSectionContent>
</FieldSet>
);
}
}
IndexerProxies.propTypes = {
isFetching: PropTypes.bool.isRequired,
error: PropTypes.object,
items: PropTypes.arrayOf(PropTypes.object).isRequired,
tagList: PropTypes.arrayOf(PropTypes.object).isRequired,
indexerList: PropTypes.arrayOf(PropTypes.object).isRequired,
onConfirmDeleteIndexerProxy: PropTypes.func.isRequired
};
export default IndexerProxies;

View File

@@ -0,0 +1,65 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { deleteIndexerProxy, fetchIndexerProxies } from 'Store/Actions/settingsActions';
import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
import createTagsSelector from 'Store/Selectors/createTagsSelector';
import sortByName from 'Utilities/Array/sortByName';
import IndexerProxies from './IndexerProxies';
function createMapStateToProps() {
return createSelector(
createSortedSectionSelector('settings.indexerProxies', sortByName),
createSortedSectionSelector('indexers', sortByName),
createTagsSelector(),
(indexerProxies, indexers, tagList) => {
return {
...indexerProxies,
indexerList: indexers.items,
tagList
};
}
);
}
const mapDispatchToProps = {
fetchIndexerProxies,
deleteIndexerProxy
};
class IndexerProxiesConnector extends Component {
//
// Lifecycle
componentDidMount() {
this.props.fetchIndexerProxies();
}
//
// Listeners
onConfirmDeleteIndexerProxy = (id) => {
this.props.deleteIndexerProxy({ id });
}
//
// Render
render() {
return (
<IndexerProxies
{...this.props}
onConfirmDeleteIndexerProxy={this.onConfirmDeleteIndexerProxy}
/>
);
}
}
IndexerProxiesConnector.propTypes = {
fetchIndexerProxies: PropTypes.func.isRequired,
deleteIndexerProxy: PropTypes.func.isRequired
};
export default connect(createMapStateToProps, mapDispatchToProps)(IndexerProxiesConnector);

View File

@@ -0,0 +1,23 @@
.indexerProxy {
composes: card from '~Components/Card.css';
width: 290px;
}
.name {
@add-mixin truncate;
margin-bottom: 20px;
font-weight: 300;
font-size: 24px;
}
.indexers {
flex: 1 0 auto;
}
.enabled {
display: flex;
flex-wrap: wrap;
margin-top: 5px;
}

View File

@@ -0,0 +1,144 @@
import _ from 'lodash';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import Card from 'Components/Card';
import Label from 'Components/Label';
import ConfirmModal from 'Components/Modal/ConfirmModal';
import TagList from 'Components/TagList';
import { kinds } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
import EditIndexerProxyModalConnector from './EditIndexerProxyModalConnector';
import styles from './IndexerProxy.css';
class IndexerProxy extends Component {
//
// Lifecycle
constructor(props, context) {
super(props, context);
this.state = {
isEditIndexerProxyModalOpen: false,
isDeleteIndexerProxyModalOpen: false
};
}
//
// Listeners
onEditIndexerProxyPress = () => {
this.setState({ isEditIndexerProxyModalOpen: true });
}
onEditIndexerProxyModalClose = () => {
this.setState({ isEditIndexerProxyModalOpen: false });
}
onDeleteIndexerProxyPress = () => {
this.setState({
isEditIndexerProxyModalOpen: false,
isDeleteIndexerProxyModalOpen: true
});
}
onDeleteIndexerProxyModalClose= () => {
this.setState({ isDeleteIndexerProxyModalOpen: false });
}
onConfirmDeleteIndexerProxy = () => {
this.props.onConfirmDeleteIndexerProxy(this.props.id);
}
//
// Render
render() {
const {
id,
name,
tags,
tagList,
indexerList
} = this.props;
return (
<Card
className={styles.indexerProxy}
overlayContent={true}
onPress={this.onEditIndexerProxyPress}
>
<div className={styles.name}>
{name}
</div>
<TagList
tags={tags}
tagList={tagList}
/>
<div className={styles.indexers}>
{
tags.map((t) => {
const indexers = _.filter(indexerList, { tags: [t] });
if (!indexers || indexers.length === 0) {
return null;
}
return indexers.map((i) => {
return (
<Label
key={i.name}
kind={kinds.SUCCESS}
>
{i.name}
</Label>
);
});
})
}
</div>
{
!tags || tags.length === 0 ?
<Label
kind={kinds.DISABLED}
outline={true}
>
Disabled
</Label> :
null
}
<EditIndexerProxyModalConnector
id={id}
isOpen={this.state.isEditIndexerProxyModalOpen}
onModalClose={this.onEditIndexerProxyModalClose}
onDeleteIndexerProxyPress={this.onDeleteIndexerProxyPress}
/>
<ConfirmModal
isOpen={this.state.isDeleteIndexerProxyModalOpen}
kind={kinds.DANGER}
title={translate('DeleteIndexerProxy')}
message={translate('DeleteIndexerProxyMessageText', [name])}
confirmLabel={translate('Delete')}
onConfirm={this.onConfirmDeleteIndexerProxy}
onCancel={this.onDeleteIndexerProxyModalClose}
/>
</Card>
);
}
}
IndexerProxy.propTypes = {
id: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
tags: PropTypes.arrayOf(PropTypes.number).isRequired,
tagList: PropTypes.arrayOf(PropTypes.object).isRequired,
indexerList: PropTypes.arrayOf(PropTypes.object).isRequired,
onConfirmDeleteIndexerProxy: PropTypes.func.isRequired
};
export default IndexerProxy;

View File

@@ -0,0 +1,22 @@
import React from 'react';
import PageContent from 'Components/Page/PageContent';
import PageContentBody from 'Components/Page/PageContentBody';
import SettingsToolbarConnector from 'Settings/SettingsToolbarConnector';
import translate from 'Utilities/String/translate';
import IndexerProxiesConnector from './IndexerProxies/IndexerProxiesConnector';
function IndexerSettings() {
return (
<PageContent title={translate('Proxies')}>
<SettingsToolbarConnector
showSave={false}
/>
<PageContentBody>
<IndexerProxiesConnector />
</PageContentBody>
</PageContent>
);
}
export default IndexerSettings;

View File

@@ -16,13 +16,24 @@ function Settings() {
<PageContentBody>
<Link
className={styles.link}
to="/settings/applications"
to="/settings/indexers"
>
Applications
{translate('Indexers')}
</Link>
<div className={styles.summary}>
Applications and settings to configure how prowlarr interacts with your PVR programs
{translate('IndexerSettingsSummary')}
</div>
<Link
className={styles.link}
to="/settings/applications"
>
{translate('Apps')}
</Link>
<div className={styles.summary}>
{translate('AppSettingsSummary')}
</div>
<Link
@@ -40,7 +51,7 @@ function Settings() {
className={styles.link}
to="/settings/connect"
>
Notifications
{translate('Notifications')}
</Link>
<div className={styles.summary}>

View File

@@ -1,47 +0,0 @@
import PropTypes from 'prop-types';
import React from 'react';
import titleCase from 'Utilities/String/titleCase';
function TagDetailsDelayProfile(props) {
const {
preferredProtocol,
enableUsenet,
enableTorrent,
usenetDelay,
torrentDelay
} = props;
return (
<div>
<div>
Protocol: {titleCase(preferredProtocol)}
</div>
<div>
{
enableUsenet ?
`Usenet Delay: ${usenetDelay}` :
'Usenet disabled'
}
</div>
<div>
{
enableTorrent ?
`Torrent Delay: ${torrentDelay}` :
'Torrents disabled'
}
</div>
</div>
);
}
TagDetailsDelayProfile.propTypes = {
preferredProtocol: PropTypes.string.isRequired,
enableUsenet: PropTypes.bool.isRequired,
enableTorrent: PropTypes.bool.isRequired,
usenetDelay: PropTypes.number.isRequired,
torrentDelay: PropTypes.number.isRequired
};
export default TagDetailsDelayProfile;

View File

@@ -1,26 +1,22 @@
import PropTypes from 'prop-types';
import React from 'react';
import FieldSet from 'Components/FieldSet';
import Label from 'Components/Label';
import Button from 'Components/Link/Button';
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 { kinds } from 'Helpers/Props';
import split from 'Utilities/String/split';
import translate from 'Utilities/String/translate';
import TagDetailsDelayProfile from './TagDetailsDelayProfile';
import styles from './TagDetailsModalContent.css';
function TagDetailsModalContent(props) {
const {
label,
isTagUsed,
movies,
delayProfiles,
indexers,
notifications,
restrictions,
indexerProxies,
onModalClose,
onDeleteTagPress
} = props;
@@ -40,13 +36,13 @@ function TagDetailsModalContent(props) {
}
{
!!movies.length &&
<FieldSet legend={translate('Movies')}>
!!indexers.length &&
<FieldSet legend={translate('Indexers')}>
{
movies.map((item) => {
indexers.map((item) => {
return (
<div key={item.id}>
{item.title}
{item.name}
</div>
);
})
@@ -54,35 +50,6 @@ function TagDetailsModalContent(props) {
</FieldSet>
}
{
!!delayProfiles.length &&
<FieldSet legend={translate('DelayProfile')}>
{
delayProfiles.map((item) => {
const {
id,
preferredProtocol,
enableUsenet,
enableTorrent,
usenetDelay,
torrentDelay
} = item;
return (
<TagDetailsDelayProfile
key={id}
preferredProtocol={preferredProtocol}
enableUsenet={enableUsenet}
enableTorrent={enableTorrent}
usenetDelay={usenetDelay}
torrentDelay={torrentDelay}
/>
);
})
}
</FieldSet>
}
{
!!notifications.length &&
<FieldSet legend={translate('Connections')}>
@@ -99,44 +66,13 @@ function TagDetailsModalContent(props) {
}
{
!!restrictions.length &&
<FieldSet legend={translate('Restrictions')}>
!!indexerProxies.length &&
<FieldSet legend={translate('Indexer Proxies')}>
{
restrictions.map((item) => {
indexerProxies.map((item) => {
return (
<div
key={item.id}
className={styles.restriction}
>
<div>
{
split(item.required).map((r) => {
return (
<Label
key={r}
kind={kinds.SUCCESS}
>
{r}
</Label>
);
})
}
</div>
<div>
{
split(item.ignored).map((i) => {
return (
<Label
key={i}
kind={kinds.DANGER}
>
{i}
</Label>
);
})
}
</div>
<div key={item.id}>
{item.name}
</div>
);
})
@@ -171,10 +107,9 @@ function TagDetailsModalContent(props) {
TagDetailsModalContent.propTypes = {
label: PropTypes.string.isRequired,
isTagUsed: PropTypes.bool.isRequired,
movies: PropTypes.arrayOf(PropTypes.object).isRequired,
delayProfiles: PropTypes.arrayOf(PropTypes.object).isRequired,
indexers: PropTypes.arrayOf(PropTypes.object).isRequired,
notifications: PropTypes.arrayOf(PropTypes.object).isRequired,
restrictions: PropTypes.arrayOf(PropTypes.object).isRequired,
indexerProxies: PropTypes.arrayOf(PropTypes.object).isRequired,
onModalClose: PropTypes.func.isRequired,
onDeleteTagPress: PropTypes.func.isRequired
};

View File

@@ -1,6 +1,5 @@
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import createAllIndexersSelector from 'Store/Selectors/createAllIndexersSelector';
import TagDetailsModalContent from './TagDetailsModalContent';
function findMatchingItems(ids, items) {
@@ -9,35 +8,15 @@ function findMatchingItems(ids, items) {
});
}
function createUnorderedMatchingMoviesSelector() {
function createMatchingIndexersSelector() {
return createSelector(
(state, { indexerIds }) => indexerIds,
createAllIndexersSelector(),
(state) => state.indexers.items,
findMatchingItems
);
}
function createMatchingMoviesSelector() {
return createSelector(
createUnorderedMatchingMoviesSelector(),
(movies) => {
return movies.sort((movieA, movieB) => {
const sortTitleA = movieA.sortTitle;
const sortTitleB = movieB.sortTitle;
if (sortTitleA > sortTitleB) {
return 1;
} else if (sortTitleA < sortTitleB) {
return -1;
}
return 0;
});
}
);
}
function createMatchingNotificationsSelector() {
function createMatchingIndexerProxiesSelector() {
return createSelector(
(state, { notificationIds }) => notificationIds,
(state) => state.settings.notifications.items,
@@ -45,13 +24,23 @@ function createMatchingNotificationsSelector() {
);
}
function createMatchingNotificationsSelector() {
return createSelector(
(state, { indexerProxyIds }) => indexerProxyIds,
(state) => state.settings.indexerProxies.items,
findMatchingItems
);
}
function createMapStateToProps() {
return createSelector(
createMatchingMoviesSelector(),
createMatchingIndexersSelector(),
createMatchingIndexerProxiesSelector(),
createMatchingNotificationsSelector(),
(movies, notifications) => {
(indexers, indexerProxies, notifications) => {
return {
movies,
indexers,
indexerProxies,
notifications
};
}

View File

@@ -53,11 +53,9 @@ class Tag extends Component {
render() {
const {
label,
delayProfileIds,
notificationIds,
restrictionIds,
importListIds,
movieIds
indexerIds,
indexerProxyIds
} = this.props;
const {
@@ -66,11 +64,9 @@ class Tag extends Component {
} = this.state;
const isTagUsed = !!(
delayProfileIds.length ||
indexerIds.length ||
notificationIds.length ||
restrictionIds.length ||
importListIds.length ||
movieIds.length
indexerProxyIds.length
);
return (
@@ -87,37 +83,23 @@ class Tag extends Component {
isTagUsed &&
<div>
{
!!movieIds.length &&
!!indexerIds.length &&
<div>
{movieIds.length} movies
</div>
}
{
!!delayProfileIds.length &&
<div>
{delayProfileIds.length} delay profile{delayProfileIds.length > 1 && 's'}
{indexerIds.length} {indexerIds.length > 1 ? translate('Indexers') : translate('Indexer')}
</div>
}
{
!!notificationIds.length &&
<div>
{notificationIds.length} connection{notificationIds.length > 1 && 's'}
{notificationIds.length} {notificationIds.length > 1 ? translate('Notifications') : translate('Notification')}
</div>
}
{
!!restrictionIds.length &&
!!indexerProxyIds.length &&
<div>
{restrictionIds.length} restriction{restrictionIds.length > 1 && 's'}
</div>
}
{
!!importListIds.length &&
<div>
{importListIds.length} list{importListIds.length > 1 && 's'}
{indexerProxyIds.length} {indexerProxyIds.length > 1 ? translate('IndexerProxies') : translate('IndexerProxy')}
</div>
}
</div>
@@ -126,18 +108,16 @@ class Tag extends Component {
{
!isTagUsed &&
<div>
No links
{translate('NoLinks')}
</div>
}
<TagDetailsModal
label={label}
isTagUsed={isTagUsed}
movieIds={movieIds}
delayProfileIds={delayProfileIds}
indexerIds={indexerIds}
notificationIds={notificationIds}
restrictionIds={restrictionIds}
importListIds={importListIds}
indexerProxyIds={indexerProxyIds}
isOpen={isDetailsModalOpen}
onModalClose={this.onDetailsModalClose}
onDeleteTagPress={this.onDeleteTagPress}
@@ -160,20 +140,16 @@ class Tag extends Component {
Tag.propTypes = {
id: PropTypes.number.isRequired,
label: PropTypes.string.isRequired,
delayProfileIds: PropTypes.arrayOf(PropTypes.number).isRequired,
notificationIds: PropTypes.arrayOf(PropTypes.number).isRequired,
restrictionIds: PropTypes.arrayOf(PropTypes.number).isRequired,
importListIds: PropTypes.arrayOf(PropTypes.number).isRequired,
movieIds: PropTypes.arrayOf(PropTypes.number).isRequired,
indexerIds: PropTypes.arrayOf(PropTypes.number).isRequired,
indexerProxyIds: PropTypes.arrayOf(PropTypes.number).isRequired,
onConfirmDeleteTag: PropTypes.func.isRequired
};
Tag.defaultProps = {
delayProfileIds: [],
indexerIds: [],
notificationIds: [],
restrictionIds: [],
importListIds: [],
movieIds: []
indexerProxyIds: []
};
export default Tag;

View File

@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { fetchNotifications } from 'Store/Actions/settingsActions';
import { fetchIndexerProxies, fetchNotifications } from 'Store/Actions/settingsActions';
import { fetchTagDetails } from 'Store/Actions/tagActions';
import Tags from './Tags';
@@ -26,7 +26,8 @@ function createMapStateToProps() {
const mapDispatchToProps = {
dispatchFetchTagDetails: fetchTagDetails,
dispatchFetchNotifications: fetchNotifications
dispatchFetchNotifications: fetchNotifications,
dispatchFetchIndexerProxies: fetchIndexerProxies
};
class MetadatasConnector extends Component {
@@ -37,11 +38,13 @@ class MetadatasConnector extends Component {
componentDidMount() {
const {
dispatchFetchTagDetails,
dispatchFetchNotifications
dispatchFetchNotifications,
dispatchFetchIndexerProxies
} = this.props;
dispatchFetchTagDetails();
dispatchFetchNotifications();
dispatchFetchIndexerProxies();
}
//
@@ -58,7 +61,8 @@ class MetadatasConnector extends Component {
MetadatasConnector.propTypes = {
dispatchFetchTagDetails: PropTypes.func.isRequired,
dispatchFetchNotifications: PropTypes.func.isRequired
dispatchFetchNotifications: PropTypes.func.isRequired,
dispatchFetchIndexerProxies: PropTypes.func.isRequired
};
export default connect(createMapStateToProps, mapDispatchToProps)(MetadatasConnector);

View File

@@ -10,7 +10,7 @@ import {
import getSectionState from 'Utilities/State/getSectionState';
import updateSectionState from 'Utilities/State/updateSectionState';
const blacklistedProperties = [
const omittedProperties = [
'section',
'id'
];
@@ -31,7 +31,7 @@ export default function createHandleActions(handlers, defaultState, section) {
if (section === baseSection) {
const newState = Object.assign(getSectionState(state, payloadSection),
_.omit(payload, blacklistedProperties));
_.omit(payload, omittedProperties));
return updateSectionState(state, payloadSection, newState);
}

View File

@@ -0,0 +1,110 @@
import { createAction } from 'redux-actions';
import createFetchHandler from 'Store/Actions/Creators/createFetchHandler';
import createFetchSchemaHandler from 'Store/Actions/Creators/createFetchSchemaHandler';
import createRemoveItemHandler from 'Store/Actions/Creators/createRemoveItemHandler';
import createSaveProviderHandler, { createCancelSaveProviderHandler } from 'Store/Actions/Creators/createSaveProviderHandler';
import createTestProviderHandler, { createCancelTestProviderHandler } from 'Store/Actions/Creators/createTestProviderHandler';
import createSetProviderFieldValueReducer from 'Store/Actions/Creators/Reducers/createSetProviderFieldValueReducer';
import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/createSetSettingValueReducer';
import { createThunk } from 'Store/thunks';
import selectProviderSchema from 'Utilities/State/selectProviderSchema';
//
// Variables
const section = 'settings.indexerProxies';
//
// Actions Types
export const FETCH_INDEXER_PROXYS = 'settings/indexerProxies/fetchIndexerProxies';
export const FETCH_INDEXER_PROXY_SCHEMA = 'settings/indexerProxies/fetchIndexerProxySchema';
export const SELECT_INDEXER_PROXY_SCHEMA = 'settings/indexerProxies/selectIndexerProxySchema';
export const SET_INDEXER_PROXY_VALUE = 'settings/indexerProxies/setIndexerProxyValue';
export const SET_INDEXER_PROXY_FIELD_VALUE = 'settings/indexerProxies/setIndexerProxyFieldValue';
export const SAVE_INDEXER_PROXY = 'settings/indexerProxies/saveIndexerProxy';
export const CANCEL_SAVE_INDEXER_PROXY = 'settings/indexerProxies/cancelSaveIndexerProxy';
export const DELETE_INDEXER_PROXY = 'settings/indexerProxies/deleteIndexerProxy';
export const TEST_INDEXER_PROXY = 'settings/indexerProxies/testIndexerProxy';
export const CANCEL_TEST_INDEXER_PROXY = 'settings/indexerProxies/cancelTestIndexerProxy';
//
// Action Creators
export const fetchIndexerProxies = createThunk(FETCH_INDEXER_PROXYS);
export const fetchIndexerProxySchema = createThunk(FETCH_INDEXER_PROXY_SCHEMA);
export const selectIndexerProxySchema = createAction(SELECT_INDEXER_PROXY_SCHEMA);
export const saveIndexerProxy = createThunk(SAVE_INDEXER_PROXY);
export const cancelSaveIndexerProxy = createThunk(CANCEL_SAVE_INDEXER_PROXY);
export const deleteIndexerProxy = createThunk(DELETE_INDEXER_PROXY);
export const testIndexerProxy = createThunk(TEST_INDEXER_PROXY);
export const cancelTestIndexerProxy = createThunk(CANCEL_TEST_INDEXER_PROXY);
export const setIndexerProxyValue = createAction(SET_INDEXER_PROXY_VALUE, (payload) => {
return {
section,
...payload
};
});
export const setIndexerProxyFieldValue = createAction(SET_INDEXER_PROXY_FIELD_VALUE, (payload) => {
return {
section,
...payload
};
});
//
// Details
export default {
//
// State
defaultState: {
isFetching: false,
isPopulated: false,
error: null,
isSchemaFetching: false,
isSchemaPopulated: false,
schemaError: null,
schema: [],
selectedSchema: {},
isSaving: false,
saveError: null,
isTesting: false,
items: [],
pendingChanges: {}
},
//
// Action Handlers
actionHandlers: {
[FETCH_INDEXER_PROXYS]: createFetchHandler(section, '/indexerProxy'),
[FETCH_INDEXER_PROXY_SCHEMA]: createFetchSchemaHandler(section, '/indexerProxy/schema'),
[SAVE_INDEXER_PROXY]: createSaveProviderHandler(section, '/indexerProxy'),
[CANCEL_SAVE_INDEXER_PROXY]: createCancelSaveProviderHandler(section),
[DELETE_INDEXER_PROXY]: createRemoveItemHandler(section, '/indexerProxy'),
[TEST_INDEXER_PROXY]: createTestProviderHandler(section, '/indexerProxy'),
[CANCEL_TEST_INDEXER_PROXY]: createCancelTestProviderHandler(section)
},
//
// Reducers
reducers: {
[SET_INDEXER_PROXY_VALUE]: createSetSettingValueReducer(section),
[SET_INDEXER_PROXY_FIELD_VALUE]: createSetProviderFieldValueReducer(section),
[SELECT_INDEXER_PROXY_SCHEMA]: (state, { payload }) => {
return selectProviderSchema(state, section, payload, (selectedSchema) => {
return selectedSchema;
});
}
}
};

View File

@@ -7,6 +7,7 @@ import development from './Settings/development';
import downloadClients from './Settings/downloadClients';
import general from './Settings/general';
import indexerCategories from './Settings/indexerCategories';
import indexerProxies from './Settings/indexerProxies';
import languages from './Settings/languages';
import notifications from './Settings/notifications';
import ui from './Settings/ui';
@@ -14,6 +15,7 @@ import ui from './Settings/ui';
export * from './Settings/downloadClients';
export * from './Settings/general';
export * from './Settings/indexerCategories';
export * from './Settings/indexerProxies';
export * from './Settings/languages';
export * from './Settings/notifications';
export * from './Settings/applications';
@@ -35,6 +37,7 @@ export const defaultState = {
downloadClients: downloadClients.defaultState,
general: general.defaultState,
indexerCategories: indexerCategories.defaultState,
indexerProxies: indexerProxies.defaultState,
languages: languages.defaultState,
notifications: notifications.defaultState,
applications: applications.defaultState,
@@ -64,6 +67,7 @@ export const actionHandlers = handleThunks({
...downloadClients.actionHandlers,
...general.actionHandlers,
...indexerCategories.actionHandlers,
...indexerProxies.actionHandlers,
...languages.actionHandlers,
...notifications.actionHandlers,
...applications.actionHandlers,
@@ -84,6 +88,7 @@ export const reducers = createHandleActions({
...downloadClients.reducers,
...general.reducers,
...indexerCategories.reducers,
...indexerProxies.reducers,
...languages.reducers,
...notifications.reducers,
...applications.reducers,

View File

@@ -87,6 +87,13 @@ export const defaultState = {
isVisible: true,
isModifiable: false
},
{
name: 'time',
label: translate('Time'),
isSortable: true,
isVisible: true,
isModifiable: false
},
{
name: 'logger',
label: translate('Component'),
@@ -100,13 +107,6 @@ export const defaultState = {
isVisible: true,
isModifiable: false
},
{
name: 'time',
label: translate('Time'),
isSortable: true,
isVisible: true,
isModifiable: false
},
{
name: 'actions',
columnLabel: translate('Actions'),

View File

@@ -58,9 +58,9 @@ class LogsTableRow extends Component {
render() {
const {
level,
time,
logger,
message,
time,
exception,
columns
} = this.props;
@@ -96,6 +96,15 @@ class LogsTableRow extends Component {
);
}
if (name === 'time') {
return (
<RelativeDateCellConnector
key={name}
date={time}
/>
);
}
if (name === 'logger') {
return (
<TableRowCell key={name}>
@@ -112,15 +121,6 @@ class LogsTableRow extends Component {
);
}
if (name === 'time') {
return (
<RelativeDateCellConnector
key={name}
date={time}
/>
);
}
if (name === 'actions') {
return (
<TableRowCell
@@ -148,9 +148,9 @@ class LogsTableRow extends Component {
LogsTableRow.propTypes = {
level: PropTypes.string.isRequired,
time: PropTypes.string.isRequired,
logger: PropTypes.string.isRequired,
message: PropTypes.string.isRequired,
time: PropTypes.string.isRequired,
exception: PropTypes.string,
columns: PropTypes.arrayOf(PropTypes.object).isRequired
};

View File

@@ -7,18 +7,6 @@ function isRelative(ajaxOptions) {
return !absUrlRegex.test(ajaxOptions.url);
}
function moveBodyToQuery(ajaxOptions) {
if (ajaxOptions.data && ajaxOptions.type === 'DELETE') {
if (ajaxOptions.url.contains('?')) {
ajaxOptions.url += '&';
} else {
ajaxOptions.url += '?';
}
ajaxOptions.url += $.param(ajaxOptions.data);
delete ajaxOptions.data;
}
}
function addRootUrl(ajaxOptions) {
ajaxOptions.url = apiRoot + ajaxOptions.url;
}
@@ -32,7 +20,7 @@ function addContentType(ajaxOptions) {
if (
ajaxOptions.contentType == null &&
ajaxOptions.dataType === 'json' &&
(ajaxOptions.method === 'PUT' || ajaxOptions.method === 'POST')) {
(ajaxOptions.method === 'PUT' || ajaxOptions.method === 'POST' || ajaxOptions.method === 'DELETE')) {
ajaxOptions.contentType = 'application/json';
}
}
@@ -52,7 +40,6 @@ export default function createAjaxRequest(originalAjaxOptions) {
const ajaxOptions = { dataType: 'json', ...originalAjaxOptions };
if (isRelative(ajaxOptions)) {
moveBodyToQuery(ajaxOptions);
addRootUrl(ajaxOptions);
addApiKey(ajaxOptions);
addContentType(ajaxOptions);

View File

@@ -30,7 +30,7 @@
"@fortawesome/free-regular-svg-icons": "5.15.3",
"@fortawesome/free-solid-svg-icons": "5.15.3",
"@fortawesome/react-fontawesome": "0.1.14",
"@microsoft/signalr": "5.0.8",
"@microsoft/signalr": "5.0.9",
"@sentry/browser": "6.10.0",
"@sentry/integrations": "6.10.0",
"chart.js": "3.2.0",

View File

@@ -94,7 +94,7 @@
<!-- Standard testing packages -->
<ItemGroup Condition="'$(TestProject)'=='true'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="NUnit" Version="3.13.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="NunitXml.TestLogger" Version="3.0.97" />

View File

@@ -3,7 +3,6 @@
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="FluentMigrator" value="https://pkgs.dev.azure.com/fluentmigrator/fluentmigrator/_packaging/fluentmigrator/nuget/v3/index.json" />
<add key="dotnet-bsd-crossbuild" value="https://pkgs.dev.azure.com/Servarr/Servarr/_packaging/dotnet-bsd-crossbuild/nuget/v3/index.json" />
<add key="Mono.Posix.NETStandard" value="https://pkgs.dev.azure.com/Servarr/Servarr/_packaging/Mono.Posix.NETStandard/nuget/v3/index.json" />
<add key="SQLite" value="https://pkgs.dev.azure.com/Servarr/Servarr/_packaging/SQLite/nuget/v3/index.json" />

View File

@@ -0,0 +1,24 @@
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Common.Http;
using NzbDrone.Test.Common;
namespace NzbDrone.Common.Test.Http
{
[TestFixture]
public class UserAgentParserFixture : TestBase
{
// Ref *Arr `_userAgent = $"{BuildInfo.AppName}/{BuildInfo.Version} ({osName} {osVersion})";`
// Ref Mylar `Mylar3/' +str(hash) +'(' +vers +') +http://www.github.com/mylar3/mylar3/`
[TestCase("Mylar3/ 3ee23rh23irqfq (13123123) http://www.github.com/mylar3/mylar3/", "Mylar3")]
[TestCase("Lidarr/1.0.0.2300 (ubuntu 20.04)", "Lidarr")]
[TestCase("Radarr/1.0.0.2300 (ubuntu 20.04)", "Radarr")]
[TestCase("Readarr/1.0.0.2300 (ubuntu 20.04)", "Readarr")]
[TestCase("Sonarr/3.0.6.9999 (ubuntu 20.04)", "Sonarr")]
[TestCase("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36", "Other")]
public void should_parse_user_agent(string userAgent, string parsedAgent)
{
UserAgentParser.ParseSource(userAgent).Should().Be(parsedAgent);
}
}
}

View File

@@ -22,6 +22,11 @@ namespace NzbDrone.Common.Test.InstrumentationTests
[TestCase(@" var authkey = ""2b51db35e1910123321025a12b9933d2"";")]
[TestCase(@"https://hd-space.org/index.php?page=login: uid=mySecret&pwd=mySecret")]
[TestCase(@"https://beyond-hd.me/api/torrents/2b51db35e1912ffc138825a12b9933d2")]
[TestCase(@"Req: [POST] https://www3.yggtorrent.nz/user/login: id=mySecret&pass=mySecret&ci_csrf_token=2b51db35e1912ffc138825a12b9933d2")]
// avistaz response
[TestCase(@"""download"":""https:\/\/avistaz.to\/rss\/download\/2b51db35e1910123321025a12b9933d2\/tb51db35e1910123321025a12b9933d2.torrent"",")]
[TestCase(@",""info_hash"":""2b51db35e1910123321025a12b9933d2"",")]
// NzbGet
[TestCase(@"{ ""Name"" : ""ControlUsername"", ""Value"" : ""mySecret"" }, { ""Name"" : ""ControlPassword"", ""Value"" : ""mySecret"" }, ")]
@@ -102,5 +107,13 @@ namespace NzbDrone.Common.Test.InstrumentationTests
cleansedMessage.Should().Be(message);
}
[TestCase(@"https://www.torrentleech.org/torrents/browse/list/imdbID/tt8005374/categories/29,2,26,27,32,44,7,34,35")]
public void should_not_clean_url(string message)
{
var cleansedMessage = CleanseLogMessage.Cleanse(message);
cleansedMessage.Should().Be(message);
}
}
}

View File

@@ -160,5 +160,16 @@ namespace NzbDrone.Common.Extensions
{
return new HashSet<T>(source, comparer);
}
public static T FirstIfSingleOrDefault<T>(this IEnumerable<T> source, T replace = default)
{
if (source is ICollection<T> collection)
{
return collection.Count == 1 ? collection.First() : replace;
}
var test = source.Take(2).ToList();
return test.Count == 1 ? test[0] : replace;
}
}
}

View File

@@ -59,7 +59,7 @@ namespace NzbDrone.Common.Http.Dispatchers
webRequest.Timeout = (int)Math.Ceiling(request.RequestTimeout.TotalMilliseconds);
}
webRequest.Proxy = GetProxy(request.Url);
webRequest.Proxy = request.Proxy ?? GetProxy(request.Url);
if (request.Headers != null)
{

View File

@@ -61,7 +61,7 @@ namespace NzbDrone.Common.Http
_cookieContainerCache = cacheManager.GetCache<CookieContainer>(typeof(HttpClient));
}
public async Task<HttpResponse> ExecuteAsync(HttpRequest request)
public virtual async Task<HttpResponse> ExecuteAsync(HttpRequest request)
{
var cookieContainer = InitializeRequestCookies(request);

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Extensions;
@@ -31,6 +32,7 @@ namespace NzbDrone.Common.Http
public HttpMethod Method { get; set; }
public HttpHeader Headers { get; set; }
public Encoding Encoding { get; set; }
public IWebProxy Proxy { get; set; }
public byte[] ContentData { get; set; }
public string ContentSummary { get; set; }
public bool SuppressHttpError { get; set; }
@@ -87,6 +89,19 @@ namespace NzbDrone.Common.Http
}
}
public string GetContent()
{
if (Encoding != null)
{
return Encoding.GetString(ContentData);
}
else
{
var encoding = HttpHeader.GetEncodingFromContentType(Headers.ContentType);
return encoding.GetString(ContentData);
}
}
public void AddBasicAuthentication(string username, string password)
{
var authInfo = Convert.ToBase64String(Encoding.GetEncoding("ISO-8859-1").GetBytes($"{username}:{password}"));

View File

@@ -9,7 +9,7 @@ namespace NzbDrone.Common.Http
{
public static class UserAgentParser
{
private static readonly Regex AppSourceRegex = new Regex(@"(?<agent>.*)\/.*(\(.*\))?",
private static readonly Regex AppSourceRegex = new Regex(@"(?<agent>[a-z0-9]*)\/.*(?:\(.*\))?",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
public static string SimplifyUserAgent(string userAgent)

View File

@@ -11,10 +11,10 @@ namespace NzbDrone.Common.Instrumentation
private static readonly Regex[] CleansingRules = new[]
{
// Url
new Regex(@"(?<=\?|&|: |;)(apikey|token|passkey|auth|authkey|user|uid|api|[a-z_]*apikey|account|passwd|pwd)=(?<secret>[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
new Regex(@"(?<=\?|&| )[^=]*?(_?(?<!use)token|username|passwo?rd)=(?<secret>[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
new Regex(@"torrentleech\.org/(?!rss)(?<secret>[0-9a-z]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
new Regex(@"torrentleech\.org/rss/download/[0-9]+/(?<secret>[0-9a-z]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
new Regex(@"(?<=[?&: ;])(apikey|token|pass(?:key|wd)?|auth|authkey|user|u?id|api|[a-z_]*apikey|account|pwd)=(?<secret>[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
new Regex(@"(?<=[?& ])[^=]*?(_?(?<!use)token|username|passwo?rd)=(?<secret>[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
new Regex(@"rss\.torrentleech\.org/(?!rss)(?<secret>[0-9a-z]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
new Regex(@"rss\.torrentleech\.org/rss/download/[0-9]+/(?<secret>[0-9a-z]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
new Regex(@"iptorrents\.com/[/a-z0-9?&;]*?(?:[?&;](u|tp)=(?<secret>[^&=;]+?))+(?= |;|&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
new Regex(@"/fetch/[a-z0-9]{32}/(?<secret>[a-z0-9]{32})", RegexOptions.Compiled),
new Regex(@"getnzb.*?(?<=\?|&)(r)=(?<secret>[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
@@ -45,7 +45,11 @@ namespace NzbDrone.Common.Instrumentation
new Regex(@"(?<=\?|&)(authkey|torrent_pass)=(?<secret>[^&=]+?)(?=""|&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
// Plex
new Regex(@"(?<=\?|&)(X-Plex-Client-Identifier|X-Plex-Token)=(?<secret>[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase)
new Regex(@"(?<=\?|&)(X-Plex-Client-Identifier|X-Plex-Token)=(?<secret>[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
//avistaz
new Regex(@"avistaz\.[a-z]{2,3}\\\/rss\\\/download\\\/(?<secret>[^&=]+?)\\\/(?<secret>[^&=]+?)\.torrent", RegexOptions.Compiled | RegexOptions.IgnoreCase),
new Regex(@",""info_hash"":""(?<secret>[^&=]+?)"",", RegexOptions.Compiled | RegexOptions.IgnoreCase),
};
private static readonly Regex CleanseRemoteIPRegex = new Regex(@"(?:Auth-\w+(?<!Failure|Unauthorized) ip|from) (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})", RegexOptions.Compiled);

View File

@@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNet4.SocksProxy" Version="1.4.0.1" />
<PackageReference Include="DryIoc.dll" Version="4.7.6" />
<PackageReference Include="DryIoc.dll" Version="4.8.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2" />
<PackageReference Include="NLog.Extensions.Logging" Version="1.7.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />

View File

@@ -19,6 +19,10 @@ namespace NzbDrone.Core.Test.HealthCheck
Mocker.SetConstant<IEnumerable<IProvideHealthCheck>>(new[] { _healthCheck });
Mocker.SetConstant<ICacheManager>(Mocker.Resolve<CacheManager>());
Mocker.GetMock<IServerSideNotificationService>()
.Setup(v => v.GetServerChecks())
.Returns(new List<Core.HealthCheck.HealthCheck>());
}
[Test]

View File

@@ -2,6 +2,8 @@ using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Housekeeping.Housekeepers;
using NzbDrone.Core.IndexerProxies;
using NzbDrone.Core.IndexerProxies.Http;
using NzbDrone.Core.Tags;
using NzbDrone.Core.Test.Framework;
@@ -22,5 +24,30 @@ namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
Subject.Clean();
AllStoredModels.Should().BeEmpty();
}
[Test]
public void should_not_delete_used_tags()
{
var tags = Builder<Tag>
.CreateListOfSize(2)
.All()
.With(x => x.Id = 0)
.BuildList();
Db.InsertMany(tags);
var settings = Builder<HttpSettings>.CreateNew().Build();
var restrictions = Builder<IndexerProxyDefinition>.CreateListOfSize(2)
.All()
.With(x => x.Id = 0)
.With(x => x.Settings = settings)
.With(v => v.Tags.Add(tags[0].Id))
.BuildList();
Db.InsertMany(restrictions);
Subject.Clean();
AllStoredModels.Should().HaveCount(1);
}
}
}

View File

@@ -33,9 +33,9 @@ namespace NzbDrone.Core.Test.IndexerTests.AvistazTests
{
var recentFeed = ReadAllText(@"Files/Indexers/PrivateHD/recentfeed.json");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.ExecuteAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => Task.FromResult(new HttpResponse(r, new HttpHeader { { "Content-Type", "application/json" } }, new CookieCollection(), recentFeed)));
Mocker.GetMock<IIndexerHttpClient>()
.Setup(o => o.ExecuteProxiedAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET), Subject.Definition))
.Returns<HttpRequest, IndexerDefinition>((r, d) => Task.FromResult(new HttpResponse(r, new HttpHeader { { "Content-Type", "application/json" } }, new CookieCollection(), recentFeed)));
var releases = (await Subject.Fetch(new MovieSearchCriteria { Categories = new int[] { 2000 } })).Releases;

View File

@@ -32,9 +32,9 @@ namespace NzbDrone.Core.Test.IndexerTests.FileListTests
{
var recentFeed = ReadAllText(@"Files/Indexers/FileList/recentfeed.json");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.ExecuteAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), recentFeed)));
Mocker.GetMock<IIndexerHttpClient>()
.Setup(o => o.ExecuteProxiedAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET), Subject.Definition))
.Returns<HttpRequest, IndexerDefinition>((r, d) => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), recentFeed)));
var releases = (await Subject.Fetch(new MovieSearchCriteria { Categories = new int[] { 2000 } })).Releases;

View File

@@ -44,9 +44,9 @@ namespace NzbDrone.Core.Test.IndexerTests.HDBitsTests
{
var responseJson = ReadAllText(fileName);
Mocker.GetMock<IHttpClient>()
.Setup(o => o.ExecuteAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.POST)))
.Returns<HttpRequest>(r => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), responseJson)));
Mocker.GetMock<IIndexerHttpClient>()
.Setup(o => o.ExecuteProxiedAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.POST), Subject.Definition))
.Returns<HttpRequest, IndexerDefinition>((r, d) => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), responseJson)));
var torrents = (await Subject.Fetch(_movieSearchCriteria)).Releases;
@@ -73,9 +73,9 @@ namespace NzbDrone.Core.Test.IndexerTests.HDBitsTests
{
var responseJson = new { status = 5, message = "Invalid authentication credentials" }.ToJson();
Mocker.GetMock<IHttpClient>()
.Setup(v => v.ExecuteAsync(It.IsAny<HttpRequest>()))
.Returns<HttpRequest>(r => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), Encoding.UTF8.GetBytes(responseJson))));
Mocker.GetMock<IIndexerHttpClient>()
.Setup(o => o.ExecuteProxiedAsync(It.IsAny<HttpRequest>(), Subject.Definition))
.Returns<HttpRequest, IndexerDefinition>((r, d) => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), Encoding.UTF8.GetBytes(responseJson))));
var torrents = (await Subject.Fetch(_movieSearchCriteria)).Releases;

View File

@@ -1,10 +1,12 @@
using System;
using System.Net;
using System.Threading.Tasks;
using System.Xml;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Http;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers.Newznab;
using NzbDrone.Core.Test.Framework;
@@ -14,6 +16,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
public class NewznabCapabilitiesProviderFixture : CoreTest<NewznabCapabilitiesProvider>
{
private NewznabSettings _settings;
private IndexerDefinition _definition;
private string _caps;
[SetUp]
@@ -24,14 +27,24 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
BaseUrl = "http://indxer.local"
};
_definition = new IndexerDefinition()
{
Id = 5,
Name = "Newznab",
Settings = new NewznabSettings()
{
BaseUrl = "http://indexer.local/"
}
};
_caps = ReadAllText("Files/Indexers/Newznab/newznab_caps.xml");
}
private void GivenCapsResponse(string caps)
{
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Get(It.IsAny<HttpRequest>()))
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), new CookieCollection(), caps));
Mocker.GetMock<IIndexerHttpClient>()
.Setup(o => o.ExecuteProxied(It.IsAny<HttpRequest>(), It.IsAny<IndexerDefinition>()))
.Returns<HttpRequest, IndexerDefinition>((r, d) => new HttpResponse(r, new HttpHeader(), new CookieCollection(), caps));
}
[Test]
@@ -39,11 +52,11 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
{
GivenCapsResponse(_caps);
Subject.GetCapabilities(_settings);
Subject.GetCapabilities(_settings);
Subject.GetCapabilities(_settings, _definition);
Subject.GetCapabilities(_settings, _definition);
Mocker.GetMock<IHttpClient>()
.Verify(o => o.Get(It.IsAny<HttpRequest>()), Times.Once());
Mocker.GetMock<IIndexerHttpClient>()
.Verify(o => o.ExecuteProxied(It.IsAny<HttpRequest>(), It.IsAny<IndexerDefinition>()), Times.Once());
}
[Test]
@@ -51,7 +64,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
{
GivenCapsResponse(_caps);
var caps = Subject.GetCapabilities(_settings);
var caps = Subject.GetCapabilities(_settings, _definition);
caps.LimitsDefault.Value.Should().Be(25);
caps.LimitsMax.Value.Should().Be(60);
@@ -62,7 +75,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
{
GivenCapsResponse(_caps.Replace("<limits", "<abclimits"));
var caps = Subject.GetCapabilities(_settings);
var caps = Subject.GetCapabilities(_settings, _definition);
caps.LimitsDefault.Value.Should().Be(100);
caps.LimitsMax.Value.Should().Be(100);
@@ -71,11 +84,11 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
[Test]
public void should_throw_if_failed_to_get()
{
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Get(It.IsAny<HttpRequest>()))
Mocker.GetMock<IIndexerHttpClient>()
.Setup(o => o.ExecuteProxied(It.IsAny<HttpRequest>(), It.IsAny<IndexerDefinition>()))
.Throws<Exception>();
Assert.Throws<Exception>(() => Subject.GetCapabilities(_settings));
Assert.Throws<Exception>(() => Subject.GetCapabilities(_settings, _definition));
}
[Test]
@@ -83,7 +96,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
{
GivenCapsResponse(_caps.Replace("<limits", "<>"));
Assert.Throws<XmlException>(() => Subject.GetCapabilities(_settings));
Assert.Throws<XmlException>(() => Subject.GetCapabilities(_settings, _definition));
}
[Test]
@@ -91,7 +104,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
{
GivenCapsResponse(_caps.Replace("5030", "asdf"));
var result = Subject.GetCapabilities(_settings);
var result = Subject.GetCapabilities(_settings, _definition);
result.Should().NotBeNull();
}

View File

@@ -33,7 +33,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
_caps = new IndexerCapabilities();
Mocker.GetMock<INewznabCapabilitiesProvider>()
.Setup(v => v.GetCapabilities(It.IsAny<NewznabSettings>()))
.Setup(v => v.GetCapabilities(It.IsAny<NewznabSettings>(), It.IsAny<IndexerDefinition>()))
.Returns(_caps);
}
@@ -42,9 +42,9 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
{
var recentFeed = ReadAllText(@"Files/Indexers/Newznab/newznab_nzb_su.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.ExecuteAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), recentFeed)));
Mocker.GetMock<IIndexerHttpClient>()
.Setup(o => o.ExecuteProxiedAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET), Subject.Definition))
.Returns<HttpRequest, IndexerDefinition>((r, d) => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), recentFeed)));
var releases = (await Subject.Fetch(new MovieSearchCriteria { Categories = new int[] { 2000 }, Limit = 100, Offset = 0 })).Releases;

View File

@@ -13,6 +13,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
public class NewznabRequestGeneratorFixture : CoreTest<NewznabRequestGenerator>
{
private MovieSearchCriteria _movieSearchCriteria;
private TvSearchCriteria _tvSearchCriteria;
private IndexerCapabilities _capabilities;
[SetUp]
@@ -30,10 +31,17 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
Categories = new int[] { 2000 }
};
_tvSearchCriteria = new TvSearchCriteria
{
SearchTerm = "Star Wars",
Categories = new int[] { 5000 },
Season = 0
};
_capabilities = new IndexerCapabilities();
Mocker.GetMock<INewznabCapabilitiesProvider>()
.Setup(v => v.GetCapabilities(It.IsAny<NewznabSettings>()))
.Setup(v => v.GetCapabilities(It.IsAny<NewznabSettings>(), It.IsAny<IndexerDefinition>()))
.Returns(_capabilities);
}
@@ -178,5 +186,18 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
pageTier2.Url.Query.Should().NotContain("imdbid=0076759");
pageTier2.Url.Query.Should().Contain("q=");
}
[Test]
public void should_pad_seasons_for_tv_search()
{
_capabilities.TvSearchParams = new List<TvSearchParam> { TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep };
var results = Subject.GetSearchRequests(_tvSearchCriteria);
results.Tiers.Should().Be(1);
var pageTier = results.GetTier(0).First().First();
pageTier.Url.Query.Should().Contain("season=00");
}
}
}

View File

@@ -36,13 +36,13 @@ namespace NzbDrone.Core.Test.IndexerTests.PTPTests
Json.Serialize(authResponse, authStream);
var responseJson = ReadAllText(fileName);
Mocker.GetMock<IHttpClient>()
.Setup(o => o.ExecuteAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.POST)))
.Returns<HttpRequest>(r => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), authStream.ToString())));
Mocker.GetMock<IIndexerHttpClient>()
.Setup(o => o.ExecuteProxiedAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.POST), Subject.Definition))
.Returns<HttpRequest, IndexerDefinition>((r, d) => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), authStream.ToString())));
Mocker.GetMock<IHttpClient>()
.Setup(o => o.ExecuteAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => Task.FromResult(new HttpResponse(r, new HttpHeader { ContentType = HttpAccept.Json.Value }, new CookieCollection(), responseJson)));
Mocker.GetMock<IIndexerHttpClient>()
.Setup(o => o.ExecuteProxiedAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET), Subject.Definition))
.Returns<HttpRequest, IndexerDefinition>((r, d) => Task.FromResult(new HttpResponse(r, new HttpHeader { ContentType = HttpAccept.Json.Value }, new CookieCollection(), responseJson)));
var torrents = (await Subject.Fetch(new MovieSearchCriteria())).Releases;

View File

@@ -37,9 +37,9 @@ namespace NzbDrone.Core.Test.IndexerTests.RarbgTests
{
var recentFeed = ReadAllText(@"Files/Indexers/Rarbg/RecentFeed_v2.json");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.ExecuteAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), recentFeed)));
Mocker.GetMock<IIndexerHttpClient>()
.Setup(o => o.ExecuteProxiedAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET), Subject.Definition))
.Returns<HttpRequest, IndexerDefinition>((r, d) => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), recentFeed)));
var releases = (await Subject.Fetch(new MovieSearchCriteria { Categories = new int[] { 2000 } })).Releases;
@@ -64,9 +64,9 @@ namespace NzbDrone.Core.Test.IndexerTests.RarbgTests
[Test]
public async Task should_parse_error_20_as_empty_results()
{
Mocker.GetMock<IHttpClient>()
.Setup(o => o.ExecuteAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), "{ error_code: 20, error: \"some message\" }")));
Mocker.GetMock<IIndexerHttpClient>()
.Setup(o => o.ExecuteProxiedAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET), Subject.Definition))
.Returns<HttpRequest, IndexerDefinition>((r, d) => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), "{ error_code: 20, error: \"some message\" }")));
var releases = (await Subject.Fetch(new MovieSearchCriteria { Categories = new int[] { 2000 } })).Releases;
@@ -76,9 +76,9 @@ namespace NzbDrone.Core.Test.IndexerTests.RarbgTests
[Test]
public async Task should_warn_on_unknown_error()
{
Mocker.GetMock<IHttpClient>()
.Setup(o => o.ExecuteAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), "{ error_code: 25, error: \"some message\" }")));
Mocker.GetMock<IIndexerHttpClient>()
.Setup(o => o.ExecuteProxiedAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET), Subject.Definition))
.Returns<HttpRequest, IndexerDefinition>((r, d) => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), "{ error_code: 25, error: \"some message\" }")));
var releases = (await Subject.Fetch(new MovieSearchCriteria { Categories = new int[] { 2000 } })).Releases;

View File

@@ -20,7 +20,7 @@ namespace NzbDrone.Core.Test.IndexerTests
public int _supportedPageSize;
public override int PageSize => _supportedPageSize;
public TestIndexer(IHttpClient httpClient, IEventAggregator eventAggregator, IIndexerStatusService indexerStatusService, IConfigService configService, IValidateNzbs nzbValidationService, Logger logger)
public TestIndexer(IIndexerHttpClient httpClient, IEventAggregator eventAggregator, IIndexerStatusService indexerStatusService, IConfigService configService, IValidateNzbs nzbValidationService, Logger logger)
: base(httpClient, eventAggregator, indexerStatusService, configService, nzbValidationService, logger)
{
}

View File

@@ -34,7 +34,7 @@ namespace NzbDrone.Core.Test.IndexerTests.TorznabTests
_caps = new IndexerCapabilities();
Mocker.GetMock<INewznabCapabilitiesProvider>()
.Setup(v => v.GetCapabilities(It.IsAny<NewznabSettings>()))
.Setup(v => v.GetCapabilities(It.IsAny<NewznabSettings>(), It.IsAny<IndexerDefinition>()))
.Returns(_caps);
}
@@ -43,9 +43,9 @@ namespace NzbDrone.Core.Test.IndexerTests.TorznabTests
{
var recentFeed = ReadAllText(@"Files/Indexers/Torznab/torznab_hdaccess_net.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.ExecuteAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), recentFeed)));
Mocker.GetMock<IIndexerHttpClient>()
.Setup(o => o.ExecuteProxiedAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET), Subject.Definition))
.Returns<HttpRequest, IndexerDefinition>((r, d) => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), recentFeed)));
var releases = (await Subject.Fetch(new MovieSearchCriteria())).Releases;
@@ -72,9 +72,9 @@ namespace NzbDrone.Core.Test.IndexerTests.TorznabTests
{
var recentFeed = ReadAllText(@"Files/Indexers/Torznab/torznab_tpb.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.ExecuteAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), recentFeed)));
Mocker.GetMock<IIndexerHttpClient>()
.Setup(o => o.ExecuteProxiedAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET), Subject.Definition))
.Returns<HttpRequest, IndexerDefinition>((r, d) => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), recentFeed)));
var releases = (await Subject.Fetch(new MovieSearchCriteria())).Releases;
@@ -102,9 +102,9 @@ namespace NzbDrone.Core.Test.IndexerTests.TorznabTests
{
var recentFeed = ReadAllText(@"Files/Indexers/Torznab/torznab_animetosho.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.ExecuteAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), recentFeed)));
Mocker.GetMock<IIndexerHttpClient>()
.Setup(o => o.ExecuteProxiedAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET), Subject.Definition))
.Returns<HttpRequest, IndexerDefinition>((r, d) => Task.FromResult(new HttpResponse(r, new HttpHeader(), new CookieCollection(), recentFeed)));
var releases = (await Subject.Fetch(new MovieSearchCriteria())).Releases;

View File

@@ -0,0 +1,24 @@
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.ParserTests
{
[TestFixture]
public class ParseUtilFixture : CoreTest
{
[TestCase("1023.4 KB", 1047961)]
[TestCase("1023.4 MB", 1073112704)]
[TestCase("1,023.4 MB", 1073112704)]
[TestCase("1.023,4 MB", 1073112704)]
[TestCase("1 023,4 MB", 1073112704)]
[TestCase("1.023.4 MB", 1073112704)]
[TestCase("1023.4 GB", 1098867408896)]
[TestCase("1023.4 TB", 1125240226709504)]
public void should_parse_size(string stringSize, long size)
{
ParseUtil.GetBytes(stringSize).Should().Be(size);
}
}
}

View File

@@ -3,7 +3,7 @@
<TargetFrameworks>net5.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="2.0.78" />
<PackageReference Include="Dapper" Version="2.0.90" />
<PackageReference Include="NBuilder" Version="6.1.0" />
<PackageReference Include="System.Data.SQLite.Core.Servarr" Version="1.0.113.0-0" />
<PackageReference Include="YamlDotNet" Version="11.2.1" />

View File

@@ -6,5 +6,6 @@ namespace NzbDrone.Core.Annotations
public string Name { get; set; }
public int Order { get; set; }
public string Hint { get; set; }
public int? ParentValue { get; set; }
}
}

View File

@@ -7,5 +7,6 @@ namespace NzbDrone.Core.Applications
public int IndexerId { get; set; }
public int AppId { get; set; }
public int RemoteIndexerId { get; set; }
public string RemoteIndexerName { get; set; }
}
}

View File

@@ -8,6 +8,7 @@ namespace NzbDrone.Core.Applications
{
List<AppIndexerMap> GetMappingsForApp(int appId);
AppIndexerMap Insert(AppIndexerMap appIndexerMap);
AppIndexerMap Update(AppIndexerMap appIndexerMap);
void Delete(int mappingId);
void DeleteAllForApp(int appId);
}
@@ -41,6 +42,11 @@ namespace NzbDrone.Core.Applications
return _appIndexerMapRepository.Insert(appIndexerMap);
}
public AppIndexerMap Update(AppIndexerMap appIndexerMap)
{
return _appIndexerMapRepository.Update(appIndexerMap);
}
public void Handle(ProviderDeletedEvent<IApplication> message)
{
_appIndexerMapRepository.DeleteAllForApp(message.ProviderId);

View File

@@ -14,7 +14,7 @@ namespace NzbDrone.Core.Applications
protected readonly IAppIndexerMapService _appIndexerMapService;
protected readonly Logger _logger;
protected static readonly Regex AppIndexerRegex = new Regex(@"\/(?<indexer>\d.)\/",
protected static readonly Regex AppIndexerRegex = new Regex(@"\/(?<indexer>\d{1,3})(?:\/(?:api)?\/?)?$",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
public abstract string Name { get; }
@@ -58,7 +58,7 @@ namespace NzbDrone.Core.Applications
public abstract void AddIndexer(IndexerDefinition indexer);
public abstract void UpdateIndexer(IndexerDefinition indexer);
public abstract void RemoveIndexer(int indexerId);
public abstract Dictionary<int, int> GetIndexerMappings();
public abstract List<AppIndexerMap> GetIndexerMappings();
public virtual object RequestAction(string action, IDictionary<string, string> query)
{

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Net;
using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration.Events;
using NzbDrone.Core.Indexers;
@@ -110,9 +111,6 @@ namespace NzbDrone.Core.Applications
{
var indexerMappings = _appIndexerMapService.GetMappingsForApp(app.Definition.Id);
//Remote-Local mappings currently stored by Prowlarr
var prowlarrMappings = indexerMappings.ToDictionary(i => i.RemoteIndexerId, i => i.IndexerId);
//Get Dictionary of Remote Indexers point to Prowlarr and what they are mapped to
var remoteMappings = ExecuteAction(a => a.GetIndexerMappings(), app);
@@ -124,9 +122,16 @@ namespace NzbDrone.Core.Applications
//Add mappings if not already in db, these were setup manually in the app or orphaned by a table wipe
foreach (var mapping in remoteMappings)
{
if (!prowlarrMappings.ContainsKey(mapping.Key))
if (!indexerMappings.Any(m => (m.RemoteIndexerId > 0 && m.RemoteIndexerId == mapping.RemoteIndexerId) || (m.RemoteIndexerName.IsNotNullOrWhiteSpace() && m.RemoteIndexerName == mapping.RemoteIndexerName)))
{
var addMapping = new AppIndexerMap { AppId = app.Definition.Id, RemoteIndexerId = mapping.Key, IndexerId = mapping.Value };
var addMapping = new AppIndexerMap
{
AppId = app.Definition.Id,
RemoteIndexerId = mapping.RemoteIndexerId,
RemoteIndexerName = mapping.RemoteIndexerName,
IndexerId = mapping.IndexerId
};
_appIndexerMapService.Insert(addMapping);
indexerMappings.Add(addMapping);
}
@@ -154,9 +159,11 @@ namespace NzbDrone.Core.Applications
if (removeRemote)
{
var allIndexers = _indexerFactory.All();
foreach (var mapping in indexerMappings)
{
if (!indexers.Any(x => x.Id == mapping.IndexerId))
if (!allIndexers.Any(x => x.Id == mapping.IndexerId))
{
_logger.Info("Indexer with the ID {0} was found within {1} but is no longer defined within Prowlarr, this is being removed.", mapping.IndexerId, app.Name);
ExecuteAction(a => a.RemoveIndexer(mapping.IndexerId), app);

View File

@@ -9,6 +9,6 @@ namespace NzbDrone.Core.Applications
void AddIndexer(IndexerDefinition indexer);
void UpdateIndexer(IndexerDefinition indexer);
void RemoveIndexer(int indexerId);
Dictionary<int, int> GetIndexerMappings();
List<AppIndexerMap> GetIndexerMappings();
}
}

View File

@@ -40,7 +40,10 @@ namespace NzbDrone.Core.Applications.Lidarr
Capabilities = new IndexerCapabilities()
};
testIndexer.Capabilities.Categories.AddCategoryMapping(1, NewznabStandardCategory.Audio);
foreach (var cat in NewznabStandardCategory.AllCats)
{
testIndexer.Capabilities.Categories.AddCategoryMapping(1, cat);
}
try
{
@@ -55,12 +58,12 @@ namespace NzbDrone.Core.Applications.Lidarr
return new ValidationResult(failures);
}
public override Dictionary<int, int> GetIndexerMappings()
public override List<AppIndexerMap> GetIndexerMappings()
{
var indexers = _lidarrV1Proxy.GetIndexers(Settings)
.Where(i => i.Implementation == "Newznab" || i.Implementation == "Torznab");
var mappings = new Dictionary<int, int>();
var mappings = new List<AppIndexerMap>();
foreach (var indexer in indexers)
{
@@ -71,7 +74,7 @@ namespace NzbDrone.Core.Applications.Lidarr
if (match.Groups["indexer"].Success && int.TryParse(match.Groups["indexer"].Value, out var indexerId))
{
//Add parsed mapping if it's mapped to a Indexer in this Prowlarr instance
mappings.Add(indexer.Id, indexerId);
mappings.Add(new AppIndexerMap { RemoteIndexerId = indexer.Id, IndexerId = indexerId });
}
}
}

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using FluentValidation;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Applications.Lidarr
@@ -26,8 +27,6 @@ namespace NzbDrone.Core.Applications.Lidarr
SyncCategories = new[] { 3000, 3010, 3030, 3040, 3050, 3060 };
}
public IEnumerable<int> SyncCategories { get; set; }
[FieldDefinition(0, Label = "Prowlarr Server", HelpText = "Prowlarr server URL as Lidarr sees it, including http(s)://, port, and urlbase if needed")]
public string ProwlarrUrl { get; set; }
@@ -37,6 +36,9 @@ namespace NzbDrone.Core.Applications.Lidarr
[FieldDefinition(2, Label = "ApiKey", Privacy = PrivacyLevel.ApiKey, HelpText = "The ApiKey generated by Lidarr in Settings/General")]
public string ApiKey { get; set; }
[FieldDefinition(3, Label = "Sync Categories", Type = FieldType.Select, SelectOptions = typeof(NewznabCategoryFieldConverter), Advanced = true, HelpText = "Only Indexers that support these categories will be synced")]
public IEnumerable<int> SyncCategories { get; set; }
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));

View File

@@ -0,0 +1,154 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using FluentValidation.Results;
using Newtonsoft.Json.Linq;
using NLog;
using NzbDrone.Common.Cache;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers;
namespace NzbDrone.Core.Applications.Mylar
{
public class Mylar : ApplicationBase<MylarSettings>
{
public override string Name => "Mylar";
private readonly IMylarV3Proxy _mylarV3Proxy;
private readonly IConfigFileProvider _configFileProvider;
public Mylar(IMylarV3Proxy mylarV3Proxy, IConfigFileProvider configFileProvider, IAppIndexerMapService appIndexerMapService, Logger logger)
: base(appIndexerMapService, logger)
{
_mylarV3Proxy = mylarV3Proxy;
_configFileProvider = configFileProvider;
}
public override ValidationResult Test()
{
var failures = new List<ValidationFailure>();
try
{
failures.AddIfNotNull(_mylarV3Proxy.TestConnection(Settings));
}
catch (WebException ex)
{
_logger.Error(ex, "Unable to send test message");
failures.AddIfNotNull(new ValidationFailure("BaseUrl", "Unable to complete application test, cannot connect to Mylar"));
}
return new ValidationResult(failures);
}
public override List<AppIndexerMap> GetIndexerMappings()
{
var indexers = _mylarV3Proxy.GetIndexers(Settings);
var mappings = new List<AppIndexerMap>();
foreach (var indexer in indexers)
{
if (indexer.Apikey == _configFileProvider.ApiKey)
{
var match = AppIndexerRegex.Match(indexer.Host);
if (match.Groups["indexer"].Success && int.TryParse(match.Groups["indexer"].Value, out var indexerId))
{
//Add parsed mapping if it's mapped to a Indexer in this Prowlarr instance
mappings.Add(new AppIndexerMap { RemoteIndexerName = $"{indexer.Type},{indexer.Name}", IndexerId = indexerId });
}
}
}
return mappings;
}
public override void AddIndexer(IndexerDefinition indexer)
{
if (indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any())
{
var mylarIndexer = BuildMylarIndexer(indexer, indexer.Protocol);
var remoteIndexer = _mylarV3Proxy.AddIndexer(mylarIndexer, Settings);
_appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerName = $"{remoteIndexer.Type},{remoteIndexer.Name}" });
}
}
public override void RemoveIndexer(int indexerId)
{
var appMappings = _appIndexerMapService.GetMappingsForApp(Definition.Id);
var indexerMapping = appMappings.FirstOrDefault(m => m.IndexerId == indexerId);
if (indexerMapping != null)
{
//Remove Indexer remotely and then remove the mapping
var indexerProps = indexerMapping.RemoteIndexerName.Split(",");
_mylarV3Proxy.RemoveIndexer(indexerProps[1], (MylarProviderType)Enum.Parse(typeof(MylarProviderType), indexerProps[0]), Settings);
_appIndexerMapService.Delete(indexerMapping.Id);
}
}
public override void UpdateIndexer(IndexerDefinition indexer)
{
_logger.Debug("Updating indexer {0} [{1}]", indexer.Name, indexer.Id);
var appMappings = _appIndexerMapService.GetMappingsForApp(Definition.Id);
var indexerMapping = appMappings.FirstOrDefault(m => m.IndexerId == indexer.Id);
var indexerProps = indexerMapping.RemoteIndexerName.Split(",");
var mylarIndexer = BuildMylarIndexer(indexer, indexer.Protocol, indexerProps[1]);
//Use the old remote id to find the indexer on Mylar incase the update was from a name change in Prowlarr
var remoteIndexer = _mylarV3Proxy.GetIndexer(indexerProps[1], mylarIndexer.Type, Settings);
if (remoteIndexer != null)
{
_logger.Debug("Remote indexer found, syncing with current settings");
if (!mylarIndexer.Equals(remoteIndexer))
{
_mylarV3Proxy.UpdateIndexer(mylarIndexer, Settings);
indexerMapping.RemoteIndexerName = $"{mylarIndexer.Type},{mylarIndexer.Altername}";
_appIndexerMapService.Update(indexerMapping);
}
}
else
{
_appIndexerMapService.Delete(indexerMapping.Id);
if (indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any())
{
_logger.Debug("Remote indexer not found, re-adding {0} to Mylar", indexer.Name);
var newRemoteIndexer = _mylarV3Proxy.AddIndexer(mylarIndexer, Settings);
_appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerName = $"{newRemoteIndexer.Type},{newRemoteIndexer.Name}" });
}
else
{
_logger.Debug("Remote indexer not found for {0}, skipping re-add to Mylar due to indexer capabilities", indexer.Name);
}
}
}
private MylarIndexer BuildMylarIndexer(IndexerDefinition indexer, DownloadProtocol protocol, string originalName = null)
{
var schema = protocol == DownloadProtocol.Usenet ? MylarProviderType.Newznab : MylarProviderType.Torznab;
var mylarIndexer = new MylarIndexer
{
Name = originalName ?? $"{indexer.Name} (Prowlarr)",
Altername = $"{indexer.Name} (Prowlarr)",
Host = $"{Settings.ProwlarrUrl.TrimEnd('/')}/{indexer.Id}/api",
Apikey = _configFileProvider.ApiKey,
Categories = string.Join(",", indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray())),
Enabled = indexer.Enable,
Type = schema,
};
return mylarIndexer;
}
}
}

View File

@@ -0,0 +1,8 @@
namespace NzbDrone.Core.Applications.Mylar
{
public class MylarError
{
public int Code { get; set; }
public string Message { get; set; }
}
}

View File

@@ -0,0 +1,23 @@
using System;
using NzbDrone.Common.Exceptions;
namespace NzbDrone.Core.Applications.Mylar
{
public class MylarException : NzbDroneException
{
public MylarException(string message)
: base(message)
{
}
public MylarException(string message, params object[] args)
: base(message, args)
{
}
public MylarException(string message, Exception innerException)
: base(message, innerException)
{
}
}
}

View File

@@ -0,0 +1,49 @@
using System.Collections.Generic;
namespace NzbDrone.Core.Applications.Mylar
{
public class MylarIndexerResponse
{
public bool Success { get; set; }
public MylarIndexerData Data { get; set; }
public MylarError Error { get; set; }
}
public class MylarIndexerData
{
public List<MylarIndexer> Torznabs { get; set; }
public List<MylarIndexer> Newznabs { get; set; }
}
public enum MylarProviderType
{
Newznab,
Torznab
}
public class MylarIndexer
{
public string Name { get; set; }
public string Host { get; set; }
public string Apikey { get; set; }
public string Categories { get; set; }
public bool Enabled { get; set; }
public string Altername { get; set; }
public MylarProviderType Type { get; set; }
public bool Equals(MylarIndexer other)
{
if (ReferenceEquals(null, other))
{
return false;
}
return other.Host == Host &&
other.Apikey == Apikey &&
other.Name == Name &&
other.Categories == Categories &&
other.Enabled == Enabled &&
other.Altername == Altername;
}
}
}

View File

@@ -0,0 +1,48 @@
using System.Collections.Generic;
using FluentValidation;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Applications.Mylar
{
public class MylarSettingsValidator : AbstractValidator<MylarSettings>
{
public MylarSettingsValidator()
{
RuleFor(c => c.BaseUrl).IsValidUrl();
RuleFor(c => c.ProwlarrUrl).IsValidUrl();
RuleFor(c => c.ApiKey).NotEmpty();
RuleFor(c => c.SyncCategories).NotEmpty();
}
}
public class MylarSettings : IApplicationSettings
{
private static readonly MylarSettingsValidator Validator = new MylarSettingsValidator();
public MylarSettings()
{
ProwlarrUrl = "http://localhost:9696";
BaseUrl = "http://localhost:8090";
SyncCategories = new[] { NewznabStandardCategory.BooksComics.Id };
}
[FieldDefinition(0, Label = "Prowlarr Server", HelpText = "Prowlarr server URL as Mylar sees it, including http(s)://, port, and urlbase if needed")]
public string ProwlarrUrl { get; set; }
[FieldDefinition(1, Label = "Mylar Server", HelpText = "Mylar server URL, including http(s):// and port if needed")]
public string BaseUrl { get; set; }
[FieldDefinition(2, Label = "ApiKey", Privacy = PrivacyLevel.ApiKey, HelpText = "The ApiKey generated by Mylar in Settings/Web Interface")]
public string ApiKey { get; set; }
[FieldDefinition(3, Label = "Sync Categories", Type = FieldType.Select, SelectOptions = typeof(NewznabCategoryFieldConverter), Advanced = true, HelpText = "Only Indexers that support these categories will be synced")]
public IEnumerable<int> SyncCategories { get; set; }
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));
}
}
}

View File

@@ -0,0 +1,8 @@
namespace NzbDrone.Core.Applications.Mylar
{
public class MylarStatus
{
public bool Success { get; set; }
public MylarError Error { get; set; }
}
}

View File

@@ -0,0 +1,187 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FluentValidation.Results;
using Newtonsoft.Json;
using NLog;
using NzbDrone.Common.Http;
namespace NzbDrone.Core.Applications.Mylar
{
public interface IMylarV3Proxy
{
MylarIndexer AddIndexer(MylarIndexer indexer, MylarSettings settings);
List<MylarIndexer> GetIndexers(MylarSettings settings);
MylarIndexer GetIndexer(string indexerName, MylarProviderType indexerType, MylarSettings settings);
void RemoveIndexer(string indexerName, MylarProviderType indexerType, MylarSettings settings);
MylarIndexer UpdateIndexer(MylarIndexer indexer, MylarSettings settings);
ValidationFailure TestConnection(MylarSettings settings);
}
public class MylarV1Proxy : IMylarV3Proxy
{
private readonly IHttpClient _httpClient;
private readonly Logger _logger;
public MylarV1Proxy(IHttpClient httpClient, Logger logger)
{
_httpClient = httpClient;
_logger = logger;
}
public MylarStatus GetStatus(MylarSettings settings)
{
var request = BuildRequest(settings, "/api", "getVersion", HttpMethod.GET);
return Execute<MylarStatus>(request);
}
public List<MylarIndexer> GetIndexers(MylarSettings settings)
{
var request = BuildRequest(settings, "/api", "listProviders", HttpMethod.GET);
var response = Execute<MylarIndexerResponse>(request);
if (!response.Success)
{
throw new MylarException(string.Format("Mylar Error - Code {0}: {1}", response.Error.Code, response.Error.Message));
}
var indexers = new List<MylarIndexer>();
var torIndexers = response.Data.Torznabs;
torIndexers.ForEach(i => i.Type = MylarProviderType.Torznab);
var nzbIndexers = response.Data.Newznabs;
nzbIndexers.ForEach(i => i.Type = MylarProviderType.Newznab);
indexers.AddRange(torIndexers);
indexers.AddRange(nzbIndexers);
indexers.ForEach(i => i.Altername = i.Name);
return indexers;
}
public MylarIndexer GetIndexer(string indexerName, MylarProviderType indexerType, MylarSettings settings)
{
var indexers = GetIndexers(settings);
return indexers.SingleOrDefault(i => i.Name == indexerName && i.Type == indexerType);
}
public void RemoveIndexer(string indexerName, MylarProviderType indexerType, MylarSettings settings)
{
var parameters = new Dictionary<string, string>
{
{ "name", indexerName },
{ "providertype", indexerType.ToString().ToLower() }
};
var request = BuildRequest(settings, "/api", "delProvider", HttpMethod.GET, parameters);
CheckForError(Execute<MylarStatus>(request));
}
public MylarIndexer AddIndexer(MylarIndexer indexer, MylarSettings settings)
{
var parameters = new Dictionary<string, string>
{
{ "name", indexer.Name },
{ "providertype", indexer.Type.ToString().ToLower() },
{ "host", indexer.Host },
{ "prov_apikey", indexer.Apikey },
{ "enabled", indexer.Enabled.ToString().ToLower() },
{ "categories", indexer.Categories }
};
var request = BuildRequest(settings, "/api", "addProvider", HttpMethod.GET, parameters);
CheckForError(Execute<MylarStatus>(request));
return indexer;
}
public MylarIndexer UpdateIndexer(MylarIndexer indexer, MylarSettings settings)
{
var parameters = new Dictionary<string, string>
{
{ "name", indexer.Name },
{ "providertype", indexer.Type.ToString().ToLower() },
{ "host", indexer.Host },
{ "prov_apikey", indexer.Apikey },
{ "enabled", indexer.Enabled.ToString().ToLower() },
{ "categories", indexer.Categories },
{ "altername", indexer.Altername }
};
var request = BuildRequest(settings, "/api", "changeProvider", HttpMethod.GET, parameters);
CheckForError(Execute<MylarStatus>(request));
return indexer;
}
private void CheckForError(MylarStatus response)
{
if (!response.Success)
{
throw new MylarException(string.Format("Mylar Error - Code {0}: {1}", response.Error.Code, response.Error.Message));
}
}
public ValidationFailure TestConnection(MylarSettings settings)
{
try
{
var status = GetStatus(settings);
if (!status.Success)
{
return new ValidationFailure("ApiKey", status.Error.Message);
}
}
catch (HttpException ex)
{
_logger.Error(ex, "Unable to send test message");
return new ValidationFailure("BaseUrl", "Unable to complete application test");
}
catch (Exception ex)
{
_logger.Error(ex, "Unable to send test message");
return new ValidationFailure("", "Unable to send test message");
}
return null;
}
private HttpRequest BuildRequest(MylarSettings settings, string resource, string command, HttpMethod method, Dictionary<string, string> parameters = null)
{
var baseUrl = settings.BaseUrl.TrimEnd('/');
var requestBuilder = new HttpRequestBuilder(baseUrl).Resource(resource)
.AddQueryParam("cmd", command)
.AddQueryParam("apikey", settings.ApiKey);
if (parameters != null)
{
foreach (var param in parameters)
{
requestBuilder.AddQueryParam(param.Key, param.Value);
}
}
var request = requestBuilder.Build();
request.Headers.ContentType = "application/json";
request.Method = method;
request.AllowAutoRedirect = true;
return request;
}
private TResource Execute<TResource>(HttpRequest request)
where TResource : new()
{
var response = _httpClient.Execute(request);
var results = JsonConvert.DeserializeObject<TResource>(response.Content);
return results;
}
}
}

View File

@@ -40,7 +40,10 @@ namespace NzbDrone.Core.Applications.Radarr
Capabilities = new IndexerCapabilities()
};
testIndexer.Capabilities.Categories.AddCategoryMapping(1, NewznabStandardCategory.Movies);
foreach (var cat in NewznabStandardCategory.AllCats)
{
testIndexer.Capabilities.Categories.AddCategoryMapping(1, cat);
}
try
{
@@ -55,12 +58,12 @@ namespace NzbDrone.Core.Applications.Radarr
return new ValidationResult(failures);
}
public override Dictionary<int, int> GetIndexerMappings()
public override List<AppIndexerMap> GetIndexerMappings()
{
var indexers = _radarrV3Proxy.GetIndexers(Settings)
.Where(i => i.Implementation == "Newznab" || i.Implementation == "Torznab");
var mappings = new Dictionary<int, int>();
var mappings = new List<AppIndexerMap>();
foreach (var indexer in indexers)
{
@@ -71,7 +74,7 @@ namespace NzbDrone.Core.Applications.Radarr
if (match.Groups["indexer"].Success && int.TryParse(match.Groups["indexer"].Value, out var indexerId))
{
//Add parsed mapping if it's mapped to a Indexer in this Prowlarr instance
mappings.Add(indexer.Id, indexerId);
mappings.Add(new AppIndexerMap { RemoteIndexerId = indexer.Id, IndexerId = indexerId });
}
}
}

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using FluentValidation;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Applications.Radarr
@@ -12,6 +13,7 @@ namespace NzbDrone.Core.Applications.Radarr
RuleFor(c => c.BaseUrl).IsValidUrl();
RuleFor(c => c.ProwlarrUrl).IsValidUrl();
RuleFor(c => c.ApiKey).NotEmpty();
RuleFor(c => c.SyncCategories).NotEmpty();
}
}
@@ -26,8 +28,6 @@ namespace NzbDrone.Core.Applications.Radarr
SyncCategories = new[] { 2000, 2010, 2020, 2030, 2040, 2045, 2050, 2060, 2070, 2080 };
}
public IEnumerable<int> SyncCategories { get; set; }
[FieldDefinition(0, Label = "Prowlarr Server", HelpText = "Prowlarr server URL as Radarr sees it, including http(s)://, port, and urlbase if needed")]
public string ProwlarrUrl { get; set; }
@@ -37,6 +37,9 @@ namespace NzbDrone.Core.Applications.Radarr
[FieldDefinition(2, Label = "ApiKey", Privacy = PrivacyLevel.ApiKey, HelpText = "The ApiKey generated by Radarr in Settings/General")]
public string ApiKey { get; set; }
[FieldDefinition(3, Label = "Sync Categories", Type = FieldType.Select, SelectOptions = typeof(NewznabCategoryFieldConverter), Advanced = true, HelpText = "Only Indexers that support these categories will be synced")]
public IEnumerable<int> SyncCategories { get; set; }
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));

View File

@@ -40,7 +40,10 @@ namespace NzbDrone.Core.Applications.Readarr
Capabilities = new IndexerCapabilities()
};
testIndexer.Capabilities.Categories.AddCategoryMapping(1, NewznabStandardCategory.Books);
foreach (var cat in NewznabStandardCategory.AllCats)
{
testIndexer.Capabilities.Categories.AddCategoryMapping(1, cat);
}
try
{
@@ -55,12 +58,12 @@ namespace NzbDrone.Core.Applications.Readarr
return new ValidationResult(failures);
}
public override Dictionary<int, int> GetIndexerMappings()
public override List<AppIndexerMap> GetIndexerMappings()
{
var indexers = _readarrV1Proxy.GetIndexers(Settings)
.Where(i => i.Implementation == "Newznab" || i.Implementation == "Torznab");
.Where(i => i.Implementation == "Newznab" || i.Implementation == "Torznab");
var mappings = new Dictionary<int, int>();
var mappings = new List<AppIndexerMap>();
foreach (var indexer in indexers)
{
@@ -71,7 +74,7 @@ namespace NzbDrone.Core.Applications.Readarr
if (match.Groups["indexer"].Success && int.TryParse(match.Groups["indexer"].Value, out var indexerId))
{
//Add parsed mapping if it's mapped to a Indexer in this Prowlarr instance
mappings.Add(indexer.Id, indexerId);
mappings.Add(new AppIndexerMap { RemoteIndexerId = indexer.Id, IndexerId = indexerId });
}
}
}

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using FluentValidation;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Applications.Readarr
@@ -12,6 +13,7 @@ namespace NzbDrone.Core.Applications.Readarr
RuleFor(c => c.BaseUrl).IsValidUrl();
RuleFor(c => c.ProwlarrUrl).IsValidUrl();
RuleFor(c => c.ApiKey).NotEmpty();
RuleFor(c => c.SyncCategories).NotEmpty();
}
}
@@ -26,8 +28,6 @@ namespace NzbDrone.Core.Applications.Readarr
SyncCategories = new[] { 3030, 7000, 7010, 7020, 7030, 7040, 7050, 7060 };
}
public IEnumerable<int> SyncCategories { get; set; }
[FieldDefinition(0, Label = "Prowlarr Server", HelpText = "Prowlarr server URL as Readarr sees it, including http(s)://, port, and urlbase if needed")]
public string ProwlarrUrl { get; set; }
@@ -37,6 +37,9 @@ namespace NzbDrone.Core.Applications.Readarr
[FieldDefinition(2, Label = "ApiKey", Privacy = PrivacyLevel.ApiKey, HelpText = "The ApiKey generated by Readarr in Settings/General")]
public string ApiKey { get; set; }
[FieldDefinition(3, Label = "Sync Categories", Type = FieldType.Select, SelectOptions = typeof(NewznabCategoryFieldConverter), Advanced = true, HelpText = "Only Indexers that support these categories will be synced")]
public IEnumerable<int> SyncCategories { get; set; }
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));

View File

@@ -40,7 +40,10 @@ namespace NzbDrone.Core.Applications.Sonarr
Capabilities = new IndexerCapabilities()
};
testIndexer.Capabilities.Categories.AddCategoryMapping(1, NewznabStandardCategory.TV);
foreach (var cat in NewznabStandardCategory.AllCats)
{
testIndexer.Capabilities.Categories.AddCategoryMapping(1, cat);
}
try
{
@@ -55,12 +58,12 @@ namespace NzbDrone.Core.Applications.Sonarr
return new ValidationResult(failures);
}
public override Dictionary<int, int> GetIndexerMappings()
public override List<AppIndexerMap> GetIndexerMappings()
{
var indexers = _sonarrV3Proxy.GetIndexers(Settings)
.Where(i => i.Implementation == "Newznab" || i.Implementation == "Torznab");
var mappings = new Dictionary<int, int>();
var mappings = new List<AppIndexerMap>();
foreach (var indexer in indexers)
{
@@ -71,7 +74,7 @@ namespace NzbDrone.Core.Applications.Sonarr
if (match.Groups["indexer"].Success && int.TryParse(match.Groups["indexer"].Value, out var indexerId))
{
//Add parsed mapping if it's mapped to a Indexer in this Prowlarr instance
mappings.Add(indexer.Id, indexerId);
mappings.Add(new AppIndexerMap { RemoteIndexerId = indexer.Id, IndexerId = indexerId });
}
}
}
@@ -81,7 +84,7 @@ namespace NzbDrone.Core.Applications.Sonarr
public override void AddIndexer(IndexerDefinition indexer)
{
if (indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any())
if (indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any() || indexer.Capabilities.Categories.SupportedCategories(Settings.AnimeSyncCategories.ToArray()).Any())
{
var sonarrIndexer = BuildSonarrIndexer(indexer, indexer.Protocol);
@@ -128,7 +131,7 @@ namespace NzbDrone.Core.Applications.Sonarr
{
_appIndexerMapService.Delete(indexerMapping.Id);
if (indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any())
if (indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any() || indexer.Capabilities.Categories.SupportedCategories(Settings.AnimeSyncCategories.ToArray()).Any())
{
_logger.Debug("Remote indexer not found, re-adding {0} to Sonarr", indexer.Name);
sonarrIndexer.Id = 0;
@@ -169,7 +172,7 @@ namespace NzbDrone.Core.Applications.Sonarr
sonarrIndexer.Fields.FirstOrDefault(x => x.Name == "apiPath").Value = "/api";
sonarrIndexer.Fields.FirstOrDefault(x => x.Name == "apiKey").Value = _configFileProvider.ApiKey;
sonarrIndexer.Fields.FirstOrDefault(x => x.Name == "categories").Value = JArray.FromObject(indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()));
sonarrIndexer.Fields.FirstOrDefault(x => x.Name == "animeCategories").Value = JArray.FromObject(indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()));
sonarrIndexer.Fields.FirstOrDefault(x => x.Name == "animeCategories").Value = JArray.FromObject(indexer.Capabilities.Categories.SupportedCategories(Settings.AnimeSyncCategories.ToArray()));
return sonarrIndexer;
}

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using FluentValidation;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Applications.Sonarr
@@ -23,11 +24,10 @@ namespace NzbDrone.Core.Applications.Sonarr
{
ProwlarrUrl = "http://localhost:9696";
BaseUrl = "http://localhost:8989";
SyncCategories = new[] { 5000, 5010, 5020, 5030, 5040, 5045, 5050, 5070 };
SyncCategories = new[] { 5000, 5010, 5020, 5030, 5040, 5045, 5050 };
AnimeSyncCategories = new[] { 5070 };
}
public IEnumerable<int> SyncCategories { get; set; }
[FieldDefinition(0, Label = "Prowlarr Server", HelpText = "Prowlarr server URL as Sonarr sees it, including http(s)://, port, and urlbase if needed")]
public string ProwlarrUrl { get; set; }
@@ -37,6 +37,12 @@ namespace NzbDrone.Core.Applications.Sonarr
[FieldDefinition(2, Label = "ApiKey", Privacy = PrivacyLevel.ApiKey, HelpText = "The ApiKey generated by Sonarr in Settings/General")]
public string ApiKey { get; set; }
[FieldDefinition(3, Label = "Sync Categories", Type = FieldType.Select, SelectOptions = typeof(NewznabCategoryFieldConverter), Advanced = true, HelpText = "Only Indexers that support these categories will be synced")]
public IEnumerable<int> SyncCategories { get; set; }
[FieldDefinition(4, Label = "Anime Sync Categories", Type = FieldType.Select, SelectOptions = typeof(NewznabCategoryFieldConverter), Advanced = true, HelpText = "Only Indexers that support these categories will be synced")]
public IEnumerable<int> AnimeSyncCategories { get; set; }
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));

View File

@@ -45,6 +45,8 @@ namespace NzbDrone.Core.Configuration
bool UpdateAutomatically { get; }
UpdateMechanism UpdateMechanism { get; }
string UpdateScriptPath { get; }
string SyslogServer { get; }
int SyslogPort { get; }
}
public class ConfigFileProvider : IConfigFileProvider
@@ -213,6 +215,9 @@ namespace NzbDrone.Core.Configuration
public string UpdateScriptPath => GetValue("UpdateScriptPath", "", false);
public string SyslogServer => GetValue("SyslogServer", "", persist: false);
public int SyslogPort => GetValueInt("SyslogPort", 514, persist: false);
public int GetValueInt(string key, int defaultValue, bool persist = true)
{
return Convert.ToInt32(GetValue(key, defaultValue, persist));

View File

@@ -0,0 +1,21 @@
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(10)]
public class IndexerProxies : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Create.TableForModel("IndexerProxies")
.WithColumn("Name").AsString()
.WithColumn("Settings").AsString()
.WithColumn("Implementation").AsString()
.WithColumn("ConfigContract").AsString().Nullable()
.WithColumn("Tags").AsString().Nullable();
Alter.Table("Indexers").AddColumn("Tags").AsString().Nullable();
}
}
}

View File

@@ -0,0 +1,14 @@
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(11)]
public class app_indexer_remote_name : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Alter.Table("ApplicationIndexerMapping").AddColumn("RemoteIndexerName").AsString().Nullable();
}
}
}

View File

@@ -0,0 +1,14 @@
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(13)]
public class desi_gazelle_to_unit3d : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Update.Table("Indexers").Set(new { ConfigContract = "Unit3dSettings", Enable = 0 }).Where(new { Implementation = "DesiTorrents" });
}
}
}

Some files were not shown because too many files have changed in this diff Show More