Code cleanup. Implemented ability to schedule Library Backups.

This commit is contained in:
Joseph Milazzo 2021-02-17 08:58:36 -06:00
parent 83b9394b17
commit b4ee16d8d1
35 changed files with 217 additions and 91 deletions

View file

@ -18,10 +18,12 @@ namespace API.Interfaces
/// <param name="userId"></param>
/// <returns></returns>
Task<IEnumerable<SeriesDto>> GetSeriesDtoForLibraryIdAsync(int libraryId, int userId);
/// <summary>
/// Does not add user information like progress, ratings, etc.
/// </summary>
/// <param name="libraryIds"></param>
/// <param name="searchQuery">Series name to search for</param>
/// <returns></returns>
Task<IEnumerable<SearchResultDto>> SearchSeries(int[] libraryIds, string searchQuery);
Task<IEnumerable<Series>> GetSeriesForLibraryIdAsync(int libraryId);

View file

@ -2,6 +2,10 @@
{
public interface ITaskScheduler
{
/// <summary>
/// For use on Server startup
/// </summary>
void ScheduleTasks();
void ScanLibrary(int libraryId, bool forceUpdate = false);
void CleanupChapters(int[] chapterIds);
void RefreshMetadata(int libraryId, bool forceUpdate = true);

View file

@ -1,6 +1,6 @@
using System.IO.Compression;
namespace API.Interfaces
namespace API.Interfaces.Services
{
public interface IArchiveService
{

View file

@ -0,0 +1,7 @@
namespace API.Interfaces.Services
{
public interface IBackupService
{
void BackupDatabase();
}
}

View file

@ -1,7 +1,7 @@
using System.Threading.Tasks;
using API.Entities;
namespace API.Interfaces
namespace API.Interfaces.Services
{
public interface ICacheService
{

View file

@ -2,7 +2,7 @@
using System.Threading.Tasks;
using API.DTOs;
namespace API.Interfaces
namespace API.Interfaces.Services
{
public interface IDirectoryService
{
@ -21,5 +21,11 @@ namespace API.Interfaces
/// <param name="searchPatternExpression"></param>
/// <returns></returns>
string[] GetFiles(string path, string searchPatternExpression = "");
/// <summary>
/// Returns true if the path exists and is a directory. If path does not exist, this will create it. Returns false in all fail cases.
/// </summary>
/// <param name="directoryPath"></param>
/// <returns></returns>
bool ExistOrCreate(string directoryPath);
}
}

View file

@ -1,4 +1,4 @@
namespace API.Interfaces
namespace API.Interfaces.Services
{
public interface IScannerService
{

View file

@ -1,7 +1,7 @@
using System.Threading.Tasks;
using API.Entities;
namespace API.Interfaces
namespace API.Interfaces.Services
{
public interface ITokenService
{