Kavita/API/Interfaces/Services/ICacheService.cs
Joseph Milazzo 4f3461710c
More Polishing (#428)
# Added
- Added: Added a new button on admin dashboard to clear cache for the whole server

# Changed
- Changed: Moved the download logs to the new System page
- Changed: Tag Badges now show the correct cursor to help indication actions. For example, Collection badges on series detail page can be clicked, while type cannot.

# Fixed
- Fixed: Fixed an issue in develop builds where Pagination no longer worked due to Header not being exposed
- Fixed: After Scanning a series, clear out any cached chapters

=======================================================
* After Scanning a series, clear out any cached chapters.


* Implemented cursor overrides for tag badges

* Fixed pagination no longer working due to Pagination header not being able to be read from the UI.

* Fixed some css things with icons within tagbadges not taking the selection mode styling

* Moved download logs button to the system page

* Implemented the ability to clear cache for the whole server from admin dashboard

* Removed debug code

* Up the Regex Timeout for the Github Build System
2021-07-24 19:14:38 -05:00

40 lines
1.4 KiB
C#

using System.Collections.Generic;
using System.Threading.Tasks;
using API.Entities;
namespace API.Interfaces.Services
{
public interface ICacheService
{
/// <summary>
/// Ensures the cache is created for the given chapter and if not, will create it. Should be called before any other
/// cache operations (except cleanup).
/// </summary>
/// <param name="chapterId"></param>
/// <returns>Chapter for the passed chapterId. Side-effect from ensuring cache.</returns>
Task<Chapter> Ensure(int chapterId);
/// <summary>
/// Clears cache directory of all folders and files.
/// </summary>
void Cleanup();
/// <summary>
/// Clears cache directory of all volumes. This can be invoked from deleting a library or a series.
/// </summary>
/// <param name="chapterIds">Volumes that belong to that library. Assume the library might have been deleted before this invocation.</param>
void CleanupChapters(IEnumerable<int> chapterIds);
/// <summary>
/// Returns the absolute path of a cached page.
/// </summary>
/// <param name="chapter">Chapter entity with Files populated.</param>
/// <param name="page">Page number to look for</param>
/// <returns></returns>
Task<(string path, MangaFile file)> GetCachedPagePath(Chapter chapter, int page);
void EnsureCacheDirectory();
}
}