pull/1741/head
tidusjar 7 years ago
parent 197d32da8f
commit a6ca902479

@ -10,7 +10,7 @@
<ItemGroup>
<PackageReference Include="Ensure.That" Version="7.0.0-pre32" />
<PackageReference Include="MailKit" Version="1.18.1.1" />
<PackageReference Include="MailKit" Version="1.20.0" />
</ItemGroup>
<ItemGroup>

@ -22,7 +22,7 @@ namespace Ombi.Store.Repository
public GlobalSettings Insert(GlobalSettings entity)
{
_cache.Remove(GetName(entity.SettingsName));
//_cache.Remove(GetName(entity.SettingsName));
var settings = Db.Settings.Add(entity);
Db.SaveChanges();
return settings.Entity;
@ -30,7 +30,7 @@ namespace Ombi.Store.Repository
public async Task<GlobalSettings> InsertAsync(GlobalSettings entity)
{
_cache.Remove(GetName(entity.SettingsName));
//_cache.Remove(GetName(entity.SettingsName));
var settings = await Db.Settings.AddAsync(entity).ConfigureAwait(false);
await Db.SaveChangesAsync().ConfigureAwait(false);
return settings.Entity;
@ -39,48 +39,48 @@ namespace Ombi.Store.Repository
public GlobalSettings Get(string pageName)
{
return _cache.GetOrCreate(GetName(pageName), entry =>
{
entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(1);
//return _cache.GetOrCreate(GetName(pageName), entry =>
//{
// entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(1);
var entity = Db.Settings.AsNoTracking().FirstOrDefault(x => x.SettingsName == pageName);
return entity;
});
//});
}
public async Task<GlobalSettings> GetAsync(string settingsName)
{
return await _cache.GetOrCreateAsync(GetName(settingsName), async entry =>
{
entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(1);
//return await _cache.GetOrCreateAsync(GetName(settingsName), async entry =>
//{
//entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(1);
var obj = await Db.Settings.AsNoTracking().FirstOrDefaultAsync(x => x.SettingsName == settingsName);
return obj;
});
//});
}
public async Task DeleteAsync(GlobalSettings entity)
{
_cache.Remove(GetName(entity.SettingsName));
//_cache.Remove(GetName(entity.SettingsName));
Db.Settings.Remove(entity);
await Db.SaveChangesAsync();
}
public async Task UpdateAsync(GlobalSettings entity)
{
_cache.Remove(GetName(entity.SettingsName));
//_cache.Remove(GetName(entity.SettingsName));
Db.Update(entity);
await Db.SaveChangesAsync();
}
public void Delete(GlobalSettings entity)
{
_cache.Remove(GetName(entity.SettingsName));
//_cache.Remove(GetName(entity.SettingsName));
Db.Settings.Remove(entity);
Db.SaveChanges();
}
public void Update(GlobalSettings entity)
{
_cache.Remove(GetName(entity.SettingsName));
//_cache.Remove(GetName(entity.SettingsName));
Db.SaveChanges();
}

@ -1,4 +1,6 @@
<i class="fa fa-info-circle" tooltipPosition="left" [escape]="false" pTooltip="{{helpText}}"></i>

<wiki [url]="'https://github.com/tidusjar/Ombi/wiki/Notification-Template-Variables'" [text]="'Notification Variables'"></wiki>
<br><br>
<ngb-accordion [closeOthers]="true" activeIds="0-header">

@ -9,23 +9,4 @@ import { INotificationTemplates, NotificationType } from "../../interfaces";
export class NotificationTemplate {
@Input() public templates: INotificationTemplates[];
public NotificationType = NotificationType;
public helpText = `
{RequestedUser} : The User who requested the content <br/>
{RequestedDate} : The Date the media was requested <br/>
{Title} : The title of the request e.g. Lion King <br/>
{Type} : The request type e.g. Movie/Tv Show <br/>
{Overview} : Overview of the requested item <br/>
{Year} : The release year of the request<br/>
{EpisodesList} : A comma seperated list of Episodes requested<br/>
{SeasonsList} : A comma seperated list of seasons requested<br/>
{PosterImage} : The requested poster image link<br/>
{ApplicationName} : The Application Name from the Customization Settings
{ApplicationUrl} : The Application URL from the Customization Settings
{LongDate} : 15 June 2017 <br/>
{ShortDate} : 15/06/2017 <br/>
{LongTime} : 16:02:34 <br/>
{ShortTime} : 16:02 <br/>
`;
}

@ -1,5 +1,15 @@
<div class="col-md-12">
<div class="col-md-1 col-md-push-11">
<a href="{{url}}" target="_blank" class="btn btn-sm btn-info-outline">Wiki</a>
<div *ngIf="!text" class="col-md-1 col-md-push-11">
<a href="{{url}}" target="_blank" class="btn btn-sm btn-info-outline">
<span >Wiki</span>
</a>
</div>
<div *ngIf="text" class="col-md-1 col-md-push-9">
<a href="{{url}}" target="_blank" class="btn btn-sm btn-info-outline">
<span>{{text}}</span>
</a>
</div>
</div>

@ -6,4 +6,5 @@
})
export class WikiComponent {
@Input() public url: string;
@Input() public text: string;
}

Loading…
Cancel
Save