Delete cached box art when deleting a PC

This commit is contained in:
Cameron Gutman
2019-07-27 16:45:01 -04:00
parent 8665fe364f
commit 352b6f7dd9
2 changed files with 13 additions and 0 deletions

View File

@@ -137,6 +137,16 @@ public class DiskAssetLoader {
return CacheHelper.openPath(false, cacheDir, "boxart", computerUuid, appId + ".png");
}
public void deleteAssetsForComputer(String computerUuid) {
File dir = CacheHelper.openPath(false, cacheDir, "boxart", computerUuid);
File[] files = dir.listFiles();
if (files != null) {
for (File f : files) {
f.delete();
}
}
}
public void populateCacheWithStream(CachedAppAssetLoader.LoaderTuple tuple, InputStream input) {
OutputStream out = null;
boolean success = false;