mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
Compare commits
11 Commits
v0.1.3.158
...
sonarr-pul
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
679166fc1c | ||
|
|
d77aa82961 | ||
|
|
c7a4060c4c | ||
|
|
64e6f98683 | ||
|
|
dcc2a14c60 | ||
|
|
22781b62e6 | ||
|
|
d93329a3fd | ||
|
|
ef20abba7a | ||
|
|
d647b47e88 | ||
|
|
e22f284a14 | ||
|
|
7ac8b5600e |
@@ -9,7 +9,7 @@ variables:
|
|||||||
testsFolder: './_tests'
|
testsFolder: './_tests'
|
||||||
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
|
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
|
||||||
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
|
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
|
||||||
majorVersion: '0.1.3'
|
majorVersion: '0.1.5'
|
||||||
minorVersion: $[counter('minorVersion', 1)]
|
minorVersion: $[counter('minorVersion', 1)]
|
||||||
readarrVersion: '$(majorVersion).$(minorVersion)'
|
readarrVersion: '$(majorVersion).$(minorVersion)'
|
||||||
buildName: '$(Build.SourceBranchName).$(readarrVersion)'
|
buildName: '$(Build.SourceBranchName).$(readarrVersion)'
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: $breakpointSmall) {
|
@media only screen and (max-width: $breakpointSmall) {
|
||||||
.event {
|
.overlay {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ export const possibleFilterTypes = {
|
|||||||
{ key: filterTypes.CONTAINS, value: 'contains' },
|
{ key: filterTypes.CONTAINS, value: 'contains' },
|
||||||
{ key: filterTypes.NOT_CONTAINS, value: 'does not contain' },
|
{ key: filterTypes.NOT_CONTAINS, value: 'does not contain' },
|
||||||
{ key: filterTypes.EQUAL, value: 'equal' },
|
{ key: filterTypes.EQUAL, value: 'equal' },
|
||||||
{ key: filterTypes.NOT_EQUAL, value: 'not equal' }
|
{ key: filterTypes.NOT_EQUAL, value: 'not equal' },
|
||||||
|
{ key: filterTypes.STARTS_WITH, value: 'starts with' },
|
||||||
|
{ key: filterTypes.NOT_STARTS_WITH, value: 'does not start with' },
|
||||||
|
{ key: filterTypes.ENDS_WITH, value: 'ends with' },
|
||||||
|
{ key: filterTypes.NOT_ENDS_WITH, value: 'does not end with' }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -39,6 +39,22 @@ const filterTypePredicates = {
|
|||||||
|
|
||||||
[filterTypes.NOT_EQUAL]: function(itemValue, filterValue) {
|
[filterTypes.NOT_EQUAL]: function(itemValue, filterValue) {
|
||||||
return itemValue !== filterValue;
|
return itemValue !== filterValue;
|
||||||
|
},
|
||||||
|
|
||||||
|
[filterTypes.STARTS_WITH]: function(itemValue, filterValue) {
|
||||||
|
return itemValue.toLowerCase().startsWith(filterValue.toLowerCase());
|
||||||
|
},
|
||||||
|
|
||||||
|
[filterTypes.NOT_STARTS_WITH]: function(itemValue, filterValue) {
|
||||||
|
return !itemValue.toLowerCase().startsWith(filterValue.toLowerCase());
|
||||||
|
},
|
||||||
|
|
||||||
|
[filterTypes.ENDS_WITH]: function(itemValue, filterValue) {
|
||||||
|
return itemValue.toLowerCase().endsWith(filterValue.toLowerCase());
|
||||||
|
},
|
||||||
|
|
||||||
|
[filterTypes.NOT_ENDS_WITH]: function(itemValue, filterValue) {
|
||||||
|
return !itemValue.toLowerCase().endsWith(filterValue.toLowerCase());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ export const LESS_THAN = 'lessThan';
|
|||||||
export const LESS_THAN_OR_EQUAL = 'lessThanOrEqual';
|
export const LESS_THAN_OR_EQUAL = 'lessThanOrEqual';
|
||||||
export const NOT_CONTAINS = 'notContains';
|
export const NOT_CONTAINS = 'notContains';
|
||||||
export const NOT_EQUAL = 'notEqual';
|
export const NOT_EQUAL = 'notEqual';
|
||||||
|
export const STARTS_WITH = 'startsWith';
|
||||||
|
export const NOT_STARTS_WITH = 'notStartsWith';
|
||||||
|
export const ENDS_WITH = 'endsWith';
|
||||||
|
export const NOT_ENDS_WITH = 'notEndsWith';
|
||||||
|
|
||||||
export const all = [
|
export const all = [
|
||||||
CONTAINS,
|
CONTAINS,
|
||||||
@@ -23,5 +27,9 @@ export const all = [
|
|||||||
IN_LAST,
|
IN_LAST,
|
||||||
NOT_IN_LAST,
|
NOT_IN_LAST,
|
||||||
IN_NEXT,
|
IN_NEXT,
|
||||||
NOT_IN_NEXT
|
NOT_IN_NEXT,
|
||||||
|
STARTS_WITH,
|
||||||
|
NOT_STARTS_WITH,
|
||||||
|
ENDS_WITH,
|
||||||
|
NOT_ENDS_WITH
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
@@ -275,7 +276,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
|
|||||||
|
|
||||||
[TestCase(-1)] // Infinite/Unknown
|
[TestCase(-1)] // Infinite/Unknown
|
||||||
[TestCase(-2)] // Magnet Downloading
|
[TestCase(-2)] // Magnet Downloading
|
||||||
public void should_ignore_negative_eta(int eta)
|
public void should_ignore_negative_eta(long eta)
|
||||||
{
|
{
|
||||||
_completed.Eta = eta;
|
_completed.Eta = eta;
|
||||||
|
|
||||||
@@ -284,6 +285,26 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
|
|||||||
item.RemainingTime.Should().NotHaveValue();
|
item.RemainingTime.Should().NotHaveValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestCase(2147483648)] // 2038-01-19T03:14:08Z > int.MaxValue as unix timestamp can be either an int or a long
|
||||||
|
public void should_support_long_values_for_eta_in_seconds(long eta)
|
||||||
|
{
|
||||||
|
_downloading.Eta = eta;
|
||||||
|
|
||||||
|
PrepareClientToReturnDownloadingItem();
|
||||||
|
var item = Subject.GetItems().Single();
|
||||||
|
item.RemainingTime.Should().Be(TimeSpan.FromSeconds(eta));
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase(2147483648000)] // works with milliseconds format too
|
||||||
|
public void should_support_long_values_for_eta_in_milliseconds(long eta)
|
||||||
|
{
|
||||||
|
_downloading.Eta = eta;
|
||||||
|
|
||||||
|
PrepareClientToReturnDownloadingItem();
|
||||||
|
var item = Subject.GetItems().Single();
|
||||||
|
item.RemainingTime.Should().Be(TimeSpan.FromMilliseconds(eta));
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void should_not_be_removable_and_should_not_allow_move_files_if_max_ratio_reached_and_not_stopped()
|
public void should_not_be_removable_and_should_not_allow_move_files_if_max_ratio_reached_and_not_stopped()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.VuzeTests
|
|||||||
|
|
||||||
[TestCase(-1)] // Infinite/Unknown
|
[TestCase(-1)] // Infinite/Unknown
|
||||||
[TestCase(-2)] // Magnet Downloading
|
[TestCase(-2)] // Magnet Downloading
|
||||||
public void should_ignore_negative_eta(int eta)
|
public void should_ignore_negative_eta(long eta)
|
||||||
{
|
{
|
||||||
_completed.Eta = eta;
|
_completed.Eta = eta;
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,14 @@ namespace NzbDrone.Core.Download.Clients.Transmission
|
|||||||
|
|
||||||
if (torrent.Eta >= 0)
|
if (torrent.Eta >= 0)
|
||||||
{
|
{
|
||||||
item.RemainingTime = TimeSpan.FromSeconds(torrent.Eta);
|
try
|
||||||
|
{
|
||||||
|
item.RemainingTime = TimeSpan.FromSeconds(torrent.Eta);
|
||||||
|
}
|
||||||
|
catch (OverflowException)
|
||||||
|
{
|
||||||
|
item.RemainingTime = TimeSpan.FromMilliseconds(torrent.Eta);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!torrent.ErrorString.IsNullOrWhiteSpace())
|
if (!torrent.ErrorString.IsNullOrWhiteSpace())
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
|
|||||||
public long TotalSize { get; set; }
|
public long TotalSize { get; set; }
|
||||||
public long LeftUntilDone { get; set; }
|
public long LeftUntilDone { get; set; }
|
||||||
public bool IsFinished { get; set; }
|
public bool IsFinished { get; set; }
|
||||||
public int Eta { get; set; }
|
public long Eta { get; set; }
|
||||||
public TransmissionTorrentStatus Status { get; set; }
|
public TransmissionTorrentStatus Status { get; set; }
|
||||||
public int SecondsDownloading { get; set; }
|
public int SecondsDownloading { get; set; }
|
||||||
public int SecondsSeeding { get; set; }
|
public int SecondsSeeding { get; set; }
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace NzbDrone.Core.MetadataSource.Goodreads
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImageUrl = element.ElementAsString("image_url");
|
ImageUrl = element.ElementAsString("image_url");
|
||||||
ImageUrl = element.ElementAsString("large_image_url");
|
LargeImageUrl = element.ElementAsString("large_image_url");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,13 +28,7 @@ namespace NzbDrone.Core.Notifications.Webhook
|
|||||||
EventType = WebhookEventType.Grab,
|
EventType = WebhookEventType.Grab,
|
||||||
InstanceName = _configFileProvider.InstanceName,
|
InstanceName = _configFileProvider.InstanceName,
|
||||||
Author = new WebhookAuthor(message.Author),
|
Author = new WebhookAuthor(message.Author),
|
||||||
Books = remoteBook.Books.ConvertAll(x => new WebhookBook(x)
|
Books = remoteBook.Books.ConvertAll(x => new WebhookBook(x)),
|
||||||
{
|
|
||||||
// TODO: Stop passing these parameters inside an book v3
|
|
||||||
Quality = quality.Quality.Name,
|
|
||||||
QualityVersion = quality.Revision.Version,
|
|
||||||
ReleaseGroup = remoteBook.ParsedBookInfo.ReleaseGroup
|
|
||||||
}),
|
|
||||||
Release = new WebhookRelease(quality, remoteBook),
|
Release = new WebhookRelease(quality, remoteBook),
|
||||||
DownloadClient = message.DownloadClientName,
|
DownloadClient = message.DownloadClientName,
|
||||||
DownloadClientType = message.DownloadClientType,
|
DownloadClientType = message.DownloadClientType,
|
||||||
@@ -93,7 +87,7 @@ namespace NzbDrone.Core.Notifications.Webhook
|
|||||||
{
|
{
|
||||||
return new WebhookBookDeletePayload
|
return new WebhookBookDeletePayload
|
||||||
{
|
{
|
||||||
EventType = WebhookEventType.Delete,
|
EventType = WebhookEventType.BookDelete,
|
||||||
InstanceName = _configFileProvider.InstanceName,
|
InstanceName = _configFileProvider.InstanceName,
|
||||||
Author = new WebhookAuthor(deleteMessage.Book.Author),
|
Author = new WebhookAuthor(deleteMessage.Book.Author),
|
||||||
Book = new WebhookBook(deleteMessage.Book),
|
Book = new WebhookBook(deleteMessage.Book),
|
||||||
@@ -105,7 +99,7 @@ namespace NzbDrone.Core.Notifications.Webhook
|
|||||||
{
|
{
|
||||||
return new WebhookBookFileDeletePayload
|
return new WebhookBookFileDeletePayload
|
||||||
{
|
{
|
||||||
EventType = WebhookEventType.Delete,
|
EventType = WebhookEventType.BookFileDelete,
|
||||||
InstanceName = _configFileProvider.InstanceName,
|
InstanceName = _configFileProvider.InstanceName,
|
||||||
Author = new WebhookAuthor(deleteMessage.Book.Author),
|
Author = new WebhookAuthor(deleteMessage.Book.Author),
|
||||||
Book = new WebhookBook(deleteMessage.Book),
|
Book = new WebhookBook(deleteMessage.Book),
|
||||||
@@ -117,7 +111,7 @@ namespace NzbDrone.Core.Notifications.Webhook
|
|||||||
{
|
{
|
||||||
return new WebhookAuthorDeletePayload
|
return new WebhookAuthorDeletePayload
|
||||||
{
|
{
|
||||||
EventType = WebhookEventType.Delete,
|
EventType = WebhookEventType.AuthorDelete,
|
||||||
InstanceName = _configFileProvider.InstanceName,
|
InstanceName = _configFileProvider.InstanceName,
|
||||||
Author = new WebhookAuthor(deleteMessage.Author),
|
Author = new WebhookAuthor(deleteMessage.Author),
|
||||||
DeletedFiles = deleteMessage.DeletedFiles
|
DeletedFiles = deleteMessage.DeletedFiles
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using NzbDrone.Core.Books;
|
using NzbDrone.Core.Books;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Notifications.Webhook
|
namespace NzbDrone.Core.Notifications.Webhook
|
||||||
@@ -12,17 +14,16 @@ namespace NzbDrone.Core.Notifications.Webhook
|
|||||||
public WebhookBook(Book book)
|
public WebhookBook(Book book)
|
||||||
{
|
{
|
||||||
Id = book.Id;
|
Id = book.Id;
|
||||||
|
GoodreadsId = book.ForeignBookId;
|
||||||
Title = book.Title;
|
Title = book.Title;
|
||||||
ReleaseDate = book.ReleaseDate;
|
ReleaseDate = book.ReleaseDate;
|
||||||
|
Edition = new WebhookBookEdition(book.Editions.Value.Single(e => e.Monitored));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
public string GoodreadsId { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
|
public WebhookBookEdition Edition { get; set; }
|
||||||
public DateTime? ReleaseDate { get; set; }
|
public DateTime? ReleaseDate { get; set; }
|
||||||
|
|
||||||
public string Quality { get; set; }
|
|
||||||
public int QualityVersion { get; set; }
|
|
||||||
public string ReleaseGroup { get; set; }
|
|
||||||
public string SceneName { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using NzbDrone.Core.Books;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Notifications.Webhook
|
||||||
|
{
|
||||||
|
public class WebhookBookEdition
|
||||||
|
{
|
||||||
|
public WebhookBookEdition(Edition edition)
|
||||||
|
{
|
||||||
|
GoodreadsId = edition.ForeignEditionId;
|
||||||
|
Title = edition.Title;
|
||||||
|
Asin = edition.Asin;
|
||||||
|
Isbn13 = edition.Isbn13;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string GoodreadsId { get; set; }
|
||||||
|
public string Asin { get; set; }
|
||||||
|
public string Isbn13 { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,7 +12,9 @@ namespace NzbDrone.Core.Notifications.Webhook
|
|||||||
Grab,
|
Grab,
|
||||||
Download,
|
Download,
|
||||||
Rename,
|
Rename,
|
||||||
Delete,
|
AuthorDelete,
|
||||||
|
BookDelete,
|
||||||
|
BookFileDelete,
|
||||||
Health,
|
Health,
|
||||||
Retag,
|
Retag,
|
||||||
ApplicationUpdate
|
ApplicationUpdate
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using Microsoft.Extensions.DependencyInjection;
|
|||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.Extensions.Hosting.WindowsServices;
|
using Microsoft.Extensions.Hosting.WindowsServices;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
using Npgsql;
|
||||||
using NzbDrone.Common.Composition.Extensions;
|
using NzbDrone.Common.Composition.Extensions;
|
||||||
using NzbDrone.Common.Disk;
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Common.EnvironmentInfo;
|
using NzbDrone.Common.EnvironmentInfo;
|
||||||
@@ -55,6 +56,7 @@ namespace NzbDrone.Host
|
|||||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||||
|
|
||||||
var appMode = GetApplicationMode(startupContext);
|
var appMode = GetApplicationMode(startupContext);
|
||||||
|
var config = GetConfiguration(startupContext);
|
||||||
|
|
||||||
switch (appMode)
|
switch (appMode)
|
||||||
{
|
{
|
||||||
@@ -83,12 +85,22 @@ namespace NzbDrone.Host
|
|||||||
// Utility mode
|
// Utility mode
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
new Container(rules => rules.WithNzbDroneRules())
|
new HostBuilder()
|
||||||
.AutoAddServices(ASSEMBLIES)
|
.UseServiceProviderFactory(new DryIocServiceProviderFactory(new Container(rules => rules.WithNzbDroneRules())))
|
||||||
.AddNzbDroneLogger()
|
.ConfigureContainer<IContainer>(c =>
|
||||||
.AddStartupContext(startupContext)
|
{
|
||||||
.Resolve<UtilityModeRouter>()
|
c.AutoAddServices(Bootstrap.ASSEMBLIES)
|
||||||
.Route(appMode);
|
.AddNzbDroneLogger()
|
||||||
|
.AddDatabase()
|
||||||
|
.AddStartupContext(startupContext)
|
||||||
|
.Resolve<UtilityModeRouter>()
|
||||||
|
.Route(appMode);
|
||||||
|
})
|
||||||
|
.ConfigureServices(services =>
|
||||||
|
{
|
||||||
|
services.Configure<PostgresOptions>(config.GetSection("Readarr:Postgres"));
|
||||||
|
}).Build();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,6 +123,7 @@ namespace NzbDrone.Host
|
|||||||
GC.Collect();
|
GC.Collect();
|
||||||
GC.WaitForPendingFinalizers();
|
GC.WaitForPendingFinalizers();
|
||||||
SQLiteConnection.ClearAllPools();
|
SQLiteConnection.ClearAllPools();
|
||||||
|
NpgsqlConnection.ClearAllPools();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IHostBuilder CreateConsoleHostBuilder(string[] args, StartupContext context)
|
public static IHostBuilder CreateConsoleHostBuilder(string[] args, StartupContext context)
|
||||||
|
|||||||
Reference in New Issue
Block a user