Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
spektor56 committed Jan 21, 2020
1 parent 54a71f3 commit 3dc4260
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions LBGDBMetadata/LbgdbMetadataPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,20 @@ private async Task<bool> ImportXml<T>(Stream metaDataStream) where T : class
return true;
}

public bool HasData()
{
using (var metaDataContext = new MetaDataContext())
{
if (metaDataContext.Games.Any())
{
return true;
}
}

return false;
}


public async Task<string> UpdateMetadata(ProgressViewViewModel progress)
{
//string newMetadataHash = "";
Expand Down
2 changes: 1 addition & 1 deletion LBGDBMetadata/LbgdbMetadataSettingsView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private void Button_Click(object sender, RoutedEventArgs e)
private async void UserControl_Loaded(object sender, RoutedEventArgs e)
{
//btnRefresh.IsEnabled = true;
btnRefresh.IsEnabled = !File.Exists(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "lbgdb.db")) || await _plugin.NewMetadataAvailable();
btnRefresh.IsEnabled = !_plugin.HasData() || await _plugin.NewMetadataAvailable();
}
}
}

0 comments on commit 3dc4260

Please sign in to comment.