Compare commits

...

36 Commits

Author SHA1 Message Date
Qstick
fa304dcaca Random 2022-01-02 23:39:55 -06:00
Qstick
e04133d34a More Mono Cleaning 2022-01-02 23:19:47 -06:00
Qstick
07575ae239 Fixed: (LazyLibrarian) Test indexer pull on setup to validate 2022-01-02 21:50:44 -06:00
Qstick
8e7acd8946 Fixed: (Mylar) Test indexer pull on setup to validate Mylar functionality 2022-01-02 21:50:44 -06:00
Qstick
3ecc926298 Fixed: (HDTorrents) Use Sanitized search string on all search types 2022-01-02 19:43:46 -06:00
Qstick
1e532624af Fixed: (Redacted) Guid and FL Parsing in line with Gazelle 2022-01-02 16:45:34 -06:00
Agneev Mukherjee
8a5194e604 Update index.ejs 2022-01-02 13:10:07 -06:00
Agneev Mukherjee
8a73cf72c2 Set login.html theme-color to color of logo 2022-01-02 13:10:07 -06:00
Qstick
76982c5988 Fixed: (Gazelle) Freeleech detection for releases 2022-01-01 20:08:59 -06:00
Qstick
b9dfe5e359 Fixed: (Gazelle) Use InfoUrl for GUID to avoid global duplicates 2022-01-01 20:01:40 -06:00
Qstick
a5e13ca776 New: Genre parameter for Music search 2022-01-01 15:04:05 -06:00
Qstick
e2ddfbff9c New: Genre parameter for Movie search 2022-01-01 14:49:01 -06:00
Qstick
66b4c7891d New: TmdbId Parameter for TV Search 2022-01-01 14:43:49 -06:00
Qstick
480a76c290 New: Support for language metadata 2022-01-01 14:23:44 -06:00
Servarr
1373ab255d Automated API Docs update 2021-12-31 19:41:04 -06:00
Qstick
1dc00eb445 More powerful label actions 2021-12-31 19:34:28 -06:00
Qstick
a366bec684 New: Reenable TV Id search for PrivateHD 2021-12-31 19:34:28 -06:00
Qstick
ecca6e9f49 New: TVDB and TMDB Search for AvistaZ
Ref #717
2021-12-31 19:34:13 -06:00
Yukine
03db7a9bbd Fixed: (SpeedApp) correct categories in query string of requests 2021-12-31 15:09:03 -06:00
Qstick
9cb04466c1 DbType param on update check 2021-12-31 13:19:22 -06:00
bakerboy448
2bae37d0c5 Fixed: (TorrentLeech) Calculating Incorrect Age
Closes #720
2021-12-31 11:04:31 -06:00
bakerboy448
0dbd23c52b Fixed: Various Translations 2021-12-30 23:34:48 -06:00
bakerboy448
66a6311dcc Fixed: SemiPublic => SemiPrivate 2021-12-30 23:00:19 -06:00
Servarr
c5b111530c Automated API Docs update 2021-12-30 22:37:20 -06:00
Qstick
77724a50a4 Really fix Github token for API PR 2021-12-30 21:42:46 -06:00
Qstick
22cbd01c57 Bump to 0.1.10 2021-12-30 19:03:04 -06:00
Yukine
fd55a624a7 Fixed: (AnimeBytes) Do not Page requests 2021-12-30 19:01:42 -06:00
Qstick
75984e954e Update LocalizationController.cs 2021-12-30 18:41:56 -06:00
Qstick
3fce120578 Fixed: (SpeedApp) Map Categories instead of building
Fixes #574
2021-12-30 18:30:58 -06:00
Qstick
6e8fb22c71 New: Additional logging for InvalidModel BadRequest API calls
[common]
2021-12-30 17:51:34 -06:00
Qstick
8ec7a4898d Maintain PrimaryKey and AutoIncrement on some schemas
[common]
2021-12-30 17:51:11 -06:00
Qstick
642848d331 API Annotations 2021-12-30 15:51:51 -06:00
Qstick
c9e6a0339e Fixed: (Cardigann) Indexer privacy tweaks, Semi-Public fixes
Fixes #744
2021-12-29 18:18:09 -06:00
Qstick
25620e8670 Fix GitHub token variable usage 2021-12-29 18:16:36 -06:00
Mouton99
5b804e8f3a New: (TorrentSeeds) Migrate to API & YML 2021-12-29 18:14:22 -06:00
Servarr
548db6a5cd Automated API Docs update 2021-12-29 17:48:53 -06:00
65 changed files with 432 additions and 726 deletions

16
.github/label-actions.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
# Configuration for Label Actions - https://github.com/dessant/label-actions
'Type: Support':
comment: >
:wave: @{issue-author}, we use the issue tracker exclusively
for bug reports and feature requests. However, this issue appears
to be a support request. Please hop over onto our [Discord](https://prowlarr.com/discord)
or [Subreddit](https://reddit.com/r/prowlarr)
close: true
'Type: Indexer Request':
comment: >
:wave: @{issue-author}, we use the issue tracker exclusively
for bug reports and feature requests. However, this issue appears
to be a indexer request. Please use our Indexer request [site](https://requests.prowlarr.com/)
close: true

23
.github/workflows/label-actions.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: 'Label Actions'
on:
issues:
types: [labeled, unlabeled]
pull_request:
types: [labeled, unlabeled]
discussion:
types: [labeled, unlabeled]
permissions:
contents: read
issues: write
pull-requests: write
discussions: write
jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/label-actions@v2
with:
process-only: 'issues, prs'

View File

@@ -1,21 +0,0 @@
name: 'Support requests'
on:
issues:
types: [labeled, unlabeled, reopened]
jobs:
support:
runs-on: ubuntu-latest
steps:
- uses: dessant/support-requests@v2
with:
github-token: ${{ github.token }}
support-label: 'Type: Support'
issue-comment: >
:wave: @{issue-author}, we use the issue tracker exclusively
for bug reports and feature requests. However, this issue appears
to be a support request. Please hop over onto our [Discord](https://prowlarr.com/discord)
or [Subreddit](https://reddit.com/r/prowlarr)
close-issue: true
lock-issue: false

View File

@@ -7,7 +7,7 @@ variables:
outputFolder: './_output'
artifactsFolder: './_artifacts'
testsFolder: './_tests'
majorVersion: '0.1.9'
majorVersion: '0.1.10'
minorVersion: $[counter('minorVersion', 1)]
prowlarrVersion: '$(majorVersion).$(minorVersion)'
buildName: '$(Build.SourceBranchName).$(prowlarrVersion)'
@@ -857,14 +857,14 @@ stages:
then
git commit -am 'Automated API Docs update'
git push -f --set-upstream origin api-docs
curl -X POST -H 'Authorization: token $GITHUB_TOKEN' -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/prowlarr/prowlarr/pulls -d '{"head":"api-docs","base":"develop","title":"Update API docs"}'
curl -X POST -H "Authorization: token ${GITHUBTOKEN}" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/prowlarr/prowlarr/pulls -d '{"head":"api-docs","base":"develop","title":"Update API docs"}'
else
echo "No changes since last run"
fi
displayName: Commit API Doc Change
continueOnError: true
env:
GITHUB_TOKEN: $(githubToken)
GITHUBTOKEN: $(githubToken)
- task: CopyFiles@2
displayName: 'Copy openapi.json to: $(Build.ArtifactStagingDirectory)'
inputs:

View File

@@ -77,7 +77,9 @@ function AppUpdatedModalContent(props) {
<div>
{
!update.changes &&
<div className={styles.maintenance}>Maintenance release</div>
<div className={styles.maintenance}>
{translate('MaintenanceRelease')}
</div>
}
{

View File

@@ -166,7 +166,9 @@ class FilterBuilderModalContent extends Component {
</div>
</div>
<div className={styles.label}>Filters</div>
<div className={styles.label}>
{translate('Filters')}
</div>
<div className={styles.rows}>
{

View File

@@ -41,7 +41,7 @@ function HistoryDetails(props) {
{
!!data &&
<DescriptionListItem
title={'Query Results'}
title={translate('QueryResults')}
data={queryResults ? queryResults : '-'}
/>
}
@@ -49,7 +49,7 @@ function HistoryDetails(props) {
{
!!data &&
<DescriptionListItem
title={'Categories'}
title={translate('Categories')}
data={categories ? categories : '-'}
/>
}
@@ -57,7 +57,7 @@ function HistoryDetails(props) {
{
!!data &&
<DescriptionListItem
title={'Source'}
title={translate('Source')}
data={source}
/>
}
@@ -65,7 +65,7 @@ function HistoryDetails(props) {
{
!!data &&
<DescriptionListItem
title={'Url'}
title={translate('Url')}
data={url ? <Link to={url}>{translate('Link')}</Link> : '-'}
/>
}
@@ -93,7 +93,7 @@ function HistoryDetails(props) {
{
!!data &&
<DescriptionListItem
title={'Source'}
title={translate('Source')}
data={source ? source : '-'}
/>
}
@@ -101,7 +101,7 @@ function HistoryDetails(props) {
{
!!data &&
<DescriptionListItem
title={'Title'}
title={translate('Title')}
data={title ? title : '-'}
/>
}
@@ -109,7 +109,7 @@ function HistoryDetails(props) {
{
!!data &&
<DescriptionListItem
title={'Url'}
title={translate('Url')}
data={url ? <Link to={url}>{translate('Link')}</Link> : '-'}
/>
}

View File

@@ -4,6 +4,7 @@ import FormGroup from 'Components/Form/FormGroup';
import FormInputGroup from 'Components/Form/FormInputGroup';
import FormLabel from 'Components/Form/FormLabel';
import { inputTypes } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
class HistoryOptions extends Component {
@@ -56,14 +57,14 @@ class HistoryOptions extends Component {
return (
<Fragment>
<FormGroup>
<FormLabel>History Cleanup</FormLabel>
<FormLabel>{translate('HistoryCleanup')}</FormLabel>
<FormInputGroup
type={inputTypes.NUMBER}
name="historyCleanupDays"
value={historyCleanupDays}
helpText="Set to 0 to disable automatic cleanup"
helpTextWarning="History items older than the selected number of days will be cleaned up automatically"
helpText={translate('HistoryCleanupDaysHelpText')}
helpTextWarning={translate('HistoryCleanupDaysHelpTextWarning')}
onChange={this.onGlobalInputChange}
/>
</FormGroup>

View File

@@ -56,6 +56,21 @@ const protocols = [
}
];
const privacyLevels = [
{
key: 'private',
value: translate('Private')
},
{
key: 'semiPrivate',
value: translate('SemiPrivate')
},
{
key: 'public',
value: translate('Public')
}
];
class AddIndexerModalContent extends Component {
//
@@ -99,10 +114,6 @@ class AddIndexerModalContent extends Component {
.sort((a, b) => a.localeCompare(b))
.map((language) => ({ key: language, value: language }));
const privacyLevels = Array.from(new Set(indexers.map(({ privacy }) => privacy)))
.sort((a, b) => a.localeCompare(b))
.map((privacy) => ({ key: privacy, value: privacy }));
const filteredIndexers = indexers.filter((indexer) => {
const { filter, filterProtocols, filterLanguages, filterPrivacyLevels } = this.state;

View File

@@ -3,6 +3,8 @@ import React, { Component } from 'react';
import TableRowCell from 'Components/Table/Cells/TableRowCell';
import TableRowButton from 'Components/Table/TableRowButton';
import ProtocolLabel from 'Indexer/Index/Table/ProtocolLabel';
import firstCharToUpper from 'Utilities/String/firstCharToUpper';
import translate from 'Utilities/String/translate';
import styles from './SelectIndexerRow.css';
class SelectIndexerRow extends Component {
@@ -47,7 +49,7 @@ class SelectIndexerRow extends Component {
</TableRowCell>
<TableRowCell>
{privacy}
{translate(firstCharToUpper(privacy))}
</TableRowCell>
</TableRowButton>
);

View File

@@ -159,7 +159,7 @@ function EditIndexerModalContent(props) {
<FormInputGroup
type={inputTypes.TAG}
name="tags"
helpText="Use tags to specify default clients, specify Indexer Proxies, or just to organize your indexers."
helpText={translate('IndexerTagsHelpText')}
{...tags}
onChange={onInputChange}
/>

View File

@@ -302,14 +302,14 @@ class IndexerIndex extends Component {
<PageToolbar>
<PageToolbarSection>
<PageToolbarButton
label={'Add Indexer'}
label={translate('AddIndexer')}
iconName={icons.ADD}
spinningName={icons.ADD}
onPress={this.onAddIndexerPress}
/>
<PageToolbarButton
label={'Test All Indexers'}
label={translate('TestAllIndexers')}
iconName={icons.TEST}
isSpinning={isTestingAll}
isDisabled={hasNoIndexer}
@@ -321,13 +321,13 @@ class IndexerIndex extends Component {
{
isMovieEditorActive ?
<PageToolbarButton
label={'Indexers'}
label={translate('Indexers')}
iconName={icons.MOVIE_CONTINUING}
isDisabled={hasNoIndexer}
onPress={this.onMovieEditorTogglePress}
/> :
<PageToolbarButton
label={'Mass Editor'}
label={translate('MassEditor')}
iconName={icons.EDIT}
isDisabled={hasNoIndexer}
onPress={this.onMovieEditorTogglePress}

View File

@@ -240,14 +240,14 @@ class IndexerIndexRow extends Component {
>
<IconButton
name={icons.INFO}
title={'Indexer info'}
title={translate('IndexerInfo')}
onPress={this.onIndexerInfoPress}
/>
<IconButton
className={styles.externalLink}
name={icons.EXTERNAL_LINK}
title={'Website'}
title={translate('Website')}
to={indexerUrls[0].replace('api.', '')}
/>

View File

@@ -299,7 +299,7 @@ class SearchIndexRow extends Component {
<IconButton
className={styles.downloadLink}
name={icons.SAVE}
title={'Save'}
title={translate('Save')}
to={downloadUrl}
/>
</VirtualTableRowCell>

View File

@@ -61,7 +61,7 @@ class Applications extends Component {
return (
<FieldSet legend={translate('Applications')}>
<PageSectionContent
errorMessage="Unable to load application list"
errorMessage={translate('UnableToLoadApplicationList')}
{...otherProps}
>
<div className={styles.applications}>

View File

@@ -61,7 +61,7 @@ class IndexerProxies extends Component {
} = this.state;
return (
<FieldSet legend={translate('Indexer Proxies')}>
<FieldSet legend={translate('IndexerProxies')}>
<PageSectionContent
errorMessage={translate('UnableToLoadIndexerProxies')}
{...otherProps}

View File

@@ -67,7 +67,7 @@ function TagDetailsModalContent(props) {
{
!!indexerProxies.length &&
<FieldSet legend={translate('Indexer Proxies')}>
<FieldSet legend={translate('IndexerProxies')}>
{
indexerProxies.map((item) => {
return (

View File

@@ -199,7 +199,7 @@ class QueuedTaskRow extends Component {
</span>
{
clientUserAgent ?
<span className={styles.userAgent} title="User-Agent provided by the app that called the API">
<span className={styles.userAgent} title={translate('UserAgentProvidedByTheAppThatCalledTheAPI')}>
from: {clientUserAgent}
</span> :
null

View File

@@ -6,8 +6,8 @@
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<!-- Chrome, Opera, and Firefox OS -->
<meta name="theme-color" content="#3a3f51" />
<!-- Chrome, Safari, Opera, and Firefox OS -->
<meta name="theme-color" content="#e66001" />
<!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#3a3f51" />

View File

@@ -6,8 +6,8 @@
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<!-- Chrome, Opera, and Firefox OS -->
<meta name="theme-color" content="#464b51" />
<!-- Chrome, Safari, Opera, and Firefox OS -->
<meta name="theme-color" content="#e66001" />
<!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#464b51" />

View File

@@ -229,11 +229,6 @@ namespace NzbDrone.Common.Test.Http
[Test]
public void should_follow_redirects_to_https()
{
if (typeof(TDispatcher) == typeof(ManagedHttpDispatcher) && PlatformInfo.IsMono)
{
Assert.Ignore("Will fail on tls1.2 via managed dispatcher, ignore.");
}
var request = new HttpRequestBuilder($"https://{_httpBinHost}/redirect-to")
.AddQueryParam("url", $"https://radarr.video/")
.Build();

View File

@@ -34,19 +34,10 @@ namespace NzbDrone.Common.Http.Dispatchers
{
var webRequest = (HttpWebRequest)WebRequest.Create((Uri)request.Url);
if (PlatformInfo.IsMono)
{
// On Mono GZipStream/DeflateStream leaks memory if an exception is thrown, use an intermediate buffer in that case.
webRequest.AutomaticDecompression = DecompressionMethods.None;
webRequest.Headers.Add("Accept-Encoding", "gzip");
}
else
{
// Deflate is not a standard and could break depending on implementation.
// we should just stick with the more compatible Gzip
//http://stackoverflow.com/questions/8490718/how-to-decompress-stream-deflated-with-java-util-zip-deflater-in-net
webRequest.AutomaticDecompression = DecompressionMethods.GZip;
}
// Deflate is not a standard and could break depending on implementation.
// we should just stick with the more compatible Gzip
//http://stackoverflow.com/questions/8490718/how-to-decompress-stream-deflated-with-java-util-zip-deflater-in-net
webRequest.AutomaticDecompression = DecompressionMethods.GZip;
webRequest.Method = request.Method.ToString();
webRequest.UserAgent = _userAgentBuilder.GetUserAgent(request.UseSimplifiedUserAgent);
@@ -127,19 +118,6 @@ namespace NzbDrone.Common.Http.Dispatchers
try
{
data = await responseStream.ToBytes();
if (PlatformInfo.IsMono && httpWebResponse.ContentEncoding == "gzip")
{
using (var compressedStream = new MemoryStream(data))
using (var gzip = new GZipStream(compressedStream, CompressionMode.Decompress))
using (var decompressedStream = new MemoryStream())
{
gzip.CopyTo(decompressedStream);
data = decompressedStream.ToArray();
}
httpWebResponse.Headers.Remove("Content-Encoding");
}
}
catch (Exception ex)
{

View File

@@ -91,7 +91,9 @@ namespace NzbDrone.Common.Http
request.ContentData = null;
}
response = await ExecuteRequestAsync(request, cookieContainer);
var redirectContainer = HandleRedirectCookies(request, response);
response = await ExecuteRequestAsync(request, redirectContainer);
}
while (response.HasHttpRedirect);
}
@@ -162,6 +164,41 @@ namespace NzbDrone.Common.Http
return response;
}
private CookieContainer HandleRedirectCookies(HttpRequest request, HttpResponse response)
{
var sourceContainer = new CookieContainer();
var responseCookies = response.GetCookies();
if (responseCookies.Count != 0)
{
foreach (var pair in responseCookies)
{
Cookie cookie;
if (pair.Value == null)
{
cookie = new Cookie(pair.Key, "", "/")
{
Expires = DateTime.Now.AddDays(-1)
};
}
else
{
cookie = new Cookie(pair.Key, pair.Value, "/")
{
// Use Now rather than UtcNow to work around Mono cookie expiry bug.
// See https://gist.github.com/ta264/7822b1424f72e5b4c961
Expires = DateTime.Now.AddHours(1)
};
}
sourceContainer.Add((Uri)request.Url, cookie);
}
}
return sourceContainer;
}
private CookieContainer InitializeRequestCookies(HttpRequest request)
{
lock (_cookieContainerCache)

View File

@@ -11,21 +11,19 @@ namespace NzbDrone.Common.Http
{
private static readonly Regex RegexSetCookie = new Regex("^(.*?)=(.*?)(?:;|$)", RegexOptions.Compiled);
public HttpResponse(HttpRequest request, HttpHeader headers, CookieCollection cookies, byte[] binaryData, long elapsedTime = 0, HttpStatusCode statusCode = HttpStatusCode.OK)
public HttpResponse(HttpRequest request, HttpHeader headers, byte[] binaryData, long elapsedTime = 0, HttpStatusCode statusCode = HttpStatusCode.OK)
{
Request = request;
Headers = headers;
Cookies = cookies;
ResponseData = binaryData;
StatusCode = statusCode;
ElapsedTime = elapsedTime;
}
public HttpResponse(HttpRequest request, HttpHeader headers, CookieCollection cookies, string content, long elapsedTime = 0, HttpStatusCode statusCode = HttpStatusCode.OK)
public HttpResponse(HttpRequest request, HttpHeader headers, string content, long elapsedTime = 0, HttpStatusCode statusCode = HttpStatusCode.OK)
{
Request = request;
Headers = headers;
Cookies = cookies;
ResponseData = Headers.GetEncodingFromContentType().GetBytes(content);
_content = content;
StatusCode = statusCode;
@@ -34,7 +32,6 @@ namespace NzbDrone.Common.Http
public HttpRequest Request { get; private set; }
public HttpHeader Headers { get; private set; }
public CookieCollection Cookies { get; private set; }
public HttpStatusCode StatusCode { get; private set; }
public long ElapsedTime { get; private set; }
public byte[] ResponseData { get; private set; }
@@ -92,9 +89,14 @@ namespace NzbDrone.Common.Http
{
var result = new Dictionary<string, string>();
foreach (Cookie cookie in Cookies)
var setCookieHeaders = CookieUtil.CookieHeaderToDictionary();
foreach (var cookie in setCookieHeaders)
{
result[cookie.Name] = cookie.Value;
var match = RegexSetCookie.Match(cookie);
if (match.Success)
{
result[match.Groups[1].Value] = match.Groups[2].Value;
}
}
return result;

View File

@@ -38,16 +38,6 @@ namespace NzbDrone.Common.Instrumentation
return;
}
if (PlatformInfo.IsMono)
{
if ((exception is TypeInitializationException && exception.InnerException is DllNotFoundException) ||
exception is DllNotFoundException)
{
Logger.Debug(exception, "Minor Fail: " + exception.Message);
return;
}
}
Console.WriteLine("EPIC FAIL: {0}", exception);
Logger.Fatal(exception, "EPIC FAIL.");
}

View File

@@ -106,13 +106,6 @@ namespace NzbDrone.Common.Instrumentation.Sentry
o.Debug = false;
o.DiagnosticLevel = SentryLevel.Debug;
o.Release = BuildInfo.Release;
if (PlatformInfo.IsMono)
{
// Mono 6.0 broke GzipStream.WriteAsync
// TODO: Check specific version
o.RequestBodyCompressionLevel = System.IO.Compression.CompressionLevel.NoCompression;
}
o.BeforeSend = x => SentryCleanser.CleanseEvent(x);
o.BeforeBreadcrumb = x => SentryCleanser.CleanseBreadcrumb(x);
o.Environment = BuildInfo.Branch;
@@ -155,7 +148,7 @@ namespace NzbDrone.Common.Instrumentation.Sentry
{
scope.SetTag("is_docker", $"{osInfo.IsDocker}");
if (osInfo.Name != null && PlatformInfo.IsMono)
if (osInfo.Name != null && !OsInfo.IsWindows)
{
// Sentry auto-detection of non-Windows platforms isn't that accurate on certain devices.
scope.Contexts.OperatingSystem.Name = osInfo.Name.FirstCharToUpper();

View File

@@ -366,11 +366,6 @@ namespace NzbDrone.Common.Processes
private (string Path, string Args) GetPathAndArgs(string path, string args)
{
if (PlatformInfo.IsMono && path.EndsWith(".exe", StringComparison.InvariantCultureIgnoreCase))
{
return ("mono", $"--debug {path} {args}");
}
if (OsInfo.IsWindows && path.EndsWith(".bat", StringComparison.InvariantCultureIgnoreCase))
{
return ("cmd.exe", $"/c {path} {args}");

View File

@@ -1,4 +1,4 @@
using System.Data;
using System.Data;
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
@@ -38,6 +38,7 @@ namespace NzbDrone.Core.Test.Datastore.SqliteSchemaDumperTests
result.Name.Should().Be(tableName);
result.Columns.Count.Should().Be(1);
result.Columns.First().Name.Should().Be(columnName);
result.Columns.First().IsIdentity.Should().BeTrue();
}
[TestCase(@"CREATE INDEX TestIndex ON TestTable (MyId)", "TestIndex", "TestTable", "MyId")]

View File

@@ -133,12 +133,19 @@ namespace NzbDrone.Core.Applications.LazyLibrarian
{
return new ValidationFailure("ApiKey", status.Error.Message);
}
var indexers = GetIndexers(settings);
}
catch (HttpException ex)
{
_logger.Error(ex, "Unable to send test message");
return new ValidationFailure("BaseUrl", "Unable to complete application test");
}
catch (LazyLibrarianException ex)
{
_logger.Error(ex, "Connection test failed");
return new ValidationFailure("", ex.Message);
}
catch (Exception ex)
{
_logger.Error(ex, "Unable to send test message");

View File

@@ -133,12 +133,19 @@ namespace NzbDrone.Core.Applications.Mylar
{
return new ValidationFailure("ApiKey", status.Error.Message);
}
var indexers = GetIndexers(settings);
}
catch (HttpException ex)
{
_logger.Error(ex, "Unable to send test message");
return new ValidationFailure("BaseUrl", "Unable to complete application test");
}
catch (MylarException ex)
{
_logger.Error(ex, "Connection test failed");
return new ValidationFailure("", ex.Message);
}
catch (Exception ex)
{
_logger.Error(ex, "Unable to send test message");

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using FluentMigrator.Model;
using FluentMigrator.Runner.Processors.SQLite;
@@ -66,6 +67,24 @@ namespace NzbDrone.Core.Datastore.Migration.Framework
if (columnReader.Read() == SqliteSyntaxReader.TokenType.StringToken)
{
if (columnReader.ValueToUpper == "PRIMARY")
{
columnReader.SkipTillToken(SqliteSyntaxReader.TokenType.ListStart);
if (columnReader.Read() == SqliteSyntaxReader.TokenType.Identifier)
{
var pk = table.Columns.First(v => v.Name == columnReader.Value);
pk.IsPrimaryKey = true;
pk.IsNullable = true;
pk.IsUnique = true;
if (columnReader.Buffer.ToUpperInvariant().Contains("AUTOINCREMENT"))
{
pk.IsIdentity = true;
}
continue;
}
}
if (columnReader.ValueToUpper == "CONSTRAINT" ||
columnReader.ValueToUpper == "PRIMARY" || columnReader.ValueToUpper == "UNIQUE" ||
columnReader.ValueToUpper == "CHECK" || columnReader.ValueToUpper == "FOREIGN")

View File

@@ -10,6 +10,7 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
public int? TmdbId { get; set; }
public int? TraktId { get; set; }
public int? Year { get; set; }
public string Genre { get; set; }
public override bool RssSearch
{
@@ -64,6 +65,11 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
builder = builder.Append($" TraktId:[{TraktId}]");
}
if (Genre.IsNotNullOrWhiteSpace())
{
builder = builder.Append($" Genre:[{Genre}]");
}
return builder.ToString().Trim();
}
}

View File

@@ -7,6 +7,8 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
public string Album { get; set; }
public string Artist { get; set; }
public string Label { get; set; }
public string Genre { get; set; }
public int? Year { get; set; }
public override bool RssSearch
{

View File

@@ -16,6 +16,7 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
public int? RId { get; set; }
public int? TvMazeId { get; set; }
public int? TraktId { get; set; }
public int? TmdbId { get; set; }
public string SanitizedTvSearchString => (SanitizedSearchTerm + " " + EpisodeSearchString).Trim();
public string EpisodeSearchString => GetEpisodeSearchString();
@@ -74,6 +75,11 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
builder.Append($" TraktId:[{TraktId}]");
}
if (TmdbId.HasValue)
{
builder.Append($" TmdbId:[{TmdbId}]");
}
builder = builder.Append(searchEpisodeTerm);
return builder.ToString().Trim();
}

View File

@@ -89,6 +89,8 @@ namespace NzbDrone.Core.IndexerSearch
new XAttribute("type", protocol == DownloadProtocol.Torrent ? "application/x-bittorrent" : "application/x-nzb")),
r.Categories == null ? null : from c in r.Categories select GetNabElement("category", c.Id, protocol),
r.IndexerFlags == null ? null : from f in r.IndexerFlags select GetNabElement("tag", f.Name, protocol),
r.Languages == null ? null : from c in r.Languages select GetNabElement("language", c.Id, protocol),
r.Subs == null ? null : from c in r.Subs select GetNabElement("subs", c.Id, protocol),
GetNabElement("rageid", r.TvRageId, protocol),
GetNabElement("tvdbid", r.TvdbId, protocol),
GetNabElement("imdb", r.ImdbId.ToString("D7"), protocol),

View File

@@ -60,6 +60,7 @@ namespace NzbDrone.Core.IndexerSearch
searchSpec.TmdbId = request.tmdbid;
searchSpec.TraktId = request.traktid;
searchSpec.Year = request.year;
searchSpec.Genre = request.genre;
return new NewznabResults { Releases = await Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec) };
}
@@ -71,6 +72,8 @@ namespace NzbDrone.Core.IndexerSearch
searchSpec.Artist = request.artist;
searchSpec.Album = request.album;
searchSpec.Label = request.label;
searchSpec.Genre = request.genre;
searchSpec.Year = request.year;
return new NewznabResults { Releases = await Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec) };
}
@@ -84,6 +87,7 @@ namespace NzbDrone.Core.IndexerSearch
searchSpec.TvdbId = request.tvdbid;
searchSpec.ImdbId = request.imdbid;
searchSpec.TraktId = request.traktid;
searchSpec.TmdbId = request.tmdbid;
searchSpec.RId = request.rid;
searchSpec.TvMazeId = request.tvmazeid;

View File

@@ -30,7 +30,7 @@ namespace NzbDrone.Core.Indexers.Definitions
public override string Language => "ru-RU";
public override Encoding Encoding => Encoding.UTF8;
public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
public override IndexerPrivacy Privacy => IndexerPrivacy.SemiPublic;
public override IndexerPrivacy Privacy => IndexerPrivacy.SemiPrivate;
public override IndexerCapabilities Capabilities => SetCapabilities();
public Anidub(IIndexerHttpClient httpClient, IEventAggregator eventAggregator, IIndexerStatusService indexerStatusService, IConfigService configService, Logger logger)

View File

@@ -106,7 +106,37 @@ namespace NzbDrone.Core.Indexers.Definitions
{
}
private IEnumerable<IndexerRequest> GetPagedRequests(string searchType, string term, int[] categories)
public IndexerPageableRequestChain GetSearchRequests(MovieSearchCriteria searchCriteria)
=> GetRequestWithSearchType(searchCriteria, "anime");
public IndexerPageableRequestChain GetSearchRequests(MusicSearchCriteria searchCriteria)
=> GetRequestWithSearchType(searchCriteria, "music");
public IndexerPageableRequestChain GetSearchRequests(TvSearchCriteria searchCriteria)
=> GetRequestWithSearchType(searchCriteria, "anime");
public IndexerPageableRequestChain GetSearchRequests(BookSearchCriteria searchCriteria)
=> GetRequestWithSearchType(searchCriteria, "anime");
public IndexerPageableRequestChain GetSearchRequests(BasicSearchCriteria searchCriteria)
=> GetRequestWithSearchType(searchCriteria, "anime");
private IndexerPageableRequestChain GetRequestWithSearchType(SearchCriteriaBase searchCriteria, string searchType)
{
var pageableRequests = new IndexerPageableRequestChain();
// TODO: Remove this once Prowlarr has proper support for non Pageable Indexers and can tell Sonarr that indexer doesn't support pagination in a proper way, for now just return empty release list on all request containing an offset
if (searchCriteria.Offset is > 0)
{
return pageableRequests;
}
pageableRequests.Add(GetRequest(searchType, searchCriteria.SanitizedSearchTerm, searchCriteria.Categories));
return pageableRequests;
}
private IEnumerable<IndexerRequest> GetRequest(string searchType, string term, int[] categories)
{
var searchUrl = string.Format("{0}/scrape.php", Settings.BaseUrl.TrimEnd('/'));
@@ -135,51 +165,6 @@ namespace NzbDrone.Core.Indexers.Definitions
yield return request;
}
public IndexerPageableRequestChain GetSearchRequests(MovieSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetPagedRequests("anime", searchCriteria.SanitizedSearchTerm, searchCriteria.Categories));
return pageableRequests;
}
public IndexerPageableRequestChain GetSearchRequests(MusicSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetPagedRequests("music", searchCriteria.SanitizedSearchTerm, searchCriteria.Categories));
return pageableRequests;
}
public IndexerPageableRequestChain GetSearchRequests(TvSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetPagedRequests("anime", searchCriteria.SanitizedSearchTerm, searchCriteria.Categories));
return pageableRequests;
}
public IndexerPageableRequestChain GetSearchRequests(BookSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetPagedRequests("anime", searchCriteria.SanitizedSearchTerm, searchCriteria.Categories));
return pageableRequests;
}
public IndexerPageableRequestChain GetSearchRequests(BasicSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetPagedRequests("anime", searchCriteria.SanitizedSearchTerm, searchCriteria.Categories));
return pageableRequests;
}
public Func<IDictionary<string, string>> GetCookies { get; set; }
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }

View File

@@ -36,11 +36,11 @@ namespace NzbDrone.Core.Indexers.Definitions
{
TvSearchParams = new List<TvSearchParam>
{
TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep, TvSearchParam.ImdbId
TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep, TvSearchParam.ImdbId, TvSearchParam.TvdbId
},
MovieSearchParams = new List<MovieSearchParam>
{
MovieSearchParam.Q, MovieSearchParam.ImdbId
MovieSearchParam.Q, MovieSearchParam.ImdbId, MovieSearchParam.TmdbId
}
};

View File

@@ -77,6 +77,10 @@ namespace NzbDrone.Core.Indexers.Definitions.Avistaz
{
parameters.Add("imdb", searchCriteria.FullImdbId);
}
else if (searchCriteria.TmdbId.HasValue)
{
parameters.Add("tmdb", searchCriteria.TmdbId.Value.ToString());
}
else
{
parameters.Add("search", GetSearchTerm(searchCriteria.SanitizedSearchTerm).Trim());
@@ -105,6 +109,12 @@ namespace NzbDrone.Core.Indexers.Definitions.Avistaz
if (searchCriteria.ImdbId.IsNotNullOrWhiteSpace())
{
parameters.Add("imdb", searchCriteria.FullImdbId);
parameters.Add("search", GetSearchTerm(searchCriteria.EpisodeSearchString).Trim());
}
else if (searchCriteria.TvdbId.HasValue)
{
parameters.Add("tvdb", searchCriteria.TvdbId.Value.ToString());
parameters.Add("search", GetSearchTerm(searchCriteria.EpisodeSearchString).Trim());
}
else
{

View File

@@ -128,7 +128,12 @@ namespace NzbDrone.Core.Indexers.Cardigann
IndexerUrls = definition.Links.ToArray(),
Settings = new CardigannSettings { DefinitionFile = definition.File },
Protocol = DownloadProtocol.Torrent,
Privacy = definition.Type == "private" ? IndexerPrivacy.Private : IndexerPrivacy.Public,
Privacy = definition.Type switch
{
"private" => IndexerPrivacy.Private,
"public" => IndexerPrivacy.Public,
_ => IndexerPrivacy.SemiPrivate
},
SupportsRss = SupportsRss,
SupportsSearch = SupportsSearch,
SupportsRedirect = SupportsRedirect,

View File

@@ -52,6 +52,8 @@ namespace NzbDrone.Core.Indexers.Gazelle
foreach (var result in jsonResponse.Resource.Response.Results)
{
var posterUrl = GetPosterUrl(result.Cover);
if (result.Torrents != null)
{
foreach (var torrent in result.Torrents)
@@ -66,9 +68,11 @@ namespace NzbDrone.Core.Indexers.Gazelle
title += " [Cue]";
}
var infoUrl = GetInfoUrl(result.GroupId, id);
var release = new GazelleInfo()
{
Guid = string.Format("Gazelle-{0}", id),
Guid = infoUrl,
Title = WebUtility.HtmlDecode(title),
Container = torrent.Encoding,
Files = torrent.FileCount,
@@ -76,11 +80,14 @@ namespace NzbDrone.Core.Indexers.Gazelle
Codec = torrent.Format,
Size = long.Parse(torrent.Size),
DownloadUrl = GetDownloadUrl(id),
InfoUrl = GetInfoUrl(result.GroupId, id),
InfoUrl = infoUrl,
Seeders = int.Parse(torrent.Seeders),
Peers = int.Parse(torrent.Leechers) + int.Parse(torrent.Seeders),
PublishDate = torrent.Time.ToUniversalTime(),
Scene = torrent.Scene,
PosterUrl = posterUrl,
DownloadVolumeFactor = torrent.IsFreeLeech || torrent.IsNeutralLeech || torrent.IsPersonalFreeLeech ? 0 : 1,
UploadVolumeFactor = torrent.IsNeutralLeech ? 0 : 1
};
var category = torrent.Category;
@@ -100,19 +107,23 @@ namespace NzbDrone.Core.Indexers.Gazelle
{
var id = result.TorrentId;
var groupName = WebUtility.HtmlDecode(result.GroupName);
var infoUrl = GetInfoUrl(result.GroupId, id);
var release = new GazelleInfo()
{
Guid = string.Format("Gazelle-{0}", id),
Guid = infoUrl,
Title = groupName,
Size = long.Parse(result.Size),
DownloadUrl = GetDownloadUrl(id),
InfoUrl = GetInfoUrl(result.GroupId, id),
InfoUrl = infoUrl,
Seeders = int.Parse(result.Seeders),
Peers = int.Parse(result.Leechers) + int.Parse(result.Seeders),
Files = result.FileCount,
Grabs = result.Snatches,
PublishDate = DateTimeOffset.FromUnixTimeSeconds(result.GroupTime).UtcDateTime,
PosterUrl = posterUrl,
DownloadVolumeFactor = result.IsFreeLeech || result.IsNeutralLeech || result.IsPersonalFreeLeech ? 0 : 1,
UploadVolumeFactor = result.IsNeutralLeech ? 0 : 1
};
var category = result.Category;
@@ -147,7 +158,19 @@ namespace NzbDrone.Core.Indexers.Gazelle
return url.FullUri;
}
private string GetInfoUrl(string groupId, int torrentId)
protected virtual string GetPosterUrl(string cover)
{
if (!string.IsNullOrEmpty(cover))
{
return cover.StartsWith("http") ?
new HttpUri(cover).FullUri :
new HttpUri(_settings.BaseUrl).CombinePath(cover).FullUri;
}
return null;
}
protected virtual string GetInfoUrl(string groupId, int torrentId)
{
var url = new HttpUri(_settings.BaseUrl)
.CombinePath("/torrents.php")

View File

@@ -178,7 +178,7 @@ namespace NzbDrone.Core.Indexers.Definitions
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetPagedRequests(string.Format("{0}", searchCriteria.SearchTerm), searchCriteria.Categories));
pageableRequests.Add(GetPagedRequests(string.Format("{0}", searchCriteria.SanitizedSearchTerm), searchCriteria.Categories));
return pageableRequests;
}
@@ -187,7 +187,7 @@ namespace NzbDrone.Core.Indexers.Definitions
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetPagedRequests(string.Format("{0}", searchCriteria.SearchTerm), searchCriteria.Categories, searchCriteria.FullImdbId));
pageableRequests.Add(GetPagedRequests(string.Format("{0}", searchCriteria.SanitizedSearchTerm), searchCriteria.Categories, searchCriteria.FullImdbId));
return pageableRequests;
}
@@ -196,7 +196,7 @@ namespace NzbDrone.Core.Indexers.Definitions
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetPagedRequests(string.Format("{0}", searchCriteria.SearchTerm), searchCriteria.Categories));
pageableRequests.Add(GetPagedRequests(string.Format("{0}", searchCriteria.SanitizedSearchTerm), searchCriteria.Categories));
return pageableRequests;
}
@@ -205,7 +205,7 @@ namespace NzbDrone.Core.Indexers.Definitions
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetPagedRequests(string.Format("{0}", searchCriteria.SearchTerm), searchCriteria.Categories));
pageableRequests.Add(GetPagedRequests(string.Format("{0}", searchCriteria.SanitizedSearchTerm), searchCriteria.Categories));
return pageableRequests;
}

View File

@@ -1,6 +1,5 @@
using System.Collections.Generic;
using NLog;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers.Definitions.Avistaz;
using NzbDrone.Core.Messaging.Events;
@@ -36,11 +35,11 @@ namespace NzbDrone.Core.Indexers.Definitions
{
TvSearchParams = new List<TvSearchParam>
{
TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep
TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep, TvSearchParam.ImdbId, TvSearchParam.TvdbId
},
MovieSearchParams = new List<MovieSearchParam>
{
MovieSearchParam.Q, MovieSearchParam.ImdbId
MovieSearchParam.Q, MovieSearchParam.ImdbId, MovieSearchParam.TmdbId
},
MusicSearchParams = new List<MusicSearchParam>
{

View File

@@ -221,9 +221,11 @@ namespace NzbDrone.Core.Indexers.Definitions
title += " [Cue]";
}
var infoUrl = GetInfoUrl(result.GroupId, id);
GazelleInfo release = new GazelleInfo()
{
Guid = string.Format("Redacted-{0}", id),
Guid = infoUrl,
// Splice Title from info to avoid calling API again for every torrent.
Title = WebUtility.HtmlDecode(title),
@@ -232,7 +234,7 @@ namespace NzbDrone.Core.Indexers.Definitions
Codec = torrent.Format,
Size = long.Parse(torrent.Size),
DownloadUrl = GetDownloadUrl(id, torrent.CanUseToken),
InfoUrl = GetInfoUrl(result.GroupId, id),
InfoUrl = infoUrl,
Seeders = int.Parse(torrent.Seeders),
Peers = int.Parse(torrent.Leechers) + int.Parse(torrent.Seeders),
PublishDate = torrent.Time.ToUniversalTime(),
@@ -240,6 +242,8 @@ namespace NzbDrone.Core.Indexers.Definitions
Freeleech = torrent.IsFreeLeech || torrent.IsPersonalFreeLeech,
Files = torrent.FileCount,
Grabs = torrent.Snatches,
DownloadVolumeFactor = torrent.IsFreeLeech || torrent.IsNeutralLeech || torrent.IsPersonalFreeLeech ? 0 : 1,
UploadVolumeFactor = torrent.IsNeutralLeech ? 0 : 1
};
var category = torrent.Category;
@@ -260,19 +264,23 @@ namespace NzbDrone.Core.Indexers.Definitions
else
{
var id = result.TorrentId;
var infoUrl = GetInfoUrl(result.GroupId, id);
GazelleInfo release = new GazelleInfo()
{
Guid = string.Format("Redacted-{0}", id),
Guid = infoUrl,
Title = WebUtility.HtmlDecode(result.GroupName),
Size = long.Parse(result.Size),
DownloadUrl = GetDownloadUrl(id, result.CanUseToken),
InfoUrl = GetInfoUrl(result.GroupId, id),
InfoUrl = infoUrl,
Seeders = int.Parse(result.Seeders),
Peers = int.Parse(result.Leechers) + int.Parse(result.Seeders),
PublishDate = DateTimeOffset.FromUnixTimeSeconds(result.GroupTime).UtcDateTime,
Freeleech = result.IsFreeLeech || result.IsPersonalFreeLeech,
Files = result.FileCount,
Grabs = result.Snatches,
DownloadVolumeFactor = result.IsFreeLeech || result.IsNeutralLeech || result.IsPersonalFreeLeech ? 0 : 1,
UploadVolumeFactor = result.IsNeutralLeech ? 0 : 1
};
var category = result.Category;

View File

@@ -61,7 +61,7 @@ namespace NzbDrone.Core.Indexers.Definitions
public override IParseIndexerResponse GetParser()
{
return new SpeedAppParser(Settings);
return new SpeedAppParser(Settings, Capabilities.Categories);
}
protected override bool CheckIfLoginNeeded(HttpResponse httpResponse)
@@ -335,7 +335,7 @@ namespace NzbDrone.Core.Indexers.Definitions
}
}
var searchUrl = Settings.BaseUrl + "/api/torrent?" + qc.GetQueryString();
var searchUrl = Settings.BaseUrl + "/api/torrent?" + qc.GetQueryString(duplicateKeysIfMulti: true);
var request = new IndexerRequest(searchUrl, HttpAccept.Json);
@@ -347,13 +347,15 @@ namespace NzbDrone.Core.Indexers.Definitions
public class SpeedAppParser : IParseIndexerResponse
{
public SpeedAppSettings Settings { get; set; }
private readonly SpeedAppSettings _settings;
private readonly IndexerCapabilitiesCategories _categories;
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
public SpeedAppParser(SpeedAppSettings settings)
public SpeedAppParser(SpeedAppSettings settings, IndexerCapabilitiesCategories categories)
{
Settings = settings;
_settings = settings;
_categories = categories;
}
public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
@@ -377,12 +379,12 @@ namespace NzbDrone.Core.Indexers.Definitions
Description = torrent.ShortDescription,
Size = torrent.Size,
ImdbId = ParseUtil.GetImdbID(torrent.ImdbId).GetValueOrDefault(),
DownloadUrl = $"{Settings.BaseUrl}/api/torrent/{torrent.Id}/download",
DownloadUrl = $"{_settings.BaseUrl}/api/torrent/{torrent.Id}/download",
PosterUrl = torrent.Poster,
InfoUrl = torrent.Url,
Grabs = torrent.TimesCompleted,
PublishDate = torrent.CreatedAt,
Categories = new List<IndexerCategory> { new (torrent.Category.Id, torrent.Category.Name), },
Categories = _categories.MapTrackerCatToNewznab(torrent.Category.Id.ToString()),
InfoHash = null,
Seeders = torrent.Seeders,
Peers = torrent.Leechers + torrent.Seeders,

View File

@@ -281,7 +281,7 @@ namespace NzbDrone.Core.Indexers.Definitions
var torrentId = row.fid.ToString();
var details = new Uri(_settings.BaseUrl + "torrent/" + torrentId);
var link = new Uri(_settings.BaseUrl + "download/" + torrentId + "/" + row.filename);
var publishDate = DateTime.ParseExact(row.addedTimestamp.ToString(), "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
var publishDate = DateTime.ParseExact(row.addedTimestamp.ToString(), "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);
var seeders = (int)row.seeders;
var leechers = (int)row.leechers;
var grabs = (int)row.completed;

View File

@@ -21,6 +21,7 @@ using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.Definitions
{
[Obsolete("Moved to YML for Cardigann v3")]
public class TorrentSeeds : TorrentIndexerBase<TorrentSeedsSettings>
{
public override string Name => "TorrentSeeds";

View File

@@ -13,7 +13,9 @@ namespace NzbDrone.Core.Indexers
ImdbId,
TvdbId,
RId,
TvMazeId
TvMazeId,
TraktId,
TmdbId
}
public enum MovieSearchParam
@@ -24,6 +26,7 @@ namespace NzbDrone.Core.Indexers
ImdbTitle,
ImdbYear,
TraktId,
Genre
}
public enum MusicSearchParam
@@ -32,7 +35,8 @@ namespace NzbDrone.Core.Indexers
Album,
Artist,
Label,
Year
Year,
Genre
}
public enum SearchParam
@@ -65,12 +69,15 @@ namespace NzbDrone.Core.Indexers
public bool TvSearchTvdbAvailable => TvSearchParams.Contains(TvSearchParam.TvdbId);
public bool TvSearchTvRageAvailable => TvSearchParams.Contains(TvSearchParam.RId);
public bool TvSearchTvMazeAvailable => TvSearchParams.Contains(TvSearchParam.TvMazeId);
public bool TvSearchTraktAvailable => TvSearchParams.Contains(TvSearchParam.TraktId);
public bool TvSearchTmdbAvailable => TvSearchParams.Contains(TvSearchParam.TmdbId);
public List<MovieSearchParam> MovieSearchParams;
public bool MovieSearchAvailable => MovieSearchParams.Count > 0;
public bool MovieSearchImdbAvailable => MovieSearchParams.Contains(MovieSearchParam.ImdbId);
public bool MovieSearchTmdbAvailable => MovieSearchParams.Contains(MovieSearchParam.TmdbId);
public bool MovieSearchTraktAvailable => MovieSearchParams.Contains(MovieSearchParam.TraktId);
public bool MovieSearchGenreAvailable => MovieSearchParams.Contains(MovieSearchParam.Genre);
public List<MusicSearchParam> MusicSearchParams;
public bool MusicSearchAvailable => MusicSearchParams.Count > 0;
@@ -78,6 +85,7 @@ namespace NzbDrone.Core.Indexers
public bool MusicSearchArtistAvailable => MusicSearchParams.Contains(MusicSearchParam.Artist);
public bool MusicSearchLabelAvailable => MusicSearchParams.Contains(MusicSearchParam.Label);
public bool MusicSearchYearAvailable => MusicSearchParams.Contains(MusicSearchParam.Year);
public bool MusicSearchGenreAvailable => MusicSearchParams.Contains(MusicSearchParam.Genre);
public List<BookSearchParam> BookSearchParams;
public bool BookSearchAvailable => BookSearchParams.Count > 0;
@@ -284,6 +292,16 @@ namespace NzbDrone.Core.Indexers
parameters.Add("tvmazeid");
}
if (TvSearchTraktAvailable)
{
parameters.Add("traktid");
}
if (TvSearchTmdbAvailable)
{
parameters.Add("tmdbid");
}
return string.Join(",", parameters);
}
@@ -307,6 +325,16 @@ namespace NzbDrone.Core.Indexers
parameters.Add("tmdbid");
}
if (MovieSearchTraktAvailable)
{
parameters.Add("traktid");
}
if (MovieSearchGenreAvailable)
{
parameters.Add("genre");
}
return string.Join(",", parameters);
}
@@ -333,6 +361,11 @@ namespace NzbDrone.Core.Indexers
parameters.Add("year");
}
if (MusicSearchGenreAvailable)
{
parameters.Add("genre");
}
return string.Join(",", parameters);
}

View File

@@ -94,7 +94,12 @@ namespace NzbDrone.Core.Indexers
definition.Description = defFile.Description;
definition.Language = defFile.Language;
definition.Encoding = Encoding.GetEncoding(defFile.Encoding);
definition.Privacy = defFile.Type == "private" ? IndexerPrivacy.Private : IndexerPrivacy.Public;
definition.Privacy = defFile.Type switch
{
"private" => IndexerPrivacy.Private,
"public" => IndexerPrivacy.Public,
_ => IndexerPrivacy.SemiPrivate
};
definition.Capabilities = new IndexerCapabilities();
definition.Capabilities.ParseCardigannSearchModes(defFile.Caps.Modes);
definition.Capabilities.SupportsRawSearch = defFile.Caps.Allowrawsearch;

View File

@@ -3,7 +3,7 @@ namespace NzbDrone.Core.Indexers
public enum IndexerPrivacy
{
Public,
SemiPublic,
SemiPrivate,
Private
}
}

View File

@@ -61,6 +61,7 @@
"BypassProxyForLocalAddresses": "Bypass Proxy for Local Addresses",
"Cancel": "Cancel",
"CancelPendingTask": "Are you sure you want to cancel this pending task?",
"Categories": "Categories",
"Category": "Category",
"CertificateValidation": "Certificate Validation",
"CertificateValidationHelpText": "Change how strict HTTPS certification validation is",
@@ -69,7 +70,6 @@
"ClearHistory": "Clear History",
"ClearHistoryMessageText": "Are you sure you want to clear all Prowlarr history?",
"ClientPriority": "Client Priority",
"CloneIndexer": "Clone Indexer",
"CloneProfile": "Clone Profile",
"Close": "Close",
"CloseCurrentModal": "Close Current Modal",
@@ -88,7 +88,6 @@
"Date": "Date",
"Dates": "Dates",
"DBMigration": "DB Migration",
"DelayProfile": "Delay Profile",
"Delete": "Delete",
"DeleteApplication": "Delete Application",
"DeleteApplicationMessageText": "Are you sure you want to delete the application '{0}'?",
@@ -97,8 +96,6 @@
"DeleteBackupMessageText": "Are you sure you want to delete the backup '{0}'?",
"DeleteDownloadClient": "Delete Download Client",
"DeleteDownloadClientMessageText": "Are you sure you want to delete the download client '{0}'?",
"DeleteIndexer": "Delete Indexer",
"DeleteIndexerMessageText": "Are you sure you want to delete the indexer '{0}'?",
"DeleteIndexerProxy": "Delete Indexer Proxy",
"DeleteIndexerProxyMessageText": "Are you sure you want to delete the proxy '{0}'?",
"DeleteNotification": "Delete Notification",
@@ -113,35 +110,21 @@
"Docker": "Docker",
"Donations": "Donations",
"DownloadClient": "Download Client",
"DownloadClientCheckNoneAvailableMessage": "No download client is available",
"DownloadClientCheckUnableToCommunicateMessage": "Unable to communicate with {0}.",
"DownloadClients": "Download Clients",
"DownloadClientSettings": "Download Client Settings",
"DownloadClientsSettingsSummary": "Download clients configuration for integration into Prowlarr UI search",
"DownloadClientStatusCheckAllClientMessage": "All download clients are unavailable due to failures",
"DownloadClientStatusCheckSingleClientMessage": "Download clients unavailable due to failures: {0}",
"DownloadClientUnavailable": "Download client is unavailable",
"Downloading": "Downloading",
"Edit": "Edit",
"EditAppProfile": "Edit App Profile",
"EditIndexer": "Edit Indexer",
"Enable": "Enable",
"EnableAutoHelpText": "If enabled, Movies will be automatically added to Prowlarr from this list",
"EnableAutomaticAdd": "Enable Automatic Add",
"EnableAutomaticSearch": "Enable Automatic Search",
"EnableAutomaticSearchHelpText": "Will be used when automatic searches are performed via the UI or by Prowlarr",
"EnableAutomaticSearchHelpTextWarning": "Will be used when interactive search is used",
"EnableColorImpairedMode": "Enable Color-Impaired Mode",
"EnableColorImpairedModeHelpText": "Altered style to allow color-impaired users to better distinguish color coded information",
"EnableCompletedDownloadHandlingHelpText": "Automatically import completed downloads from download client",
"Enabled": "Enabled",
"EnabledHelpText": "Enable this list for use in Prowlarr",
"EnableHelpText": "Enable metadata file creation for this metadata type",
"EnableIndexer": "Enable Indexer",
"EnableInteractiveSearch": "Enable Interactive Search",
"EnableInteractiveSearchHelpText": "Will be used when interactive search is used",
"EnableInteractiveSearchHelpTextWarning": "Search is not supported with this indexer",
"EnableMediaInfoHelpText": "Extract video information such as resolution, runtime and codec information from files. This requires Prowlarr to read parts of the file which may cause high disk or network activity during scans.",
"EnableRss": "Enable RSS",
"EnableRssHelpText": "Enable Rss feed for Indexer",
"EnableSSL": "Enable SSL",
@@ -152,7 +135,6 @@
"Events": "Events",
"EventType": "Event Type",
"Exception": "Exception",
"ExistingMovies": "Existing Movie(s)",
"ExistingTag": "Existing tag",
"Failed": "Failed",
"FeatureRequests": "Feature Requests",
@@ -160,6 +142,7 @@
"Files": "Files",
"Filter": "Filter",
"FilterPlaceHolder": "Search indexers",
"Filters": "Filters",
"Fixed": "Fixed",
"FocusSearchBox": "Focus Search Box",
"Folder": "Folder",
@@ -175,18 +158,21 @@
"HiddenClickToShow": "Hidden, click to show",
"HideAdvanced": "Hide Advanced",
"History": "History",
"HistoryCleanup": "History Cleanup",
"HistoryCleanupDaysHelpText": "Set to 0 to disable automatic cleanup",
"HistoryCleanupDaysHelpTextWarning": "History items older than the selected number of days will be cleaned up automatically",
"HomePage": "Home Page",
"Host": "Host",
"Hostname": "Hostname",
"Id": "Id",
"IgnoredAddresses": "Ignored Addresses",
"IllRestartLater": "I'll restart later",
"Importing": "Importing",
"IncludeHealthWarningsHelpText": "Include Health Warnings",
"Indexer": "Indexer",
"IndexerAuth": "Indexer Auth",
"IndexerFlags": "Indexer Flags",
"IndexerHealthCheckNoIndexers": "No indexers enabled, Prowlarr will not return search results",
"IndexerInfo": "Indexer Info",
"IndexerLongTermStatusCheckAllClientMessage": "All indexers are unavailable due to failures for more than 6 hours",
"IndexerLongTermStatusCheckSingleClientMessage": "Indexers unavailable due to failures for more than 6 hours: {0}",
"IndexerObsoleteCheckMessage": "Indexers are obsolete or have been updated: {0}. Please remove and (or) re-add to Prowlarr",
@@ -211,7 +197,6 @@
"Interval": "Interval",
"KeyboardShortcuts": "Keyboard Shortcuts",
"Language": "Language",
"Languages": "Languages",
"LastWriteTime": "Last Write Time",
"LaunchBrowserHelpText": " Open a web browser and navigate to the Prowlarr homepage on app start.",
"Level": "Level",
@@ -220,27 +205,16 @@
"LogLevel": "Log Level",
"LogLevelTraceHelpTextWarning": "Trace logging should only be enabled temporarily",
"Logs": "Logs",
"MaintenanceRelease": "Maintenance release",
"MaintenanceRelease": "Maintenance Release: bug fixes and other improvements. See Github Commit History for more details",
"Manual": "Manual",
"MaximumLimits": "Maximum Limits",
"MassEditor": "Mass Editor",
"Mechanism": "Mechanism",
"Message": "Message",
"MIA": "MIA",
"MinimumLimits": "Minimum Limits",
"MinutesHundredTwenty": "120 Minutes: {0}",
"MinutesNinety": "90 Minutes: {0}",
"MinutesSixty": "60 Minutes: {0}",
"Mode": "Mode",
"MonoNotNetCoreCheckMessage": "Please upgrade to the .NET Core version of Prowlarr",
"MonoTlsCheckMessage": "Prowlarr Mono 4.x tls workaround still enabled, consider removing MONO_TLS_PROVIDER=legacy environment option",
"MonoVersion": "Mono Version",
"MonoVersionCheckUpgradeRecommendedMessage": "Currently installed Mono version {0} is supported but upgrading to {1} is recommended.",
"MoreInfo": "More Info",
"MovieDetailsNextMovie": "Movie Details: Next Movie",
"MovieDetailsPreviousMovie": "Movie Details: Previous Movie",
"MovieIndexScrollBottom": "Movie Index: Scroll Bottom",
"MovieIndexScrollTop": "Movie Index: Scroll Top",
"Movies": "Movies",
"MovieSearch": "Movie Search",
"Name": "Name",
"NetCore": ".NET",
@@ -249,10 +223,8 @@
"NoChange": "No Change",
"NoChanges": "No Changes",
"NoLeaveIt": "No, Leave It",
"NoLimitForAnyRuntime": "No limit for any runtime",
"NoLinks": "No Links",
"NoLogFiles": "No log files",
"NoMinimumForAnyRuntime": "No minimum for any runtime",
"NoSearchResultsFound": "No search results found, try performing a new search below.",
"NoTagsHaveBeenAddedYet": "No tags have been added yet",
"Notification": "Notification",
@@ -264,6 +236,7 @@
"Ok": "Ok",
"OnApplicationUpdate": "On Application Update",
"OnApplicationUpdateHelpText": "On Application Update",
"OnGrab": "On Grab",
"OnHealthIssue": "On Health Issue",
"OnHealthIssueHelpText": "On Health Issue",
"OpenBrowserOnStart": "Open browser on start",
@@ -274,21 +247,21 @@
"PageSizeHelpText": "Number of items to show on each page",
"Password": "Password",
"Peers": "Peers",
"Pending": "Pending",
"PendingChangesDiscardChanges": "Discard changes and leave",
"PendingChangesMessage": "You have unsaved changes, are you sure you want to leave this page?",
"PendingChangesStayReview": "Stay and review changes",
"Port": "Port",
"PortNumber": "Port Number",
"PreferredSize": "Preferred Size",
"Presets": "Presets",
"Priority": "Priority",
"PriorityHelpText": "Prioritize multiple Download Clients. Round-Robin is used for clients with the same priority.",
"PrioritySettings": "Priority",
"Privacy": "Privacy",
"Private": "Private",
"Protocol": "Protocol",
"ProwlarrSupportsAnyDownloadClient": "Prowlarr supports any of the download clients listed below.",
"ProwlarrSupportsAnyIndexer": "Prowlarr supports many indexers in addition to any indexer that uses the Newznab/Torznab standard using 'Generic Newznab' (for usenet) or 'Generic Torznab' (for torrents). Search & Select your indexer from below.",
"Proxies": "Proxies",
"Proxy": "Proxy",
"ProxyBypassFilterHelpText": "Use ',' as a separator, and '*.' as a wildcard for subdomains",
"ProxyCheckBadRequestMessage": "Failed to test proxy. StatusCode: {0}",
@@ -298,10 +271,10 @@
"ProxyType": "Proxy Type",
"ProxyUsernameHelpText": "You only need to enter a username and password if one is required. Leave them blank otherwise.",
"PtpOldSettingsCheckMessage": "The following PassThePopcorn indexers have deprecated settings and should be updated: {0}",
"QualityDefinitions": "Quality Definitions",
"QualitySettings": "Quality Settings",
"Public": "Public",
"Query": "Query",
"QueryOptions": "Query Options",
"QueryResults": "Query Results",
"Queue": "Queue",
"ReadTheWikiForMoreInformation": "Read the Wiki for more information",
"Reddit": "Reddit",
@@ -310,7 +283,6 @@
"Refresh": "Refresh",
"RefreshMovie": "Refresh movie",
"ReleaseBranchCheckOfficialBranchMessage": "Branch {0} is not a valid Prowlarr release branch, you will not receive updates",
"ReleaseBranchCheckPreviousVersionMessage": "Branch {0} is for a previous version of Prowlarr, set branch to 'Nightly' for further updates",
"ReleaseStatus": "Release Status",
"Reload": "Reload",
"RemovedFromTaskQueue": "Removed from task queue",
@@ -324,7 +296,6 @@
"RestartRequiredHelpTextWarning": "Requires restart to take effect",
"Restore": "Restore",
"RestoreBackup": "Restore Backup",
"Restrictions": "Restrictions",
"Result": "Result",
"Retention": "Retention",
"RSS": "RSS",
@@ -340,6 +311,7 @@
"Security": "Security",
"Seeders": "Seeders",
"SelectAll": "Select All",
"SemiPrivate": "Semi-Private",
"SendAnonymousUsageData": "Send Anonymous Usage Data",
"SetTags": "Set Tags",
"Settings": "Settings",
@@ -396,6 +368,7 @@
"TestAll": "Test All",
"TestAllApps": "Test All Apps",
"TestAllClients": "Test All Clients",
"TestAllIndexers": "Test All Indexers",
"Time": "Time",
"Title": "Title",
"Today": "Today",
@@ -416,6 +389,7 @@
"UnableToAddANewIndexerPleaseTryAgain": "Unable to add a new indexer, please try again.",
"UnableToAddANewIndexerProxyPleaseTryAgain": "Unable to add a new indexer proxy, please try again.",
"UnableToAddANewNotificationPleaseTryAgain": "Unable to add a new notification, please try again.",
"UnableToLoadApplicationList": "Unable to load application list",
"UnableToLoadAppProfiles": "Unable to load app profiles",
"UnableToLoadBackups": "Unable to load backups",
"UnableToLoadDevelopmentSettings": "Unable to load Development settings",
@@ -423,9 +397,7 @@
"UnableToLoadGeneralSettings": "Unable to load General settings",
"UnableToLoadHistory": "Unable to load history",
"UnableToLoadIndexerProxies": "Unable To Load Indexer Proxies",
"UnableToLoadIndexers": "Unable to load Indexers",
"UnableToLoadNotifications": "Unable to load Notifications",
"UnableToLoadQualityDefinitions": "Unable to load Quality Definitions",
"UnableToLoadTags": "Unable to load Tags",
"UnableToLoadUISettings": "Unable to load UI settings",
"UnsavedChanges": "Unsaved Changes",
@@ -438,14 +410,17 @@
"Updates": "Updates",
"UpdateScriptPathHelpText": "Path to a custom script that takes an extracted update package and handle the remainder of the update process",
"Uptime": "Uptime",
"Url": "Url",
"URLBase": "URL Base",
"UrlBaseHelpText": "For reverse proxy support, default is empty",
"Usenet": "Usenet",
"UseProxy": "Use Proxy",
"UserAgentProvidedByTheAppThatCalledTheAPI": "User-Agent provided by the app that called the API",
"Username": "Username",
"Version": "Version",
"View": "View",
"Warn": "Warn",
"Website": "Website",
"Wiki": "Wiki",
"YesCancel": "Yes, Cancel",
"Yesterday": "Yesterday"

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Languages;
namespace NzbDrone.Core.Parser.Model
{
@@ -44,8 +45,9 @@ namespace NzbDrone.Core.Parser.Model
public string Container { get; set; }
public string Codec { get; set; }
public string Resolution { get; set; }
public ICollection<Language> Languages { get; set; }
public ICollection<Language> Subs { get; set; }
public ICollection<IndexerCategory> Categories { get; set; }
public ICollection<IndexerFlag> IndexerFlags { get; set; }
public int Age

View File

@@ -5,6 +5,7 @@ using NzbDrone.Common.Cloud;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Http;
using NzbDrone.Core.Analytics;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Core.Update
{
@@ -20,13 +21,15 @@ namespace NzbDrone.Core.Update
private readonly IHttpRequestBuilderFactory _requestBuilder;
private readonly IPlatformInfo _platformInfo;
private readonly IAnalyticsService _analyticsService;
private readonly IMainDatabase _mainDatabase;
public UpdatePackageProvider(IHttpClient httpClient, IProwlarrCloudRequestBuilder requestBuilder, IAnalyticsService analyticsService, IPlatformInfo platformInfo)
public UpdatePackageProvider(IHttpClient httpClient, IProwlarrCloudRequestBuilder requestBuilder, IAnalyticsService analyticsService, IPlatformInfo platformInfo, IMainDatabase mainDatabase)
{
_platformInfo = platformInfo;
_analyticsService = analyticsService;
_requestBuilder = requestBuilder.Services;
_httpClient = httpClient;
_mainDatabase = mainDatabase;
}
public UpdatePackage GetLatestUpdate(string branch, Version currentVersion)
@@ -38,6 +41,7 @@ namespace NzbDrone.Core.Update
.AddQueryParam("arch", RuntimeInformation.OSArchitecture)
.AddQueryParam("runtime", PlatformInfo.Platform.ToString().ToLowerInvariant())
.AddQueryParam("runtimeVer", _platformInfo.Version)
.AddQueryParam("dbType", _mainDatabase.DatabaseType)
.SetSegment("branch", branch);
if (_analyticsService.IsEnabled)
@@ -65,6 +69,7 @@ namespace NzbDrone.Core.Update
.AddQueryParam("arch", RuntimeInformation.OSArchitecture)
.AddQueryParam("runtime", PlatformInfo.Platform.ToString().ToLowerInvariant())
.AddQueryParam("runtimeVer", _platformInfo.Version)
.AddQueryParam("dbType", _mainDatabase.DatabaseType)
.SetSegment("branch", branch);
if (previousVersion != null && previousVersion != currentVersion)

View File

@@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
@@ -184,6 +185,21 @@ namespace NzbDrone.Host
});
services.AddAppAuthentication();
services.PostConfigure<ApiBehaviorOptions>(options =>
{
var builtInFactory = options.InvalidModelStateResponseFactory;
options.InvalidModelStateResponseFactory = context =>
{
var loggerFactory = context.HttpContext.RequestServices.GetRequiredService<ILoggerFactory>();
var logger = loggerFactory.CreateLogger(context.ActionDescriptor.DisplayName);
logger.LogError(STJson.ToJson(context.ModelState));
return builtInFactory(context);
};
});
}
public void Configure(IApplicationBuilder app,

View File

@@ -44,10 +44,6 @@ namespace NzbDrone.Test.Common
{
consoleExe = "Prowlarr.Console.exe";
}
else if (PlatformInfo.IsMono)
{
consoleExe = "Prowlarr.exe";
}
else
{
consoleExe = "Prowlarr";

View File

@@ -46,6 +46,7 @@ namespace Prowlarr.Api.V1.Commands
}
[RestPostById]
[Produces("application/json")]
public ActionResult<CommandResource> StartCommand(CommandResource commandResource)
{
var commandType =
@@ -69,6 +70,7 @@ namespace Prowlarr.Api.V1.Commands
}
[HttpGet]
[Produces("application/json")]
public List<CommandResource> GetStartedCommands()
{
return _commandQueueManager.All().ToResource();

View File

@@ -23,6 +23,7 @@ namespace Prowlarr.Api.V1.Config
}
[HttpGet]
[Produces("application/json")]
public TResource GetConfig()
{
var resource = ToResource(_configService);
@@ -32,6 +33,7 @@ namespace Prowlarr.Api.V1.Config
}
[RestPutById]
[Produces("application/json")]
public virtual ActionResult<TResource> SaveConfig(TResource resource)
{
var dictionary = resource.GetType()

View File

@@ -23,12 +23,14 @@ namespace Prowlarr.Api.V1.CustomFilters
}
[HttpGet]
[Produces("application/json")]
public List<CustomFilterResource> GetCustomFilters()
{
return _customFilterService.All().ToResource();
}
[RestPostById]
[Produces("application/json")]
public ActionResult<CustomFilterResource> AddCustomFilter(CustomFilterResource resource)
{
var customFilter = _customFilterService.Add(resource.ToModel());
@@ -37,6 +39,7 @@ namespace Prowlarr.Api.V1.CustomFilters
}
[RestPutById]
[Produces("application/json")]
public ActionResult<CustomFilterResource> UpdateCustomFilter(CustomFilterResource resource)
{
_customFilterService.Update(resource.ToModel());

View File

@@ -28,6 +28,7 @@ namespace Prowlarr.Api.V1.Health
}
[HttpGet]
[Produces("application/json")]
public List<HealthResource> GetHealth()
{
return _healthCheckService.Results().ToResource();

View File

@@ -27,6 +27,7 @@ namespace Prowlarr.Api.V1.History
}
[HttpGet]
[Produces("application/json")]
public PagingResource<HistoryResource> GetHistory()
{
var pagingResource = Request.ReadPagingResourceFromRequest<HistoryResource>();
@@ -58,12 +59,14 @@ namespace Prowlarr.Api.V1.History
}
[HttpGet("since")]
[Produces("application/json")]
public List<HistoryResource> GetHistorySince(DateTime date, HistoryEventType? eventType = null)
{
return _historyService.Since(date, eventType).Select(h => MapToResource(h)).ToList();
}
[HttpGet("indexer")]
[Produces("application/json")]
public List<HistoryResource> GetIndexerHistory(int indexerId, HistoryEventType? eventType = null)
{
return _historyService.GetByIndexerId(indexerId, eventType).Select(h => MapToResource(h)).ToList();

View File

@@ -22,6 +22,7 @@ namespace Prowlarr.Api.V1.Languages
}
[HttpGet]
[Produces("application/json")]
public List<LanguageResource> GetAll()
{
return Language.All.Select(l => new LanguageResource

View File

@@ -21,9 +21,10 @@ namespace Prowlarr.Api.V1.Localization
}
[HttpGet]
public string GetLocalizationDictionary()
[Produces("application/json")]
public IActionResult GetLocalizationDictionary()
{
return JsonSerializer.Serialize(_localizationService.GetLocalizationDictionary().ToResource(), _serializerSettings);
return Json(_localizationService.GetLocalizationDictionary().ToResource(), _serializerSettings);
}
}
}

View File

@@ -41,6 +41,7 @@ namespace Prowlarr.Api.V1
}
[HttpGet]
[Produces("application/json")]
public List<TProviderResource> GetAll()
{
var providerDefinitions = _providerFactory.All().OrderBy(p => p.ImplementationName);
@@ -58,6 +59,7 @@ namespace Prowlarr.Api.V1
}
[RestPostById]
[Produces("application/json")]
public ActionResult<TProviderResource> CreateProvider(TProviderResource providerResource)
{
var providerDefinition = GetDefinition(providerResource, false);
@@ -73,6 +75,7 @@ namespace Prowlarr.Api.V1
}
[RestPutById]
[Produces("application/json")]
public ActionResult<TProviderResource> UpdateProvider(TProviderResource providerResource)
{
var providerDefinition = GetDefinition(providerResource, false);
@@ -110,6 +113,7 @@ namespace Prowlarr.Api.V1
}
[HttpGet("schema")]
[Produces("application/json")]
public virtual List<TProviderResource> GetTemplates()
{
var defaultDefinitions = _providerFactory.GetDefaultDefinitions().OrderBy(p => p.ImplementationName).ToList();

View File

@@ -9,6 +9,23 @@
},
"version": "1.0.0"
},
"servers": [
{
"url": "{protocol}://{hostpath}",
"variables": {
"protocol": {
"default": "http",
"enum": [
"http",
"https"
]
},
"hostpath": {
"default": "localhost:9696"
}
}
}
],
"paths": {
"/api/v1/applications/{id}": {
"get": {
@@ -86,20 +103,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/ApplicationResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApplicationResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/ApplicationResource"
}
}
}
}
@@ -136,14 +143,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ApplicationResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -151,14 +150,6 @@
"$ref": "#/components/schemas/ApplicationResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ApplicationResource"
}
}
}
}
}
@@ -191,20 +182,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/ApplicationResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApplicationResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/ApplicationResource"
}
}
}
}
@@ -220,14 +201,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ApplicationResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -235,14 +208,6 @@
"$ref": "#/components/schemas/ApplicationResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ApplicationResource"
}
}
}
}
}
@@ -763,20 +728,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/CommandResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/CommandResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/CommandResource"
}
}
}
}
@@ -790,14 +745,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CommandResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -805,14 +752,6 @@
"$ref": "#/components/schemas/CommandResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CommandResource"
}
}
}
}
}
@@ -895,20 +834,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/CustomFilterResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/CustomFilterResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/CustomFilterResource"
}
}
}
}
@@ -945,14 +874,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CustomFilterResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -960,14 +881,6 @@
"$ref": "#/components/schemas/CustomFilterResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CustomFilterResource"
}
}
}
}
}
@@ -1000,20 +913,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/CustomFilterResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/CustomFilterResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/CustomFilterResource"
}
}
}
}
@@ -1058,20 +961,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/DevelopmentConfigResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/DevelopmentConfigResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/DevelopmentConfigResource"
}
}
}
}
@@ -1125,20 +1018,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/DevelopmentConfigResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/DevelopmentConfigResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/DevelopmentConfigResource"
}
}
}
}
@@ -1221,20 +1104,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/DownloadClientResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/DownloadClientResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/DownloadClientResource"
}
}
}
}
@@ -1271,14 +1144,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DownloadClientResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -1286,14 +1151,6 @@
"$ref": "#/components/schemas/DownloadClientResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DownloadClientResource"
}
}
}
}
}
@@ -1326,20 +1183,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/DownloadClientResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/DownloadClientResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/DownloadClientResource"
}
}
}
}
@@ -1355,14 +1202,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DownloadClientResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -1370,14 +1209,6 @@
"$ref": "#/components/schemas/DownloadClientResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DownloadClientResource"
}
}
}
}
}
@@ -1544,20 +1375,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/DownloadClientConfigResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/DownloadClientConfigResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/DownloadClientConfigResource"
}
}
}
}
@@ -1573,20 +1394,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/DownloadClientConfigResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/DownloadClientConfigResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/DownloadClientConfigResource"
}
}
}
}
@@ -1700,14 +1511,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/HealthResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -1715,14 +1518,6 @@
"$ref": "#/components/schemas/HealthResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/HealthResource"
}
}
}
}
}
@@ -1738,20 +1533,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/HistoryResourcePagingResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/HistoryResourcePagingResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/HistoryResourcePagingResource"
}
}
}
}
@@ -1784,14 +1569,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/HistoryResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -1799,14 +1576,6 @@
"$ref": "#/components/schemas/HistoryResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/HistoryResource"
}
}
}
}
}
@@ -1839,14 +1608,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/HistoryResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -1854,14 +1615,6 @@
"$ref": "#/components/schemas/HistoryResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/HistoryResource"
}
}
}
}
}
@@ -2069,20 +1822,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/IndexerResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/IndexerResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/IndexerResource"
}
}
}
}
@@ -2119,14 +1862,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/IndexerResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -2134,14 +1869,6 @@
"$ref": "#/components/schemas/IndexerResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/IndexerResource"
}
}
}
}
}
@@ -2174,20 +1901,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/IndexerResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/IndexerResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/IndexerResource"
}
}
}
}
@@ -2203,14 +1920,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/IndexerResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -2218,14 +1927,6 @@
"$ref": "#/components/schemas/IndexerResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/IndexerResource"
}
}
}
}
}
@@ -2490,20 +2191,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/IndexerProxyResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/IndexerProxyResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/IndexerProxyResource"
}
}
}
}
@@ -2540,14 +2231,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/IndexerProxyResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -2555,14 +2238,6 @@
"$ref": "#/components/schemas/IndexerProxyResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/IndexerProxyResource"
}
}
}
}
}
@@ -2595,20 +2270,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/IndexerProxyResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/IndexerProxyResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/IndexerProxyResource"
}
}
}
}
@@ -2624,14 +2289,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/IndexerProxyResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -2639,14 +2296,6 @@
"$ref": "#/components/schemas/IndexerProxyResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/IndexerProxyResource"
}
}
}
}
}
@@ -2923,14 +2572,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/LanguageResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -2938,14 +2579,6 @@
"$ref": "#/components/schemas/LanguageResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/LanguageResource"
}
}
}
}
}
@@ -2959,24 +2592,7 @@
],
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
},
"application/json": {
"schema": {
"type": "string"
}
},
"text/json": {
"schema": {
"type": "string"
}
}
}
"description": "Success"
}
}
}
@@ -3648,20 +3264,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotificationResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/NotificationResource"
}
}
}
}
@@ -3698,14 +3304,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NotificationResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -3713,14 +3311,6 @@
"$ref": "#/components/schemas/NotificationResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NotificationResource"
}
}
}
}
}
@@ -3753,20 +3343,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotificationResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/NotificationResource"
}
}
}
}
@@ -3782,14 +3362,6 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NotificationResource"
}
}
},
"application/json": {
"schema": {
"type": "array",
@@ -3797,14 +3369,6 @@
"$ref": "#/components/schemas/NotificationResource"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NotificationResource"
}
}
}
}
}
@@ -4703,20 +4267,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/UiConfigResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/UiConfigResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/UiConfigResource"
}
}
}
}
@@ -4732,20 +4286,10 @@
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/UiConfigResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/UiConfigResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/UiConfigResource"
}
}
}
}
@@ -5756,7 +5300,7 @@
"IndexerPrivacy": {
"enum": [
"public",
"semiPublic",
"semiPrivate",
"private"
],
"type": "string"