mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-15 07:14:14 +01:00
calculate and display local cache size on cache changes, add clear cache button
This commit is contained in:
parent
cc0af38b31
commit
f8919abea8
7 changed files with 87 additions and 68 deletions
|
|
@ -4,6 +4,7 @@ using Dalamud.Interface.Windowing;
|
|||
using ImGuiNET;
|
||||
using MareSynchronos.WebAPI;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using MareSynchronos.Utils;
|
||||
|
|
@ -190,7 +191,18 @@ namespace MareSynchronos.UI
|
|||
{
|
||||
_uiShared.DrawFileScanState();
|
||||
_uiShared.DrawCacheDirectorySetting();
|
||||
_uiShared.DrawParallelScansSetting();
|
||||
ImGui.Text($"Local cache size: {UiShared.ByteToString(_uiShared.FileCacheSize)}");
|
||||
ImGui.SameLine();
|
||||
if (ImGui.Button("Clear local cache"))
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
foreach (var file in Directory.GetFiles(_configuration.CacheFolder))
|
||||
{
|
||||
File.Delete(file);
|
||||
}
|
||||
});
|
||||
}
|
||||
ImGui.TreePop();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue