using System.Collections.Generic; using System.Threading.Tasks; using API.DTOs; namespace API.Interfaces { public interface IDirectoryService { /// /// Lists out top-level folders for a given directory. Filters out System and Hidden folders. /// /// Absolute path of directory to scan. /// List of folder names IEnumerable ListDirectory(string rootPath); /// /// Lists out top-level files for a given directory. /// TODO: Implement ability to provide a filter for file types (done in another implementation on DirectoryService) /// /// Absolute path /// List of folder names IList ListFiles(string rootPath); /// /// Given a library id, scans folders for said library. Parses files and generates DB updates. Will overwrite /// cover images if forceUpdate is true. /// /// Library to scan against /// Force overwriting for cover images void ScanLibrary(int libraryId, bool forceUpdate); /// /// Returns the path a volume would be extracted to. /// Deprecated. /// /// /// string GetExtractPath(int volumeId); Task ReadImageAsync(string imagePath); /// /// Extracts an archive to a temp cache directory. Returns path to new directory. If temp cache directory already exists, /// will return that without performing an extraction. Returns empty string if there are any invalidations which would /// prevent operations to perform correctly (missing archivePath file, empty archive, etc). /// /// A valid file to an archive file. /// Path to extract to /// string ExtractArchive(string archivePath, string extractPath); } }