Settings done for #298

This commit is contained in:
tidusjar 2016-06-06 17:19:56 +01:00
parent 0dd30968d5
commit 66bede34f4
4 changed files with 45 additions and 36 deletions

View file

@ -24,6 +24,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Threading.Tasks;
using Nancy.Responses.Negotiation;
using PlexRequests.Core;
using PlexRequests.Core.SettingModels;
@ -34,8 +38,16 @@ namespace PlexRequests.UI.Modules
public LandingPageModule(ISettingsService<PlexRequestSettings> settingsService, ISettingsService<LandingPageSettings> landing) : base("landing", settingsService)
{
LandingSettings = landing;
Get["/", true] = async (x, ct) => await Index();
}
private ISettingsService<LandingPageSettings> LandingSettings { get; }
private async Task<Negotiator> Index()
{
var model = await LandingSettings.GetSettingsAsync();
return View["Index", model];
}
}
}