Android: Don't queue up multiple rescans before directory initialization
This commit is contained in:
parent
dbcdead04d
commit
cad4548b27
|
@ -80,6 +80,8 @@ public final class MainActivity extends AppCompatActivity implements MainView
|
||||||
{
|
{
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
|
boolean cacheAlreadyLoading = GameFileCacheService.isLoading();
|
||||||
|
|
||||||
if (DirectoryInitialization.shouldStart(this))
|
if (DirectoryInitialization.shouldStart(this))
|
||||||
{
|
{
|
||||||
DirectoryInitialization.start(this);
|
DirectoryInitialization.start(this);
|
||||||
|
@ -93,15 +95,13 @@ public final class MainActivity extends AppCompatActivity implements MainView
|
||||||
// such as system language, cover downloading...
|
// such as system language, cover downloading...
|
||||||
forEachPlatformGamesView(PlatformGamesView::refetchMetadata);
|
forEachPlatformGamesView(PlatformGamesView::refetchMetadata);
|
||||||
|
|
||||||
if (sShouldRescanLibrary)
|
if (sShouldRescanLibrary && !cacheAlreadyLoading)
|
||||||
{
|
{
|
||||||
GameFileCacheService.startRescan(this);
|
GameFileCacheService.startRescan(this);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
sShouldRescanLibrary = true;
|
sShouldRescanLibrary = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy()
|
protected void onDestroy()
|
||||||
|
|
|
@ -68,6 +68,8 @@ public final class TvMainActivity extends FragmentActivity implements MainView
|
||||||
{
|
{
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
|
boolean cacheAlreadyLoading = GameFileCacheService.isLoading();
|
||||||
|
|
||||||
if (DirectoryInitialization.shouldStart(this))
|
if (DirectoryInitialization.shouldStart(this))
|
||||||
{
|
{
|
||||||
DirectoryInitialization.start(this);
|
DirectoryInitialization.start(this);
|
||||||
|
@ -80,15 +82,13 @@ public final class TvMainActivity extends FragmentActivity implements MainView
|
||||||
// such as system language, cover downloading...
|
// such as system language, cover downloading...
|
||||||
refetchMetadata();
|
refetchMetadata();
|
||||||
|
|
||||||
if (sShouldRescanLibrary)
|
if (sShouldRescanLibrary && !cacheAlreadyLoading)
|
||||||
{
|
{
|
||||||
GameFileCacheService.startRescan(this);
|
GameFileCacheService.startRescan(this);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
sShouldRescanLibrary = true;
|
sShouldRescanLibrary = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy()
|
protected void onDestroy()
|
||||||
|
|
Loading…
Reference in New Issue