using System.Threading.Tasks;
using API.Entities;
namespace API.Interfaces
{
    public interface ICacheService
    {
        /// 
        /// Ensures the cache is created for the given volume and if not, will create it. Should be called before any other
        /// cache operations (except cleanup).
        /// 
        /// 
        /// Volume for the passed volumeId. Side-effect from ensuring cache.
        Task Ensure(int volumeId);
        /// 
        /// Clears cache directory of all folders and files.
        /// 
        void Cleanup();
        /// 
        /// Clears cache directory of all volumes. This can be invoked from deleting a library or a series.
        /// 
        /// Volumes that belong to that library. Assume the library might have been deleted before this invocation.
        void CleanupVolumes(int[] volumeIds);
        
        /// 
        /// Returns the absolute path of a cached page. 
        /// 
        /// 
        /// Page number to look for
        /// 
        string GetCachedPagePath(Volume volume, int page);
    }
}