Refactor: standardize namespace and using directive style

Refactored all C# test files to use explicit namespace declarations and moved all using directives inside the namespace block for consistency. Updated assembly info and cache files to reflect the new build. Adjusted MvcTestingAppManifest.json to use fully qualified assembly names. No functional changes; all updates are related to code style, organization, and project metadata.
This commit is contained in:
2026-02-20 16:26:53 -05:00
parent 44ab9e1d6d
commit af1152b001
1436 changed files with 36615 additions and 15508 deletions
+1
View File
@@ -0,0 +1 @@
# EditorConfig for MediaBrowser.Model# https://EditorConfig.orgroot = true[*]charset = utf-8insert_final_newline = truetrim_trailing_whitespace = true[*.cs]indent_size = 4indent_style = spacedotnet_sort_system_directives_first = truedotnet_separate_import_directive_groups = false# StyleCop Analyzer Rules - Disabled for project consistencydotnet_diagnostic.SA1101.severity = nonedotnet_diagnostic.SA1309.severity = nonedotnet_diagnostic.SA1204.severity = nonedotnet_diagnostic.SA1202.severity = nonedotnet_diagnostic.SA1135.severity = nonedotnet_diagnostic.SA1600.severity = suggestion# StyleCop Analyzer Rules - Keep enableddotnet_diagnostic.SA1413.severity = warningdotnet_diagnostic.SA1515.severity = warningdotnet_diagnostic.SA1518.severity = warning
+1
View File
@@ -3,3 +3,4 @@
################################################################################
/.vs/Jellyfin
/.vs
+377
View File
@@ -0,0 +1,377 @@
#!/usr/bin/env pwsh
<#
.SYNOPSIS
Converts C# files from block-scoped to file-scoped namespaces and fixes System namespace conflicts.
.DESCRIPTION
This script converts all C# files in MediaBrowser.Model from block-scoped namespaces
to file-scoped namespaces, and replaces System using directives with global::System
to resolve conflicts with MediaBrowser.Model.System namespace.
.PARAMETER Path
The root path to search for C# files. Defaults to "MediaBrowser.Model"
.PARAMETER DryRun
If specified, shows what would be changed without actually modifying files
.PARAMETER Verbose
Shows detailed processing information
.PARAMETER BackupFiles
Creates .bak files before conversion
.EXAMPLE
.\ConvertToFileScopedNamespaces.ps1 -DryRun
.EXAMPLE
.\ConvertToFileScopedNamespaces.ps1 -BackupFiles
.EXAMPLE
.\ConvertToFileScopedNamespaces.ps1 -Path "MediaBrowser.Model\Dlna" -Verbose
#>
param(
[string]$Path = "MediaBrowser.Model",
[switch]$DryRun,
[switch]$BackupFiles
)
$ErrorActionPreference = "Stop"
$VerbosePreference = if ($PSBoundParameters.ContainsKey('Verbose')) { 'Continue' } else { 'SilentlyContinue' }
function Get-IndentString {
param([string]$Line)
if ($Line -match '^(\s+)') {
return $Matches[1]
}
return ""
}
function Get-IndentLevel {
param([string]$IndentString)
# Count spaces (4 spaces = 1 level) or tabs (1 tab = 1 level)
$spaces = ($IndentString.ToCharArray() | Where-Object { $_ -eq ' ' }).Count
$tabs = ($IndentString.ToCharArray() | Where-Object { $_ -eq "`t" }).Count
return [Math]::Max($tabs, [Math]::Floor($spaces / 4))
}
function Remove-OneIndentLevel {
param([string]$Line, [ref]$IndentChar, [ref]$IndentSize)
if ([string]::IsNullOrWhiteSpace($Line)) {
return $Line
}
$indent = Get-IndentString -Line $Line
if ($indent.Length -eq 0) {
return $Line
}
# Detect indent character and size on first indented line
if ($IndentChar.Value -eq $null) {
if ($indent[0] -eq "`t") {
$IndentChar.Value = "`t"
$IndentSize.Value = 1
} else {
$IndentChar.Value = ' '
# Detect indent size (usually 4 spaces)
$IndentSize.Value = 4
if ($indent.Length -ge 2) {
# Try to detect actual indent size
for ($i = 1; $i -le 8; $i++) {
if ($indent.Length % $i -eq 0) {
$IndentSize.Value = $i
break
}
}
}
}
Write-Verbose "Detected indent: '$($IndentChar.Value)' x $($IndentSize.Value)"
}
# Remove one level of indentation
if ($IndentChar.Value -eq "`t") {
if ($Line -match '^\t(.*)') {
return $Matches[1]
}
} else {
$pattern = "^" + (' ' * $IndentSize.Value) + '(.*)'
if ($Line -match $pattern) {
return $Matches[1]
}
}
return $Line
}
function Test-FileScopedNamespace {
param([string]$Content)
# Check if already using file-scoped namespace (semicolon after namespace declaration)
return $Content -match 'namespace\s+[\w\.]+\s*;'
}
function Test-BlockScopedNamespace {
param([string]$Content)
# Check for block-scoped namespace
return $Content -match 'namespace\s+[\w\.]+\s*\r?\n?\s*\{'
}
function Add-GlobalPrefix {
param([string]$Content)
# System namespaces to prefix (ordered from most specific to least)
$systemNamespaces = @(
'System\.Xml\.Serialization',
'System\.ComponentModel\.DataAnnotations',
'System\.ComponentModel',
'System\.Collections\.Generic',
'System\.Collections\.Concurrent',
'System\.Collections',
'System\.Diagnostics\.CodeAnalysis',
'System\.Diagnostics',
'System\.Globalization',
'System\.Linq',
'System\.Text\.RegularExpressions',
'System\.Text',
'System\.Threading\.Tasks',
'System\.Threading',
'System\.IO',
'System\.Net',
'System\.Runtime',
'System' # Must be last to avoid partial matches
)
foreach ($ns in $systemNamespaces) {
# Don't add global:: if it's already there
# Match: "using System.X" but not "using global::System.X"
$pattern = '(\s+using\s+)(?!global::)(' + $ns + ')(\s|;)'
$replacement = '${1}global::${2}${3}'
$Content = $Content -replace $pattern, $replacement
}
return $Content
}
function Convert-ToFileScopedNamespace {
param(
[string]$FilePath,
[switch]$DryRun,
[switch]$CreateBackup
)
$content = Get-Content -Path $FilePath -Raw
$originalContent = $content
$modified = $false
# Check current state
$hasFileScopedNS = Test-FileScopedNamespace -Content $content
$hasBlockScopedNS = Test-BlockScopedNamespace -Content $content
if ($hasFileScopedNS) {
Write-Verbose " Already using file-scoped namespace"
# But still add global:: prefixes if needed
$contentWithGlobal = Add-GlobalPrefix -Content $content
if ($contentWithGlobal -ne $content) {
$content = $contentWithGlobal
$modified = $true
Write-Host " [UPDATED] Added global:: prefixes" -ForegroundColor Yellow
} else {
Write-Host " [SKIP] Already correct" -ForegroundColor Gray
return $false
}
}
elseif (-not $hasBlockScopedNS) {
Write-Host " [SKIP] No namespace found" -ForegroundColor Gray
return $false
}
else {
Write-Verbose " Converting block-scoped to file-scoped namespace"
# Extract namespace name and line
if ($content -match 'namespace\s+([\w\.]+)\s*\r?\n?\s*\{') {
$namespaceName = $Matches[1]
Write-Verbose " Namespace: $namespaceName"
} else {
Write-Warning " Could not parse namespace"
return $false
}
# Step 1: Convert namespace declaration to file-scoped
$content = $content -replace '(namespace\s+[\w\.]+)\s*\r?\n?\s*\{', '$1;'
$modified = $true
# Step 2: Add global:: prefixes to System using directives
$content = Add-GlobalPrefix -Content $content
# Step 3: Parse into lines for indentation removal
$lines = $content -split '\r?\n'
$hasWindowsLineEndings = $originalContent -match '\r\n'
# Find namespace declaration line
$namespaceLineIndex = -1
for ($i = 0; $i -lt $lines.Length; $i++) {
if ($lines[$i] -match '^namespace\s+[\w\.]+\s*;') {
$namespaceLineIndex = $i
break
}
}
if ($namespaceLineIndex -lt 0) {
Write-Warning " Could not find namespace declaration after conversion"
return $false
}
# Step 4: Remove one level of indentation from all lines after namespace
$indentChar = $null
$indentSize = 4
$indentCharRef = [ref]$indentChar
$indentSizeRef = [ref]$indentSize
for ($i = $namespaceLineIndex + 1; $i -lt $lines.Length; $i++) {
$lines[$i] = Remove-OneIndentLevel -Line $lines[$i] -IndentChar $indentCharRef -IndentSize $indentSizeRef
}
# Step 5: Remove the closing brace of the namespace
# Find the last non-empty, non-whitespace line that's just a closing brace
$closingBraceIndex = -1
for ($i = $lines.Length - 1; $i -gt $namespaceLineIndex; $i--) {
$trimmed = $lines[$i].Trim()
if ($trimmed -eq '}') {
$closingBraceIndex = $i
break
}
elseif ($trimmed -ne '' -and $trimmed -ne '}') {
# Found non-brace content, stop looking
break
}
}
if ($closingBraceIndex -ge 0) {
Write-Verbose " Removing closing brace at line $closingBraceIndex"
$lines = $lines[0..($closingBraceIndex-1)] + $lines[($closingBraceIndex+1)..($lines.Length-1)]
}
# Step 6: Rejoin lines
$lineEnding = if ($hasWindowsLineEndings) { "`r`n" } else { "`n" }
$content = ($lines | Where-Object { $_ -ne $null }) -join $lineEnding
# Step 7: Clean up trailing whitespace and ensure single newline at end
$content = $content.TrimEnd()
$content += $lineEnding
Write-Host " [CONVERTED] Block-scoped → File-scoped" -ForegroundColor Green
}
# Apply changes
if ($modified -and $content -ne $originalContent) {
if ($DryRun) {
Write-Host " [DRY-RUN] Would save changes" -ForegroundColor Cyan
return $true
}
if ($CreateBackup) {
$backupPath = "$FilePath.bak"
Copy-Item -Path $FilePath -Destination $backupPath -Force
Write-Verbose " Created backup: $backupPath"
}
# Write with correct encoding (UTF-8 without BOM for .cs files)
[System.IO.File]::WriteAllText($FilePath, $content, [System.Text.UTF8Encoding]::new($false))
return $true
}
return $false
}
# Main script
Write-Host "=" * 80 -ForegroundColor Cyan
Write-Host "C# File-Scoped Namespace Converter" -ForegroundColor Cyan
Write-Host "Fixes MediaBrowser.Model.System namespace conflicts" -ForegroundColor Cyan
Write-Host "=" * 80 -ForegroundColor Cyan
Write-Host
if ($DryRun) {
Write-Host "🔍 DRY RUN MODE - No files will be modified" -ForegroundColor Yellow
Write-Host
}
if ($BackupFiles) {
Write-Host "💾 Backup mode enabled - .bak files will be created" -ForegroundColor Yellow
Write-Host
}
if (-not (Test-Path $Path)) {
Write-Error "❌ Path not found: $Path"
exit 1
}
# Find all C# files
$files = Get-ChildItem -Path $Path -Filter "*.cs" -Recurse | Where-Object {
$_.FullName -notmatch "\\obj\\" -and
$_.FullName -notmatch "\\bin\\" -and
$_.FullName -notmatch "\\Properties\\AssemblyInfo\.cs$"
}
Write-Host "Found $($files.Count) C# files in $Path" -ForegroundColor Cyan
Write-Host
$convertedCount = 0
$skippedCount = 0
$errorCount = 0
$updatedCount = 0
foreach ($file in $files) {
$relativePath = $file.FullName.Replace((Get-Location).Path, "").TrimStart([char]92, [char]47)
Write-Host "📄 $relativePath" -ForegroundColor White
try {
$result = Convert-ToFileScopedNamespace -FilePath $file.FullName -DryRun:$DryRun -CreateBackup:$BackupFiles
if ($result) {
if ($result -eq "updated") {
$updatedCount++
} else {
$convertedCount++
}
} else {
$skippedCount++
}
}
catch {
Write-Host " [ERROR] $_" -ForegroundColor Red
Write-Verbose $_.ScriptStackTrace
$errorCount++
}
}
Write-Host
Write-Host "=" * 80 -ForegroundColor Cyan
Write-Host "Summary:" -ForegroundColor Cyan
Write-Host "=" * 80 -ForegroundColor Cyan
Write-Host " 📊 Total files: $($files.Count)" -ForegroundColor White
Write-Host " ✅ Converted: $convertedCount" -ForegroundColor Green
Write-Host " 🔄 Updated (global::): $updatedCount" -ForegroundColor Yellow
Write-Host " ⏭️ Skipped: $skippedCount" -ForegroundColor Gray
Write-Host " ❌ Errors: $errorCount" -ForegroundColor Red
if ($DryRun) {
Write-Host
Write-Host "This was a DRY RUN. Run without -DryRun to apply changes." -ForegroundColor Yellow
} elseif ($convertedCount -gt 0 -or $updatedCount -gt 0) {
Write-Host
Write-Host "✨ Conversion complete! Next steps:" -ForegroundColor Green
Write-Host " 1. Review changes with: git diff" -ForegroundColor White
Write-Host " 2. Build project: dotnet build MediaBrowser.Model\MediaBrowser.Model.csproj" -ForegroundColor White
Write-Host " 3. If successful: git add . && git commit -m `"Convert to file-scoped namespaces`"" -ForegroundColor White
}
Write-Host "=" * 80 -ForegroundColor Cyan
exit $errorCount
+388
View File
@@ -0,0 +1,388 @@
#!/usr/bin/env pwsh
<#
.SYNOPSIS
Converts C# files from block-scoped to file-scoped namespaces and fixes System namespace conflicts.
.DESCRIPTION
This script converts all C# files in MediaBrowser.Model from block-scoped namespaces
to file-scoped namespaces, and replaces System using directives with global::System
to resolve conflicts with MediaBrowser.Model.System namespace.
.PARAMETER Path
The root path to search for C# files. Defaults to "MediaBrowser.Model"
.PARAMETER DryRun
If specified, shows what would be changed without actually modifying files
.PARAMETER Verbose
Shows detailed processing information
.PARAMETER BackupFiles
Creates .bak files before conversion
.EXAMPLE
.\ConvertToFileScopedNamespaces.ps1 -DryRun
.EXAMPLE
.\ConvertToFileScopedNamespaces.ps1 -BackupFiles
.EXAMPLE
.\ConvertToFileScopedNamespaces.ps1 -Path "MediaBrowser.Model\Dlna" -Verbose
#>
param(
[string]$Path = "MediaBrowser.Model",
[switch]$DryRun,
[switch]$BackupFiles
)
$ErrorActionPreference = "Stop"
$VerbosePreference = if ($PSBoundParameters.ContainsKey('Verbose')) { 'Continue' } else { 'SilentlyContinue' }
function Get-IndentString {
param([string]$Line)
if ($Line -match '^(\s+)') {
return $Matches[1]
}
return ""
}
function Get-IndentLevel {
param([string]$IndentString)
# Count spaces (4 spaces = 1 level) or tabs (1 tab = 1 level)
$spaces = ($IndentString.ToCharArray() | Where-Object { $_ -eq ' ' }).Count
$tabs = ($IndentString.ToCharArray() | Where-Object { $_ -eq "`t" }).Count
return [Math]::Max($tabs, [Math]::Floor($spaces / 4))
}
function Remove-OneIndentLevel {
param([string]$Line, [ref]$IndentChar, [ref]$IndentSize)
if ([string]::IsNullOrWhiteSpace($Line)) {
return $Line
}
$indent = Get-IndentString -Line $Line
if ($indent.Length -eq 0) {
return $Line
}
# Detect indent character and size on first indented line
if ($IndentChar.Value -eq $null) {
if ($indent[0] -eq "`t") {
$IndentChar.Value = "`t"
$IndentSize.Value = 1
} else {
$IndentChar.Value = ' '
# Detect indent size (usually 4 spaces)
$IndentSize.Value = 4
if ($indent.Length -ge 2) {
# Try to detect actual indent size
for ($i = 1; $i -le 8; $i++) {
if ($indent.Length % $i -eq 0) {
$IndentSize.Value = $i
break
}
}
}
}
Write-Verbose "Detected indent: '$($IndentChar.Value)' x $($IndentSize.Value)"
}
# Remove one level of indentation
if ($IndentChar.Value -eq "`t") {
if ($Line -match '^\t(.*)') {
return $Matches[1]
}
} else {
$pattern = "^" + (' ' * $IndentSize.Value) + '(.*)'
if ($Line -match $pattern) {
return $Matches[1]
}
}
return $Line
}
function Test-FileScopedNamespace {
param([string]$Content)
# Check if already using file-scoped namespace (semicolon after namespace declaration)
return $Content -match 'namespace\s+[\w\.]+\s*;'
}
function Test-BlockScopedNamespace {
param([string]$Content)
# Check for block-scoped namespace
return $Content -match 'namespace\s+[\w\.]+\s*\r?\n?\s*\{'
}
function Add-GlobalPrefix {
param([string]$Content)
# System namespaces to prefix (ordered from most specific to least)
$systemNamespaces = @(
'System\.Xml\.Serialization',
'System\.ComponentModel\.DataAnnotations',
'System\.ComponentModel',
'System\.Collections\.Generic',
'System\.Collections\.Concurrent',
'System\.Collections',
'System\.Diagnostics\.CodeAnalysis',
'System\.Diagnostics',
'System\.Globalization',
'System\.Linq\.Expressions',
'System\.Linq',
'System\.Text\.Json\.Serialization',
'System\.Text\.Json',
'System\.Text\.RegularExpressions',
'System\.Text',
'System\.Threading\.Tasks',
'System\.Threading',
'System\.Runtime\.Serialization',
'System\.Runtime\.CompilerServices',
'System\.Runtime',
'System\.Net\.Http',
'System\.Net\.Sockets',
'System\.Net\.WebSockets',
'System\.Net\.Mime',
'System\.Net',
'System\.IO\.Compression',
'System\.IO',
'System\.Security',
'System' # Must be last to avoid partial matches
)
foreach ($ns in $systemNamespaces) {
# Don't add global:: if it's already there
# Match: "using System.X" but not "using global::System.X"
$pattern = '(\s+using\s+)(?!global::)(' + $ns + ')(\s|;)'
$replacement = '${1}global::${2}${3}'
$Content = $Content -replace $pattern, $replacement
}
return $Content
}
function Convert-ToFileScopedNamespace {
param(
[string]$FilePath,
[switch]$DryRun,
[switch]$CreateBackup
)
$content = Get-Content -Path $FilePath -Raw
$originalContent = $content
$modified = $false
# Check current state
$hasFileScopedNS = Test-FileScopedNamespace -Content $content
$hasBlockScopedNS = Test-BlockScopedNamespace -Content $content
if ($hasFileScopedNS) {
Write-Verbose " Already using file-scoped namespace"
# But still add global:: prefixes if needed
$contentWithGlobal = Add-GlobalPrefix -Content $content
if ($contentWithGlobal -ne $content) {
$content = $contentWithGlobal
$modified = $true
Write-Host " [UPDATED] Added global:: prefixes" -ForegroundColor Yellow
} else {
Write-Host " [SKIP] Already correct" -ForegroundColor Gray
return $false
}
}
elseif (-not $hasBlockScopedNS) {
Write-Host " [SKIP] No namespace found" -ForegroundColor Gray
return $false
}
else {
Write-Verbose " Converting block-scoped to file-scoped namespace"
# Extract namespace name and line
if ($content -match 'namespace\s+([\w\.]+)\s*\r?\n?\s*\{') {
$namespaceName = $Matches[1]
Write-Verbose " Namespace: $namespaceName"
} else {
Write-Warning " Could not parse namespace"
return $false
}
# Step 1: Convert namespace declaration to file-scoped
$content = $content -replace '(namespace\s+[\w\.]+)\s*\r?\n?\s*\{', '$1;'
$modified = $true
# Step 2: Add global:: prefixes to System using directives
$content = Add-GlobalPrefix -Content $content
# Step 3: Parse into lines for indentation removal
$lines = $content -split '\r?\n'
$hasWindowsLineEndings = $originalContent -match '\r\n'
# Find namespace declaration line
$namespaceLineIndex = -1
for ($i = 0; $i -lt $lines.Length; $i++) {
if ($lines[$i] -match '^namespace\s+[\w\.]+\s*;') {
$namespaceLineIndex = $i
break
}
}
if ($namespaceLineIndex -lt 0) {
Write-Warning " Could not find namespace declaration after conversion"
return $false
}
# Step 4: Remove one level of indentation from all lines after namespace
$indentChar = $null
$indentSize = 4
$indentCharRef = [ref]$indentChar
$indentSizeRef = [ref]$indentSize
for ($i = $namespaceLineIndex + 1; $i -lt $lines.Length; $i++) {
$lines[$i] = Remove-OneIndentLevel -Line $lines[$i] -IndentChar $indentCharRef -IndentSize $indentSizeRef
}
# Step 5: Remove the closing brace of the namespace
# Find the last non-empty, non-whitespace line that's just a closing brace
$closingBraceIndex = -1
for ($i = $lines.Length - 1; $i -gt $namespaceLineIndex; $i--) {
$trimmed = $lines[$i].Trim()
if ($trimmed -eq '}') {
$closingBraceIndex = $i
break
}
elseif ($trimmed -ne '' -and $trimmed -ne '}') {
# Found non-brace content, stop looking
break
}
}
if ($closingBraceIndex -ge 0) {
Write-Verbose " Removing closing brace at line $closingBraceIndex"
$lines = $lines[0..($closingBraceIndex-1)] + $lines[($closingBraceIndex+1)..($lines.Length-1)]
}
# Step 6: Rejoin lines
$lineEnding = if ($hasWindowsLineEndings) { "`r`n" } else { "`n" }
$content = ($lines | Where-Object { $_ -ne $null }) -join $lineEnding
# Step 7: Clean up trailing whitespace and ensure single newline at end
$content = $content.TrimEnd()
$content += $lineEnding
Write-Host " [CONVERTED] Block-scoped → File-scoped" -ForegroundColor Green
}
# Apply changes
if ($modified -and $content -ne $originalContent) {
if ($DryRun) {
Write-Host " [DRY-RUN] Would save changes" -ForegroundColor Cyan
return $true
}
if ($CreateBackup) {
$backupPath = "$FilePath.bak"
Copy-Item -Path $FilePath -Destination $backupPath -Force
Write-Verbose " Created backup: $backupPath"
}
# Write with correct encoding (UTF-8 without BOM for .cs files)
[System.IO.File]::WriteAllText($FilePath, $content, [System.Text.UTF8Encoding]::new($false))
return $true
}
return $false
}
# Main script
Write-Host ("=" * 80) -ForegroundColor Cyan
Write-Host "C# File-Scoped Namespace Converter" -ForegroundColor Cyan
Write-Host "Fixes MediaBrowser.Model.System namespace conflicts" -ForegroundColor Cyan
Write-Host ("=" * 80) -ForegroundColor Cyan
Write-Host
if ($DryRun) {
Write-Host "DRY RUN MODE - No files will be modified" -ForegroundColor Yellow
Write-Host
}
if ($BackupFiles) {
Write-Host "Backup mode enabled - .bak files will be created" -ForegroundColor Yellow
Write-Host
}
if (-not (Test-Path $Path)) {
Write-Error "❌ Path not found: $Path"
exit 1
}
# Find all C# files
$files = Get-ChildItem -Path $Path -Filter "*.cs" -Recurse | Where-Object {
$_.FullName -notmatch "\\obj\\" -and
$_.FullName -notmatch "\\bin\\" -and
$_.FullName -notmatch "\\Properties\\AssemblyInfo\.cs$"
}
Write-Host "Found $($files.Count) C# files in $Path" -ForegroundColor Cyan
Write-Host
$convertedCount = 0
$skippedCount = 0
$errorCount = 0
$updatedCount = 0
foreach ($file in $files) {
$relativePath = $file.FullName.Replace((Get-Location).Path, "").TrimStart([char]92, [char]47)
Write-Host "[Processing] $relativePath" -ForegroundColor White
try {
$result = Convert-ToFileScopedNamespace -FilePath $file.FullName -DryRun:$DryRun -CreateBackup:$BackupFiles
if ($result) {
if ($result -eq "updated") {
$updatedCount++
} else {
$convertedCount++
}
} else {
$skippedCount++
}
}
catch {
Write-Host " [ERROR] $_" -ForegroundColor Red
Write-Verbose $_.ScriptStackTrace
$errorCount++
}
}
Write-Host
Write-Host ("=" * 80) -ForegroundColor Cyan
Write-Host "Summary:" -ForegroundColor Cyan
Write-Host ("=" * 80) -ForegroundColor Cyan
Write-Host " Total files: $($files.Count)" -ForegroundColor White
Write-Host " Converted: $convertedCount" -ForegroundColor Green
Write-Host " Updated (global::): $updatedCount" -ForegroundColor Yellow
Write-Host " Skipped: $skippedCount" -ForegroundColor Gray
Write-Host " Errors: $errorCount" -ForegroundColor Red
if ($DryRun) {
Write-Host
Write-Host "This was a DRY RUN. Run without -DryRun to apply changes." -ForegroundColor Yellow
} elseif ($convertedCount -gt 0 -or $updatedCount -gt 0) {
Write-Host
Write-Host "Conversion complete! Next steps:" -ForegroundColor Green
Write-Host " 1. Review changes with: git diff" -ForegroundColor White
Write-Host " 2. Build project: dotnet build MediaBrowser.Model\MediaBrowser.Model.csproj" -ForegroundColor White
Write-Host " 3. If successful: git add . && git commit -m `"Convert to file-scoped namespaces`"" -ForegroundColor White
}
Write-Host ("=" * 80) -ForegroundColor Cyan
exit $errorCount
+2 -2
View File
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Audio
{
using System;
using System.Globalization;
using System.IO;
@@ -9,8 +11,6 @@ using System.Text.RegularExpressions;
using Emby.Naming.Common;
using Jellyfin.Extensions;
namespace Emby.Naming.Audio
{
/// <summary>
/// Helper class to determine if Album is multipart.
/// </summary>
+2 -2
View File
@@ -2,13 +2,13 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Audio
{
using System;
using System.IO;
using Emby.Naming.Common;
using Jellyfin.Extensions;
namespace Emby.Naming.Audio
{
/// <summary>
/// Static helper class to determine if file at path is audio file.
/// </summary>
+2 -2
View File
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System;
namespace Emby.Naming.AudioBook
{
using System;
/// <summary>
/// Represents a single video file.
/// </summary>
@@ -2,13 +2,13 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.AudioBook
{
using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
using Emby.Naming.Common;
namespace Emby.Naming.AudioBook
{
/// <summary>
/// Parser class to extract part and/or chapter number from audiobook filename.
/// </summary>
+2 -2
View File
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System.Collections.Generic;
namespace Emby.Naming.AudioBook
{
using System.Collections.Generic;
/// <summary>
/// Represents a complete video, including all parts and subtitles.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.AudioBook
{
using System;
using System.Collections.Generic;
using System.IO;
@@ -10,8 +12,6 @@ using Emby.Naming.Common;
using Emby.Naming.Video;
using MediaBrowser.Model.IO;
namespace Emby.Naming.AudioBook
{
/// <summary>
/// Class used to resolve Name, Year, alternative files and extras from stack of files.
/// </summary>
+2 -2
View File
@@ -2,12 +2,12 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.AudioBook
{
using System.Globalization;
using System.Text.RegularExpressions;
using Emby.Naming.Common;
namespace Emby.Naming.AudioBook
{
/// <summary>
/// Helper class to retrieve name and year from audiobook previously retrieved name.
/// </summary>
+2 -2
View File
@@ -2,13 +2,13 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.AudioBook
{
using System;
using System.IO;
using Emby.Naming.Common;
using Jellyfin.Extensions;
namespace Emby.Naming.AudioBook
{
/// <summary>
/// Resolve specifics (path, container, partNumber, chapterNumber) about audiobook file.
/// </summary>
+2 -2
View File
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System.Text.RegularExpressions;
namespace Emby.Naming.Book
{
using System.Text.RegularExpressions;
/// <summary>
/// Helper class to retrieve basic metadata from a book filename.
/// </summary>
+2 -2
View File
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System;
namespace Emby.Naming.Book
{
using System;
/// <summary>
/// Data object used to pass metadata parsed from a book filename.
/// </summary>
+2 -2
View File
@@ -2,11 +2,11 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Common
{
using System;
using System.Text.RegularExpressions;
namespace Emby.Naming.Common
{
/// <summary>
/// Regular expressions for parsing TV Episodes.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.ExternalFiles
{
using System;
using System.IO;
using System.Linq;
@@ -10,8 +12,6 @@ using Jellyfin.Extensions;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Globalization;
namespace Emby.Naming.ExternalFiles
{
/// <summary>
/// External media file parser class.
/// </summary>
+2 -2
View File
@@ -2,14 +2,14 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.TV
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Emby.Naming.Common;
namespace Emby.Naming.TV
{
/// <summary>
/// Used to parse information about episode from path.
/// </summary>
+2 -2
View File
@@ -2,14 +2,14 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.TV
{
using System;
using System.IO;
using Emby.Naming.Common;
using Emby.Naming.Video;
using Jellyfin.Extensions;
namespace Emby.Naming.TV
{
/// <summary>
/// Used to resolve information about episode from path.
/// </summary>
+2 -2
View File
@@ -2,13 +2,13 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.TV
{
using System;
using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
namespace Emby.Naming.TV
{
/// <summary>
/// Class to parse season paths.
/// </summary>
+2 -6
View File
@@ -1,11 +1,7 @@
// <copyright file="SeriesPathParser.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using Emby.Naming.Common;
namespace Emby.Naming.TV
{
using Emby.Naming.Common;
/// <summary>
/// Used to parse information about series from paths containing more information that only the series name.
/// Uses the same regular expressions as the EpisodePathParser but have different success criteria.
+2 -2
View File
@@ -2,12 +2,12 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.TV
{
using System.IO;
using System.Text.RegularExpressions;
using Emby.Naming.Common;
namespace Emby.Naming.TV
{
/// <summary>
/// Used to resolve information about series from path.
/// </summary>
+2 -2
View File
@@ -2,12 +2,12 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.TV;
using System;
using System.Linq;
using MediaBrowser.Model.Entities;
namespace Emby.Naming.TV;
/// <summary>
/// Helper class for TV metadata parsing.
/// </summary>
+2 -6
View File
@@ -1,13 +1,9 @@
// <copyright file="CleanDateTimeParser.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Video
{
using System.Collections.Generic;
using System.Globalization;
using System.Text.RegularExpressions;
namespace Emby.Naming.Video
{
/// <summary>
/// <see href="http://kodi.wiki/view/Advancedsettings.xml#video" />.
/// </summary>
+2 -6
View File
@@ -1,13 +1,9 @@
// <copyright file="CleanStringParser.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Video
{
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text.RegularExpressions;
namespace Emby.Naming.Video
{
/// <summary>
/// <see href="http://kodi.wiki/view/Advancedsettings.xml#video" />.
/// </summary>
+2 -6
View File
@@ -1,11 +1,7 @@
// <copyright file="ExtraResult.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using MediaBrowser.Model.Entities;
namespace Emby.Naming.Video
{
using MediaBrowser.Model.Entities;
/// <summary>
/// Holder object for passing results from ExtraResolver.
/// </summary>
+2 -6
View File
@@ -1,12 +1,8 @@
// <copyright file="ExtraRule.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Video
{
using MediaBrowser.Model.Entities;
using MediaType = Emby.Naming.Common.MediaType;
namespace Emby.Naming.Video
{
/// <summary>
/// A rule used to match a file path with an <see cref="MediaBrowser.Model.Entities.ExtraType"/>.
/// </summary>
+2 -2
View File
@@ -2,14 +2,14 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Video
{
using System;
using System.IO;
using System.Text.RegularExpressions;
using Emby.Naming.Audio;
using Emby.Naming.Common;
namespace Emby.Naming.Video
{
/// <summary>
/// Resolve if file is extra for video.
/// </summary>
+2 -2
View File
@@ -2,12 +2,12 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Video
{
using System;
using System.Collections.Generic;
using Jellyfin.Extensions;
namespace Emby.Naming.Video
{
/// <summary>
/// Object holding list of files paths with additional information.
/// </summary>
+1 -5
View File
@@ -1,12 +1,8 @@
// <copyright file="FileStackRule.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Video;
using System.Diagnostics.CodeAnalysis;
using System.Text.RegularExpressions;
namespace Emby.Naming.Video;
/// <summary>
/// Regex based rule for file stacking (eg. disc1, disc2).
/// </summary>
+2 -2
View File
@@ -2,11 +2,11 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Video
{
using System;
using Emby.Naming.Common;
namespace Emby.Naming.Video
{
/// <summary>
/// Parse 3D format related flags.
/// </summary>
+2 -2
View File
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Video
{
using System;
using System.Collections.Generic;
using System.IO;
@@ -10,8 +12,6 @@ using Emby.Naming.AudioBook;
using Emby.Naming.Common;
using MediaBrowser.Model.IO;
namespace Emby.Naming.Video
{
/// <summary>
/// Resolve <see cref="FileStack"/> from list of paths.
/// </summary>
+2 -2
View File
@@ -2,13 +2,13 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Video
{
using System;
using System.IO;
using Emby.Naming.Common;
using Jellyfin.Extensions;
namespace Emby.Naming.Video
{
/// <summary>
/// Resolve if file is stub (.disc).
/// </summary>
+2 -2
View File
@@ -2,11 +2,11 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Video
{
using System;
using MediaBrowser.Model.Entities;
namespace Emby.Naming.Video
{
/// <summary>
/// Represents a single video file.
/// </summary>
+2 -2
View File
@@ -2,12 +2,12 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Video
{
using System;
using System.Collections.Generic;
using MediaBrowser.Model.Entities;
namespace Emby.Naming.Video
{
/// <summary>
/// Represents a complete video, including all parts and subtitles.
/// </summary>
+2 -2
View File
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Video
{
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -12,8 +14,6 @@ using Emby.Naming.Common;
using Jellyfin.Extensions;
using MediaBrowser.Model.IO;
namespace Emby.Naming.Video
{
/// <summary>
/// Resolves alternative versions and extras from list of video files.
/// </summary>
+2 -2
View File
@@ -2,14 +2,14 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Video
{
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using Emby.Naming.Common;
using Jellyfin.Extensions;
namespace Emby.Naming.Video
{
/// <summary>
/// Resolves <see cref="VideoFileInfo"/> from file path.
/// </summary>
+2 -2
View File
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Photos;
using System;
using System.IO;
using System.Linq;
@@ -20,8 +22,6 @@ using TagLib.IFD;
using TagLib.IFD.Entries;
using TagLib.IFD.Tags;
namespace Emby.Photos;
/// <summary>
/// Metadata provider for photos.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.AppBase
{
using System;
using System.Collections.Generic;
using System.IO;
@@ -9,8 +11,6 @@ using System.Linq;
using Jellyfin.Extensions;
using MediaBrowser.Common.Configuration;
namespace Emby.Server.Implementations.AppBase
{
/// <summary>
/// Provides a base class to hold common application paths used by both the UI and Server.
/// This can be subclassed to add application-specific paths.
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.AppBase
{
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -16,8 +18,6 @@ using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Serialization;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.AppBase
{
/// <summary>
/// Class BaseConfigurationManager.
/// </summary>
@@ -2,12 +2,12 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.AppBase
{
using System;
using System.IO;
using MediaBrowser.Model.Serialization;
namespace Emby.Server.Implementations.AppBase
{
/// <summary>
/// Class ConfigurationHelper.
/// </summary>
@@ -2,12 +2,12 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Branding
{
using System.Collections.Generic;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Model.Branding;
namespace Emby.Server.Implementations.Branding
{
/// <summary>
/// A configuration factory for <see cref="BrandingOptions"/>.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Chapters;
using System;
using System.Collections.Generic;
using System.IO;
@@ -23,8 +25,6 @@ using MediaBrowser.Model.IO;
using MediaBrowser.Model.MediaInfo;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Chapters;
/// <summary>
/// The chapter manager.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Collections
{
using System.Collections.Generic;
using System.Linq;
using Emby.Server.Implementations.Images;
@@ -15,8 +17,6 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
namespace Emby.Server.Implementations.Collections
{
/// <summary>
/// A collection image provider.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Collections
{
using System;
using System.Collections.Generic;
using System.IO;
@@ -21,8 +23,6 @@ using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.IO;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Collections
{
/// <summary>
/// The collection manager.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Configuration
{
using System;
using System.Globalization;
using System.IO;
@@ -14,8 +16,6 @@ using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Serialization;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Configuration
{
/// <summary>
/// Class ServerConfigurationManager.
/// </summary>
@@ -1,12 +1,8 @@
// <copyright file="ConfigurationOptions.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations
{
using System.Collections.Generic;
using static MediaBrowser.Controller.Extensions.ConfigurationExtensions;
namespace Emby.Server.Implementations
{
/// <summary>
/// Static class containing the default configuration options for the web server.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Cryptography
{
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -9,8 +11,6 @@ using System.Security.Cryptography;
using MediaBrowser.Model.Cryptography;
using static MediaBrowser.Model.Cryptography.Constants;
namespace Emby.Server.Implementations.Cryptography
{
/// <summary>
/// Class providing abstractions over cryptographic functions.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Data;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.Threading.Channels;
@@ -15,8 +17,6 @@ using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Playlists;
namespace Emby.Server.Implementations.Data;
/// <inheritdoc />
public class ItemTypeLookup : IItemTypeLookup
{
@@ -1,13 +1,9 @@
// <copyright file="TypeMapper.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Data
{
using System;
using System.Collections.Concurrent;
using System.Linq;
namespace Emby.Server.Implementations.Data
{
/// <summary>
/// Class TypeMapper.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.EntryPoints;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -24,8 +26,6 @@ using MediaBrowser.Model.Session;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.EntryPoints;
/// <summary>
/// A <see cref="IHostedService"/> responsible for notifying users when libraries are updated.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.EntryPoints
{
using System;
using System.Collections.Generic;
using System.Linq;
@@ -14,8 +16,6 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Session;
using Microsoft.Extensions.Hosting;
namespace Emby.Server.Implementations.EntryPoints
{
/// <summary>
/// <see cref="IHostedService"/> responsible for notifying users when associated item data is updated.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.HttpServer
{
using System;
using System.Buffers;
using System.IO.Pipelines;
@@ -18,8 +20,6 @@ using MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
using MediaBrowser.Model.Session;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.HttpServer
{
/// <summary>
/// Class WebSocketConnection.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.IO
{
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -16,8 +18,6 @@ using MediaBrowser.Model.IO;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.IO
{
/// <inheritdoc cref="ILibraryMonitor" />
public sealed class LibraryMonitor : ILibraryMonitor, IDisposable
{
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.IO
{
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -14,8 +16,6 @@ using MediaBrowser.Controller.IO;
using MediaBrowser.Model.IO;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.IO
{
/// <summary>
/// Class ManagedFileSystem.
/// </summary>
@@ -1,7 +1,3 @@
// <copyright file="FolderImageProvider.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
#pragma warning disable CS1591
using MediaBrowser.Common.Configuration;
@@ -1,7 +1,3 @@
// <copyright file="PhotoAlbumImageProvider.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
#pragma warning disable CS1591
using MediaBrowser.Common.Configuration;
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library
{
using System;
using System.IO;
using Emby.Naming.Audio;
@@ -11,8 +13,6 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Model.IO;
namespace Emby.Server.Implementations.Library
{
/// <summary>
/// Provides the core resolver ignore rules.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library;
using System;
using System.IO;
using System.Text.RegularExpressions;
@@ -10,8 +12,6 @@ using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Model.IO;
namespace Emby.Server.Implementations.Library;
/// <summary>
/// Resolver rule class for ignoring files via .ignore.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library;
using System;
using System.IO;
using System.Linq;
@@ -14,8 +16,6 @@ using MediaBrowser.Controller.MediaSegments;
using MediaBrowser.Controller.Trickplay;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library;
/// <summary>
/// IExternalDataManager implementation.
/// </summary>
@@ -2,11 +2,11 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library
{
using System;
using DotNet.Globbing;
namespace Emby.Server.Implementations.Library
{
/// <summary>
/// Glob patterns for files to ignore.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library;
using System;
using System.Collections.Generic;
using System.Threading;
@@ -10,8 +12,6 @@ using Jellyfin.MediaEncoding.Keyframes;
using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Persistence;
namespace Emby.Server.Implementations.Library;
/// <summary>
/// Manager for Keyframe data.
/// </summary>
@@ -2,13 +2,13 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library
{
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using MediaBrowser.Common.Providers;
namespace Emby.Server.Implementations.Library
{
/// <summary>
/// Class providing extension methods for working with paths.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library;
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -11,8 +13,6 @@ using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.IO;
namespace Emby.Server.Implementations.Library;
/// <summary>
/// IPathManager implementation.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library
{
using System;
using System.IO;
using System.Linq;
@@ -10,8 +12,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.IO;
namespace Emby.Server.Implementations.Library
{
/// <summary>
/// Class ResolverHelper.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Resolvers.Audio
{
#nullable disable
using System;
@@ -20,8 +22,6 @@ using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Model.IO;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Resolvers.Audio
{
/// <summary>
/// The music album resolver.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Resolvers.Audio
{
#nullable disable
using System;
@@ -17,8 +19,6 @@ using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Model.Entities;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Resolvers.Audio
{
/// <summary>
/// The music artist resolver.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Resolvers
{
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
@@ -15,8 +17,6 @@ using MediaBrowser.Model.Entities;
using Microsoft.Extensions.Logging;
using static Emby.Naming.Video.ExtraRuleResolver;
namespace Emby.Server.Implementations.Library.Resolvers
{
/// <summary>
/// Resolves a Path into a Video or Video subclass.
/// </summary>
@@ -1,15 +1,11 @@
// <copyright file="FolderResolver.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Resolvers
{
#nullable disable
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Resolvers;
namespace Emby.Server.Implementations.Library.Resolvers
{
/// <summary>
/// Class FolderResolver.
/// </summary>
@@ -1,15 +1,11 @@
// <copyright file="GenericFolderResolver.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Resolvers
{
#nullable disable
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Resolvers;
namespace Emby.Server.Implementations.Library.Resolvers
{
/// <summary>
/// Class FolderResolver.
/// </summary>
@@ -1,7 +1,5 @@
// <copyright file="GenericVideoResolver.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Resolvers
{
#nullable disable
using Emby.Naming.Common;
@@ -9,8 +7,6 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Resolvers
{
/// <summary>
/// Resolves a Path into an instance of the <see cref="Video"/> class.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Resolvers.Movies
{
#nullable disable
using System;
@@ -11,8 +13,6 @@ using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Entities;
namespace Emby.Server.Implementations.Library.Resolvers.Movies
{
/// <summary>
/// Class BoxSetResolver.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Resolvers.Movies
{
#nullable disable
using System;
@@ -24,8 +26,6 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Resolvers.Movies
{
/// <summary>
/// Class MovieResolver.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Resolvers
{
#nullable disable
using System;
@@ -13,8 +15,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Model.Entities;
namespace Emby.Server.Implementations.Library.Resolvers
{
/// <summary>
/// Class PhotoAlbumResolver.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Resolvers
{
using System;
using System.IO;
using System.Linq;
@@ -16,8 +18,6 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Model.Entities;
namespace Emby.Server.Implementations.Library.Resolvers
{
/// <summary>
/// Class PhotoResolver.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Resolvers
{
#nullable disable
using System;
@@ -14,8 +16,6 @@ using MediaBrowser.Controller.Playlists;
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.LocalMetadata.Savers;
namespace Emby.Server.Implementations.Library.Resolvers
{
/// <summary>
/// <see cref="IItemResolver"/> for <see cref="Playlist"/> library items.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Resolvers.TV
{
#nullable disable
using System;
@@ -14,8 +16,6 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Resolvers.TV
{
/// <summary>
/// Class EpisodeResolver.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Resolvers.TV
{
#nullable disable
using System.Globalization;
@@ -12,8 +14,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Globalization;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Resolvers.TV
{
/// <summary>
/// Class SeasonResolver.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -17,8 +19,6 @@ using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Entities;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library;
/// <summary>
/// The splashscreen post scan task.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Validators;
using System;
using System.Threading;
using System.Threading.Tasks;
@@ -9,8 +11,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Validators;
/// <summary>
/// Class ArtistsPostScanTask.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Validators;
using System;
using System.Globalization;
using System.Linq;
@@ -14,8 +16,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Validators;
/// <summary>
/// Class ArtistsValidator.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Validators;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -15,8 +17,6 @@ using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Library;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Validators;
/// <summary>
/// Class CollectionPostScanTask.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Validators;
using System;
using System.Threading;
using System.Threading.Tasks;
@@ -9,8 +11,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Validators;
/// <summary>
/// Class GenresPostScanTask.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Validators;
using System;
using System.Globalization;
using System.Threading;
@@ -12,8 +14,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Validators;
/// <summary>
/// Class GenresValidator.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Validators;
using System;
using System.Threading;
using System.Threading.Tasks;
@@ -9,8 +11,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Validators;
/// <summary>
/// Class MusicGenresPostScanTask.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Validators;
using System;
using System.Threading;
using System.Threading.Tasks;
@@ -9,8 +11,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Validators;
/// <summary>
/// Class MusicGenresValidator.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Validators;
using System;
using System.Linq;
using System.Threading;
@@ -13,8 +15,6 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.IO;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Validators;
/// <summary>
/// Class PeopleValidator.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Validators;
using System;
using System.Threading;
using System.Threading.Tasks;
@@ -9,8 +11,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Validators;
/// <summary>
/// Class MusicGenresPostScanTask.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Library.Validators;
using System;
using System.Globalization;
using System.Threading;
@@ -12,8 +14,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Validators;
/// <summary>
/// Class StudiosValidator.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Localization
{
using System;
using System.Collections.Concurrent;
using System.Collections.Frozen;
@@ -19,8 +21,6 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Globalization;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Localization
{
/// <summary>
/// Class LocalizationManager.
/// </summary>
@@ -1,12 +1,8 @@
// <copyright file="PluginLoadContext.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Plugins;
using System.Reflection;
using System.Runtime.Loader;
namespace Emby.Server.Implementations.Plugins;
/// <summary>
/// A custom <see cref="AssemblyLoadContext"/> for loading Jellyfin plugins.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.Plugins
{
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -28,8 +30,6 @@ using MediaBrowser.Model.Updates;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Plugins
{
/// <summary>
/// Defines the <see cref="PluginManager" />.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.QuickConnect
{
using System;
using System.Collections.Concurrent;
using System.Globalization;
@@ -17,8 +19,6 @@ using MediaBrowser.Controller.Session;
using MediaBrowser.Model.QuickConnect;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.QuickConnect
{
/// <summary>
/// Quick connect implementation.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.ScheduledTasks;
#nullable disable
using System;
@@ -20,8 +22,6 @@ using MediaBrowser.Common.Extensions;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.ScheduledTasks;
/// <summary>
/// Class ScheduledTaskWorker.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.ScheduledTasks;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -12,8 +14,6 @@ using MediaBrowser.Common.Configuration;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.ScheduledTasks;
/// <summary>
/// Class TaskManager.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -23,8 +25,6 @@ using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
/// <summary>
/// The audio normalization task.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
using System;
using System.Collections.Generic;
using System.IO;
@@ -21,8 +23,6 @@ using MediaBrowser.Model.IO;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
/// <summary>
/// Class ChapterImagesTask.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
using System;
using System.Collections.Generic;
using System.Threading;
@@ -11,8 +13,6 @@ using MediaBrowser.Model.Activity;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Tasks;
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
/// <summary>
/// Deletes old activity log entries.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
using System;
using System.Collections.Generic;
using System.IO;
@@ -19,8 +21,6 @@ using MediaBrowser.Model.IO;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
/// <summary>
/// Deletes path references from collections and playlists that no longer exists.
/// </summary>

Some files were not shown because too many files have changed in this diff Show More