Sweep VRChat cache function

This commit is contained in:
Natsumi
2021-05-23 01:41:06 +12:00
parent 7c0108cf54
commit 188d4a4972
3 changed files with 53 additions and 1 deletions

View File

@@ -7064,6 +7064,7 @@ speechSynthesis.getVoices();
$app.data.worldAutoCacheGPS = configRepository.getString('VRCX_worldAutoCacheGPS');
$app.data.worldAutoCacheInviteFilter = configRepository.getBool('VRCX_worldAutoCacheInviteFilter');
$app.data.worldAutoCacheGPSFilter = configRepository.getBool('VRCX_worldAutoCacheGPSFilter');
$app.data.autoSweepVRChatCache = configRepository.getBool('VRCX_autoSweepVRChatCache');
var saveOpenVROption = function () {
configRepository.setBool('openVR', this.openVR);
configRepository.setBool('openVRAlways', this.openVRAlways);
@@ -7081,6 +7082,7 @@ speechSynthesis.getVoices();
configRepository.setString('VRCX_worldAutoCacheGPS', this.worldAutoCacheGPS);
configRepository.setBool('VRCX_worldAutoCacheInviteFilter', this.worldAutoCacheInviteFilter);
configRepository.setBool('VRCX_worldAutoCacheGPSFilter', this.worldAutoCacheGPSFilter);
configRepository.setBool('VRCX_autoSweepVRChatCache', this.autoSweepVRChatCache);
this.updateVRConfigVars();
};
$app.data.TTSvoices = speechSynthesis.getVoices();
@@ -7108,6 +7110,7 @@ speechSynthesis.getVoices();
$app.watch.worldAutoCacheGPS = saveOpenVROption;
$app.watch.worldAutoCacheInviteFilter = saveOpenVROption;
$app.watch.worldAutoCacheGPSFilter = saveOpenVROption;
$app.watch.autoSweepVRChatCache = saveOpenVROption;
$app.watch.notificationTTS = saveNotificationTTS;
$app.data.isDarkMode = configRepository.getBool('isDarkMode');
$appDarkStyle.disabled = $app.data.isDarkMode === false;
@@ -11700,6 +11703,18 @@ speechSynthesis.getVoices();
this.getVRChatCacheSize();
};
$app.methods.sweepVRChatCache = async function () {
await this.readVRChatConfigFile();
var cacheDirectory = '';
if (this.VRChatConfigFile.cache_directory) {
cacheDirectory = this.VRChatConfigFile.cache_directory;
}
await AssetBundleCacher.SweepCache(cacheDirectory);
if (this.VRChatConfigDialog.visible) {
this.getVRChatCacheSize();
}
};
$app.data.VRChatUsedCacheSize = '';
$app.data.VRChatTotalCacheSize = '';
$app.data.VRChatCacheSizeLoading = false;

View File

@@ -869,6 +869,10 @@ html
div.options-container-item
el-button-group
el-button(size="small" icon="el-icon-download" @click="showDownloadDialog()") Download History
br
div.options-container-item
span.name(style="min-width:250px") Auto sweep cache when closing VRChat
el-switch(v-model="autoSweepVRChatCache")
div.options-container
span.header Application
div.options-container-item
@@ -1523,6 +1527,9 @@ html
span Clear Cache
el-button(type="default" @click="deleteAllVRChatCache" :disabled="isGameRunning" size="small" icon="el-icon-delete" circle style="margin-left:5px")
br
span Delete all old versions from cache
el-button(size="small" style="margin-left:5px" icon="el-icon-folder-delete" @click="sweepVRChatCache()") Sweep Cache
br
div(style="display:inline-block;margin-top:10px" v-for="(item, value) in VRChatConfigList" :key="value")
span(v-text="item.name" style="word-break:keep-all")
|: