pull/1510/head
tidusjar 7 years ago
parent ba2fd48067
commit d7f0f61ece

@ -61,7 +61,7 @@ namespace Ombi.Schedule.Jobs.Plex
public async Task CacheContent()
{
var plexSettings = Plex.GetSettings();
var plexSettings = await Plex.GetSettingsAsync();
if (!plexSettings.Enable)
{
return;
@ -222,12 +222,16 @@ namespace Ombi.Schedule.Jobs.Plex
{
if (plexSettings.PlexSelectedLibraries.Any())
{
// Only get the enabled libs
var keys = plexSettings.PlexSelectedLibraries.Where(x => x.Enabled).Select(x => x.Key.ToString()).ToList();
if (!keys.Contains(dir.key))
if (plexSettings.PlexSelectedLibraries.Any(x => x.Enabled))
{
// We are not monitoring this lib
continue;
// Only get the enabled libs
var keys = plexSettings.PlexSelectedLibraries.Where(x => x.Enabled)
.Select(x => x.Key.ToString()).ToList();
if (!keys.Contains(dir.key))
{
// We are not monitoring this lib
continue;
}
}
}
var lib = PlexApi.GetLibrary(plexSettings.PlexAuthToken, plexSettings.FullUri, dir.key).Result;

@ -71,14 +71,19 @@ namespace Ombi.Schedule.Jobs.Plex
{
if (settings.PlexSelectedLibraries.Any())
{
// Make sure we have enabled this
var keys = settings.PlexSelectedLibraries.Where(x => x.Enabled).Select(x => x.Key.ToString()).ToList();
if (!keys.Contains(section.key))
// Are any enabled?
if (settings.PlexSelectedLibraries.Any(x => x.Enabled))
{
// We are not monitoring this lib
continue;
// Make sure we have enabled this
var keys = settings.PlexSelectedLibraries.Where(x => x.Enabled).Select(x => x.Key.ToString())
.ToList();
if (!keys.Contains(section.key))
{
// We are not monitoring this lib
continue;
}
}
// Get the episodes
await GetEpisodes(settings, section);
}

@ -40,7 +40,7 @@ namespace Ombi.Settings.Settings
public async Task<T> GetSettingsAsync()
{
var result = await Repo.GetAsync(EntityName).ConfigureAwait(false);
var result = await Repo.GetAsync(EntityName);
if (result == null)
{
return new T();
@ -94,8 +94,8 @@ namespace Ombi.Settings.Settings
modified.Id = entity.Id;
var globalSettings = new GlobalSettings { SettingsName = EntityName, Content = JsonConvert.SerializeObject(modified, SerializerSettings.Settings), Id = entity.Id };
entity.Content = EncryptSettings(globalSettings);
await Repo.UpdateAsync(entity).ConfigureAwait(false);
globalSettings.Content = EncryptSettings(globalSettings);
await Repo.UpdateAsync(globalSettings).ConfigureAwait(false);
return true;
}
@ -117,7 +117,7 @@ namespace Ombi.Settings.Settings
{
await Repo.DeleteAsync(entity);
}
}
private string EncryptSettings(GlobalSettings settings)

@ -31,5 +31,7 @@ namespace Ombi.Store.Context
DbSet<MovieIssues> MovieIssues { get; set; }
DbSet<TvIssues> TvIssues { get; set; }
DbSet<Tokens> Tokens { get; set; }
EntityEntry Update(object entity);
EntityEntry<TEntity> Update<TEntity>(TEntity entity) where TEntity : class;
}
}

@ -19,7 +19,7 @@ namespace Ombi.Store.Context
Database.Migrate();
// Add the notifcation templates
}

@ -63,7 +63,7 @@ namespace Ombi.Store.Repository
{
var obj = await Db.Settings.FirstOrDefaultAsync(x => x.SettingsName == settingsName);
Db.Entry(obj).Reload();
if (obj != null) Db.Entry(obj).Reload();
return obj;
}

@ -24,7 +24,7 @@
<ng-template ngbTabContent>
<br />
<br />
<div class="col-md-12 col-md-push-10" style="float: right;">
<div class="col-md-2 " style="float: right;">
<button type="submit" (click)="removeServer(server)" class="btn btn-danger-outline">Remove Server</button>
</div>
<br />

@ -27,7 +27,7 @@
<ng-template ngbTabContent>
<br />
<br />
<div class="col-md-12 col-md-push-10" style="float: right;">
<div class="col-md-2 " style="float: right;">
<button type="submit" (click)="removeServer(server)" class="btn btn-danger-outline">Remove Server</button>
</div>
<br />

Loading…
Cancel
Save