Initial Push

This commit is contained in:
Qstick
2020-10-18 04:18:35 -04:00
parent 09ed2ab889
commit e1020f4107
1845 changed files with 1516 additions and 113975 deletions

View File

@@ -0,0 +1,30 @@
using System.IO;
using NLog;
using NzbDrone.Common.Disk;
using NzbDrone.Core.Backup;
namespace Prowlarr.Http.Frontend.Mappers
{
public class BackupFileMapper : StaticResourceMapperBase
{
private readonly IBackupService _backupService;
public BackupFileMapper(IBackupService backupService, IDiskProvider diskProvider, Logger logger)
: base(diskProvider, logger)
{
_backupService = backupService;
}
public override string Map(string resourceUrl)
{
var path = resourceUrl.Replace("/backup/", "").Replace('/', Path.DirectorySeparatorChar);
return Path.Combine(_backupService.GetBackupFolder(), path);
}
public override bool CanHandle(string resourceUrl)
{
return resourceUrl.StartsWith("/backup/") && BackupService.BackupFileRegex.IsMatch(resourceUrl);
}
}
}