summaryrefslogtreecommitdiff
path: root/Source/Android/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Android/app/src/main/java')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameFileCache.java16
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheService.java14
2 files changed, 18 insertions, 12 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameFileCache.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameFileCache.java
index e359d701bc..cca12267b2 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameFileCache.java
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameFileCache.java
@@ -99,7 +99,7 @@ public class GameFileCache
*
* @return true if the cache was modified
*/
- public boolean scanLibrary()
+ public boolean update()
{
boolean recursiveScan = BooleanSetting.MAIN_RECURSIVE_ISO_PATHS.getBooleanGlobal();
@@ -107,13 +107,7 @@ public class GameFileCache
String[] folderPaths = folderPathsSet.toArray(new String[0]);
- boolean cacheChanged = update(folderPaths, recursiveScan);
- cacheChanged |= updateAdditionalMetadata();
- if (cacheChanged)
- {
- save();
- }
- return cacheChanged;
+ return update(folderPaths, recursiveScan);
}
public native int getSize();
@@ -122,11 +116,11 @@ public class GameFileCache
public native GameFile addOrGet(String gamePath);
- private native boolean update(String[] folderPaths, boolean recursiveScan);
+ public native boolean update(String[] folderPaths, boolean recursiveScan);
- private native boolean updateAdditionalMetadata();
+ public native boolean updateAdditionalMetadata();
public native boolean load();
- private native boolean save();
+ public native boolean save();
}
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheService.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheService.java
index 34bf1afa0a..0abd072467 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheService.java
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheService.java
@@ -177,12 +177,24 @@ public final class GameFileCacheService extends IntentService
{
synchronized (gameFileCache)
{
- boolean changed = gameFileCache.scanLibrary();
+ boolean changed = gameFileCache.update();
if (changed)
{
updateGameFileArray();
sendBroadcast(CACHE_UPDATED);
}
+
+ boolean additionalMetadataChanged = gameFileCache.updateAdditionalMetadata();
+ if (additionalMetadataChanged)
+ {
+ updateGameFileArray();
+ sendBroadcast(CACHE_UPDATED);
+ }
+
+ if (changed || additionalMetadataChanged)
+ {
+ gameFileCache.save();
+ }
}
}