mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
Fixed all warnings
This commit is contained in:
parent
0d55eec72e
commit
6b668c62d6
13 changed files with 26 additions and 56 deletions
|
@ -135,16 +135,15 @@ namespace Ombi.Api.Plex
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
// 192.168.1.69:32400/library/metadata/3662/allLeaves
|
/// 192.168.1.69:32400/library/metadata/3662/allLeaves
|
||||||
// The metadata ratingkey should be in the Cache
|
/// The metadata ratingkey should be in the Cache
|
||||||
// Search for it and then call the above with the Directory.RatingKey
|
/// Search for it and then call the above with the Directory.RatingKey
|
||||||
// THEN! We need the episode metadata using result.Vide.Key ("/library/metadata/3664")
|
/// THEN! We need the episode metadata using result.Vide.Key ("/library/metadata/3664")
|
||||||
// We then have the GUID which contains the TVDB ID plus the season and episode number: guid="com.plexapp.agents.thetvdb://269586/2/8?lang=en"
|
/// We then have the GUID which contains the TVDB ID plus the season and episode number: guid="com.plexapp.agents.thetvdb://269586/2/8?lang=en"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="authToken"></param>
|
/// <param name="authToken"></param>
|
||||||
/// <param name="plexFullHost"></param>
|
/// <param name="plexFullHost"></param>
|
||||||
/// <param name="ratingKey"></param>
|
/// <param name="ratingKey"></param>
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<PlexMetadata> GetEpisodeMetaData(string authToken, string plexFullHost, int ratingKey)
|
public async Task<PlexMetadata> GetEpisodeMetaData(string authToken, string plexFullHost, int ratingKey)
|
||||||
{
|
{
|
||||||
var request = new Request($"/library/metadata/{ratingKey}", plexFullHost, HttpMethod.Get);
|
var request = new Request($"/library/metadata/{ratingKey}", plexFullHost, HttpMethod.Get);
|
||||||
|
@ -308,7 +307,7 @@ namespace Ombi.Api.Plex
|
||||||
}
|
}
|
||||||
private async Task CheckInstallId(PlexSettings s)
|
private async Task CheckInstallId(PlexSettings s)
|
||||||
{
|
{
|
||||||
if (s.InstallId == null || s.InstallId == Guid.Empty)
|
if (s?.InstallId == Guid.Empty || s.InstallId == Guid.Empty)
|
||||||
{
|
{
|
||||||
s.InstallId = Guid.NewGuid();
|
s.InstallId = Guid.NewGuid();
|
||||||
await _plexSettings.SaveSettingsAsync(s);
|
await _plexSettings.SaveSettingsAsync(s);
|
||||||
|
|
|
@ -5,7 +5,7 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ombi.Api
|
namespace Ombi.Api
|
||||||
{
|
{
|
||||||
public static class HttpRequestExtnesions
|
public static class HttpRequestExtensions
|
||||||
{
|
{
|
||||||
public static async Task<HttpRequestMessage> Clone(this HttpRequestMessage request)
|
public static async Task<HttpRequestMessage> Clone(this HttpRequestMessage request)
|
||||||
{
|
{
|
||||||
|
@ -14,9 +14,9 @@ namespace Ombi.Api
|
||||||
Content = await request.Content.Clone(),
|
Content = await request.Content.Clone(),
|
||||||
Version = request.Version
|
Version = request.Version
|
||||||
};
|
};
|
||||||
foreach (KeyValuePair<string, object> prop in request.Properties)
|
foreach (KeyValuePair<string, object> prop in request.Options)
|
||||||
{
|
{
|
||||||
clone.Properties.Add(prop);
|
clone.Options.TryAdd(prop.Key, prop.Value);
|
||||||
}
|
}
|
||||||
foreach (KeyValuePair<string, IEnumerable<string>> header in request.Headers)
|
foreach (KeyValuePair<string, IEnumerable<string>> header in request.Headers)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace Ombi.Core.Engine.Demo
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<SearchMovieViewModel>> NowPlayingMovies()
|
new public async Task<IEnumerable<SearchMovieViewModel>> NowPlayingMovies()
|
||||||
{
|
{
|
||||||
var rand = new Random();
|
var rand = new Random();
|
||||||
var responses = new List<SearchMovieViewModel>();
|
var responses = new List<SearchMovieViewModel>();
|
||||||
|
@ -72,18 +72,18 @@ namespace Ombi.Core.Engine.Demo
|
||||||
return responses;
|
return responses;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<SearchMovieViewModel>> PopularMovies()
|
new public async Task<IEnumerable<SearchMovieViewModel>> PopularMovies()
|
||||||
{
|
{
|
||||||
return await NowPlayingMovies();
|
return await NowPlayingMovies();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<IEnumerable<SearchMovieViewModel>> TopRatedMovies()
|
new public async Task<IEnumerable<SearchMovieViewModel>> TopRatedMovies()
|
||||||
{
|
{
|
||||||
return await NowPlayingMovies();
|
return await NowPlayingMovies();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<SearchMovieViewModel>> UpcomingMovies()
|
new public async Task<IEnumerable<SearchMovieViewModel>> UpcomingMovies()
|
||||||
{
|
{
|
||||||
|
|
||||||
return await NowPlayingMovies();
|
return await NowPlayingMovies();
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace Ombi.Core.Engine.Demo
|
||||||
|
|
||||||
private readonly DemoLists _demoLists;
|
private readonly DemoLists _demoLists;
|
||||||
|
|
||||||
public async Task<IEnumerable<SearchTvShowViewModel>> Search(string search)
|
new public async Task<IEnumerable<SearchTvShowViewModel>> Search(string search)
|
||||||
{
|
{
|
||||||
var searchResult = await TvMazeApi.Search(search);
|
var searchResult = await TvMazeApi.Search(search);
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace Ombi.Core.Engine.V2
|
||||||
private readonly IMovieRequestRepository _movieRepo;
|
private readonly IMovieRequestRepository _movieRepo;
|
||||||
private readonly ITvRequestRepository _tvRepo;
|
private readonly ITvRequestRepository _tvRepo;
|
||||||
|
|
||||||
public async Task<List<CalendarViewModel>> GetCalendarData()
|
public Task<List<CalendarViewModel>> GetCalendarData()
|
||||||
{
|
{
|
||||||
var viewModel = new List<CalendarViewModel>();
|
var viewModel = new List<CalendarViewModel>();
|
||||||
var movies = _movieRepo.GetAll().Where(x =>
|
var movies = _movieRepo.GetAll().Where(x =>
|
||||||
|
@ -78,7 +78,7 @@ namespace Ombi.Core.Engine.V2
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return viewModel;
|
return Task.FromResult(viewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetBackgroundColor(BaseRequest req)
|
private string GetBackgroundColor(BaseRequest req)
|
||||||
|
|
|
@ -144,7 +144,8 @@ namespace Ombi.Notifications.Agents
|
||||||
"Available" => "51283",
|
"Available" => "51283",
|
||||||
"Denied" => "13959168",
|
"Denied" => "13959168",
|
||||||
"Processing Request" => "37354",
|
"Processing Request" => "37354",
|
||||||
"Pending Approval" => "16754470"
|
"Pending Approval" => "16754470",
|
||||||
|
_ => throw new ArgumentOutOfRangeException(nameof(color))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,9 @@ namespace Ombi.Store.Context.Sqlite
|
||||||
Database.ExecuteSqlRaw(@"INSERT OR IGNORE INTO __EFMigrationsHistory (MigrationId,ProductVersion)
|
Database.ExecuteSqlRaw(@"INSERT OR IGNORE INTO __EFMigrationsHistory (MigrationId,ProductVersion)
|
||||||
VALUES('20191103205133_Inital', '2.2.6-servicing-10079'); ");
|
VALUES('20191103205133_Inital', '2.2.6-servicing-10079'); ");
|
||||||
}
|
}
|
||||||
|
#pragma warning disable RCS1075 // Avoid empty catch clause that catches System.Exception.
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
#pragma warning restore RCS1075 // Avoid empty catch clause that catches System.Exception.
|
||||||
{
|
{
|
||||||
// ignored
|
// ignored
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,10 +9,7 @@ namespace Ombi.Store.Repository.Requests
|
||||||
public interface ITvRequestRepository : IRepository<TvRequests>
|
public interface ITvRequestRepository : IRepository<TvRequests>
|
||||||
{
|
{
|
||||||
OmbiContext Db { get; }
|
OmbiContext Db { get; }
|
||||||
Task<TvRequests> Add(TvRequests request);
|
|
||||||
Task<ChildRequests> AddChild(ChildRequests request);
|
Task<ChildRequests> AddChild(ChildRequests request);
|
||||||
Task Delete(TvRequests request);
|
|
||||||
Task DeleteRange(IEnumerable<TvRequests> request);
|
|
||||||
Task DeleteChild(ChildRequests request);
|
Task DeleteChild(ChildRequests request);
|
||||||
IQueryable<TvRequests> Get();
|
IQueryable<TvRequests> Get();
|
||||||
IQueryable<TvRequests> GetLite();
|
IQueryable<TvRequests> GetLite();
|
||||||
|
|
|
@ -19,11 +19,7 @@ namespace Ombi.Controllers.V1.External
|
||||||
[Produces("application/json")]
|
[Produces("application/json")]
|
||||||
public class EmbyController : Controller
|
public class EmbyController : Controller
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="emby"></param>
|
|
||||||
/// <param name="embySettings"></param>
|
|
||||||
public EmbyController(IEmbyApiFactory emby, ISettingsService<EmbySettings> embySettings)
|
public EmbyController(IEmbyApiFactory emby, ISettingsService<EmbySettings> embySettings)
|
||||||
{
|
{
|
||||||
EmbyApi = emby;
|
EmbyApi = emby;
|
||||||
|
|
|
@ -183,7 +183,7 @@ namespace Ombi.Controllers.V1
|
||||||
[HttpPost("plex")]
|
[HttpPost("plex")]
|
||||||
public async Task<bool> PlexSettings([FromBody]PlexSettings plex)
|
public async Task<bool> PlexSettings([FromBody]PlexSettings plex)
|
||||||
{
|
{
|
||||||
if (plex.InstallId == null || plex.InstallId == Guid.Empty)
|
if (plex?.InstallId == Guid.Empty || plex.InstallId == Guid.Empty)
|
||||||
{
|
{
|
||||||
plex.InstallId = Guid.NewGuid();
|
plex.InstallId = Guid.NewGuid();
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,7 +135,7 @@ namespace Ombi.Controllers.V1
|
||||||
new Claim("Id", user.Id)
|
new Claim("Id", user.Id)
|
||||||
};
|
};
|
||||||
claims.AddRange(roles.Select(role => new Claim("role", role)));
|
claims.AddRange(roles.Select(role => new Claim("role", role)));
|
||||||
if(user.Email.HasValue())
|
if (user.Email.HasValue())
|
||||||
{
|
{
|
||||||
claims.Add(new Claim("Email", user.Email));
|
claims.Add(new Claim("Email", user.Email));
|
||||||
}
|
}
|
||||||
|
@ -158,14 +158,8 @@ namespace Ombi.Controllers.V1
|
||||||
}
|
}
|
||||||
|
|
||||||
user.LastLoggedIn = DateTime.UtcNow;
|
user.LastLoggedIn = DateTime.UtcNow;
|
||||||
try
|
|
||||||
{
|
await _userManager.UpdateAsync(user);
|
||||||
await _userManager.UpdateAsync(user);
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return new JsonResult(new
|
return new JsonResult(new
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace Ombi
|
||||||
Type = SecuritySchemeType.ApiKey
|
Type = SecuritySchemeType.ApiKey
|
||||||
});
|
});
|
||||||
c.CustomSchemaIds(x => x.FullName);
|
c.CustomSchemaIds(x => x.FullName);
|
||||||
var basePath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
var basePath = Path.GetDirectoryName(AppContext.BaseDirectory);
|
||||||
var xmlPath = Path.Combine(basePath, "Swagger.xml");
|
var xmlPath = Path.Combine(basePath, "Swagger.xml");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,22 +20,11 @@
|
||||||
<ServerGarbageCollection>false</ServerGarbageCollection>
|
<ServerGarbageCollection>false</ServerGarbageCollection>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
|
||||||
<DocumentationFile>bin\Debug\netcoreapp2.2\Swagger.xml</DocumentationFile>
|
|
||||||
<NoWarn>1701;1702;1705;1591;</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Remove="$(SpaRoot)**" />
|
<Content Remove="$(SpaRoot)**" />
|
||||||
<None Remove="$(SpaRoot)**" />
|
<None Remove="$(SpaRoot)**" />
|
||||||
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
|
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
|
||||||
<DocumentationFile>bin\Release\netcoreapp2.2\Swagger.xml</DocumentationFile>
|
|
||||||
<NoWarn>1701;1702;1705;1591;</NoWarn>
|
|
||||||
<DefineConstants>TRACE;RELEASE;NETCOREAPP2_0</DefineConstants>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!-- Files not to show in IDE -->
|
<!-- Files not to show in IDE -->
|
||||||
|
@ -72,7 +61,6 @@
|
||||||
<PackageReference Include="Serilog" Version="2.9.0" />
|
<PackageReference Include="Serilog" Version="2.9.0" />
|
||||||
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
|
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
|
||||||
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
|
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
|
||||||
<PackageReference Include="Serilog.Sinks.SQLite" Version="4.0.0" />
|
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
|
||||||
<PackageReference Include="System.Security.Cryptography.Csp" Version="4.3.0" />
|
<PackageReference Include="System.Security.Cryptography.Csp" Version="4.3.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.SpaServices" Version="3.1.10" />
|
<PackageReference Include="Microsoft.AspNetCore.SpaServices" Version="3.1.10" />
|
||||||
|
@ -97,13 +85,6 @@
|
||||||
<ProjectReference Include="..\Ombi.Updater\Ombi.Updater.csproj" />
|
<ProjectReference Include="..\Ombi.Updater\Ombi.Updater.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Update="HealthCheck.css">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
|
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
|
||||||
<Exec Command="node --version" ContinueOnError="true">
|
<Exec Command="node --version" ContinueOnError="true">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue