Disable cache deletion when file in use, cache avatars.

This commit is contained in:
Natsumi
2021-08-10 17:03:42 +12:00
parent f5098485f0
commit e1898e27b8
3 changed files with 62 additions and 19 deletions
+13 -3
View File
@@ -87,16 +87,26 @@ namespace VRCX
return Path.Combine(cachePath, idHash, versionLocation);
}
public long CheckVRChatCache(string id, int version, string cacheDir)
public long[] CheckVRChatCache(string id, int version, string cacheDir)
{
long FileSize = -1;
long IsLocked = 0;
var FullLocation = GetVRChatCacheFullLocation(id, version, cacheDir);
var FileLocation = Path.Combine(FullLocation, "__data");
if (File.Exists(FileLocation))
{
FileInfo data = new FileInfo(FileLocation);
return data.Length;
FileSize = data.Length;
}
return -1;
if (File.Exists(Path.Combine(FullLocation, "__lock")))
{
IsLocked = 1;
}
return new long[]
{
FileSize,
IsLocked
};
}
public void DownloadCacheFile(string cacheDir, string url, string id, int version, int sizeInBytes, string md5, string AppVersion, bool IsUpdate)