mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-18 10:32:43 +00:00
Delete cached box art when deleting a PC
This commit is contained in:
parent
8665fe364f
commit
352b6f7dd9
@ -9,6 +9,7 @@ import com.limelight.binding.crypto.AndroidCryptoProvider;
|
||||
import com.limelight.computers.ComputerManagerListener;
|
||||
import com.limelight.computers.ComputerManagerService;
|
||||
import com.limelight.grid.PcGridAdapter;
|
||||
import com.limelight.grid.assets.DiskAssetLoader;
|
||||
import com.limelight.nvstream.http.ComputerDetails;
|
||||
import com.limelight.nvstream.http.NvApp;
|
||||
import com.limelight.nvstream.http.NvHTTP;
|
||||
@ -631,6 +632,8 @@ public class PcView extends Activity implements AdapterFragmentCallbacks {
|
||||
private void removeComputer(ComputerDetails details) {
|
||||
managerBinder.removeComputer(details);
|
||||
|
||||
new DiskAssetLoader(this).deleteAssetsForComputer(details.uuid);
|
||||
|
||||
for (int i = 0; i < pcGridAdapter.getCount(); i++) {
|
||||
ComputerObject computer = (ComputerObject) pcGridAdapter.getItem(i);
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user