mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-10 15:32:37 -07:00
Small changes
This commit is contained in:
parent
bd15090a4e
commit
36bbf3375c
2 changed files with 15 additions and 2 deletions
|
@ -719,7 +719,7 @@ namespace PlexRequests.UI.Modules
|
|||
private Response UpdateLogLevels(int level)
|
||||
{
|
||||
var settings = LogService.GetSettings();
|
||||
|
||||
Analytics.TrackEventAsync(Category.Admin, Action.Update, "Updated Log Levels", Username, CookieHelper.GetAnalyticClientId(Cookies), level);
|
||||
// apply the level
|
||||
var newLevel = LogLevel.FromOrdinal(level);
|
||||
LoggingHelper.ReconfigureLogLevel(newLevel);
|
||||
|
@ -760,6 +760,7 @@ namespace PlexRequests.UI.Modules
|
|||
private Response CreateApiKey()
|
||||
{
|
||||
this.RequiresClaims(UserClaims.Admin);
|
||||
Analytics.TrackEventAsync(Category.Admin, Action.Create, "Created API Key", Username, CookieHelper.GetAnalyticClientId(Cookies));
|
||||
var apiKey = Guid.NewGuid().ToString("N");
|
||||
var settings = PrService.GetSettings();
|
||||
|
||||
|
@ -847,6 +848,7 @@ namespace PlexRequests.UI.Modules
|
|||
{
|
||||
var settings = this.Bind<LandingPageSettings>();
|
||||
|
||||
Analytics.TrackEventAsync(Category.Admin, Action.Update, "Update Landing Page", Username, CookieHelper.GetAnalyticClientId(Cookies));
|
||||
var plexSettings = await PlexService.GetSettingsAsync();
|
||||
if (string.IsNullOrEmpty(plexSettings.Ip))
|
||||
{
|
||||
|
@ -885,6 +887,8 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
private async Task<Response> SaveScheduledJobs()
|
||||
{
|
||||
|
||||
Analytics.TrackEventAsync(Category.Admin, Action.Update, "Update ScheduledJobs", Username, CookieHelper.GetAnalyticClientId(Cookies));
|
||||
var settings = this.Bind<ScheduledJobsSettings>();
|
||||
|
||||
var result = await ScheduledJobSettings.SaveSettingsAsync(settings);
|
||||
|
@ -898,6 +902,7 @@ namespace PlexRequests.UI.Modules
|
|||
{
|
||||
try
|
||||
{
|
||||
Analytics.TrackEventAsync(Category.Admin, Action.Delete, "Clear Logs", Username, CookieHelper.GetAnalyticClientId(Cookies));
|
||||
var allLogs = await LogsRepo.GetAllAsync();
|
||||
foreach (var logEntity in allLogs)
|
||||
{
|
||||
|
|
|
@ -47,6 +47,9 @@ using System.Threading.Tasks;
|
|||
using NLog;
|
||||
|
||||
using PlexRequests.Core.Models;
|
||||
using PlexRequests.Helpers.Analytics;
|
||||
|
||||
using Action = PlexRequests.Helpers.Analytics.Action;
|
||||
|
||||
namespace PlexRequests.UI.Modules
|
||||
{
|
||||
|
@ -63,7 +66,8 @@ namespace PlexRequests.UI.Modules
|
|||
ICouchPotatoApi cpApi,
|
||||
ISonarrApi sonarrApi,
|
||||
ISickRageApi sickRageApi,
|
||||
ICacheProvider cache) : base("requests", prSettings)
|
||||
ICacheProvider cache,
|
||||
IAnalytics an) : base("requests", prSettings)
|
||||
{
|
||||
Service = service;
|
||||
PrSettings = prSettings;
|
||||
|
@ -76,6 +80,7 @@ namespace PlexRequests.UI.Modules
|
|||
SickRageApi = sickRageApi;
|
||||
CpApi = cpApi;
|
||||
Cache = cache;
|
||||
Analytics = an;
|
||||
|
||||
Get["/", true] = async (x, ct) => await LoadRequests();
|
||||
Get["/movies", true] = async (x, ct) => await GetMovies();
|
||||
|
@ -92,6 +97,7 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private IRequestService Service { get; }
|
||||
private IAnalytics Analytics { get; }
|
||||
private INotificationService NotificationService { get; }
|
||||
private ISettingsService<PlexRequestSettings> PrSettings { get; }
|
||||
private ISettingsService<PlexSettings> PlexSettings { get; }
|
||||
|
@ -295,6 +301,7 @@ namespace PlexRequests.UI.Modules
|
|||
private async Task<Response> DeleteRequest(int requestid)
|
||||
{
|
||||
this.RequiresClaims(UserClaims.Admin);
|
||||
Analytics.TrackEventAsync(Category.Requests, Action.Delete, "Delete Request", Username, CookieHelper.GetAnalyticClientId(Cookies));
|
||||
|
||||
var currentEntity = await Service.GetAsync(requestid);
|
||||
await Service.DeleteRequestAsync(currentEntity);
|
||||
|
@ -360,6 +367,7 @@ namespace PlexRequests.UI.Modules
|
|||
private async Task<Response> ChangeRequestAvailability(int requestId, bool available)
|
||||
{
|
||||
this.RequiresClaims(UserClaims.Admin);
|
||||
Analytics.TrackEventAsync(Category.Requests, Action.Update, available ? "Make request available" : "Make request unavailable", Username, CookieHelper.GetAnalyticClientId(Cookies));
|
||||
var originalRequest = await Service.GetAsync(requestId);
|
||||
if (originalRequest == null)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue