mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 10:36:54 -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>
|
||||
// 192.168.1.69:32400/library/metadata/3662/allLeaves
|
||||
// The metadata ratingkey should be in the Cache
|
||||
// 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")
|
||||
// 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"
|
||||
/// 192.168.1.69:32400/library/metadata/3662/allLeaves
|
||||
/// The metadata ratingkey should be in the Cache
|
||||
/// 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")
|
||||
/// 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>
|
||||
/// <param name="authToken"></param>
|
||||
/// <param name="plexFullHost"></param>
|
||||
/// <param name="ratingKey"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PlexMetadata> GetEpisodeMetaData(string authToken, string plexFullHost, int ratingKey)
|
||||
{
|
||||
var request = new Request($"/library/metadata/{ratingKey}", plexFullHost, HttpMethod.Get);
|
||||
|
@ -308,7 +307,7 @@ namespace Ombi.Api.Plex
|
|||
}
|
||||
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();
|
||||
await _plexSettings.SaveSettingsAsync(s);
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace Ombi.Api
|
||||
{
|
||||
public static class HttpRequestExtnesions
|
||||
public static class HttpRequestExtensions
|
||||
{
|
||||
public static async Task<HttpRequestMessage> Clone(this HttpRequestMessage request)
|
||||
{
|
||||
|
@ -14,9 +14,9 @@ namespace Ombi.Api
|
|||
Content = await request.Content.Clone(),
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace Ombi.Core.Engine.Demo
|
|||
return null;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<SearchMovieViewModel>> NowPlayingMovies()
|
||||
new public async Task<IEnumerable<SearchMovieViewModel>> NowPlayingMovies()
|
||||
{
|
||||
var rand = new Random();
|
||||
var responses = new List<SearchMovieViewModel>();
|
||||
|
@ -72,18 +72,18 @@ namespace Ombi.Core.Engine.Demo
|
|||
return responses;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<SearchMovieViewModel>> PopularMovies()
|
||||
new public async Task<IEnumerable<SearchMovieViewModel>> PopularMovies()
|
||||
{
|
||||
return await NowPlayingMovies();
|
||||
}
|
||||
|
||||
|
||||
public async Task<IEnumerable<SearchMovieViewModel>> TopRatedMovies()
|
||||
new public async Task<IEnumerable<SearchMovieViewModel>> TopRatedMovies()
|
||||
{
|
||||
return await NowPlayingMovies();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<SearchMovieViewModel>> UpcomingMovies()
|
||||
new public async Task<IEnumerable<SearchMovieViewModel>> UpcomingMovies()
|
||||
{
|
||||
|
||||
return await NowPlayingMovies();
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace Ombi.Core.Engine.Demo
|
|||
|
||||
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);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace Ombi.Core.Engine.V2
|
|||
private readonly IMovieRequestRepository _movieRepo;
|
||||
private readonly ITvRequestRepository _tvRepo;
|
||||
|
||||
public async Task<List<CalendarViewModel>> GetCalendarData()
|
||||
public Task<List<CalendarViewModel>> GetCalendarData()
|
||||
{
|
||||
var viewModel = new List<CalendarViewModel>();
|
||||
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)
|
||||
|
|
|
@ -144,7 +144,8 @@ namespace Ombi.Notifications.Agents
|
|||
"Available" => "51283",
|
||||
"Denied" => "13959168",
|
||||
"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)
|
||||
VALUES('20191103205133_Inital', '2.2.6-servicing-10079'); ");
|
||||
}
|
||||
#pragma warning disable RCS1075 // Avoid empty catch clause that catches System.Exception.
|
||||
catch (Exception)
|
||||
#pragma warning restore RCS1075 // Avoid empty catch clause that catches System.Exception.
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
|
|
@ -9,10 +9,7 @@ namespace Ombi.Store.Repository.Requests
|
|||
public interface ITvRequestRepository : IRepository<TvRequests>
|
||||
{
|
||||
OmbiContext Db { get; }
|
||||
Task<TvRequests> Add(TvRequests request);
|
||||
Task<ChildRequests> AddChild(ChildRequests request);
|
||||
Task Delete(TvRequests request);
|
||||
Task DeleteRange(IEnumerable<TvRequests> request);
|
||||
Task DeleteChild(ChildRequests request);
|
||||
IQueryable<TvRequests> Get();
|
||||
IQueryable<TvRequests> GetLite();
|
||||
|
|
|
@ -19,11 +19,7 @@ namespace Ombi.Controllers.V1.External
|
|||
[Produces("application/json")]
|
||||
public class EmbyController : Controller
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="emby"></param>
|
||||
/// <param name="embySettings"></param>
|
||||
|
||||
public EmbyController(IEmbyApiFactory emby, ISettingsService<EmbySettings> embySettings)
|
||||
{
|
||||
EmbyApi = emby;
|
||||
|
|
|
@ -183,7 +183,7 @@ namespace Ombi.Controllers.V1
|
|||
[HttpPost("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();
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ namespace Ombi.Controllers.V1
|
|||
new Claim("Id", user.Id)
|
||||
};
|
||||
claims.AddRange(roles.Select(role => new Claim("role", role)));
|
||||
if(user.Email.HasValue())
|
||||
if (user.Email.HasValue())
|
||||
{
|
||||
claims.Add(new Claim("Email", user.Email));
|
||||
}
|
||||
|
@ -158,14 +158,8 @@ namespace Ombi.Controllers.V1
|
|||
}
|
||||
|
||||
user.LastLoggedIn = DateTime.UtcNow;
|
||||
try
|
||||
{
|
||||
await _userManager.UpdateAsync(user);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
await _userManager.UpdateAsync(user);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace Ombi
|
|||
Type = SecuritySchemeType.ApiKey
|
||||
});
|
||||
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");
|
||||
try
|
||||
{
|
||||
|
|
|
@ -20,22 +20,11 @@
|
|||
<ServerGarbageCollection>false</ServerGarbageCollection>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DocumentationFile>bin\Debug\netcoreapp2.2\Swagger.xml</DocumentationFile>
|
||||
<NoWarn>1701;1702;1705;1591;</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Remove="$(SpaRoot)**" />
|
||||
<None Remove="$(SpaRoot)**" />
|
||||
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
|
||||
</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>
|
||||
<!-- Files not to show in IDE -->
|
||||
|
@ -72,7 +61,6 @@
|
|||
<PackageReference Include="Serilog" Version="2.9.0" />
|
||||
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
|
||||
<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="System.Security.Cryptography.Csp" Version="4.3.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SpaServices" Version="3.1.10" />
|
||||
|
@ -97,13 +85,6 @@
|
|||
<ProjectReference Include="..\Ombi.Updater\Ombi.Updater.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="HealthCheck.css">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
|
||||
<Exec Command="node --version" ContinueOnError="true">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue