mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Merge pull request #9529 from JosJuice/android-broadcast-before-metadata
Android: Broadcast update before updating additional metadata
This commit is contained in:
commit
19c5a19629
@ -99,7 +99,7 @@ public class GameFileCache
|
|||||||
*
|
*
|
||||||
* @return true if the cache was modified
|
* @return true if the cache was modified
|
||||||
*/
|
*/
|
||||||
public boolean scanLibrary()
|
public boolean update()
|
||||||
{
|
{
|
||||||
boolean recursiveScan = BooleanSetting.MAIN_RECURSIVE_ISO_PATHS.getBooleanGlobal();
|
boolean recursiveScan = BooleanSetting.MAIN_RECURSIVE_ISO_PATHS.getBooleanGlobal();
|
||||||
|
|
||||||
@ -107,13 +107,7 @@ public class GameFileCache
|
|||||||
|
|
||||||
String[] folderPaths = folderPathsSet.toArray(new String[0]);
|
String[] folderPaths = folderPathsSet.toArray(new String[0]);
|
||||||
|
|
||||||
boolean cacheChanged = update(folderPaths, recursiveScan);
|
return update(folderPaths, recursiveScan);
|
||||||
cacheChanged |= updateAdditionalMetadata();
|
|
||||||
if (cacheChanged)
|
|
||||||
{
|
|
||||||
save();
|
|
||||||
}
|
|
||||||
return cacheChanged;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public native int getSize();
|
public native int getSize();
|
||||||
@ -122,11 +116,11 @@ public class GameFileCache
|
|||||||
|
|
||||||
public native GameFile addOrGet(String gamePath);
|
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();
|
public native boolean load();
|
||||||
|
|
||||||
private native boolean save();
|
public native boolean save();
|
||||||
}
|
}
|
||||||
|
@ -177,12 +177,24 @@ public final class GameFileCacheService extends IntentService
|
|||||||
{
|
{
|
||||||
synchronized (gameFileCache)
|
synchronized (gameFileCache)
|
||||||
{
|
{
|
||||||
boolean changed = gameFileCache.scanLibrary();
|
boolean changed = gameFileCache.update();
|
||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
updateGameFileArray();
|
updateGameFileArray();
|
||||||
sendBroadcast(CACHE_UPDATED);
|
sendBroadcast(CACHE_UPDATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean additionalMetadataChanged = gameFileCache.updateAdditionalMetadata();
|
||||||
|
if (additionalMetadataChanged)
|
||||||
|
{
|
||||||
|
updateGameFileArray();
|
||||||
|
sendBroadcast(CACHE_UPDATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed || additionalMetadataChanged)
|
||||||
|
{
|
||||||
|
gameFileCache.save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user