mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-30 11:38:32 -07:00
Add the Issue Reporting functionality (#1811)
* Added issuesreporting and the ability to add categories to the UI * Added lazy loading!
This commit is contained in:
parent
438f56eceb
commit
246f1c07cf
109 changed files with 2905 additions and 526 deletions
|
@ -19,7 +19,7 @@ namespace Ombi.Core.Engine
|
|||
public class MovieSearchEngine : BaseMediaEngine, IMovieEngine
|
||||
{
|
||||
public MovieSearchEngine(IPrincipal identity, IRequestServiceMain service, IMovieDbApi movApi, IMapper mapper,
|
||||
ILogger<MovieSearchEngine> logger, IRuleEvaluator r, OmbiUserManager um, IMemoryCache mem)
|
||||
ILogger<MovieSearchEngine> logger, IRuleEvaluator r, OmbiUserManager um, ICacheService mem)
|
||||
: base(identity, service, r, um)
|
||||
{
|
||||
MovieApi = movApi;
|
||||
|
@ -31,7 +31,7 @@ namespace Ombi.Core.Engine
|
|||
private IMovieDbApi MovieApi { get; }
|
||||
private IMapper Mapper { get; }
|
||||
private ILogger<MovieSearchEngine> Logger { get; }
|
||||
private IMemoryCache MemCache { get; }
|
||||
private ICacheService MemCache { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Lookups the imdb information.
|
||||
|
@ -69,11 +69,7 @@ namespace Ombi.Core.Engine
|
|||
/// <returns></returns>
|
||||
public async Task<IEnumerable<SearchMovieViewModel>> PopularMovies()
|
||||
{
|
||||
var result = await MemCache.GetOrCreateAsync(CacheKeys.PopularMovies, async entry =>
|
||||
{
|
||||
entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(12);
|
||||
return await MovieApi.PopularMovies();
|
||||
});
|
||||
var result = await MemCache.GetOrAdd(CacheKeys.PopularMovies, async () => await MovieApi.PopularMovies(), DateTime.Now.AddHours(12));
|
||||
if (result != null)
|
||||
{
|
||||
Logger.LogDebug("Search Result: {result}", result);
|
||||
|
@ -88,11 +84,7 @@ namespace Ombi.Core.Engine
|
|||
/// <returns></returns>
|
||||
public async Task<IEnumerable<SearchMovieViewModel>> TopRatedMovies()
|
||||
{
|
||||
var result = await MemCache.GetOrCreateAsync(CacheKeys.TopRatedMovies, async entry =>
|
||||
{
|
||||
entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(12);
|
||||
return await MovieApi.TopRated();
|
||||
});
|
||||
var result = await MemCache.GetOrAdd(CacheKeys.TopRatedMovies, async () => await MovieApi.TopRated(), DateTime.Now.AddHours(12));
|
||||
if (result != null)
|
||||
{
|
||||
Logger.LogDebug("Search Result: {result}", result);
|
||||
|
@ -107,11 +99,7 @@ namespace Ombi.Core.Engine
|
|||
/// <returns></returns>
|
||||
public async Task<IEnumerable<SearchMovieViewModel>> UpcomingMovies()
|
||||
{
|
||||
var result = await MemCache.GetOrCreateAsync(CacheKeys.UpcomingMovies, async entry =>
|
||||
{
|
||||
entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(12);
|
||||
return await MovieApi.Upcoming();
|
||||
});
|
||||
var result = await MemCache.GetOrAdd(CacheKeys.UpcomingMovies, async () => await MovieApi.Upcoming(), DateTime.Now.AddHours(12));
|
||||
if (result != null)
|
||||
{
|
||||
Logger.LogDebug("Search Result: {result}", result);
|
||||
|
@ -126,11 +114,7 @@ namespace Ombi.Core.Engine
|
|||
/// <returns></returns>
|
||||
public async Task<IEnumerable<SearchMovieViewModel>> NowPlayingMovies()
|
||||
{
|
||||
var result = await MemCache.GetOrCreateAsync(CacheKeys.NowPlayingMovies, async entry =>
|
||||
{
|
||||
entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(12);
|
||||
return await MovieApi.NowPlaying();
|
||||
});
|
||||
var result = await MemCache.GetOrAdd(CacheKeys.NowPlayingMovies, async () => await MovieApi.NowPlaying(), DateTime.Now.AddHours(12));
|
||||
if (result != null)
|
||||
{
|
||||
Logger.LogDebug("Search Result: {result}", result);
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace Ombi.Core.Engine
|
|||
{
|
||||
public TvSearchEngine(IPrincipal identity, IRequestServiceMain service, ITvMazeApi tvMaze, IMapper mapper, ISettingsService<PlexSettings> plexSettings,
|
||||
ISettingsService<EmbySettings> embySettings, IPlexContentRepository repo, IEmbyContentRepository embyRepo, ITraktApi trakt, IRuleEvaluator r, OmbiUserManager um,
|
||||
IMemoryCache memCache)
|
||||
ICacheService memCache)
|
||||
: base(identity, service, r, um)
|
||||
{
|
||||
TvMazeApi = tvMaze;
|
||||
|
@ -46,7 +46,7 @@ namespace Ombi.Core.Engine
|
|||
private IPlexContentRepository PlexContentRepo { get; }
|
||||
private IEmbyContentRepository EmbyContentRepo { get; }
|
||||
private ITraktApi TraktApi { get; }
|
||||
private IMemoryCache MemCache { get; }
|
||||
private ICacheService MemCache { get; }
|
||||
|
||||
public async Task<IEnumerable<SearchTvShowViewModel>> Search(string searchTerm)
|
||||
{
|
||||
|
@ -124,44 +124,28 @@ namespace Ombi.Core.Engine
|
|||
|
||||
public async Task<IEnumerable<TreeNode<SearchTvShowViewModel>>> Popular()
|
||||
{
|
||||
var result = await MemCache.GetOrCreateAsync(CacheKeys.PopularTv, async entry =>
|
||||
{
|
||||
entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(12);
|
||||
return await TraktApi.GetPopularShows();
|
||||
});
|
||||
var result = await MemCache.GetOrAdd(CacheKeys.PopularTv, async () => await TraktApi.GetPopularShows(), DateTime.Now.AddHours(12));
|
||||
var processed = await ProcessResults(result);
|
||||
return processed.Select(ParseIntoTreeNode).ToList();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<TreeNode<SearchTvShowViewModel>>> Anticipated()
|
||||
{
|
||||
var result = await MemCache.GetOrCreateAsync(CacheKeys.AnticipatedTv, async entry =>
|
||||
{
|
||||
entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(12);
|
||||
return await TraktApi.GetAnticipatedShows();
|
||||
});
|
||||
var result = await MemCache.GetOrAdd(CacheKeys.AnticipatedTv, async () => await TraktApi.GetAnticipatedShows(), DateTime.Now.AddHours(12));
|
||||
var processed= await ProcessResults(result);
|
||||
return processed.Select(ParseIntoTreeNode).ToList();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<TreeNode<SearchTvShowViewModel>>> MostWatches()
|
||||
{
|
||||
var result = await MemCache.GetOrCreateAsync(CacheKeys.MostWatchesTv, async entry =>
|
||||
{
|
||||
entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(12);
|
||||
return await TraktApi.GetMostWatchesShows();
|
||||
});
|
||||
var result = await MemCache.GetOrAdd(CacheKeys.MostWatchesTv, async () => await TraktApi.GetMostWatchesShows(), DateTime.Now.AddHours(12));
|
||||
var processed = await ProcessResults(result);
|
||||
return processed.Select(ParseIntoTreeNode).ToList();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<TreeNode<SearchTvShowViewModel>>> Trending()
|
||||
{
|
||||
var result = await MemCache.GetOrCreateAsync(CacheKeys.TrendingTv, async entry =>
|
||||
{
|
||||
entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(12);
|
||||
return await TraktApi.GetTrendingShows();
|
||||
});
|
||||
var result = await MemCache.GetOrAdd(CacheKeys.TrendingTv, async () => await TraktApi.GetTrendingShows(), DateTime.Now.AddHours(12));
|
||||
var processed = await ProcessResults(result);
|
||||
return processed.Select(ParseIntoTreeNode).ToList();
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ namespace Ombi.Core
|
|||
RequestType = model.RequestType,
|
||||
Recipient = model.RequestedUser?.Email ?? string.Empty
|
||||
};
|
||||
|
||||
BackgroundJob.Enqueue(() => NotificationService.Publish(notificationModel));
|
||||
}
|
||||
public void Notify(ChildRequests model, NotificationType type)
|
||||
|
|
|
@ -52,7 +52,8 @@ namespace Ombi.Core.Helpers
|
|||
RequestedDate = DateTime.UtcNow,
|
||||
Approved = false,
|
||||
RequestedUserId = userId,
|
||||
SeasonRequests = new List<SeasonRequests>()
|
||||
SeasonRequests = new List<SeasonRequests>(),
|
||||
Title = model.Title
|
||||
};
|
||||
|
||||
return this;
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
namespace Ombi.Core.Models.Requests
|
||||
{
|
||||
public enum IssueState
|
||||
{
|
||||
None = 99,
|
||||
WrongAudio = 0,
|
||||
NoSubtitles = 1,
|
||||
WrongContent = 2,
|
||||
PlaybackIssues = 3,
|
||||
Other = 4 // Provide a message
|
||||
}
|
||||
}
|
|
@ -83,7 +83,10 @@ namespace Ombi.Core.Senders
|
|||
Success = true
|
||||
};
|
||||
}
|
||||
return new SenderResult();
|
||||
return new SenderResult
|
||||
{
|
||||
Message = "Could not send to SickRage!"
|
||||
};
|
||||
}
|
||||
return new SenderResult
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue