|
|
|
@ -29,44 +29,48 @@ namespace Ombi.Store.Context
|
|
|
|
|
|
|
|
|
|
public void Seed()
|
|
|
|
|
{
|
|
|
|
|
using (var tran = Database.BeginTransaction())
|
|
|
|
|
var strat = Database.CreateExecutionStrategy();
|
|
|
|
|
strat.Execute(() =>
|
|
|
|
|
{
|
|
|
|
|
// Add the tokens
|
|
|
|
|
var fanArt = ApplicationConfigurations.FirstOrDefault(x => x.Type == ConfigurationTypes.FanartTv);
|
|
|
|
|
if (fanArt == null)
|
|
|
|
|
using (var tran = Database.BeginTransaction())
|
|
|
|
|
{
|
|
|
|
|
ApplicationConfigurations.Add(new ApplicationConfiguration
|
|
|
|
|
// Add the tokens
|
|
|
|
|
var fanArt = ApplicationConfigurations.FirstOrDefault(x => x.Type == ConfigurationTypes.FanartTv);
|
|
|
|
|
if (fanArt == null)
|
|
|
|
|
{
|
|
|
|
|
Type = ConfigurationTypes.FanartTv,
|
|
|
|
|
Value = "4b6d983efa54d8f45c68432521335f15"
|
|
|
|
|
});
|
|
|
|
|
SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
ApplicationConfigurations.Add(new ApplicationConfiguration
|
|
|
|
|
{
|
|
|
|
|
Type = ConfigurationTypes.FanartTv,
|
|
|
|
|
Value = "4b6d983efa54d8f45c68432521335f15"
|
|
|
|
|
});
|
|
|
|
|
SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var movieDb = ApplicationConfigurations.FirstOrDefault(x => x.Type == ConfigurationTypes.FanartTv);
|
|
|
|
|
if (movieDb == null)
|
|
|
|
|
{
|
|
|
|
|
ApplicationConfigurations.Add(new ApplicationConfiguration
|
|
|
|
|
var movieDb = ApplicationConfigurations.FirstOrDefault(x => x.Type == ConfigurationTypes.FanartTv);
|
|
|
|
|
if (movieDb == null)
|
|
|
|
|
{
|
|
|
|
|
Type = ConfigurationTypes.TheMovieDb,
|
|
|
|
|
Value = "b8eabaf5608b88d0298aa189dd90bf00"
|
|
|
|
|
});
|
|
|
|
|
SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
ApplicationConfigurations.Add(new ApplicationConfiguration
|
|
|
|
|
{
|
|
|
|
|
Type = ConfigurationTypes.TheMovieDb,
|
|
|
|
|
Value = "b8eabaf5608b88d0298aa189dd90bf00"
|
|
|
|
|
});
|
|
|
|
|
SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var notification =
|
|
|
|
|
ApplicationConfigurations.FirstOrDefault(x => x.Type == ConfigurationTypes.Notification);
|
|
|
|
|
if (notification == null)
|
|
|
|
|
{
|
|
|
|
|
ApplicationConfigurations.Add(new ApplicationConfiguration
|
|
|
|
|
var notification =
|
|
|
|
|
ApplicationConfigurations.FirstOrDefault(x => x.Type == ConfigurationTypes.Notification);
|
|
|
|
|
if (notification == null)
|
|
|
|
|
{
|
|
|
|
|
Type = ConfigurationTypes.Notification,
|
|
|
|
|
Value = "4f0260c4-9c3d-41ab-8d68-27cb5a593f0e"
|
|
|
|
|
});
|
|
|
|
|
SaveChanges();
|
|
|
|
|
ApplicationConfigurations.Add(new ApplicationConfiguration
|
|
|
|
|
{
|
|
|
|
|
Type = ConfigurationTypes.Notification,
|
|
|
|
|
Value = "4f0260c4-9c3d-41ab-8d68-27cb5a593f0e"
|
|
|
|
|
});
|
|
|
|
|
SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
tran.Commit();
|
|
|
|
|
}
|
|
|
|
|
tran.Commit();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|