diff --git a/QuickPlay/Configuration.cs b/QuickPlay/Configuration.cs index 3ab5a5d..9c45760 100644 --- a/QuickPlay/Configuration.cs +++ b/QuickPlay/Configuration.cs @@ -77,7 +77,7 @@ namespace QuickPlay { // TODO: decide sensibly var cfgProvider = new HttpConfigurationProvider(playerConfigUrl); - return cfgProvider.GetConfiguration(); + return cfgProvider.GetConfigurationAsync().Result; // Bad code, but hopefully we dont hang. } // We want to compare by values. @@ -131,7 +131,7 @@ namespace QuickPlay interface IPlayerConfigurationProvider { - PlayerConfiguration GetConfiguration(); + Task GetConfigurationAsync(); } sealed class HttpConfigurationProvider : IPlayerConfigurationProvider @@ -141,7 +141,7 @@ namespace QuickPlay { configUrl = url; } - public async Task GetConfiguration() + public async Task GetConfigurationAsync() { var client = new HttpClient() ; var resp = await client.GetStreamAsync(configUrl); @@ -162,15 +162,15 @@ namespace QuickPlay { this.reader = new StreamReader(filename); } - public PlayerConfiguration GetConfiguration() + public Task GetConfigurationAsync() { - return PlayerConfiguration.FromFile(reader); + return Task.FromResult(PlayerConfiguration.FromFile(reader)); } } sealed class DummyConfigurationProvider : IPlayerConfigurationProvider { - public PlayerConfiguration GetConfiguration() => null; + public Task GetConfigurationAsync() => null; } class Song: IPlayable diff --git a/QuickPlay/QuickPlay.csproj b/QuickPlay/QuickPlay.csproj index 2d3d180..ff49baa 100644 --- a/QuickPlay/QuickPlay.csproj +++ b/QuickPlay/QuickPlay.csproj @@ -60,6 +60,7 @@ + @@ -68,6 +69,7 @@ +