Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Fix: Download titlesdb if not exists (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
89pleasure committed Jun 16, 2023
1 parent c3b29f8 commit a1f241f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/src/provider/game_list_provider.dart
Expand Up @@ -95,12 +95,13 @@ bool _titleIsValid(Map<String, dynamic> titleData) {
}

Future<void> _checkTitlesDatabase() async {
if (await _hasBeenDownloadedWithin()) {
debugPrint('Has been checked within 24 hours. Skip.');
File titlesJsonFile = await PlatformFilesystem.instance.getFile('titlesdb.json');

// Skip if exists and downloaded within 24 hours already
if (await _hasBeenDownloadedWithin() && await titlesJsonFile.exists()) {
return;
}

File titlesJsonFile = await PlatformFilesystem.instance.getFile('titlesdb.json');
final slug = RepositorySlug('arch-box', 'titledb');
final latestRelease = await GithubClient().getLatestReleaseBySlug(slug);
final assets = latestRelease.assets;
Expand Down

0 comments on commit a1f241f

Please sign in to comment.