Commit Graph

157 Commits

Author SHA1 Message Date
Diego Heras 69125add3e
core: redo search cache from scratch. resolves #10382 (#10447)
In simple words, when you make a request in Jackett, the results are saved in memory (cache). The next request will return results form the cache improving response time and making fewer requests to the sites.
* We assume all indexers/sites are stateless, the same request return the same response. If you change the search term, categories or something in the query Jackett has to make a live request to the indexer.
* There are some situations when we don't want to use the cache:
** When we are testing the indexers => if query.IsTest results are not cached
** When the user updates the configuration of one indexer => We call CleanIndexerCache to remove cached results before testing the configuration
** When there is some error/exception in the indexer => The results are not cached so we can retry in the next request
* We want to limit the memory usage, so we try to remove elements from cache ASAP:
** Each indexer can have a maximum number of results in memory. If the limit is exceeded we remove old results
** Cached results expire after some time
* Users can configure the cache or even disable it
2020-12-11 23:14:21 +01:00
airhawk777 65ca4d7478
Update to .NET 5 (#10346)
* Update to .NET 5

.NET 5 brings many performance (especially regex) improvements
https://devblogs.microsoft.com/dotnet/announcing-net-5-0/

Can look at bringing the packages upto date and using a single file executable in a future PR if the maintainers are interested

* Dotnet restore before building

* Restore on Windows only

* Out of ideas

* Update framework for windows specific apps

* Don't upgrade Microsoft.Extensions.Configuration

* drop mono from the dotnet linux build instructions

* Fix logic to get app runtime

* readme: add windows .net prereq link

* Update README.md

* azure-pipeline: bump minorversion to 17

Co-authored-by: garfield69 <garfieldsixtynine@gmail.com>
Co-authored-by: Diego Heras <ngosang@hotmail.es>
Co-authored-by: ilike2burnthing <59480337+ilike2burnthing@users.noreply.github.com>
2020-12-08 21:10:34 +13:00
Diego Heras 38f09900ca
core: fix version number to match github release tag. resolves #10249 (#10413) 2020-12-07 00:14:23 +01:00
Diego Heras 2030d9cf13
core: follow torznab specs about categories. resolves #10120 (#10147) 2020-11-08 23:27:54 +01:00
Diego Heras 2ea22af9ef
core: rename comments field to details #10092 (#10135) 2020-11-08 15:11:27 +13:00
Diego Heras c5dd37b836
core: rename banner field to poster #10092 (#10134) 2020-11-08 12:43:33 +13:00
Diego Heras 2cf78fe4fd
core: add missing torznab attributes. resolves #10118 (#10122)
* add coverurl
* rename tvdb and tmdb
2020-11-06 22:03:25 +01:00
Diego Heras 11e4143841
core: add more unit tests (#10107) 2020-11-04 21:56:54 +01:00
Diego Heras 14fdea164c
core: generate magnet link from infohash and vice versa. resolves #8590 (#10087)
* global list of public trackers
* infohash => magnet link (only in public trackers)
* magnet link => infohash
2020-11-02 17:43:13 +01:00
Diego Heras 6413ad8fd4
core: refactor results post processing: filter and fixing results (#10082) 2020-11-02 14:20:13 +01:00
Diego Heras 1d7ea48505
core: add custom cats in indexers with string categories. resolves #9746 (#10060)
* When category ids in the indexer are "strings" we create a unique hash to make it compatible with Torznab
* This PR also fix several issues related to custom cats
2020-11-02 13:42:00 +13:00
Diego Heras 7a2e52659a
core: rewrite category code from scratch. resolves #8049 (#10031)
* Core: Categories are stored in a real tree
* Sorting: First Torznab categories sorted by Id and then custom cats sorted by Name
* Filtering: Results with child category are not removed when searching by parent category. Details in #8049
* Jacket UI: Add parent category when at least one child category exists
* Torznab (caps): Remove non existent children categories. Remove duplicated categories. Details in #10006
2020-11-01 12:07:24 +01:00
Diego Heras e8c0ca31cc
core: fix disabled unit test (#10028) 2020-10-31 22:11:02 +01:00
Diego Heras b63519b64b
core: add category filter tests (#10024) 2020-10-31 01:51:19 +01:00
Diego Heras 15ea7ed9f9
core: rearrange test classes (#10023) 2020-10-31 01:12:35 +01:00
Diego Heras 767700d6bb
core: categories cleanup (#10006)
* core: categories cleanup
* swap categories 2050 Movies/BluRay / 2060 Movies/3D
* swap categories 6050 XXX/Pack / 6070 XXX/Other
* swap categories 7010 Books/Mags / 7020 Books/EBook / 7030 Books/Comics
* category validation is case sensitive
* renamed some categories to follow Newznab specs
2020-10-29 08:00:48 +13:00
Diego Heras 861655395b
core: move categories code into a new class (#10005) 2020-10-27 22:17:03 +01:00
garfield69 aec14b88e9
Core: correct Other as 8000 and Books as 7000 (#9986)
as documented in https://newznab.readthedocs.io/en/latest/misc/api/#predefined-categories
and update any indexers affected
2020-10-28 08:02:32 +13:00
Diego Heras 74d08c937f
core: add more unit tests (#9907) 2020-10-19 22:22:41 +02:00
Diego Heras da0761406f
core: refactor book-search (#9897) 2020-10-19 21:26:43 +02:00
Diego Heras 1e42016546
core: refactor music-search (#9895) 2020-10-18 23:20:08 +02:00
Diego Heras 56a260f0d7
core: disable tv-search by default (#9893)
* Disable tv-search in music trackers
* Add TVRage search in Cardigann
2020-10-18 22:47:36 +02:00
Diego Heras 9cdad3de64
core: separate categories from movie-search (#9862)
* Categories and Torznab movie-search are separated
* Movie-search parameters are validated
* Fixed some bugs in Cardigann indexers
2020-10-18 19:26:22 +02:00
Diego Heras dcf339a6eb
core: remove default categories in c# trackers (#9831) 2020-10-13 22:17:26 +02:00
Diego Heras 886de069a7
core: add tests for torznab categories (#9821) 2020-10-12 23:07:21 +02:00
Diego Heras 2654ba808c
core: relocate test classes (#9817) 2020-10-12 13:35:09 +02:00
Diego Heras a1108bc5a2
core: fix invalid characters in xml/rss. resolves #9118 (#9636) 2020-09-25 02:40:13 +02:00
Cory ac0ba0f9b1 core: refactor http webclient part 13 #8529 (#8941)
Merge string/byte request code
2020-09-21 18:13:30 +02:00
Cory 67c7b4ca70 core: refactor http webclient part 12 #8529 (#8939)
Merge web results classes into single class and update usages
2020-09-21 18:13:27 +02:00
Cory 125298425a core: refactor http webclient part 10 #8529 (#7729)
Move WebResult String and Byte properties to base class
2020-09-21 18:13:19 +02:00
ngosang 2d0b378545 Revert "core: refactor http webclient part 10 #8529 (#7729)"
This reverts commit 3a0ece162f.
2020-09-21 08:03:14 +02:00
ngosang a8d055f0d5 Revert "core: refactor http webclient part 12 #8529 (#8939)"
This reverts commit 22bced9ca3.
2020-09-21 08:02:58 +02:00
ngosang ca61f965e9 Revert "core: refactor http webclient part 13 #8529 (#8941)"
This reverts commit 4d63fa81d5.
2020-09-21 08:02:53 +02:00
Cory 4d63fa81d5 core: refactor http webclient part 13 #8529 (#8941)
Merge string/byte request code
2020-09-19 18:43:06 +02:00
Cory 22bced9ca3 core: refactor http webclient part 12 #8529 (#8939)
Merge web results classes into single class and update usages
2020-09-19 18:40:08 +02:00
Cory 3a0ece162f core: refactor http webclient part 10 #8529 (#7729)
Move WebResult String and Byte properties to base class
2020-09-19 18:39:12 +02:00
Diego Heras aa6d8962de
core: update dependencies (#9527) 2020-09-14 00:56:07 +02:00
Diego Heras 2c4ca6be1f
core: update jackett dependencies (#8977) 2020-06-14 13:25:51 +02:00
morpheus133 cd4e5de8f4
Add support of IMDBid search for ncore indexer (#7847) 2020-04-17 17:45:26 -05:00
Diego Heras 47454e4c1e
test: add unit test to validate all cardigann definitions (#8165)
* test: add unit test to validate all cardigann definitions

Error while parsing Cardigann definition 4thd.yml
YamlDotNet.Core.YamlException: (Line: 13, Col: 9, Idx: 240) - (Line: 13, Col: 9, Idx: 240): Exception during deserialization
 ---> System.Runtime.Serialization.SerializationException: Property 'dec' not found on type 'Jackett.Common.Models.CategorymappingBlock'.
2020-04-13 09:34:45 +02:00
Diego Heras 9cbc78b1c2
core: fix cookie parsing (part 2) (#8150)
* core: fix cookie parsing (part 2)

After fixing cookie storage in #8133 I noticed that I still have a lot of '.json.bak' files in the Jackett configuration folder. After deleting them they were created again in each request. The cause was we were parsing bad the cookies with '=' character in the value. Most Cloudflare cookies include if so we were sending bad cookies and solving the callenge in each request.

This PR should increase performance in several ways: we are not solving the challenge again (it takes time), we are not making extra requests and we are not updating the Jackett configuration in each request (both files '.json' and '.json.bak').

Tested with the client HttpWebClient2NetCore only. Please do some tests with the site 1337x.
2020-04-13 06:22:50 +02:00
Cory 937aa6b370
Add multi value processing to GetQueryString (#7915) 2020-04-09 23:18:10 -05:00
Cory 6dc00de864
Re-run dotnet format and enable style enforcement. (#8053) 2020-04-07 11:17:17 -05:00
junglebus 7a35701d12
Core: Package Update (#7800) 2020-03-23 04:05:17 +13:00
junglebus 38fddab2ad
Pipeline: Add code coverage (#7799) 2020-03-22 18:40:58 +13:00
Cory a89246c9a7
core: improve date parsing for today/yesterday/tomorrow. resolves #7701 (#7704) 2020-03-18 21:11:48 +13:00
Cory 3f9d182083
core: Remove warning suppression (#7513) 2020-03-06 14:57:59 +13:00
Diego Heras e55e92f9ac
Core: Fix line endings to match style guide(#7476) 2020-03-03 10:28:26 -06:00
Diego Heras b944993733
Remove CsQuery and use AngleSharp instead. Closes #7292 (#7404) 2020-03-02 07:58:14 +13:00
junglebus 1fb77a6334
Package update (#7413)
All packages except Automapper are now on latest versions
2020-03-01 15:58:46 +13:00
Cory 889a8da4e5
Convert functions and properties to expression bodies when able (#7312)
Convert functions and properties to expression bodies when able
2020-02-25 10:08:03 -06:00
Cory 348dddfbee
core: Apply declarations styles (#7166) 2020-02-11 11:16:19 +13:00
Cory 98541ac6f8
core: Sort and remove usings (#7159) 2020-02-10 07:08:34 +13:00
Cory c12da520a4
Run dotnet format on solution (#7145) 2020-02-09 15:35:16 +13:00
junglebus 67750982bc
core: Allow unit tests to run in non-Windows environments (#7022) 2020-02-06 15:21:48 +13:00
junglebus 620a09858c Make tests run on .NET Core as well (#6997)
* Make tests run on .NET Core as well

* Only run net461 tests against full framework build

* Add support for running full framework tests on linux
2020-01-23 06:42:23 +13:00
junglebus e4a511347c Minor csproj tidy up (#6878) 2020-01-10 07:18:08 +13:00
junglebus d4f873e46f Update to .NET Core 3.1 (#6857)
Minor update from .NET Core 3.0. .NET Core 3.1 is the LTS version
2020-01-08 20:51:00 +13:00
junglebus 64abc61893 Update to .NET Core 3.0 (#6151)
* Update to .NET Core 3.0

Updated Jackett so that it runs on .NET Core 3.0 now

.NET Core 3.0 brings the following benefits https://devblogs.microsoft.com/dotnet/announcing-net-core-3-0/
One of the benefits is the ability to create single file executables. I haven't enabled this yet, but its only a one line change to turn it on (would likely also require some changes to the updater).

This means that builds for LinuxAMDx64, LinuxARM32, LinuxARM64 and macOS will now run on .NET Core 3.0 instead of 2.2. Windows and Mono remain on full framework. Once .NET Core 3.1 is released (November) I'll look to moving Windows over to .NET Core as well

Tested on
-Windows 10 x64
-Debian running Jackett with Mono
-Debian running Jackett standalone (.NET Core)
2019-10-15 06:51:33 +13:00
flightlevel 08ab66a447 Package update 2019-03-25 19:27:28 +11:00
flightlevel ca4f08a030 Package update 2019-03-13 20:32:48 +11:00
flightlevel caf583a684 Package update 2019-03-03 15:23:33 +11:00
flightlevel 7a9adc283b Update to .NET Core 2.2 2018-12-23 21:54:02 +11:00
flightlevel 7a5407d2c4 Revert "Package update"
This reverts commit eaf53e0f4c.
2018-12-23 21:25:13 +11:00
flightlevel eaf53e0f4c Package update 2018-12-23 21:16:09 +11:00
flightlevel cc3ebbe1ae Package update 2018-09-15 15:28:50 +10:00
flightlevel 795c896abe Tests: Remove dependency on Jackett.dll 2018-08-18 17:27:35 +10:00
flightlevel 7d759917e6 Package updates 2018-08-14 20:02:54 +10:00
flightlevel 0dd9842e84 Update Tests to net461 2018-07-01 14:40:06 +10:00
flightlevel 601783aef6 .NET Core preparation 2 2018-06-02 17:42:01 +10:00
kaso17 e4cd2351cf update dependencies 2018-03-20 15:59:28 +01:00
flightlevel 3e5e48c3a0
Change namespace to Jackett.Common (#2691)
Really hope I don't break anything with this
Went to have a go at .NET core and it just became too confusing for me with 'Jackett' namespace referring to both Jackett.Common and Jackett
2018-03-10 19:05:56 +11:00
kaso17 f9888d7ffb fix tests 2018-02-28 16:42:35 +01:00
kaso17 a26db3a772 update dependencies 2018-02-28 15:15:29 +01:00
DarkSupremo d9178dd053 BJ-Share, B2S-Share and Speed-Share: fix Anime search (#2171)
* Fixed anime search on BJShare, removing the season from search and changing the output from "Anime SXXEXX" to "Anime EXX".
Season had to be removed because the season numbering on anime is all wrong in this tracker.

* - Changed to change title based on search for category of every row in bj-share, instead of category of search
- Fixed title parse on B2S-Share and Speed-Share to animes (series not changed) from "Anime SXXEXX" to "Anime EXX"

* - Added anime title change on empty search as well - BJ-Share
2017-11-20 15:27:25 +01:00
Nathan Holland 1c62504b22 Remove Static Configuration Class and .NET Core Prep (#2122)
* Remove static configuration class that required prior knowledge of when it was initialised to dependency injected method that ensures all configuration has already occured.

* Specify a different log name for the updater, require a path when running the Jackett updater

* Update to all .NET Standard packages

* Explicitly specify the restore project style

* Move automapper out of the  DI framework and put crude detection to prevent it from initializing more than once.
2017-11-13 19:38:38 +11:00
Nathan Holland 52c0179e8e Feature/autofac tidyup (#2096)
* Move service config service back into shared .NET Framework Library

* Move Content files into shared folder. Make autoface load different assembilies depending on what framework is using it.

* Change my mind on what the shared module should be called. Common Module is too bland.

* DotNet4.SocksProxy is not yet publically .NET Standard. Revert to previous SocksWebProxy package.

* Check in unstaged change to test dependency injection setup.
2017-11-08 15:45:21 +01:00
Nathan Holland 571c52a0f2 Feature/netcore preparation (#2072)
* Use platform detection that works on mono 4.6+

* Move to use package reference for restoring nuget packages.

* DateTimeRoutines does not have Nuget packages that support .NET Standard (and therefore .NET Core). We will have to include them for now until we can get rid of this dependency.

* Start spliting some interfaces into their own files - this will help by allowing us to split them out in the future into a seperate project so the actual implementations can stay within their respective architectures when required

* Move out common libraries

* Few more tidy up tasks to get things working with .NET Standard

* Restructure the solution layout

* Encoding work to reduce rework later on platforms without Windows codepages (or require compliance with RFC1345)

* Move folder structure around to have more natural layout of the solutions

* DI server configuration to get rid of "temporary" hack and dependency circle for serverservice

* Make all encoding consistent to match the expected encoding casing for earlier versions of mono.
2017-11-05 20:42:03 +11:00
Nathan Holland 8a6b9d4de7 Feature/netcore preparation (#2035)
* Move to use package reference for restoring nuget packages.

* Return a task result for this async method.

* Update to a supported version of the .NET Framework. This also has the side effect of allowing us to automatically generate our binding redirects on build.

* Set the solution to target VS2017

* Update test solution csproj file to support being built through MSBuild 15

* Move to use package reference for restoring nuget packages.

* Return a task result for this async method.

* Update to a supported version of the .NET Framework. This also has the side effect of allowing us to automatically generate our binding redirects on build.

* Set the solution to target VS2017

* Update test solution csproj file to support being built through MSBuild 15

* DateTimeRoutines does not have Nuget packages that support .NET Standard (and therefore .NET Core). We will have to include them for now until we can get rid of this dependency.

* Move the interfaces into their own files. This will be useful when we share them between the .NET Core and .NET Framework WebAPI

* Stage services that need to point to the new interface namespace.

* Update CurlSharp to fix memory leak issue and support better runtime compatibility with OSX and Linux

* Start spliting some interfaces into their own files - this will help by allowing us to split them out in the future into a seperate project so the actual implementations can stay within their respective architectures when required
2017-10-29 21:19:09 +11:00
Nathan Holland 7829643104 Feature/package reference restore (#2025)
* Move to use package reference for restoring nuget packages.

* Return a task result for this async method.

* Update to a supported version of the .NET Framework. This also has the side effect of allowing us to automatically generate our binding redirects on build.

* Set the solution to target VS2017

* Update test solution csproj file to support being built through MSBuild 15

* Move to use package reference for restoring nuget packages.

* Return a task result for this async method.

* Update to a supported version of the .NET Framework. This also has the side effect of allowing us to automatically generate our binding redirects on build.

* Set the solution to target VS2017

* Update test solution csproj file to support being built through MSBuild 15
2017-10-29 19:42:25 +11:00
chibidev 7c2b801ee9 Feature/remove autofac from indexer manager (#1549)
* Line endings...

* Remove Autofac and all its shenanigans from IndexerManager

I'm starting my warpath against Autofac. For the next couple PRs I want
to focus on refactoring things rather than creating new things. This
includes introducing LINQ extensions wherever possible as well as
removing Autofac/Automapper dependencies in classes (or any other
dependency, there's a great chance that most of the classes that use
Jackett.Services wouldn't need so many of them). All this is order to
boost performance and eventually reach testability. Can't stop, won't
stop.

* Remove unnecessary extension

* Modify test project

* As per @kaso17, iterating through iterator types rather than allocating them manually

* Cleaning up a little

* Adjusting interface in tests
2017-07-14 07:39:52 +02:00
chibidev 17f544be36 Bugfix/1532 1539 fix manual search circular reference (#1543)
* Line endings...

* Encoding Encoding in a reasonable way

Sadly Encoding contains a self-reference somewhere, which makes it
really hard for the json serializer to automatically encode it...
Probably there's no value in sending it over especially since no one is
using it, however just for the sake of the argument, let's just
serialize it in a reasonable way. Maybe someday there will be someone
expecting this. Or we clearly separate DTOs and models...

- Fixes Jackett/Jackett#1532
- Fixes Jackett/Jackett#1539

* Seriously... Please port this to dotnet Core so that I can use something other than @drunkvs on my MacBook

* Fix autofac registration after merge

* "Implement" new function of interface in test project
2017-07-11 22:32:56 +02:00
chibidev c0b665062e Adding an aggregate torznab feed for all configured trackers (#1312)
* Adding an aggregate torznab feed for all configured trackers

This adds just a basic first implementation of a special
torznab feed that will make all configured trackers available
with all the supported query params.
- This should close #1247 
- This also contributes to #921 

* Adding missing file

* Add missing implementation from Test project
2017-04-30 10:06:29 +02:00
flightlevel f2def1f615 Normalise Line endings (#1284)
* Add .gitattributes

* Normalise line endings
2017-04-15 18:45:10 +10:00
kaso17 88c865e8c9 dependency updates 2017-01-25 17:58:12 +01:00
kaso17 d499c291b9 WebRequest: make encoding configurable (#816) 2016-12-06 14:56:47 +01:00
kaso17 599d1c9c91 Fix Test 2016-12-05 18:25:56 +01:00
Jay Otterbein d1e767bd41 Added method in ParseUtil that strips out every invalid XML character from a string.
Added test for ParseUtil.RemoveInvalidXmlChars() using a snippet of rss from XSeeds that was originally causing problems.
2016-11-04 18:26:39 +01:00
kaso17 21cffe2d35 Add basic support for Cardigann definitions (#571)
* Add basic support for Cardigann definitions

* Add HDME definition

* Fix tests

* support split with negative indexes

* allow FromTimeAgo formats without spaces betwen value and unit

Example: 2h 3m

* Add basic support for Cardigann definitions

* Add HDME definition

* Fix tests

* support split with negative indexes

* allow FromTimeAgo formats without spaces betwen value and unit

Example: 2h 3m
2016-10-27 18:30:03 +11:00
flightlevel 791471a716 Update Packages (#459)
* Revert "Update packages (#453)"

This reverts commit 593c2f083e.

* Package Update

Package Update
2016-08-22 20:37:49 +10:00
flightlevel 593c2f083e Update packages (#453)
Update packages
2016-08-20 19:29:26 +10:00
Azerelat aadf25e3b6 Fix update cross platform issues 2015-12-27 21:11:04 +00:00
flightlevel 7a0264051d Tv Category Parser
Can Determine Torznab TV show category from title if tracker doesn't
supply a category
2015-11-21 22:56:06 +11:00
WhatFox 2310d08f99 Fix build 2015-11-18 20:03:55 +00:00
flightlevel 95abf9bb6a Update Assembly Versions
Update Assembly Versions: Now using AppVeyor for versioning, so not
required
2015-11-09 19:37:09 +11:00
flightlevel 4341136ddb Update NUGET Packages
Update NUGET Packages
2015-11-07 15:30:57 +11:00
KZ 3c0cae7166 Implement web site 2015-08-12 21:33:39 +01:00
KZ 6d0aa05761 Saved password security 2015-08-07 20:09:13 +01:00
KZ d4b61fe3a9 Add CouchPotato interface 2015-08-02 18:55:39 +01:00
KZ 922583ea5d Fix compilation under mono #117. Allow explicit web client selection. Init curl at application start. 2015-07-30 18:50:46 +01:00