mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
This commit is contained in:
parent
95c5c839f0
commit
0e6a1707f4
20 changed files with 44 additions and 18 deletions
|
@ -6,6 +6,7 @@
|
|||
<FileVersion>3.0.0.0</FileVersion>
|
||||
<Version></Version>
|
||||
<PackageVersion></PackageVersion>
|
||||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
1
src/Ombi/.gitignore
vendored
1
src/Ombi/.gitignore
vendored
|
@ -20,3 +20,4 @@ testem.log
|
|||
#/typings
|
||||
/systemjs.config.js*
|
||||
/Logs/**
|
||||
**.db
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace Ombi.Controllers.External
|
|||
/// </summary>
|
||||
[Admin]
|
||||
[ApiV1]
|
||||
[Produces("application/json")]
|
||||
public class EmbyController : Controller
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -15,6 +15,7 @@ namespace Ombi.Controllers.External
|
|||
{
|
||||
[Admin]
|
||||
[ApiV1]
|
||||
[Produces("application/json")]
|
||||
public class PlexController : Controller
|
||||
{
|
||||
public PlexController(IPlexApi plexApi, ISettingsService<PlexSettings> plexSettings)
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace Ombi.Controllers.External
|
|||
{
|
||||
[Admin]
|
||||
[ApiV1]
|
||||
[Produces("application/json")]
|
||||
public class RadarrController : Controller
|
||||
{
|
||||
public RadarrController(IRadarrApi radarr, ISettingsService<RadarrSettings> settings)
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace Ombi.Controllers.External
|
|||
{
|
||||
[Admin]
|
||||
[ApiV1]
|
||||
[Produces("application/json")]
|
||||
public class SonarrController : Controller
|
||||
{
|
||||
public SonarrController(ISonarrApi sonarr, ISettingsService<SonarrSettings> settings)
|
||||
|
|
|
@ -25,6 +25,7 @@ namespace Ombi.Controllers.External
|
|||
/// <seealso cref="Ombi.Controllers.BaseV1ApiController" />
|
||||
[Admin]
|
||||
[ApiV1]
|
||||
[Produces("application/json")]
|
||||
public class TesterController : Controller
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace Ombi.Controllers
|
|||
/// <seealso cref="Ombi.Controllers.BaseV1ApiController" />
|
||||
[PowerUser]
|
||||
[ApiV1]
|
||||
[Produces("application/json")]
|
||||
public class IdentityController : Controller
|
||||
{
|
||||
public IdentityController(UserManager<OmbiUser> user, IMapper mapper, RoleManager<IdentityRole> rm, IEmailProvider prov,
|
||||
|
|
|
@ -11,6 +11,7 @@ using Ombi.Config;
|
|||
namespace Ombi.Controllers
|
||||
{
|
||||
[ApiV1]
|
||||
[Produces("application/json")]
|
||||
public class ImagesController : Controller
|
||||
{
|
||||
public ImagesController(IFanartTvApi api, IApplicationConfigRepository config, IOptions<LandingPageBackground> options)
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Ombi.Controllers
|
|||
{
|
||||
[ApiV1]
|
||||
[AllowAnonymous]
|
||||
[Produces("application/json")]
|
||||
public class LandingPageController
|
||||
{
|
||||
public LandingPageController(ISettingsService<PlexSettings> plex, ISettingsService<EmbySettings> emby,
|
||||
|
|
|
@ -8,6 +8,7 @@ namespace Ombi.Controllers
|
|||
{
|
||||
[Authorize]
|
||||
[ApiV1]
|
||||
[Produces("application/json")]
|
||||
public class LoggingController : Controller
|
||||
{
|
||||
public LoggingController(ILogger logger)
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Ombi.Controllers
|
|||
{
|
||||
[Authorize]
|
||||
[ApiV1]
|
||||
[Produces("application/json")]
|
||||
public class RequestController : Controller
|
||||
{
|
||||
public RequestController(IMovieRequestEngine engine, ITvRequestEngine tvRequestEngine)
|
||||
|
|
|
@ -15,6 +15,7 @@ namespace Ombi.Controllers
|
|||
{
|
||||
[Authorize]
|
||||
[ApiV1]
|
||||
[Produces("application/json")]
|
||||
public class SearchController : Controller
|
||||
{
|
||||
public SearchController(IMovieEngine movie, ITvSearchEngine tvEngine, ILogger<SearchController> logger)
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace Ombi.Controllers
|
|||
/// <seealso cref="Ombi.Controllers.BaseV1ApiController" />
|
||||
[Admin]
|
||||
[ApiV1]
|
||||
[Produces("application/json")]
|
||||
public class SettingsController : Controller
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -37,6 +37,7 @@ using Ombi.Settings.Settings.Models;
|
|||
namespace Ombi.Controllers
|
||||
{
|
||||
[ApiV1]
|
||||
[Produces("application/json")]
|
||||
public class StatusController : Controller
|
||||
{
|
||||
public StatusController(ISettingsService<OmbiSettings> ombi)
|
||||
|
|
|
@ -18,6 +18,7 @@ using Ombi.Store.Repository;
|
|||
namespace Ombi.Controllers
|
||||
{
|
||||
[ApiV1]
|
||||
[Produces("application/json")]
|
||||
public class TokenController
|
||||
{
|
||||
public TokenController(UserManager<OmbiUser> um, IOptions<TokenAuthentication> ta,
|
||||
|
|
|
@ -40,6 +40,10 @@
|
|||
</ResolvedFileToPublish>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Ombi.db" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper" Version="6.1.0" />
|
||||
|
|
|
@ -71,11 +71,10 @@ namespace Ombi
|
|||
public IConfigurationRoot Configuration { get; }
|
||||
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
public IServiceProvider ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
// Add framework services.
|
||||
services.AddDbContext<OmbiContext>(options =>
|
||||
options.UseSqlite("Data Source=Ombi.db"));
|
||||
services.AddDbContext<OmbiContext>();
|
||||
|
||||
services.AddIdentity<OmbiUser, IdentityRole>()
|
||||
.AddEntityFrameworkStores<OmbiContext>()
|
||||
|
@ -179,13 +178,20 @@ namespace Ombi
|
|||
x.Audience = "Ombi";
|
||||
x.TokenValidationParameters = tokenValidationParameters;
|
||||
});
|
||||
|
||||
// Build the intermediate service provider
|
||||
var serviceProvider = services.BuildServiceProvider();
|
||||
|
||||
//return the provider
|
||||
return serviceProvider;
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMemoryCache cache)
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory,
|
||||
IMemoryCache cache, IServiceProvider serviceProvider)
|
||||
{
|
||||
|
||||
var ctx = (IOmbiContext)app.ApplicationServices.GetService(typeof(IOmbiContext));
|
||||
var ctx = serviceProvider.GetService<IOmbiContext>();
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue