- add: unpack think
This commit is contained in:
@@ -64,11 +64,9 @@ public partial class ContentService
|
||||
return await EnsureItems(manifestReader, info.DownloadUri, loadingHandler, cancellationToken);
|
||||
}
|
||||
|
||||
public async Task Unpack(RobustManifestInfo info, IWriteFileApi otherApi, ILoadingHandler loadingHandler,
|
||||
CancellationToken cancellationToken)
|
||||
public void Unpack(HashApi hashApi, IWriteFileApi otherApi, ILoadingHandler loadingHandler)
|
||||
{
|
||||
debugService.Log("Unpack manifest files");
|
||||
var hashApi = await EnsureItems(info, loadingHandler, cancellationToken);
|
||||
var items = hashApi.Manifest.Values.ToList();
|
||||
loadingHandler.AppendJob(items.Count);
|
||||
foreach (var item in items)
|
||||
@@ -86,6 +84,11 @@ public partial class ContentService
|
||||
|
||||
loadingHandler.AppendResolvedJob();
|
||||
}
|
||||
|
||||
if (loadingHandler is IDisposable disposable)
|
||||
{
|
||||
disposable.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task Download(Uri contentCdn, List<RobustManifestItem> toDownload, HashApi hashApi, ILoadingHandler loadingHandler,
|
||||
|
||||
@@ -74,6 +74,13 @@ public class FileService
|
||||
{
|
||||
return new FileApi(Path.Join(RootPath, path));
|
||||
}
|
||||
|
||||
public IReadWriteFileApi EnsureTempDir(out string path)
|
||||
{
|
||||
path = Path.Combine(Path.GetTempPath(), "tempThink"+Path.GetRandomFileName());
|
||||
Directory.CreateDirectory(path);
|
||||
return new FileApi(path);
|
||||
}
|
||||
|
||||
public ZipFileApi? OpenZip(string path, IFileApi fileApi)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user