Compare commits

...

7 Commits

Author SHA1 Message Date
Bogdan a550c6554f Check if backup folder is writable on backup
(cherry picked from commit 8aad79fd3e14eb885724a5e5790803c289be2f25)

Closes #3961
2024-12-31 12:21:54 +02:00
Bogdan c1b26eec8d Suggest adding IP to RPC whitelist for on failed Transmission auth
(cherry picked from commit f05e552e8e6dc02cd26444073ab9a678dcb36492)
2024-12-31 12:20:58 +02:00
Bogdan ffe5ede55d Bump version to 0.4.7 2024-12-22 13:25:47 +02:00
gains goblin 9005860899 Fixed: Mapping Author GR ID from import lists to AuthorGoodReadsId 2024-12-15 16:28:18 -06:00
Bogdan c67f67109e Ignore metadata tests temporarily once again 2024-12-15 23:05:58 +02:00
Bogdan 51b9744e25 Fixed: Refresh backup list on deletion
(cherry picked from commit 3b00112447361b19c04851a510e63f812597a043)
2024-12-15 05:32:13 +02:00
Mark McDowall 334d824633 Fixed: Error getting processes in some cases
(cherry picked from commit b552d4e9f7ca7388404aa0d52566010a54cb0244)
2024-12-15 05:31:53 +02:00
16 changed files with 53 additions and 40 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ variables:
testsFolder: './_tests'
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
majorVersion: '0.4.6'
majorVersion: '0.4.7'
minorVersion: $[counter('minorVersion', 1)]
readarrVersion: '$(majorVersion).$(minorVersion)'
buildName: '$(Build.SourceBranchName).$(readarrVersion)'
+10 -9
View File
@@ -42,17 +42,18 @@ namespace NzbDrone.Common
public void CreateZip(string path, IEnumerable<string> files)
{
using (var zipFile = ZipFile.Create(path))
_logger.Debug("Creating archive {0}", path);
using var zipFile = ZipFile.Create(path);
zipFile.BeginUpdate();
foreach (var file in files)
{
zipFile.BeginUpdate();
foreach (var file in files)
{
zipFile.Add(file, Path.GetFileName(file));
}
zipFile.CommitUpdate();
zipFile.Add(file, Path.GetFileName(file));
}
zipFile.CommitUpdate();
}
private void ExtractZip(string compressedFile, string destination)
@@ -313,7 +313,7 @@ namespace NzbDrone.Common.Processes
processInfo = new ProcessInfo();
processInfo.Id = process.Id;
processInfo.Name = process.ProcessName;
processInfo.StartPath = process.MainModule.FileName;
processInfo.StartPath = process.MainModule?.FileName;
if (process.Id != GetCurrentProcessId() && process.HasExited)
{
@@ -13,7 +13,7 @@ using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.MetadataSource.Goodreads
{
[TestFixture]
[Ignore("Waiting for metadata to be back again", Until = "2024-12-15 00:00:00Z")]
[Ignore("Waiting for metadata to be back again", Until = "2025-05-15 00:00:00Z")]
public class BookInfoProxyFixture : CoreTest<BookInfoProxy>
{
private MetadataProfile _metadataProfile;
@@ -15,7 +15,7 @@ using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.MetadataSource.Goodreads
{
[TestFixture]
[Ignore("Waiting for metadata to be back again", Until = "2024-12-15 00:00:00Z")]
[Ignore("Waiting for metadata to be back again", Until = "2025-05-15 00:00:00Z")]
public class BookInfoProxySearchFixture : CoreTest<BookInfoProxy>
{
[SetUp]
+9 -2
View File
@@ -66,12 +66,19 @@ namespace NzbDrone.Core.Backup
{
_logger.ProgressInfo("Starting Backup");
var backupFolder = GetBackupFolder(backupType);
_diskProvider.EnsureFolder(_backupTempFolder);
_diskProvider.EnsureFolder(GetBackupFolder(backupType));
_diskProvider.EnsureFolder(backupFolder);
if (!_diskProvider.FolderWritable(backupFolder))
{
throw new UnauthorizedAccessException($"Backup folder {backupFolder} is not writable");
}
var dateNow = DateTime.Now;
var backupFilename = $"readarr_backup_v{BuildInfo.Version}_{dateNow:yyyy.MM.dd_HH.mm.ss}.zip";
var backupPath = Path.Combine(GetBackupFolder(backupType), backupFilename);
var backupPath = Path.Combine(backupFolder, backupFilename);
Cleanup();
@@ -4,6 +4,7 @@ using System.Net;
using Newtonsoft.Json.Linq;
using NLog;
using NzbDrone.Common.Cache;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Common.Serializer;
@@ -208,7 +209,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
private void AuthenticateClient(HttpRequestBuilder requestBuilder, TransmissionSettings settings, bool reauthenticate = false)
{
var authKey = string.Format("{0}:{1}", requestBuilder.BaseUrl, settings.Password);
var authKey = $"{requestBuilder.BaseUrl}:{settings.Password}";
var sessionId = _authSessionIDCache.Find(authKey);
@@ -220,24 +221,26 @@ namespace NzbDrone.Core.Download.Clients.Transmission
authLoginRequest.SuppressHttpError = true;
var response = _httpClient.Execute(authLoginRequest);
if (response.StatusCode == HttpStatusCode.MovedPermanently)
{
var url = response.Headers.GetSingleValue("Location");
throw new DownloadClientException("Remote site redirected to " + url);
}
else if (response.StatusCode == HttpStatusCode.Conflict)
switch (response.StatusCode)
{
sessionId = response.Headers.GetSingleValue("X-Transmission-Session-Id");
case HttpStatusCode.MovedPermanently:
var url = response.Headers.GetSingleValue("Location");
if (sessionId == null)
{
throw new DownloadClientException("Remote host did not return a Session Id.");
}
}
else
{
throw new DownloadClientAuthenticationException("Failed to authenticate with Transmission.");
throw new DownloadClientException("Remote site redirected to " + url);
case HttpStatusCode.Forbidden:
throw new DownloadClientException($"Failed to authenticate with Transmission. It may be necessary to add {BuildInfo.AppName}'s IP address to RPC whitelist.");
case HttpStatusCode.Conflict:
sessionId = response.Headers.GetSingleValue("X-Transmission-Session-Id");
if (sessionId == null)
{
throw new DownloadClientException("Remote host did not return a Session Id.");
}
break;
default:
throw new DownloadClientAuthenticationException("Failed to authenticate with Transmission.");
}
_logger.Debug("Transmission authentication succeeded.");
@@ -184,7 +184,7 @@ namespace NzbDrone.Core.ImportLists
report.BookGoodreadsId = remoteBook.ForeignBookId;
report.Book = remoteBook.Title;
report.Author ??= remoteBook.AuthorMetadata.Value.Name;
report.AuthorGoodreadsId ??= remoteBook.AuthorMetadata.Value.Name;
report.AuthorGoodreadsId ??= remoteBook.AuthorMetadata.Value.ForeignAuthorId;
}
catch (BookNotFoundException)
{
@@ -7,7 +7,7 @@ using Readarr.Api.V1.Author;
namespace NzbDrone.Integration.Test.ApiTests
{
[TestFixture]
[Ignore("Waiting for metadata to be back again", Until = "2024-12-15 00:00:00Z")]
[Ignore("Waiting for metadata to be back again", Until = "2025-05-15 00:00:00Z")]
public class AuthorEditorFixture : IntegrationTest
{
private void GivenExistingAuthor()
@@ -7,7 +7,7 @@ using NUnit.Framework;
namespace NzbDrone.Integration.Test.ApiTests
{
[TestFixture]
[Ignore("Waiting for metadata to be back again", Until = "2024-12-15 00:00:00Z")]
[Ignore("Waiting for metadata to be back again", Until = "2025-05-15 00:00:00Z")]
public class AuthorFixture : IntegrationTest
{
[Test]
@@ -4,7 +4,7 @@ using NUnit.Framework;
namespace NzbDrone.Integration.Test.ApiTests
{
[TestFixture]
[Ignore("Waiting for metadata to be back again", Until = "2024-12-15 00:00:00Z")]
[Ignore("Waiting for metadata to be back again", Until = "2025-05-15 00:00:00Z")]
public class AuthorLookupFixture : IntegrationTest
{
[TestCase("Robert Harris", "Robert Harris")]
@@ -6,7 +6,7 @@ using Readarr.Api.V1.Blocklist;
namespace NzbDrone.Integration.Test.ApiTests
{
[TestFixture]
[Ignore("Waiting for metadata to be back again", Until = "2024-12-15 00:00:00Z")]
[Ignore("Waiting for metadata to be back again", Until = "2025-05-15 00:00:00Z")]
public class BlocklistFixture : IntegrationTest
{
private AuthorResource _author;
@@ -9,7 +9,7 @@ using Readarr.Api.V1.Books;
namespace NzbDrone.Integration.Test.ApiTests
{
[TestFixture]
[Ignore("Waiting for metadata to be back again", Until = "2024-12-15 00:00:00Z")]
[Ignore("Waiting for metadata to be back again", Until = "2025-05-15 00:00:00Z")]
public class CalendarFixture : IntegrationTest
{
public ClientBase<BookResource> Calendar;
@@ -8,7 +8,7 @@ using Readarr.Api.V1.RootFolders;
namespace NzbDrone.Integration.Test.ApiTests.WantedTests
{
[TestFixture]
[Ignore("Waiting for metadata to be back again", Until = "2024-12-15 00:00:00Z")]
[Ignore("Waiting for metadata to be back again", Until = "2025-05-15 00:00:00Z")]
public class CutoffUnmetFixture : IntegrationTest
{
[SetUp]
@@ -7,7 +7,7 @@ using Readarr.Api.V1.RootFolders;
namespace NzbDrone.Integration.Test.ApiTests.WantedTests
{
[TestFixture]
[Ignore("Waiting for metadata to be back again", Until = "2024-12-15 00:00:00Z")]
[Ignore("Waiting for metadata to be back again", Until = "2025-05-15 00:00:00Z")]
public class MissingFixture : IntegrationTest
{
[SetUp]
@@ -50,7 +50,7 @@ namespace Readarr.Api.V1.System.Backup
}
[RestDeleteById]
public void DeleteBackup(int id)
public object DeleteBackup(int id)
{
var backup = GetBackup(id);
@@ -67,6 +67,8 @@ namespace Readarr.Api.V1.System.Backup
}
_diskProvider.DeleteFile(path);
return new { };
}
[HttpPost("restore/{id:int}")]