Option to delete original textures from disk

This commit is contained in:
Loporrit
2025-02-24 03:35:48 +00:00
parent f7abf9f374
commit c42316b058
4 changed files with 68 additions and 8 deletions

View File

@@ -303,6 +303,19 @@ public class PlayerPerformanceService : DisposableMediatorSubscriberBase
File.Move(tmpFilePath, newFilePath);
_fileCacheManager.CreateSubstEntry(newFilePath);
shrunken = true;
// Make sure its a cache file before trying to delete it !!
bool shouldDelete = fileEntry.IsCacheEntry && File.Exists(filePath);
if (_playerPerformanceConfigService.Current.TextureShrinkDeleteOriginal && shouldDelete)
{
try
{
_logger.LogDebug("Deleting original texture: {filePath}", filePath);
File.Delete(filePath);
}
catch { }
}
}
catch (Exception e)
{