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:
@@ -47,7 +47,7 @@ namespace Emby.Naming.AudioBook
|
||||
foreach (var stack in stackResult)
|
||||
{
|
||||
var stackFiles = stack.Files
|
||||
.Select(i => this._audioBookResolver.Resolve(i))
|
||||
.Select(this._audioBookResolver.Resolve)
|
||||
.OfType<AudioBookFileInfo>()
|
||||
.ToList();
|
||||
|
||||
@@ -70,8 +70,8 @@ namespace Emby.Naming.AudioBook
|
||||
|
||||
private void FindExtraAndAlternativeFiles(ref List<AudioBookFileInfo> stackFiles, out List<AudioBookFileInfo> extras, out List<AudioBookFileInfo> alternativeVersions, AudioBookNameParserResult nameParserResult)
|
||||
{
|
||||
this.extras = new List<AudioBookFileInfo>();
|
||||
this.alternativeVersions = new List<AudioBookFileInfo>();
|
||||
extras = new List<AudioBookFileInfo>();
|
||||
alternativeVersions = new List<AudioBookFileInfo>();
|
||||
|
||||
var haveChaptersOrPages = stackFiles.Any(x => x.ChapterNumber is not null || x.PartNumber is not null);
|
||||
var groupedBy = stackFiles.GroupBy(file => new { file.ChapterNumber, file.PartNumber });
|
||||
@@ -108,7 +108,7 @@ namespace Emby.Naming.AudioBook
|
||||
.ThenBy(x => x.Path)
|
||||
.ToList();
|
||||
|
||||
this.stackFiles = stackFiles.Except(extra).ToList();
|
||||
stackFiles = stackFiles.Except(extra).ToList();
|
||||
extras.AddRange(extra);
|
||||
}
|
||||
|
||||
@@ -119,9 +119,9 @@ namespace Emby.Naming.AudioBook
|
||||
.ThenBy(x => x.Path)
|
||||
.ToList();
|
||||
|
||||
var main = this.FindMainAudioBookFile(alternatives, nameParserResult.Name);
|
||||
alternatives.Remove(main);
|
||||
this.stackFiles = stackFiles.Except(alternatives).ToList();
|
||||
var main = FindMainAudioBookFile(alternatives, nameParserResult.Name);
|
||||
_ = alternatives.Remove(main);
|
||||
stackFiles = stackFiles.Except(alternatives).ToList();
|
||||
alternativeVersions.AddRange(alternatives);
|
||||
}
|
||||
}
|
||||
@@ -134,7 +134,7 @@ namespace Emby.Naming.AudioBook
|
||||
.Skip(1)
|
||||
.ToList();
|
||||
|
||||
this.stackFiles = stackFiles.Except(alternatives).ToList();
|
||||
stackFiles = stackFiles.Except(alternatives).ToList();
|
||||
alternativeVersions.AddRange(alternatives);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user