mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-13 18:16:55 -07:00
Fixed #1705
This commit is contained in:
parent
197d32da8f
commit
a6ca902479
6 changed files with 31 additions and 37 deletions
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Ensure.That" Version="7.0.0-pre32" />
|
<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>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace Ombi.Store.Repository
|
||||||
|
|
||||||
public GlobalSettings Insert(GlobalSettings entity)
|
public GlobalSettings Insert(GlobalSettings entity)
|
||||||
{
|
{
|
||||||
_cache.Remove(GetName(entity.SettingsName));
|
//_cache.Remove(GetName(entity.SettingsName));
|
||||||
var settings = Db.Settings.Add(entity);
|
var settings = Db.Settings.Add(entity);
|
||||||
Db.SaveChanges();
|
Db.SaveChanges();
|
||||||
return settings.Entity;
|
return settings.Entity;
|
||||||
|
@ -30,7 +30,7 @@ namespace Ombi.Store.Repository
|
||||||
|
|
||||||
public async Task<GlobalSettings> InsertAsync(GlobalSettings entity)
|
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);
|
var settings = await Db.Settings.AddAsync(entity).ConfigureAwait(false);
|
||||||
await Db.SaveChangesAsync().ConfigureAwait(false);
|
await Db.SaveChangesAsync().ConfigureAwait(false);
|
||||||
return settings.Entity;
|
return settings.Entity;
|
||||||
|
@ -39,48 +39,48 @@ namespace Ombi.Store.Repository
|
||||||
|
|
||||||
public GlobalSettings Get(string pageName)
|
public GlobalSettings Get(string pageName)
|
||||||
{
|
{
|
||||||
return _cache.GetOrCreate(GetName(pageName), entry =>
|
//return _cache.GetOrCreate(GetName(pageName), entry =>
|
||||||
{
|
//{
|
||||||
entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(1);
|
// entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(1);
|
||||||
var entity = Db.Settings.AsNoTracking().FirstOrDefault(x => x.SettingsName == pageName);
|
var entity = Db.Settings.AsNoTracking().FirstOrDefault(x => x.SettingsName == pageName);
|
||||||
return entity;
|
return entity;
|
||||||
});
|
//});
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GlobalSettings> GetAsync(string settingsName)
|
public async Task<GlobalSettings> GetAsync(string settingsName)
|
||||||
{
|
{
|
||||||
return await _cache.GetOrCreateAsync(GetName(settingsName), async entry =>
|
//return await _cache.GetOrCreateAsync(GetName(settingsName), async entry =>
|
||||||
{
|
//{
|
||||||
entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(1);
|
//entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(1);
|
||||||
var obj = await Db.Settings.AsNoTracking().FirstOrDefaultAsync(x => x.SettingsName == settingsName);
|
var obj = await Db.Settings.AsNoTracking().FirstOrDefaultAsync(x => x.SettingsName == settingsName);
|
||||||
return obj;
|
return obj;
|
||||||
});
|
//});
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task DeleteAsync(GlobalSettings entity)
|
public async Task DeleteAsync(GlobalSettings entity)
|
||||||
{
|
{
|
||||||
_cache.Remove(GetName(entity.SettingsName));
|
//_cache.Remove(GetName(entity.SettingsName));
|
||||||
Db.Settings.Remove(entity);
|
Db.Settings.Remove(entity);
|
||||||
await Db.SaveChangesAsync();
|
await Db.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task UpdateAsync(GlobalSettings entity)
|
public async Task UpdateAsync(GlobalSettings entity)
|
||||||
{
|
{
|
||||||
_cache.Remove(GetName(entity.SettingsName));
|
//_cache.Remove(GetName(entity.SettingsName));
|
||||||
Db.Update(entity);
|
Db.Update(entity);
|
||||||
await Db.SaveChangesAsync();
|
await Db.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Delete(GlobalSettings entity)
|
public void Delete(GlobalSettings entity)
|
||||||
{
|
{
|
||||||
_cache.Remove(GetName(entity.SettingsName));
|
//_cache.Remove(GetName(entity.SettingsName));
|
||||||
Db.Settings.Remove(entity);
|
Db.Settings.Remove(entity);
|
||||||
Db.SaveChanges();
|
Db.SaveChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update(GlobalSettings entity)
|
public void Update(GlobalSettings entity)
|
||||||
{
|
{
|
||||||
_cache.Remove(GetName(entity.SettingsName));
|
//_cache.Remove(GetName(entity.SettingsName));
|
||||||
Db.SaveChanges();
|
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">
|
<ngb-accordion [closeOthers]="true" activeIds="0-header">
|
||||||
|
|
|
@ -9,23 +9,4 @@ import { INotificationTemplates, NotificationType } from "../../interfaces";
|
||||||
export class NotificationTemplate {
|
export class NotificationTemplate {
|
||||||
@Input() public templates: INotificationTemplates[];
|
@Input() public templates: INotificationTemplates[];
|
||||||
public NotificationType = NotificationType;
|
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-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>
|
||||||
|
|
||||||
|
<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>
|
</div>
|
|
@ -6,4 +6,5 @@
|
||||||
})
|
})
|
||||||
export class WikiComponent {
|
export class WikiComponent {
|
||||||
@Input() public url: string;
|
@Input() public url: string;
|
||||||
|
@Input() public text: string;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue