Merge branch 'Readarr:develop' into develop

pull/3344/head
adechant 4 months ago committed by GitHub
commit baefffeee8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

@ -0,0 +1,69 @@
using System.Data;
using System.Text.RegularExpressions;
using FluentMigrator;
using NLog;
using NzbDrone.Common.Instrumentation;
namespace NzbDrone.Core.Datastore.Migration
{
[Maintenance(MigrationStage.BeforeAll, TransactionBehavior.None)]
public class DatabaseEngineVersionCheck : FluentMigrator.Migration
{
protected readonly Logger _logger;
public DatabaseEngineVersionCheck()
{
_logger = NzbDroneLogger.GetLogger(this);
}
public override void Up()
{
IfDatabase("sqlite").Execute.WithConnection(LogSqliteVersion);
IfDatabase("postgres").Execute.WithConnection(LogPostgresVersion);
}
public override void Down()
{
// No-op
}
private void LogSqliteVersion(IDbConnection conn, IDbTransaction tran)
{
using (var versionCmd = conn.CreateCommand())
{
versionCmd.Transaction = tran;
versionCmd.CommandText = "SELECT sqlite_version();";
using (var reader = versionCmd.ExecuteReader())
{
while (reader.Read())
{
var version = reader.GetString(0);
_logger.Info("SQLite {0}", version);
}
}
}
}
private void LogPostgresVersion(IDbConnection conn, IDbTransaction tran)
{
using (var versionCmd = conn.CreateCommand())
{
versionCmd.Transaction = tran;
versionCmd.CommandText = "SHOW server_version";
using (var reader = versionCmd.ExecuteReader())
{
while (reader.Read())
{
var version = reader.GetString(0);
var cleanVersion = Regex.Replace(version, @"\(.*?\)", "");
_logger.Info("Postgres {0}", cleanVersion);
}
}
}
}
}
}

@ -42,12 +42,13 @@ namespace NzbDrone.Core.Datastore.Migration.Framework
serviceProvider = new ServiceCollection()
.AddLogging(b => b.AddNLog())
.AddFluentMigratorCore()
.Configure<RunnerOptions>(cfg => cfg.IncludeUntaggedMaintenances = true)
.ConfigureRunner(
builder => builder
.AddPostgres()
.AddNzbDroneSQLite()
.WithGlobalConnectionString(connectionString)
.WithMigrationsIn(Assembly.GetExecutingAssembly()))
.ScanIn(Assembly.GetExecutingAssembly()).For.All())
.Configure<TypeFilterOptions>(opt => opt.Namespace = "NzbDrone.Core.Datastore.Migration")
.Configure<ProcessorOptions>(opt =>
{

@ -169,7 +169,7 @@
"IncludeUnmonitored": "Incluir sin monitorizar",
"Indexer": "Indexador",
"IndexerPriority": "Prioridad del indexador",
"IndexerSettings": "Ajustes de Indexer",
"IndexerSettings": "Ajustes de Indexador",
"Indexers": "Indexadores",
"Interval": "Intervalo",
"IsCutoffCutoff": "Corte",

@ -125,7 +125,7 @@
"DeleteNotificationMessageText": "Tem certeza de que deseja excluir a notificação '{name}'?",
"DeleteQualityProfile": "Excluir perfil de qualidade",
"DeleteQualityProfileMessageText": "Tem certeza de que deseja excluir o perfil de qualidade '{name}'?",
"DeleteReleaseProfile": "Excluir perfil de lançamento",
"DeleteReleaseProfile": "Excluir Perfil de Lançamento",
"DeleteReleaseProfileMessageText": "Tem certeza de que deseja excluir este Perfil de Lançamento?",
"DeleteRootFolderMessageText": "Tem certeza de que deseja excluir a pasta raiz '{name}'?",
"DeleteSelectedBookFiles": "Excluir arquivos do livro selecionado",
@ -606,7 +606,7 @@
"ConsoleLogLevel": "Nível de log do console",
"CollapseMultipleBooksHelpText": "Recolher vários livros lançados no mesmo dia",
"CollapseMultipleBooks": "Recolher vários livros",
"ChownGroup": "Fazer chown de grupo",
"ChownGroup": "chown Grupo",
"CatalogNumber": "Número do Catálogo",
"CalibreUsername": "Nome de usuário do Calibre",
"CalibreUrlBase": "URL base do Calibre",

@ -105,11 +105,12 @@ namespace NzbDrone.Core.Update
return false;
}
var tempFolder = _appFolderInfo.TempFolder;
var updateSandboxFolder = _appFolderInfo.GetUpdateSandboxFolder();
if (_diskProvider.GetTotalSize(updateSandboxFolder) < 1.Gigabytes())
if (_diskProvider.GetTotalSize(tempFolder) < 1.Gigabytes())
{
_logger.Warn("Temporary location '{0}' has less than 1 GB free space, Readarr may not be able to update itself.", updateSandboxFolder);
_logger.Warn("Temporary location '{0}' has less than 1 GB free space, Readarr may not be able to update itself.", tempFolder);
}
var packageDestination = Path.Combine(updateSandboxFolder, updatePackage.FileName);

@ -4,6 +4,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Authentication;
using NzbDrone.Core.Configuration;
@ -46,7 +47,17 @@ namespace Readarr.Http.Authentication
await HttpContext.SignInAsync(AuthenticationType.Forms.ToString(), new ClaimsPrincipal(new ClaimsIdentity(claims, "Cookies", "user", "identifier")), authProperties);
return Redirect(_configFileProvider.UrlBase + "/");
if (returnUrl.IsNullOrWhiteSpace())
{
return Redirect(_configFileProvider.UrlBase + "/");
}
if (_configFileProvider.UrlBase.IsNullOrWhiteSpace() || returnUrl.StartsWith(_configFileProvider.UrlBase))
{
return Redirect(returnUrl);
}
return Redirect(_configFileProvider.UrlBase + returnUrl);
}
[HttpGet("logout")]

Loading…
Cancel
Save