Compare commits

..

33 Commits

Author SHA1 Message Date
Bogdan
5c5a163151 Fixed: (AnimeBytes) Allow season searching for ONA 2025-03-28 13:39:19 +02:00
Bogdan
023eec0ec0 Update timezone offset for PrivateHD and CinemaZ 2025-03-25 13:04:07 +02:00
Bogdan
5bc5f0e6b8 New: Categories, genres, indexer flags and publish dates for webhook releases 2025-03-25 13:00:53 +02:00
Bogdan
5cbacc01eb Fixed: Publish dates timezone in history details for grabbed releases 2025-03-25 13:00:53 +02:00
Bogdan
f4f1b38324 New: On Grab notifications for CustomScript 2025-03-25 13:00:53 +02:00
Bogdan
758dddd4ad Bump version to 1.33.1 2025-03-23 09:45:33 +02:00
Bogdan
73ee695633 New: (BeyondHD) Parsing audio and subtitles languages 2025-03-22 21:01:22 +02:00
Bogdan
27fbd7ef7e Fixed: (RuTracker.org) Improve subtitles removal 2025-03-22 12:45:10 +02:00
Bogdan
5125f256fb Fixed: Priority validation for indexers and download clients 2025-03-20 20:38:13 +02:00
Mark McDowall
b99e8d0d65 Improve logging when login fails due to CryptographicException
(cherry picked from commit 1449941471cbb8885e9298317b9a30f2576d7941)
2025-03-16 13:10:09 +02:00
Bogdan
d20b2cc9c0 Bump NLog and Polly 2025-03-16 12:06:32 +02:00
Bogdan
8a1787bdb6 Bump version to 1.33.0 2025-03-16 11:42:07 +02:00
Mark McDowall
a19b8ea997 New: Truncate button text
Fixes #2352

(cherry picked from commit 093ee5b88db0470426f6132e66a5893e5cf89bab)
2025-03-10 20:07:15 +02:00
Mark McDowall
10ea6cd753 Improve wrapping of text in sidebar
(cherry picked from commit f58dfc5605738ebccdd6adc6f1ca2a7843c086b2)
2025-03-10 20:07:15 +02:00
Bogdan
2c1b464715 New: Recommend against using uTorrent
(cherry picked from commit 6d8c3f15b343a24fc31a212463af8ed2b5792508)
2025-03-10 20:07:15 +02:00
Bogdan
3263454041 Bump version to 1.32.2 2025-03-09 11:50:31 +02:00
Servarr
015db4a916 Translations update from Servarr Weblate (#2351)
Multiple Translations updated by Weblate

ignore-downstream







Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/fi/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/ko/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/zh_CN/
Translate-URL: https://translate.servarr.com/projects/servarr/prowlarr/zh_Hans/
Translation: Servarr/Prowlarr

Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Fixer <ygj59783@zslsz.com>
Co-authored-by: Oskari Lavinto <olavinto@protonmail.com>
Co-authored-by: Weblate <noreply-mt-weblate@weblate.org>
Co-authored-by: wangdj1314 <wangdj@risenenergy.com>
Co-authored-by: 葛磊磊 <geleilei198117@163.com>
2025-03-07 10:38:29 +02:00
Bogdan
49268f3b8d Fix timezone offset tests for AvistaZ trackers 2025-03-04 13:15:44 +02:00
Bogdan
f02a6f3e2c Update timezone offset for AvistaZ trackers 2025-03-03 17:17:29 +02:00
Bogdan
46b6124b97 Bump version to 1.32.1 2025-03-02 12:17:40 +02:00
Bogdan
53bc97b3be Fixed: (BeyondHd) Search daily episodes using year-month-day format 2025-03-01 17:34:58 +02:00
Bogdan
b09d4927cc Check instance name must contain application name with culture-insensitive 2025-03-01 13:38:34 +02:00
Bogdan
328f3c0423 Bump version to 1.32.0 2025-02-22 12:55:30 +02:00
Mark McDowall
635e76526a Cleanse console log messages
(cherry picked from commit 609e964794e17343f63e1ecff3fef323e3d284ff)
2025-02-19 15:59:34 +02:00
Stevie Robinson
790feed5ab Fixed: Fallback to Instance Name for Discord notifications
(cherry picked from commit b99e06acc0a3ecae2857d9225b35424c82c67a2b)
2025-02-19 15:55:42 +02:00
Mark McDowall
59b5d2fc78 Fixed: Drop downs flickering in some cases
(cherry picked from commit 3b024443c5447b7638a69a99809bf44b2419261f)
2025-02-18 17:09:56 +02:00
Bogdan
d5b12cf51a Fixed release guid for SpeedApp 2025-02-18 04:00:24 +02:00
Bogdan
2d584f7eb6 New: Support for exclusive indexer flag
Co-authored-by: zakkarry <zak@ary.dev>
2025-02-18 02:11:57 +02:00
Bogdan
0f1d647cd7 Fixed: (FileList) Download links when passkey contains spaces 2025-02-16 12:22:44 +02:00
zodihax
d6e8d89be4 Fixed: (NorBits) Update release category parsing (#2342)
Co-authored-by: Bogdan <mynameisbogdan@users.noreply.github.com>
2025-02-12 19:27:09 +02:00
Bogdan
8672129d5a Fixed: (AnimeTorrents) Switched to cookies login 2025-02-12 15:52:22 +02:00
Bogdan
44bdff8b8f Minor cleanup for AnimeTorrents 2025-02-12 15:52:22 +02:00
Bogdan
4df8fc02f1 Bump version to 1.31.2 2025-02-09 17:51:35 +02:00
73 changed files with 430 additions and 301 deletions

View File

@@ -9,7 +9,7 @@ variables:
testsFolder: './_tests'
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
majorVersion: '1.31.1'
majorVersion: '1.33.1'
minorVersion: $[counter('minorVersion', 1)]
prowlarrVersion: '$(majorVersion).$(minorVersion)'
buildName: '$(Build.SourceBranchName).$(prowlarrVersion)'

View File

@@ -20,6 +20,8 @@ import HintedSelectInputSelectedValue from './HintedSelectInputSelectedValue';
import TextInput from './TextInput';
import styles from './EnhancedSelectInput.css';
const MINIMUM_DISTANCE_FROM_EDGE = 10;
function isArrowKey(keyCode) {
return keyCode === keyCodes.UP_ARROW || keyCode === keyCodes.DOWN_ARROW;
}
@@ -137,18 +139,9 @@ class EnhancedSelectInput extends Component {
// Listeners
onComputeMaxHeight = (data) => {
const {
top,
bottom
} = data.offsets.reference;
const windowHeight = window.innerHeight;
if ((/^botton/).test(data.placement)) {
data.styles.maxHeight = windowHeight - bottom;
} else {
data.styles.maxHeight = top;
}
data.styles.maxHeight = windowHeight - MINIMUM_DISTANCE_FROM_EDGE;
return data;
};
@@ -460,6 +453,10 @@ class EnhancedSelectInput extends Component {
order: 851,
enabled: true,
fn: this.onComputeMaxHeight
},
preventOverflow: {
enabled: true,
boundariesElement: 'viewport'
}
}}
>

View File

@@ -24,6 +24,7 @@
composes: link;
padding: 10px 24px;
padding-left: 35px;
}
.isActiveLink {
@@ -41,10 +42,6 @@
text-align: center;
}
.noIcon {
margin-left: 25px;
}
.status {
float: right;
}

View File

@@ -8,7 +8,6 @@ interface CssExports {
'isActiveParentLink': string;
'item': string;
'link': string;
'noIcon': string;
'status': string;
}
export const cssExports: CssExports;

View File

@@ -63,9 +63,7 @@ class PageSidebarItem extends Component {
</span>
}
<span className={isChildItem ? styles.noIcon : null}>
{typeof title === 'function' ? title() : title}
</span>
{typeof title === 'function' ? title() : title}
{
!!StatusComponent &&

View File

@@ -22,11 +22,14 @@
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
height: 24px;
}
.label {
padding: 0 3px;
max-width: 100%;
max-height: 100%;
color: var(--toolbarLabelColor);
font-size: $extraSmallFontSize;
line-height: calc($extraSmallFontSize + 1px);

View File

@@ -23,6 +23,7 @@ function PageToolbarButton(props) {
isDisabled && styles.isDisabled
)}
isDisabled={isDisabled || isSpinning}
title={label}
{...otherProps}
>
<Icon

View File

@@ -0,0 +1,21 @@
using System.Text;
using NLog;
using NLog.Layouts.ClefJsonLayout;
using NzbDrone.Common.EnvironmentInfo;
namespace NzbDrone.Common.Instrumentation;
public class CleansingClefLogLayout : CompactJsonLayout
{
protected override void RenderFormattedMessage(LogEventInfo logEvent, StringBuilder target)
{
base.RenderFormattedMessage(logEvent, target);
if (RuntimeInfo.IsProduction)
{
var result = CleanseLogMessage.Cleanse(target.ToString());
target.Clear();
target.Append(result);
}
}
}

View File

@@ -0,0 +1,26 @@
using System.Text;
using NLog;
using NLog.Layouts;
using NzbDrone.Common.EnvironmentInfo;
namespace NzbDrone.Common.Instrumentation;
public class CleansingConsoleLogLayout : SimpleLayout
{
public CleansingConsoleLogLayout(string format)
: base(format)
{
}
protected override void RenderFormattedMessage(LogEventInfo logEvent, StringBuilder target)
{
base.RenderFormattedMessage(logEvent, target);
if (RuntimeInfo.IsProduction)
{
var result = CleanseLogMessage.Cleanse(target.ToString());
target.Clear();
target.Append(result);
}
}
}

View File

@@ -4,7 +4,7 @@ using NLog.Targets;
namespace NzbDrone.Common.Instrumentation
{
public class NzbDroneFileTarget : FileTarget
public class CleansingFileTarget : FileTarget
{
protected override void RenderFormattedMessage(LogEventInfo logEvent, StringBuilder target)
{

View File

@@ -3,7 +3,6 @@ using System.Diagnostics;
using System.IO;
using NLog;
using NLog.Config;
using NLog.Layouts.ClefJsonLayout;
using NLog.Targets;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Extensions;
@@ -13,9 +12,11 @@ namespace NzbDrone.Common.Instrumentation
{
public static class NzbDroneLogger
{
private const string FILE_LOG_LAYOUT = @"${date:format=yyyy-MM-dd HH\:mm\:ss.f}|${level}|${logger}|${message}${onexception:inner=${newline}${newline}[v${assembly-version}] ${exception:format=ToString}${newline}${exception:format=Data}${newline}}";
public const string ConsoleLogLayout = "[${level}] ${logger}: ${message} ${onexception:inner=${newline}${newline}[v${assembly-version}] ${exception:format=ToString}${newline}${exception:format=Data}${newline}}";
public static CompactJsonLayout ClefLogLayout = new CompactJsonLayout();
private const string FileLogLayout = @"${date:format=yyyy-MM-dd HH\:mm\:ss.f}|${level}|${logger}|${message}${onexception:inner=${newline}${newline}[v${assembly-version}] ${exception:format=ToString}${newline}${exception:format=Data}${newline}}";
private const string ConsoleFormat = "[${level}] ${logger}: ${message} ${onexception:inner=${newline}${newline}[v${assembly-version}] ${exception:format=ToString}${newline}${exception:format=Data}${newline}}";
private static readonly CleansingConsoleLogLayout CleansingConsoleLayout = new (ConsoleFormat);
private static readonly CleansingClefLogLayout ClefLogLayout = new ();
private static bool _isConfigured;
@@ -119,11 +120,7 @@ namespace NzbDrone.Common.Instrumentation
? formatEnumValue
: ConsoleLogFormat.Standard;
coloredConsoleTarget.Layout = logFormat switch
{
ConsoleLogFormat.Clef => ClefLogLayout,
_ => ConsoleLogLayout
};
ConfigureConsoleLayout(coloredConsoleTarget, logFormat);
var loggingRule = new LoggingRule("*", level, coloredConsoleTarget);
@@ -140,7 +137,7 @@ namespace NzbDrone.Common.Instrumentation
private static void RegisterAppFile(IAppFolderInfo appFolderInfo, string name, string fileName, int maxArchiveFiles, LogLevel minLogLevel)
{
var fileTarget = new NzbDroneFileTarget();
var fileTarget = new CleansingFileTarget();
fileTarget.Name = name;
fileTarget.FileName = Path.Combine(appFolderInfo.GetLogFolder(), fileName);
@@ -153,7 +150,7 @@ namespace NzbDrone.Common.Instrumentation
fileTarget.MaxArchiveFiles = maxArchiveFiles;
fileTarget.EnableFileDelete = true;
fileTarget.ArchiveNumbering = ArchiveNumberingMode.Rolling;
fileTarget.Layout = FILE_LOG_LAYOUT;
fileTarget.Layout = FileLogLayout;
var loggingRule = new LoggingRule("*", minLogLevel, fileTarget);
@@ -172,7 +169,7 @@ namespace NzbDrone.Common.Instrumentation
fileTarget.ConcurrentWrites = false;
fileTarget.ConcurrentWriteAttemptDelay = 50;
fileTarget.ConcurrentWriteAttempts = 100;
fileTarget.Layout = FILE_LOG_LAYOUT;
fileTarget.Layout = FileLogLayout;
var loggingRule = new LoggingRule("*", LogLevel.Trace, fileTarget);
@@ -217,6 +214,15 @@ namespace NzbDrone.Common.Instrumentation
{
return GetLogger(obj.GetType());
}
public static void ConfigureConsoleLayout(ColoredConsoleTarget target, ConsoleLogFormat format)
{
target.Layout = format switch
{
ConsoleLogFormat.Clef => NzbDroneLogger.ClefLogLayout,
_ => NzbDroneLogger.CleansingConsoleLayout
};
}
}
public enum ConsoleLogFormat

View File

@@ -9,9 +9,9 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="6.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="NLog.Layouts.ClefJsonLayout" Version="1.0.0" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.15" />
<PackageReference Include="NLog" Version="5.4.0" />
<PackageReference Include="NLog.Layouts.ClefJsonLayout" Version="1.0.3" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.4.0" />
<PackageReference Include="Npgsql" Version="7.0.9" />
<PackageReference Include="Sentry" Version="4.0.2" />
<PackageReference Include="NLog.Targets.Syslog" Version="7.0.0" />

View File

@@ -51,7 +51,7 @@ namespace NzbDrone.Core.Test.IndexerTests.AvistazTests
torrentInfo.InfoUrl.Should().Be("https://avistaz.to/torrent/187240-japan-sinks-people-of-hope-2021-s01e05-720p-nf-web-dl-ddp20-x264-seikel");
torrentInfo.CommentUrl.Should().BeNullOrEmpty();
torrentInfo.Indexer.Should().Be(Subject.Definition.Name);
torrentInfo.PublishDate.Should().Be(DateTime.Parse("2021-11-14 21:26:21"));
torrentInfo.PublishDate.Should().Be(DateTime.Parse("2021-11-14 22:26:21"));
torrentInfo.Size.Should().Be(935127615);
torrentInfo.InfoHash.Should().Be("a879261d4e6e792402f92401141a21de70d51bf2");
torrentInfo.MagnetUrl.Should().Be(null);

View File

@@ -51,7 +51,7 @@ namespace NzbDrone.Core.Test.IndexerTests.AvistazTests
torrentInfo.InfoUrl.Should().Be("https://exoticaz.to/torrent/64040-ssis-419-my-first-experience-is-yua-mikami-from-the-day-i-lost-my-virginity-i-was-devoted-to-sex");
torrentInfo.CommentUrl.Should().BeNullOrEmpty();
torrentInfo.Indexer.Should().Be(Subject.Definition.Name);
torrentInfo.PublishDate.Should().Be(DateTime.Parse("2022-06-11 09:04:50"));
torrentInfo.PublishDate.Should().Be(DateTime.Parse("2022-06-11 10:04:50"));
torrentInfo.Size.Should().Be(7085405541);
torrentInfo.InfoHash.Should().Be("asdjfiasdf54asd7f4a2sdf544asdf");
torrentInfo.MagnetUrl.Should().Be(null);

View File

@@ -26,15 +26,15 @@ namespace NzbDrone.Core.Test.IndexerTests.HDBitsTests
[SetUp]
public void Setup()
{
Subject.Definition = new IndexerDefinition()
Subject.Definition = new IndexerDefinition
{
Name = "HdBits",
Settings = new HDBitsSettings() { ApiKey = "fakekey" }
Settings = new HDBitsSettings { ApiKey = "fakekey" }
};
_movieSearchCriteria = new MovieSearchCriteria
{
Categories = new int[] { 2000, 2010 },
Categories = new[] { 2000, 2010 },
ImdbId = "0076759"
};
}
@@ -52,7 +52,7 @@ namespace NzbDrone.Core.Test.IndexerTests.HDBitsTests
var torrents = (await Subject.Fetch(_movieSearchCriteria)).Releases;
torrents.Should().HaveCount(2);
torrents.First().Should().BeOfType<HDBitsInfo>();
torrents.First().Should().BeOfType<TorrentInfo>();
var first = torrents.First() as TorrentInfo;

View File

@@ -274,7 +274,7 @@ namespace NzbDrone.Core.Configuration
{
var instanceName = _appOptions.InstanceName ?? GetValue("InstanceName", BuildInfo.AppName);
if (instanceName.ContainsIgnoreCase(BuildInfo.AppName))
if (instanceName.Contains(BuildInfo.AppName, StringComparison.OrdinalIgnoreCase))
{
return instanceName;
}

View File

@@ -7,6 +7,7 @@ using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Validation;
@@ -25,8 +26,9 @@ namespace NzbDrone.Core.Download.Clients.Aria2
ISeedConfigProvider seedConfigProvider,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, localizationService, logger)
{
_proxy = proxy;
}

View File

@@ -8,6 +8,7 @@ using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.Download.Clients.Blackhole
@@ -20,8 +21,9 @@ namespace NzbDrone.Core.Download.Clients.Blackhole
ISeedConfigProvider seedConfigProvider,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, localizationService, logger)
{
}

View File

@@ -7,6 +7,7 @@ using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.Download.Clients.Blackhole
@@ -16,8 +17,9 @@ namespace NzbDrone.Core.Download.Clients.Blackhole
public UsenetBlackhole(IHttpClient httpClient,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(httpClient, configService, diskProvider, logger)
: base(httpClient, configService, diskProvider, localizationService, logger)
{
}

View File

@@ -9,6 +9,7 @@ using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Validation;
@@ -23,8 +24,9 @@ namespace NzbDrone.Core.Download.Clients.Deluge
ISeedConfigProvider seedConfigProvider,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, localizationService, logger)
{
_proxy = proxy;
}

View File

@@ -10,6 +10,7 @@ using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Download.Clients.DownloadStation.Proxies;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
@@ -33,8 +34,9 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
ISeedConfigProvider seedConfigProvider,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, localizationService, logger)
{
_dsInfoProxy = dsInfoProxy;
_dsTaskProxySelector = dsTaskProxySelector;

View File

@@ -9,6 +9,7 @@ using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Download.Clients.DownloadStation.Proxies;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
@@ -31,8 +32,9 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
IHttpClient httpClient,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(httpClient, configService, diskProvider, logger)
: base(httpClient, configService, diskProvider, localizationService, logger)
{
_dsInfoProxy = dsInfoProxy;
_dsTaskProxySelector = dsTaskProxySelector;

View File

@@ -8,6 +8,7 @@ using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Download.Clients.Flood.Models;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.ThingiProvider;
@@ -22,8 +23,9 @@ namespace NzbDrone.Core.Download.Clients.Flood
ISeedConfigProvider seedConfigProvider,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, localizationService, logger)
{
_proxy = proxy;
}

View File

@@ -6,6 +6,7 @@ using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.Download.Clients.FreeboxDownload
@@ -19,8 +20,9 @@ namespace NzbDrone.Core.Download.Clients.FreeboxDownload
ISeedConfigProvider seedConfigProvider,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, localizationService, logger)
{
_proxy = proxy;
}

View File

@@ -6,6 +6,7 @@ using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Validation;
@@ -20,8 +21,9 @@ namespace NzbDrone.Core.Download.Clients.Hadouken
ISeedConfigProvider seedConfigProvider,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, localizationService, logger)
{
_proxy = proxy;
}

View File

@@ -7,6 +7,7 @@ using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Validation;
@@ -20,8 +21,9 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex
IHttpClient httpClient,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(httpClient, configService, diskProvider, logger)
: base(httpClient, configService, diskProvider, localizationService, logger)
{
_proxy = proxy;
}

View File

@@ -10,6 +10,7 @@ using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Exceptions;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Validation;
@@ -18,15 +19,14 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
public class Nzbget : UsenetClientBase<NzbgetSettings>
{
private readonly INzbgetProxy _proxy;
private readonly string[] _successStatus = { "SUCCESS", "NONE" };
private readonly string[] _deleteFailedStatus = { "HEALTH", "DUPE", "SCAN", "COPY", "BAD" };
public Nzbget(INzbgetProxy proxy,
IHttpClient httpClient,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(httpClient, configService, diskProvider, logger)
: base(httpClient, configService, diskProvider, localizationService, logger)
{
_proxy = proxy;
}

View File

@@ -8,6 +8,7 @@ using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
@@ -17,8 +18,9 @@ namespace NzbDrone.Core.Download.Clients.Pneumatic
{
public Pneumatic(IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(configService, diskProvider, logger)
: base(configService, diskProvider, localizationService, logger)
{
}

View File

@@ -8,6 +8,7 @@ using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Validation;
@@ -30,8 +31,9 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
IConfigService configService,
IDiskProvider diskProvider,
ICacheManager cacheManager,
ILocalizationService localizationService,
Logger logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, localizationService, logger)
{
_proxySelector = proxySelector;

View File

@@ -9,6 +9,7 @@ using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Exceptions;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Validation;
@@ -22,8 +23,9 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
IHttpClient httpClient,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(httpClient, configService, diskProvider, logger)
: base(httpClient, configService, diskProvider, localizationService, logger)
{
_proxy = proxy;
}

View File

@@ -5,6 +5,7 @@ using NLog;
using NzbDrone.Common.Disk;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
namespace NzbDrone.Core.Download.Clients.Transmission
{
@@ -15,8 +16,9 @@ namespace NzbDrone.Core.Download.Clients.Transmission
ISeedConfigProvider seedConfigProvider,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(proxy, torrentFileInfoReader, seedConfigProvider, configService, diskProvider, logger)
: base(proxy, torrentFileInfoReader, seedConfigProvider, configService, diskProvider, localizationService, logger)
{
}

View File

@@ -6,6 +6,7 @@ using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Validation;
@@ -20,8 +21,9 @@ namespace NzbDrone.Core.Download.Clients.Transmission
ISeedConfigProvider seedConfigProvider,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, localizationService, logger)
{
_proxy = proxy;
}

View File

@@ -4,6 +4,7 @@ using NzbDrone.Common.Disk;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Download.Clients.Transmission;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
namespace NzbDrone.Core.Download.Clients.Vuze
{
@@ -16,8 +17,9 @@ namespace NzbDrone.Core.Download.Clients.Vuze
ISeedConfigProvider seedConfigProvider,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(proxy, torrentFileInfoReader, seedConfigProvider, configService, diskProvider, logger)
: base(proxy, torrentFileInfoReader, seedConfigProvider, configService, diskProvider, localizationService, logger)
{
}

View File

@@ -10,6 +10,7 @@ using NzbDrone.Core.Configuration;
using NzbDrone.Core.Download.Clients.rTorrent;
using NzbDrone.Core.Exceptions;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
@@ -27,8 +28,9 @@ namespace NzbDrone.Core.Download.Clients.RTorrent
IConfigService configService,
IDiskProvider diskProvider,
IRTorrentDirectoryValidator rTorrentDirectoryValidator,
ILocalizationService localizationService,
Logger logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, localizationService, logger)
{
_proxy = proxy;
_rTorrentDirectoryValidator = rTorrentDirectoryValidator;

View File

@@ -7,7 +7,9 @@ using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Download.Clients.UTorrent
@@ -21,8 +23,9 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
ISeedConfigProvider seedConfigProvider,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, logger)
: base(torrentFileInfoReader, seedConfigProvider, configService, diskProvider, localizationService, logger)
{
_proxy = proxy;
}
@@ -72,6 +75,9 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
}
public override string Name => "uTorrent";
public override ProviderMessage Message => new (_localizationService.GetLocalizedString("DownloadClientUTorrentProviderMessage"), ProviderMessageType.Warning);
public override bool SupportsCategories => true;
protected override void Test(List<ValidationFailure> failures)

View File

@@ -8,6 +8,7 @@ using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
@@ -19,6 +20,7 @@ namespace NzbDrone.Core.Download
{
protected readonly IConfigService _configService;
protected readonly IDiskProvider _diskProvider;
protected readonly ILocalizationService _localizationService;
protected readonly Logger _logger;
public abstract string Name { get; }
@@ -40,10 +42,12 @@ namespace NzbDrone.Core.Download
protected DownloadClientBase(IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
{
_configService = configService;
_diskProvider = diskProvider;
_localizationService = localizationService;
_logger = logger;
}

View File

@@ -8,6 +8,7 @@ using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Exceptions;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.ThingiProvider;
@@ -24,8 +25,9 @@ namespace NzbDrone.Core.Download
ISeedConfigProvider seedConfigProvider,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(configService, diskProvider, logger)
: base(configService, diskProvider, localizationService, logger)
{
_torrentFileInfoReader = torrentFileInfoReader;
_seedConfigProvider = seedConfigProvider;

View File

@@ -5,6 +5,7 @@ using NzbDrone.Common.Disk;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.ThingiProvider;
@@ -19,8 +20,9 @@ namespace NzbDrone.Core.Download
protected UsenetClientBase(IHttpClient httpClient,
IConfigService configService,
IDiskProvider diskProvider,
ILocalizationService localizationService,
Logger logger)
: base(configService, diskProvider, logger)
: base(configService, diskProvider, localizationService, logger)
{
_httpClient = httpClient;
}

View File

@@ -224,7 +224,7 @@ namespace NzbDrone.Core.History
if (message.Release.PublishDate != DateTime.MinValue)
{
history.Data.Add("PublishedDate", message.Release.PublishDate.ToString("s") + "Z");
history.Data.Add("PublishedDate", message.Release.PublishDate.ToUniversalTime().ToString("s") + "Z");
}
_historyRepository.Insert(history);

View File

@@ -232,7 +232,7 @@ namespace NzbDrone.Core.Indexers.Definitions
if (queryCats.Any() && searchCriteria is TvSearchCriteria { Season: > 0 })
{
// Avoid searching for specials if it's a non-zero season search
queryCats.RemoveAll(cat => cat is "anime[tv_special]" or "anime[ova]" or "anime[ona]" or "anime[dvd_special]" or "anime[bd_special]");
queryCats.RemoveAll(cat => cat is "anime[tv_special]" or "anime[ova]" or "anime[dvd_special]" or "anime[bd_special]");
}
if (queryCats.Any())

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using AngleSharp.Html.Parser;
using NLog;
using NzbDrone.Common.Extensions;
@@ -44,46 +43,19 @@ namespace NzbDrone.Core.Indexers.Definitions
return new AnimeTorrentsParser(Settings, Capabilities.Categories);
}
protected override async Task DoLogin()
{
UpdateCookies(null, null);
var loginUrl = Settings.BaseUrl + "login.php";
var loginPage = await ExecuteAuth(new HttpRequest(loginUrl));
var requestBuilder = new HttpRequestBuilder(loginUrl)
{
LogResponseContent = true,
AllowAutoRedirect = true
};
var authLoginRequest = requestBuilder
.Post()
.SetCookies(loginPage.GetCookies())
.AddFormParameter("username", Settings.Username)
.AddFormParameter("password", Settings.Password)
.AddFormParameter("form", "login")
.AddFormParameter("rememberme[]", "1")
.SetHeader("Content-Type", "application/x-www-form-urlencoded")
.SetHeader("Referer", loginUrl)
.Build();
var response = await ExecuteAuth(authLoginRequest);
if (response.Content == null || !response.Content.Contains("logout.php"))
{
throw new IndexerAuthException("AnimeTorrents authentication failed");
}
UpdateCookies(response.GetCookies(), DateTime.Now.AddDays(30));
_logger.Debug("AnimeTorrents authentication succeeded");
}
protected override bool CheckIfLoginNeeded(HttpResponse httpResponse)
{
return httpResponse.Content.Contains("Access Denied!") || httpResponse.Content.Contains("login.php");
if (httpResponse.Content.Contains("Access Denied!") || httpResponse.Content.Contains("login.php"))
{
throw new IndexerAuthException("AnimeTorrents authentication with cookies failed.");
}
return false;
}
protected override IDictionary<string, string> GetCookies()
{
return CookieUtil.CookieHeaderToDictionary(Settings.Cookie);
}
private IndexerCapabilities SetCapabilities()
@@ -292,7 +264,7 @@ namespace NzbDrone.Core.Indexers.Definitions
var qTitleLink = row.QuerySelector("td:nth-of-type(2) a:nth-of-type(1)");
var title = qTitleLink?.TextContent.Trim();
// If we search an get no results, we still get a table just with no info.
// If we search and get no results, we still get a table just with no info.
if (title.IsNullOrWhiteSpace())
{
break;
@@ -307,6 +279,8 @@ namespace NzbDrone.Core.Indexers.Definitions
var connections = row.QuerySelector("td:nth-of-type(8)").TextContent.Trim().Split('/', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
var seeders = ParseUtil.CoerceInt(connections[0]);
var leechers = ParseUtil.CoerceInt(connections[1]);
var grabs = ParseUtil.CoerceInt(connections[2]);
var categoryLink = row.QuerySelector("td:nth-of-type(1) a")?.GetAttribute("href") ?? string.Empty;
var categoryId = ParseUtil.GetArgumentFromQueryString(categoryLink, "cat");
@@ -328,17 +302,17 @@ namespace NzbDrone.Core.Indexers.Definitions
PublishDate = publishedDate,
Size = ParseUtil.GetBytes(row.QuerySelector("td:nth-of-type(6)").TextContent.Trim()),
Seeders = seeders,
Peers = ParseUtil.CoerceInt(connections[1]) + seeders,
Grabs = ParseUtil.CoerceInt(connections[2]),
Peers = leechers + seeders,
Grabs = grabs,
DownloadVolumeFactor = downloadVolumeFactor,
UploadVolumeFactor = 1,
Genres = row.QuerySelectorAll("td:nth-of-type(2) a.tortags").Select(t => t.TextContent.Trim()).ToList()
};
var uLFactorImg = row.QuerySelector("img[alt*=\"x Multiplier Torrent\"]");
if (uLFactorImg != null)
var uploadFactor = row.QuerySelector("img[alt*=\"x Multiplier Torrent\"]")?.GetAttribute("alt");
if (uploadFactor != null)
{
release.UploadVolumeFactor = ParseUtil.CoerceDouble(uLFactorImg.GetAttribute("alt").Split('x')[0]);
release.UploadVolumeFactor = ParseUtil.CoerceDouble(uploadFactor.Split('x')[0]);
}
releaseInfos.Add(release);
@@ -350,7 +324,7 @@ namespace NzbDrone.Core.Indexers.Definitions
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
}
public class AnimeTorrentsSettings : UserPassTorrentBaseSettings
public class AnimeTorrentsSettings : CookieTorrentBaseSettings
{
public AnimeTorrentsSettings()
{
@@ -361,7 +335,7 @@ namespace NzbDrone.Core.Indexers.Definitions
[FieldDefinition(4, Label = "Freeleech Only", Type = FieldType.Checkbox, HelpText = "Show freeleech torrents only")]
public bool FreeleechOnly { get; set; }
[FieldDefinition(5, Label = "Downloadable Only", Type = FieldType.Checkbox, HelpText = "Search downloadable torrents only (enable this only if your account class is Newbie)")]
[FieldDefinition(5, Label = "Downloadable Only", Type = FieldType.Checkbox, HelpText = "Search downloadable torrents only (enable this only if your account class is Newbie)", Advanced = true)]
public bool DownloadableOnly { get; set; }
}
}

View File

@@ -84,6 +84,6 @@ namespace NzbDrone.Core.Indexers.Definitions
public class AvistaZParser : AvistazParserBase
{
protected override string TimezoneOffset => "+02:00";
protected override string TimezoneOffset => "+01:00";
}
}

View File

@@ -55,7 +55,7 @@ namespace NzbDrone.Core.Indexers.Definitions
return FilterReleasesByQuery(cleanReleases, searchCriteria).ToList();
}
private IndexerCapabilities SetCapabilities()
private static IndexerCapabilities SetCapabilities()
{
var caps = new IndexerCapabilities
{
@@ -69,7 +69,8 @@ namespace NzbDrone.Core.Indexers.Definitions
},
Flags = new List<IndexerFlag>
{
IndexerFlag.Internal
IndexerFlag.Internal,
IndexerFlag.Exclusive,
}
};
@@ -91,7 +92,7 @@ namespace NzbDrone.Core.Indexers.Definitions
_capabilities = capabilities;
}
private IEnumerable<IndexerRequest> GetPagedRequests(SearchCriteriaBase searchCriteria, string term, string imdbId = null, int tmdbId = 0)
private IEnumerable<IndexerRequest> GetPagedRequests(SearchCriteriaBase searchCriteria, string searchTerm, string imdbId = null, int tmdbId = 0)
{
var body = new Dictionary<string, object>
{
@@ -128,9 +129,9 @@ namespace NzbDrone.Core.Indexers.Definitions
body.Add("tmdb_id", tmdbId);
}
if (term.IsNotNullOrWhiteSpace())
if (searchTerm.IsNotNullOrWhiteSpace())
{
body.Add("search", term);
body.Add("search", searchTerm.Trim());
}
var cats = _capabilities.Categories.MapTorznabCapsToTrackers(searchCriteria.Categories);
@@ -198,7 +199,16 @@ namespace NzbDrone.Core.Indexers.Definitions
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetPagedRequests(searchCriteria, searchCriteria.SanitizedTvSearchString, searchCriteria.FullImdbId));
var searchTerm = searchCriteria.SanitizedTvSearchString;
if (searchCriteria.Season is > 0 &&
searchCriteria.Episode.IsNotNullOrWhiteSpace() &&
DateTime.TryParseExact($"{searchCriteria.Season} {searchCriteria.Episode}", "yyyy MM/dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out var showDate))
{
searchTerm = $"{searchCriteria.SanitizedSearchTerm} {showDate.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)}";
}
pageableRequests.Add(GetPagedRequests(searchCriteria, searchTerm, searchCriteria.FullImdbId));
return pageableRequests;
}
@@ -275,13 +285,6 @@ namespace NzbDrone.Core.Indexers.Definitions
var details = row.InfoUrl;
var link = row.DownloadLink;
var flags = new HashSet<IndexerFlag>();
if (row.Internal)
{
flags.Add(IndexerFlag.Internal);
}
var release = new TorrentInfo
{
Title = row.Name,
@@ -291,7 +294,7 @@ namespace NzbDrone.Core.Indexers.Definitions
Guid = details,
Categories = _categories.MapTrackerCatDescToNewznab(row.Category),
PublishDate = DateTime.Parse(row.CreatedAt, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal),
IndexerFlags = flags,
IndexerFlags = GetIndexerFlags(row),
Size = row.Size,
Grabs = row.Grabs,
Seeders = row.Seeders,
@@ -301,6 +304,8 @@ namespace NzbDrone.Core.Indexers.Definitions
UploadVolumeFactor = 1,
MinimumRatio = 1,
MinimumSeedTime = 172800, // 120 hours
Languages = row.Audios?.Split(",", StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries).ToList() ?? new List<string>(),
Subs = row.Subtitles?.Split(",", StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries).ToList() ?? new List<string>(),
};
// BHD can return crazy values for tmdb
@@ -319,6 +324,23 @@ namespace NzbDrone.Core.Indexers.Definitions
.ToArray();
}
private static HashSet<IndexerFlag> GetIndexerFlags(BeyondHDTorrent item)
{
var flags = new HashSet<IndexerFlag>();
if (item.Internal)
{
flags.Add(IndexerFlag.Internal);
}
if (item.Exclusive)
{
flags.Add(IndexerFlag.Exclusive);
}
return flags;
}
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
}
@@ -450,9 +472,13 @@ namespace NzbDrone.Core.Indexers.Definitions
[JsonPropertyName("times_completed")]
public int Grabs { get; set; }
public int Seeders { get; set; }
public int Leechers { get; set; }
public string Audios { get; set; }
public string Subtitles { get; set; }
[JsonPropertyName("created_at")]
public string CreatedAt { get; set; }
@@ -478,6 +504,8 @@ namespace NzbDrone.Core.Indexers.Definitions
public bool Limited { get; set; }
public bool Exclusive { get; set; }
public bool Internal { get; set; }
}
}

View File

@@ -54,7 +54,7 @@ namespace NzbDrone.Core.Indexers.Definitions
{
private readonly IndexerCapabilitiesCategories _categories;
protected override string TimezoneOffset => "+02:00";
protected override string TimezoneOffset => "+01:00";
public ExoticaZParser(IndexerCapabilitiesCategories categories)
{

View File

@@ -101,7 +101,7 @@ public class FileListParser : IParseIndexerResponse
var url = new HttpUri(_settings.BaseUrl)
.CombinePath("/download.php")
.AddQueryParam("id", torrentId.ToString())
.AddQueryParam("passkey", _settings.Passkey);
.AddQueryParam("passkey", _settings.Passkey.Trim());
return url.FullUri;
}

View File

@@ -32,7 +32,7 @@ namespace NzbDrone.Core.Indexers.Definitions.HDBits
return new HDBitsParser(Settings, Capabilities.Categories);
}
private IndexerCapabilities SetCapabilities()
private static IndexerCapabilities SetCapabilities()
{
var caps = new IndexerCapabilities
{
@@ -43,6 +43,11 @@ namespace NzbDrone.Core.Indexers.Definitions.HDBits
MovieSearchParams = new List<MovieSearchParam>
{
MovieSearchParam.Q, MovieSearchParam.ImdbId
},
Flags = new List<IndexerFlag>
{
IndexerFlag.Internal,
IndexerFlag.Exclusive,
}
};

View File

@@ -85,6 +85,9 @@ namespace NzbDrone.Core.Indexers.Definitions.HDBits
[JsonProperty(PropertyName = "type_origin")]
public int TypeOrigin { get; set; }
[JsonProperty(PropertyName = "type_exclusive")]
public int TypeExclusive { get; set; }
[JsonProperty(PropertyName = "imdb")]
public ImdbInfo ImdbInfo { get; set; }

View File

@@ -1,9 +0,0 @@
using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.Indexers.Definitions.HDBits
{
public class HDBitsInfo : TorrentInfo
{
public bool? Internal { get; set; }
}
}

View File

@@ -62,16 +62,8 @@ namespace NzbDrone.Core.Indexers.Definitions.HDBits
}
var id = result.Id;
var internalRelease = result.TypeOrigin == 1;
var flags = new HashSet<IndexerFlag>();
if (internalRelease)
{
flags.Add(IndexerFlag.Internal);
}
releaseInfos.Add(new HDBitsInfo
releaseInfos.Add(new TorrentInfo
{
Guid = $"HDBits-{id}",
Title = GetTitle(result),
@@ -85,21 +77,18 @@ namespace NzbDrone.Core.Indexers.Definitions.HDBits
Files = (int)result.NumFiles,
Peers = result.Leechers + result.Seeders,
PublishDate = result.Added.ToUniversalTime(),
Internal = internalRelease,
Year = result.ImdbInfo?.Year ?? 0,
ImdbId = result.ImdbInfo?.Id ?? 0,
TvdbId = result.TvdbInfo?.Id ?? 0,
DownloadVolumeFactor = GetDownloadVolumeFactor(result),
UploadVolumeFactor = GetUploadVolumeFactor(result),
IndexerFlags = flags
IndexerFlags = GetIndexerFlags(result)
});
}
return releaseInfos.ToArray();
}
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
private string GetTitle(TorrentQueryResponse item)
{
// Use release name for XXX content and full discs
@@ -108,6 +97,23 @@ namespace NzbDrone.Core.Indexers.Definitions.HDBits
: item.Name;
}
private static HashSet<IndexerFlag> GetIndexerFlags(TorrentQueryResponse item)
{
var flags = new HashSet<IndexerFlag>();
if (item.TypeOrigin == 1)
{
flags.Add(IndexerFlag.Internal);
}
if (item.TypeExclusive == 1)
{
flags.Add(IndexerFlag.Exclusive);
}
return flags;
}
private double GetDownloadVolumeFactor(TorrentQueryResponse item)
{
if (item.FreeLeech == "yes")
@@ -154,5 +160,7 @@ namespace NzbDrone.Core.Indexers.Definitions.HDBits
return url.FullUri;
}
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
}
}

View File

@@ -130,29 +130,13 @@ public class NorBits : TorrentIndexerBase<NorBitsSettings>
};
caps.Categories.AddCategoryMapping("main_cat[]=1", NewznabStandardCategory.Movies, "Filmer");
caps.Categories.AddCategoryMapping("main_cat[]=1&sub2_cat[]=49", NewznabStandardCategory.MoviesUHD, "Filmer - UHD-2160p");
caps.Categories.AddCategoryMapping("main_cat[]=1&sub2_cat[]=19", NewznabStandardCategory.MoviesHD, "Filmer - HD-1080p/i");
caps.Categories.AddCategoryMapping("main_cat[]=1&sub2_cat[]=20", NewznabStandardCategory.MoviesHD, "Filmer - HD-720p");
caps.Categories.AddCategoryMapping("main_cat[]=1&sub2_cat[]=22", NewznabStandardCategory.MoviesSD, "Filmer - SD");
caps.Categories.AddCategoryMapping("main_cat[]=2", NewznabStandardCategory.TV, "TV");
caps.Categories.AddCategoryMapping("main_cat[]=2&sub2_cat[]=49", NewznabStandardCategory.TVUHD, "TV - UHD-2160p");
caps.Categories.AddCategoryMapping("main_cat[]=2&sub2_cat[]=19", NewznabStandardCategory.TVHD, "TV - HD-1080p/i");
caps.Categories.AddCategoryMapping("main_cat[]=2&sub2_cat[]=20", NewznabStandardCategory.TVHD, "TV - HD-720p");
caps.Categories.AddCategoryMapping("main_cat[]=2&sub2_cat[]=22", NewznabStandardCategory.TVSD, "TV - SD");
caps.Categories.AddCategoryMapping("main_cat[]=3", NewznabStandardCategory.PC, "Programmer");
caps.Categories.AddCategoryMapping("main_cat[]=4", NewznabStandardCategory.Console, "Spill");
caps.Categories.AddCategoryMapping("main_cat[]=5", NewznabStandardCategory.Audio, "Musikk");
caps.Categories.AddCategoryMapping("main_cat[]=5&sub2_cat[]=42", NewznabStandardCategory.AudioMP3, "Musikk - 192");
caps.Categories.AddCategoryMapping("main_cat[]=5&sub2_cat[]=43", NewznabStandardCategory.AudioMP3, "Musikk - 256");
caps.Categories.AddCategoryMapping("main_cat[]=5&sub2_cat[]=44", NewznabStandardCategory.AudioMP3, "Musikk - 320");
caps.Categories.AddCategoryMapping("main_cat[]=5&sub2_cat[]=45", NewznabStandardCategory.AudioMP3, "Musikk - VBR");
caps.Categories.AddCategoryMapping("main_cat[]=5&sub2_cat[]=46", NewznabStandardCategory.AudioLossless, "Musikk - Lossless");
caps.Categories.AddCategoryMapping("main_cat[]=6", NewznabStandardCategory.Books, "Tidsskrift");
caps.Categories.AddCategoryMapping("main_cat[]=7", NewznabStandardCategory.AudioAudiobook, "Lydbøker");
caps.Categories.AddCategoryMapping("main_cat[]=8", NewznabStandardCategory.AudioVideo, "Musikkvideoer");
caps.Categories.AddCategoryMapping("main_cat[]=8&sub2_cat[]=19", NewznabStandardCategory.AudioVideo, "Musikkvideoer - HD-1080p/i");
caps.Categories.AddCategoryMapping("main_cat[]=8&sub2_cat[]=20", NewznabStandardCategory.AudioVideo, "Musikkvideoer - HD-720p");
caps.Categories.AddCategoryMapping("main_cat[]=8&sub2_cat[]=22", NewznabStandardCategory.AudioVideo, "Musikkvideoer - SD");
caps.Categories.AddCategoryMapping("main_cat[]=40", NewznabStandardCategory.AudioOther, "Podcasts");
return caps;
@@ -281,20 +265,17 @@ public class NorBitsParser : IParseIndexerResponse
foreach (var row in rows)
{
var link = _settings.BaseUrl + row.QuerySelector("td:nth-of-type(2) > a[href*=\"download.php?id=\"]")?.GetAttribute("href").TrimStart('/');
var link = _settings.BaseUrl + row.QuerySelector("td:nth-of-type(2) > a[href*=\"download.php?id=\"]")?.GetAttribute("href")?.TrimStart('/');
var qDetails = row.QuerySelector("td:nth-of-type(2) > a[href*=\"details.php?id=\"]");
var title = qDetails?.GetAttribute("title").Trim();
var details = _settings.BaseUrl + qDetails?.GetAttribute("href").TrimStart('/');
var title = qDetails?.GetAttribute("title")?.Trim();
var details = _settings.BaseUrl + qDetails?.GetAttribute("href")?.TrimStart('/');
var mainCategory = row.QuerySelector("td:nth-of-type(1) a[href*=\"main_cat[]\"]")?.GetAttribute("href")?.Split('?').Last();
var secondCategory = row.QuerySelector("td:nth-of-type(1) a[href*=\"sub2_cat[]\"]")?.GetAttribute("href")?.Split('?').Last();
var catQuery = row.QuerySelector("td:nth-of-type(1) a[href*=\"main_cat[]\"]")?.GetAttribute("href")?.Split('?').Last().Split('&', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
var category = catQuery?.FirstOrDefault(x => x.StartsWith("main_cat[]=", StringComparison.OrdinalIgnoreCase));
var categoryList = new[] { mainCategory, secondCategory };
var cat = string.Join("&", categoryList.Where(c => !string.IsNullOrWhiteSpace(c)));
var seeders = ParseUtil.CoerceInt(row.QuerySelector("td:nth-of-type(9)").TextContent);
var leechers = ParseUtil.CoerceInt(row.QuerySelector("td:nth-of-type(10)").TextContent);
var seeders = ParseUtil.CoerceInt(row.QuerySelector("td:nth-of-type(9)")?.TextContent);
var leechers = ParseUtil.CoerceInt(row.QuerySelector("td:nth-of-type(10)")?.TextContent);
var release = new TorrentInfo
{
@@ -302,7 +283,7 @@ public class NorBitsParser : IParseIndexerResponse
InfoUrl = details,
DownloadUrl = link,
Title = title,
Categories = _categories.MapTrackerCatToNewznab(cat),
Categories = _categories.MapTrackerCatToNewznab(category),
Size = ParseUtil.GetBytes(row.QuerySelector("td:nth-of-type(7)")?.TextContent),
Files = ParseUtil.CoerceInt(row.QuerySelector("td:nth-of-type(3) > a")?.TextContent.Trim()),
Grabs = ParseUtil.CoerceInt(row.QuerySelector("td:nth-of-type(8)")?.FirstChild?.TextContent.Trim()),

View File

@@ -30,7 +30,7 @@ namespace NzbDrone.Core.Indexers.Definitions
"https://rutracker.net/",
"https://rutracker.nl/"
};
public override string Description => "RuTracker.org is a Semi-Private Russian torrent site with a thriving file-sharing community";
public override string Description => "RuTracker.org is a RUSSIAN Semi-Private site with a thriving file-sharing community";
public override string Language => "ru-RU";
public override Encoding Encoding => Encoding.GetEncoding("windows-1251");
public override IndexerPrivacy Privacy => IndexerPrivacy.SemiPrivate;
@@ -144,6 +144,7 @@ namespace NzbDrone.Core.Indexers.Definitions
SupportsRawSearch = true
};
// Note: When refreshing the categories use the tracker.php page and NOT the search.php page!
caps.Categories.AddCategoryMapping(22, NewznabStandardCategory.Movies, "Наше кино");
caps.Categories.AddCategoryMapping(941, NewznabStandardCategory.Movies, "|- Кино СССР");
caps.Categories.AddCategoryMapping(1666, NewznabStandardCategory.Movies, "|- Детские отечественные фильмы");
@@ -1751,7 +1752,7 @@ namespace NzbDrone.Core.Indexers.Definitions
title = Regex.Replace(title, @"(\([\p{IsCyrillic}\W]+)\s/\s(.+?)\)", string.Empty, RegexOptions.Compiled | RegexOptions.IgnoreCase);
// Remove VO, MVO and DVO from titles
var vo = new Regex(@".VO\s\(.+?\)");
var vo = new Regex(@"((?:\dx\s)?(?:[A-Z])?VO\s\(.+?\))");
title = vo.Replace(title, string.Empty);
// Remove R5 and (R5) from release names
@@ -1759,7 +1760,7 @@ namespace NzbDrone.Core.Indexers.Definitions
title = r5.Replace(title, "$1");
// Remove Sub languages from release names
title = Regex.Replace(title, @"(\bSub\b.*$|\b[\+]*Sub[\+]*\b)", string.Empty);
title = Regex.Replace(title, @"(\bSub\b[^+]*\b|\b[\+]*Sub[\+]*\b)", string.Empty);
}
// language fix: all rutracker releases contains russian track

View File

@@ -262,7 +262,7 @@ namespace NzbDrone.Core.Indexers.Definitions
return jsonResponse.Resource.Select(torrent => new TorrentInfo
{
Guid = torrent.Id.ToString(),
Guid = torrent.Url,
Title = CleanTitle(torrent.Name),
Description = torrent.ShortDescription,
Size = torrent.Size,

View File

@@ -63,6 +63,7 @@ namespace NzbDrone.Core.Indexers
}
public static IndexerFlag Internal => new ("internal", "Uploader is an internal release group");
public static IndexerFlag Exclusive => new ("exclusive", "An exclusive release that must not be uploaded anywhere else");
public static IndexerFlag FreeLeech => new ("freeleech", "Download doesn't count toward ratio");
public static IndexerFlag NeutralLeech => new ("neutralleech", "Download and upload doesn't count toward ratio");
public static IndexerFlag HalfLeech => new ("halfleech", "Release counts 50% to ratio");

View File

@@ -95,7 +95,7 @@ namespace NzbDrone.Core.Instrumentation
private void ReconfigureFile()
{
foreach (var target in LogManager.Configuration.AllTargets.OfType<NzbDroneFileTarget>())
foreach (var target in LogManager.Configuration.AllTargets.OfType<CleansingFileTarget>())
{
target.MaxArchiveFiles = _configFileProvider.LogRotate;
target.ArchiveAboveSize = _configFileProvider.LogSizeLimit.Megabytes();
@@ -120,11 +120,7 @@ namespace NzbDrone.Core.Instrumentation
{
var format = _configFileProvider.ConsoleLogFormat;
consoleTarget.Layout = format switch
{
ConsoleLogFormat.Clef => NzbDroneLogger.ClefLogLayout,
_ => NzbDroneLogger.ConsoleLogLayout
};
NzbDroneLogger.ConfigureConsoleLayout(consoleTarget, format);
}
}

View File

@@ -241,6 +241,7 @@
"DownloadClientStatusSingleClientHealthCheckMessage": "Download clients unavailable due to failures: {downloadClientNames}",
"DownloadClientTransmissionSettingsDirectoryHelpText": "Optional location to put downloads in, leave blank to use the default Transmission location",
"DownloadClientTransmissionSettingsUrlBaseHelpText": "Adds a prefix to the {clientName} rpc url, eg {url}, defaults to '{defaultUrl}'",
"DownloadClientUTorrentProviderMessage": "uTorrent has a history of including cryptominers, malware and ads, we strongly encourage you to choose a different client.",
"DownloadClients": "Download Clients",
"DownloadClientsLoadError": "Unable to load download clients",
"DownloadClientsSettingsSummary": "Download clients configuration for integration into {appName} UI search",

View File

@@ -312,7 +312,7 @@
"FullSync": "Täysi synkronointi",
"SyncLevelFull": "Täysi synkronointi: Pitää sovelluksen hakupalvelut täysin synkronoituna. Hakupalveluihin {appName}issa tehdyt muutokset synkronoidaan etäsovelluksen kanssa ja kaikki etäsovelluksessa tehdyt muutokset korvataan seuraavan synkronoinnin yhteydessä.",
"EnableIndexer": "Ota hakupalvelu käyttöön",
"FilterPlaceHolder": "Suodata hakupalveluita",
"FilterPlaceHolder": "Suodata palveluita",
"IndexerHealthCheckNoIndexers": "Yhtään hakupalvelua ei ole käytössä, eikä {appName} tämän vuoksi löydä tuloksia.",
"IndexerObsoleteCheckMessage": "Hakupalvelut ovat poistuneet tai ne ovat muuttuneet: {0}. Poista tai lisää ne {appName}iin uudelleen.",
"IndexerProxy": "Tiedonhaun välityspalvelin",
@@ -507,7 +507,7 @@
"AddDownloadClientImplementation": "Lisätään latauspalvelua {implementationName}",
"AddIndexerImplementation": "Lisätään hakupalvelua {implementationName}",
"OnGrabHelpText": "Kun julkaisu kaapataan",
"ManageDownloadClients": "Hallitse latauspalveluita",
"ManageDownloadClients": "Hallitse palveluita",
"NoDownloadClientsFound": "Latauspalveluita ei löytynyt",
"CountDownloadClientsSelected": "{count} latauspalvelu(a) on valittu",
"EditSelectedDownloadClients": "Muokkaa valittuja latauspalveluita",
@@ -519,7 +519,7 @@
"ApplyChanges": "Toteuta muutokset",
"EditSelectedIndexers": "Muokkaa valittuja sisältölähteitä",
"NoHistoryFound": "Historiaa ei löytynyt",
"NoIndexersFound": "Hakupalveluita ei löytynyt",
"NoIndexersFound": "Palveluita ei löytynyt",
"StopSelecting": "Lopeta valitseminen",
"EditConnectionImplementation": "Muokataan ilmoituspalvelua {implementationName}",
"AddConnectionImplementation": "Lisätään ilmoituspavelua {implementationName}",
@@ -556,7 +556,7 @@
"Implementation": "Toteutus",
"IndexerCategories": "Hakupalvelukategoriat",
"IndexerStatus": "Hakupalvelun tila",
"ManageApplications": "Sovellusten hallinta",
"ManageApplications": "Hallitse sovelluksia",
"NewznabUrl": "Newznab URL",
"PackSeedTime": "Paketin jakoaika",
"PackSeedTimeHelpText": "Aika, joka koostepaketin (kuten sarjan tuotantokauden tai esittäjän diskografian) sisältävää torrentia tulee jakaa. Käytä sovelluksen oletusta jättämällä tyhjäksi.",

View File

@@ -421,5 +421,7 @@
"UserAgentProvidedByTheAppThatCalledTheAPI": "API를 호출한 앱에서 제공하는 사용자 에이전트",
"days": "일",
"minutes": "분",
"Author": "저작자"
"Author": "저작자",
"Categories": "카테고리",
"SeedRatio": "종자 비율"
}

View File

@@ -753,5 +753,6 @@
"IndexerHDBitsSettingsUsernameHelpText": "网站用户名",
"IndexerPassThePopcornSettingsFreeleechOnlyHelpText": "只搜索免费发布",
"IndexerFileListSettingsFreeleechOnlyHelpText": "只搜索免费发布",
"IndexerFileListSettingsUsernameHelpText": "网站用户名"
"IndexerFileListSettingsUsernameHelpText": "网站用户名",
"IndexerBeyondHDSettingsRefundOnlyHelpText": "Search refund only"
}

View File

@@ -2,5 +2,6 @@
"About": "关于",
"Add": "添加",
"Analytics": "分析",
"Username": "用户名"
"Username": "用户名",
"AcceptConfirmationModal": "中文"
}

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using FluentValidation.Results;
using NLog;
using NzbDrone.Common.Disk;
@@ -38,7 +39,31 @@ namespace NzbDrone.Core.Notifications.CustomScript
public override string Link => "https://wiki.servarr.com/prowlarr/settings#connections";
public override ProviderMessage Message => new ProviderMessage("Testing will execute the script with the EventType set to Test, ensure your script handles this correctly", ProviderMessageType.Warning);
public override ProviderMessage Message => new ("Testing will execute the script with the EventType set to Test, ensure your script handles this correctly", ProviderMessageType.Warning);
public override void OnGrab(GrabMessage message)
{
var environmentVariables = new StringDictionary();
environmentVariables.Add("Prowlarr_EventType", "Grab");
environmentVariables.Add("Prowlarr_InstanceName", _configFileProvider.InstanceName);
environmentVariables.Add("Prowlarr_ApplicationUrl", _configService.ApplicationUrl);
environmentVariables.Add("Prowlarr_Release_Title", message.Release.Title);
environmentVariables.Add("Prowlarr_Release_Indexer", message.Release.Indexer ?? string.Empty);
environmentVariables.Add("Prowlarr_Release_Size", message.Release.Size.ToString());
environmentVariables.Add("Prowlarr_Release_Genres", string.Join("|", message.Release.Genres));
environmentVariables.Add("Prowlarr_Release_Categories", string.Join("|", message.Release.Categories.Select(f => f.Name)));
environmentVariables.Add("Prowlarr_Release_IndexerFlags", string.Join("|", message.Release.IndexerFlags.Select(f => f.Name)));
environmentVariables.Add("Prowlarr_Release_PublishDate", message.Release.PublishDate.ToUniversalTime().ToString("s") + "Z");
environmentVariables.Add("Prowlarr_Download_Client", message.DownloadClientName ?? string.Empty);
environmentVariables.Add("Prowlarr_Download_Client_Type", message.DownloadClientType ?? string.Empty);
environmentVariables.Add("Prowlarr_Download_Id", message.DownloadId ?? string.Empty);
environmentVariables.Add("Prowlarr_Source", message.Source ?? string.Empty);
environmentVariables.Add("Prowlarr_Host", message.Host ?? string.Empty);
environmentVariables.Add("Prowlarr_Redirect", message.Redirect.ToString());
ExecuteScript(environmentVariables);
}
public override void OnHealthIssue(HealthCheck.HealthCheck healthCheck)
{
@@ -130,10 +155,5 @@ namespace NzbDrone.Core.Notifications.CustomScript
return processOutput;
}
private bool ValidatePathParent(string possibleParent, string path)
{
return possibleParent.IsParentPath(path);
}
}
}

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using FluentValidation.Results;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Notifications.Discord.Payloads;
using NzbDrone.Core.Validation;
@@ -10,10 +11,12 @@ namespace NzbDrone.Core.Notifications.Discord
public class Discord : NotificationBase<DiscordSettings>
{
private readonly IDiscordProxy _proxy;
private readonly IConfigFileProvider _configFileProvider;
public Discord(IDiscordProxy proxy)
public Discord(IDiscordProxy proxy, IConfigFileProvider configFileProvider)
{
_proxy = proxy;
_configFileProvider = configFileProvider;
}
public override string Name => "Discord";
@@ -22,18 +25,18 @@ namespace NzbDrone.Core.Notifications.Discord
public override void OnGrab(GrabMessage message)
{
var embed = new Embed
{
Author = new DiscordAuthor
{
Name = Settings.Author.IsNullOrWhiteSpace() ? Environment.MachineName : Settings.Author,
IconUrl = "https://raw.githubusercontent.com/Prowlarr/Prowlarr/develop/Logo/256.png"
},
Title = RELEASE_GRABBED_TITLE,
Description = message.Message,
Timestamp = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"),
Color = message.Successful ? (int)DiscordColors.Success : (int)DiscordColors.Danger,
Fields = new List<DiscordField>()
};
{
Author = new DiscordAuthor
{
Name = Settings.Author.IsNullOrWhiteSpace() ? _configFileProvider.InstanceName : Settings.Author,
IconUrl = "https://raw.githubusercontent.com/Prowlarr/Prowlarr/develop/Logo/256.png"
},
Title = RELEASE_GRABBED_TITLE,
Description = message.Message,
Timestamp = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"),
Color = message.Successful ? (int)DiscordColors.Success : (int)DiscordColors.Danger,
Fields = new List<DiscordField>()
};
foreach (var field in Settings.GrabFields)
{
@@ -80,81 +83,72 @@ namespace NzbDrone.Core.Notifications.Discord
public override void OnHealthIssue(HealthCheck.HealthCheck healthCheck)
{
var attachments = new List<Embed>
{
new Embed
{
Author = new DiscordAuthor
{
Name = Settings.Author.IsNullOrWhiteSpace() ? Environment.MachineName : Settings.Author,
IconUrl = "https://raw.githubusercontent.com/Prowlarr/Prowlarr/develop/Logo/256.png"
},
Title = healthCheck.Source.Name,
Description = healthCheck.Message,
Timestamp = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"),
Color = healthCheck.Type == HealthCheck.HealthCheckResult.Warning ? (int)DiscordColors.Warning : (int)DiscordColors.Danger
}
};
var embed = new Embed
{
Author = new DiscordAuthor
{
Name = Settings.Author.IsNullOrWhiteSpace() ? _configFileProvider.InstanceName : Settings.Author,
IconUrl = "https://raw.githubusercontent.com/Prowlarr/Prowlarr/develop/Logo/256.png"
},
Title = healthCheck.Source.Name,
Description = healthCheck.Message,
Timestamp = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"),
Color = healthCheck.Type == HealthCheck.HealthCheckResult.Warning ? (int)DiscordColors.Warning : (int)DiscordColors.Danger
};
var payload = CreatePayload(null, attachments);
var payload = CreatePayload(null, new List<Embed> { embed });
_proxy.SendPayload(payload, Settings);
}
public override void OnHealthRestored(HealthCheck.HealthCheck previousCheck)
{
var attachments = new List<Embed>
{
new Embed
{
Author = new DiscordAuthor
{
Name = Settings.Author.IsNullOrWhiteSpace() ? Environment.MachineName : Settings.Author,
IconUrl = "https://raw.githubusercontent.com/Prowlarr/Prowlarr/develop/Logo/256.png"
},
Title = "Health Issue Resolved: " + previousCheck.Source.Name,
Description = $"The following issue is now resolved: {previousCheck.Message}",
Timestamp = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"),
Color = (int)DiscordColors.Success
}
};
var embed = new Embed
{
Author = new DiscordAuthor
{
Name = Settings.Author.IsNullOrWhiteSpace() ? _configFileProvider.InstanceName : Settings.Author,
IconUrl = "https://raw.githubusercontent.com/Prowlarr/Prowlarr/develop/Logo/256.png"
},
Title = "Health Issue Resolved: " + previousCheck.Source.Name,
Description = $"The following issue is now resolved: {previousCheck.Message}",
Timestamp = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"),
Color = (int)DiscordColors.Success
};
var payload = CreatePayload(null, attachments);
var payload = CreatePayload(null, new List<Embed> { embed });
_proxy.SendPayload(payload, Settings);
}
public override void OnApplicationUpdate(ApplicationUpdateMessage updateMessage)
{
var attachments = new List<Embed>
{
new Embed
{
Author = new DiscordAuthor
{
Name = Settings.Author.IsNullOrWhiteSpace() ? Environment.MachineName : Settings.Author,
IconUrl = "https://raw.githubusercontent.com/Prowlarr/Prowlarr/develop/Logo/256.png"
},
Title = APPLICATION_UPDATE_TITLE,
Timestamp = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"),
Color = (int)DiscordColors.Standard,
Fields = new List<DiscordField>()
{
new DiscordField()
{
Name = "Previous Version",
Value = updateMessage.PreviousVersion.ToString()
},
new DiscordField()
{
Name = "New Version",
Value = updateMessage.NewVersion.ToString()
}
},
}
};
var embed = new Embed
{
Author = new DiscordAuthor
{
Name = Settings.Author.IsNullOrWhiteSpace() ? _configFileProvider.InstanceName : Settings.Author,
IconUrl = "https://raw.githubusercontent.com/Prowlarr/Prowlarr/develop/Logo/256.png"
},
Title = APPLICATION_UPDATE_TITLE,
Timestamp = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"),
Color = (int)DiscordColors.Standard,
Fields = new List<DiscordField>
{
new ()
{
Name = "Previous Version",
Value = updateMessage.PreviousVersion.ToString()
},
new ()
{
Name = "New Version",
Value = updateMessage.NewVersion.ToString()
}
},
};
var payload = CreatePayload(null, attachments);
var payload = CreatePayload(null, new List<Embed> { embed });
_proxy.SendPayload(payload, Settings);
}
@@ -208,19 +202,5 @@ namespace NzbDrone.Core.Notifications.Discord
return payload;
}
private static string BytesToString(long byteCount)
{
string[] suf = { "B", "KB", "MB", "GB", "TB", "PB", "EB" }; //Longs run out around EB
if (byteCount == 0)
{
return "0 " + suf[0];
}
var bytes = Math.Abs(byteCount);
var place = Convert.ToInt32(Math.Floor(Math.Log(bytes, 1024)));
var num = Math.Round(bytes / Math.Pow(1024, place), 1);
return string.Format("{0} {1}", (Math.Sign(byteCount) * num).ToString(), suf[place]);
}
}
}

View File

@@ -1,3 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.Notifications.Webhook
@@ -13,10 +16,18 @@ namespace NzbDrone.Core.Notifications.Webhook
ReleaseTitle = release.Title;
Indexer = release.Indexer;
Size = release.Size;
Categories = release.Categories.Select(f => f.Name).ToList();
Genres = release.Genres.ToList();
IndexerFlags = release.IndexerFlags.Select(f => f.Name).ToHashSet();
PublishDate = release.PublishDate;
}
public string ReleaseTitle { get; set; }
public string Indexer { get; set; }
public long? Size { get; set; }
public List<string> Categories { get; set; }
public List<string> Genres { get; set; }
public HashSet<string> IndexerFlags { get; set; }
public DateTime? PublishDate { get; set; }
}
}

View File

@@ -9,6 +9,7 @@ namespace NzbDrone.Core.Parser.Model
{
public ReleaseInfo()
{
Genres = new List<string>();
IndexerFlags = new HashSet<IndexerFlag>();
Categories = new List<IndexerCategory>();
Languages = new List<string>();

View File

@@ -12,7 +12,7 @@
<PackageReference Include="Microsoft.Data.SqlClient" Version="2.1.7" />
<PackageReference Include="NLog.Targets.Syslog" Version="7.0.0" />
<PackageReference Include="Npgsql" Version="7.0.9" />
<PackageReference Include="Polly" Version="8.5.1" />
<PackageReference Include="Polly" Version="8.5.2" />
<PackageReference Include="Servarr.FluentMigrator.Runner" Version="3.3.2.9" />
<PackageReference Include="Servarr.FluentMigrator.Runner.Postgres" Version="3.3.2.9" />
<PackageReference Include="Servarr.FluentMigrator.Runner.SQLite" Version="3.3.2.9" />
@@ -20,7 +20,7 @@
<PackageReference Include="System.ServiceModel.Syndication" Version="6.0.0" />
<PackageReference Include="FluentValidation" Version="9.5.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="NLog" Version="5.4.0" />
<PackageReference Include="System.Data.SQLite.Core.Servarr" Version="1.0.115.5-18" />
<PackageReference Include="System.Text.Json" Version="6.0.10" />
<PackageReference Include="MonoTorrent" Version="2.0.7" />

View File

@@ -4,7 +4,7 @@
<OutputType>Library</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.15" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.4.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="6.0.2" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.6.2" />

View File

@@ -6,7 +6,7 @@
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="FluentValidation" Version="9.5.4" />
<PackageReference Include="Moq" Version="4.17.2" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="NLog" Version="5.4.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="RestSharp" Version="106.15.0" />
<PackageReference Include="RestSharp.Serializers.SystemTextJson" Version="106.15.0" />

View File

@@ -6,7 +6,7 @@
<ItemGroup>
<PackageReference Include="DryIoc.dll" Version="5.4.3" />
<PackageReference Include="DryIoc.Microsoft.DependencyInjection" Version="6.2.0" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="NLog" Version="5.4.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NzbDrone.Common\Prowlarr.Common.csproj" />

View File

@@ -4,7 +4,7 @@
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="NLog" Version="5.4.0" />
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,3 +1,4 @@
using FluentValidation;
using NzbDrone.Core.Download;
using NzbDrone.SignalR;
using Prowlarr.Http;
@@ -13,6 +14,7 @@ namespace Prowlarr.Api.V1.DownloadClient
public DownloadClientController(IBroadcastSignalRMessage signalRBroadcaster, IDownloadClientFactory downloadClientFactory)
: base(signalRBroadcaster, downloadClientFactory, "downloadclient", ResourceMapper, BulkResourceMapper)
{
SharedValidator.RuleFor(c => c.Priority).InclusiveBetween(1, 50);
}
}
}

View File

@@ -21,6 +21,7 @@ namespace Prowlarr.Api.V1.Indexers
.ValidId()
.SetValidator(appProfileExistsValidator);
SharedValidator.RuleFor(c => c.Priority).InclusiveBetween(1, 50);
SharedValidator.RuleFor(c => c.DownloadClientId).SetValidator(downloadClientExistsValidator);
}
}

View File

@@ -4,7 +4,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentValidation" Version="9.5.4" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="NLog" Version="5.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.6.2" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,9 +1,14 @@
using System.Collections.Generic;
using System.IO;
using System.Security.Claims;
using System.Security.Cryptography;
using System.Threading.Tasks;
using System.Xml;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NLog;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Authentication;
using NzbDrone.Core.Configuration;
@@ -16,11 +21,15 @@ namespace Prowlarr.Http.Authentication
{
private readonly IAuthenticationService _authService;
private readonly IConfigFileProvider _configFileProvider;
private readonly IAppFolderInfo _appFolderInfo;
private readonly Logger _logger;
public AuthenticationController(IAuthenticationService authService, IConfigFileProvider configFileProvider)
public AuthenticationController(IAuthenticationService authService, IConfigFileProvider configFileProvider, IAppFolderInfo appFolderInfo, Logger logger)
{
_authService = authService;
_configFileProvider = configFileProvider;
_appFolderInfo = appFolderInfo;
_logger = logger;
}
[HttpPost("login")]
@@ -45,7 +54,23 @@ namespace Prowlarr.Http.Authentication
IsPersistent = resource.RememberMe == "on"
};
await HttpContext.SignInAsync(AuthenticationType.Forms.ToString(), new ClaimsPrincipal(new ClaimsIdentity(claims, "Cookies", "user", "identifier")), authProperties);
try
{
await HttpContext.SignInAsync(AuthenticationType.Forms.ToString(), new ClaimsPrincipal(new ClaimsIdentity(claims, "Cookies", "user", "identifier")), authProperties);
}
catch (CryptographicException e)
{
if (e.InnerException is XmlException)
{
_logger.Error(e, "Failed to authenticate user due to corrupt XML. Please remove all XML files from {0} and restart Prowlarr", Path.Combine(_appFolderInfo.AppDataFolder, "asp"));
}
else
{
_logger.Error(e, "Failed to authenticate user. {0}", e.Message);
}
return Unauthorized();
}
if (returnUrl.IsNullOrWhiteSpace())
{

View File

@@ -5,7 +5,7 @@
<ItemGroup>
<PackageReference Include="FluentValidation" Version="9.5.4" />
<PackageReference Include="ImpromptuInterface" Version="7.0.1" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="NLog" Version="5.4.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NzbDrone.Core\Prowlarr.Core.csproj" />