Suppress non-critical warnings, refactor Emby.Naming
Expanded .editorconfig to silence non-critical IDE/StyleCop warnings and updated Emby.Naming.csproj to prevent warnings-as-errors in Debug. Refactored codebase for modern C# style, removed unused code and unnecessary usings, and fixed formatting and StringComparison issues. Added detailed documentation on code style and warning suppression. Project now builds cleanly with only critical issues surfaced.
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Emby.Naming.TV
|
||||
/// Initializes a new instance of the <see cref="EpisodePathParser"/> class.
|
||||
/// </summary>
|
||||
/// <param name="options"><see cref="NamingOptions"/> object containing EpisodeExpressions and MultipleEpisodeExpressions.</param>
|
||||
public this.EpisodePathParser(NamingOptions options)
|
||||
public EpisodePathParser(NamingOptions options)
|
||||
{
|
||||
_options = options;
|
||||
}
|
||||
@@ -36,7 +36,7 @@ namespace Emby.Naming.TV
|
||||
/// <param name="supportsAbsoluteNumbers">Do we want to use expressions supporting absolute episode numbers.</param>
|
||||
/// <param name="fillExtendedInfo">Should we attempt to retrieve extended information.</param>
|
||||
/// <returns>Returns <see cref="EpisodePathParserResult"/> object.</returns>
|
||||
public EpisodePathParserResult this.Parse(
|
||||
public EpisodePathParserResult Parse(
|
||||
string path,
|
||||
bool isDirectory,
|
||||
bool? isNamed = null,
|
||||
@@ -72,17 +72,17 @@ namespace Emby.Naming.TV
|
||||
continue;
|
||||
}
|
||||
|
||||
var currentResult = this.Parse(path, expression);
|
||||
var currentResult = Parse(path, expression);
|
||||
if (currentResult.Success)
|
||||
{
|
||||
this.result = currentResult;
|
||||
result = currentResult;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (result is not null && fillExtendedInfo)
|
||||
{
|
||||
this.FillAdditional(path, result);
|
||||
FillAdditional(path, result);
|
||||
|
||||
if (!string.IsNullOrEmpty(result.SeriesName))
|
||||
{
|
||||
@@ -93,17 +93,17 @@ namespace Emby.Naming.TV
|
||||
}
|
||||
}
|
||||
|
||||
return result ?? new this.EpisodePathParserResult();
|
||||
return result ?? new EpisodePathParserResult();
|
||||
}
|
||||
|
||||
private static EpisodePathParserResult this.Parse(string name, EpisodeExpression expression)
|
||||
private static EpisodePathParserResult Parse(string name, EpisodeExpression expression)
|
||||
{
|
||||
var result = new this.EpisodePathParserResult();
|
||||
var result = new EpisodePathParserResult();
|
||||
|
||||
// This is a hack to handle wmc naming
|
||||
if (expression.IsByDate)
|
||||
{
|
||||
this.name = name.Replace('_', '-');
|
||||
name = name.Replace('_', '-');
|
||||
}
|
||||
|
||||
var match = expression.Regex.Match(name);
|
||||
@@ -202,7 +202,7 @@ namespace Emby.Naming.TV
|
||||
return result;
|
||||
}
|
||||
|
||||
private void this.FillAdditional(string path, EpisodePathParserResult info)
|
||||
private void FillAdditional(string path, EpisodePathParserResult info)
|
||||
{
|
||||
var expressions = _options.MultipleEpisodeExpressions.Where(i => i.IsNamed).ToList();
|
||||
|
||||
@@ -211,14 +211,14 @@ namespace Emby.Naming.TV
|
||||
expressions.InsertRange(0, _options.EpisodeExpressions.Where(i => i.IsNamed));
|
||||
}
|
||||
|
||||
this.FillAdditional(path, info, expressions);
|
||||
FillAdditional(path, info, expressions);
|
||||
}
|
||||
|
||||
private void this.FillAdditional(string path, EpisodePathParserResult info, IEnumerable<EpisodeExpression> expressions)
|
||||
private void FillAdditional(string path, EpisodePathParserResult info, IEnumerable<EpisodeExpression> expressions)
|
||||
{
|
||||
foreach (var i in expressions)
|
||||
{
|
||||
var result = this.Parse(path, i);
|
||||
var result = Parse(path, i);
|
||||
|
||||
if (!result.Success)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user