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
@@ -2,12 +2,12 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System;
using System.Collections.Generic;
using Jellyfin.Extensions;
namespace MediaBrowser.Model.Extensions;
using global::System;
using global::System.Collections.Generic;
using Jellyfin.Extensions;
/// <summary>
/// Defines the <see cref="ContainerHelper"/> class.
/// </summary>
@@ -2,60 +2,58 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System;
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Model.Providers;
namespace MediaBrowser.Model.Extensions;
using global::System;
using global::System.Collections.Generic;
using global::System.Linq;
using MediaBrowser.Model.Providers;
namespace MediaBrowser.Model.Extensions
{
/// <summary>
/// Extension methods for <see cref="IEnumerable{T}"/>.
/// </summary>
public static class EnumerableExtensions
{
/// <summary>
/// Orders <see cref="RemoteImageInfo"/> by requested language in descending order, prioritizing "en" over other non-matches.
/// </summary>
/// <param name="remoteImageInfos">The remote image infos.</param>
/// <param name="requestedLanguage">The requested language for the images.</param>
/// <returns>The ordered remote image infos.</returns>
public static IEnumerable<RemoteImageInfo> OrderByLanguageDescending(this IEnumerable<RemoteImageInfo> remoteImageInfos, string requestedLanguage)
{
if (string.IsNullOrWhiteSpace(requestedLanguage))
{
// Default to English if no requested language is specified.
requestedLanguage = "en";
}
/// <summary>
/// Extension methods for <see cref="IEnumerable{T}"/>.
/// </summary>
public static class EnumerableExtensions
{
/// <summary>
/// Orders <see cref="RemoteImageInfo"/> by requested language in descending order, prioritizing "en" over other non-matches.
/// </summary>
/// <param name="remoteImageInfos">The remote image infos.</param>
/// <param name="requestedLanguage">The requested language for the images.</param>
/// <returns>The ordered remote image infos.</returns>
public static IEnumerable<RemoteImageInfo> OrderByLanguageDescending(this IEnumerable<RemoteImageInfo> remoteImageInfos, string requestedLanguage)
{
if (string.IsNullOrWhiteSpace(requestedLanguage))
{
// Default to English if no requested language is specified.
requestedLanguage = "en";
}
return remoteImageInfos.OrderByDescending(i =>
{
// Image priority ordering:
// - Images that match the requested language
// - Images with no language
// - TODO: Images that match the original language
// - Images in English
// - Images that don't match the requested language
return remoteImageInfos.OrderByDescending(i =>
{
// Image priority ordering:
// - Images that match the requested language
// - Images with no language
// - TODO: Images that match the original language
// - Images in English
// - Images that don't match the requested language
if (string.Equals(requestedLanguage, i.Language, StringComparison.OrdinalIgnoreCase))
{
return 4;
}
if (string.Equals(requestedLanguage, i.Language, StringComparison.OrdinalIgnoreCase))
{
return 4;
}
if (string.IsNullOrEmpty(i.Language))
{
return 3;
}
if (string.IsNullOrEmpty(i.Language))
{
return 3;
}
if (string.Equals(i.Language, "en", StringComparison.OrdinalIgnoreCase))
{
return 2;
}
if (string.Equals(i.Language, "en", StringComparison.OrdinalIgnoreCase))
{
return 2;
}
return 0;
})
.ThenByDescending(i => Math.Round(i.CommunityRating ?? 0, 1) )
.ThenByDescending(i => i.VoteCount ?? 0);
}
}
}
return 0;
})
.ThenByDescending(i => Math.Round(i.CommunityRating ?? 0, 1) )
.ThenByDescending(i => i.VoteCount ?? 0);
}
}
@@ -2,12 +2,12 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System;
using System.Linq;
using MediaBrowser.Model.Configuration;
namespace MediaBrowser.Model.Extensions;
using global::System;
using global::System.Linq;
using MediaBrowser.Model.Configuration;
/// <summary>
/// Extensions for <see cref="LibraryOptions"/>.
/// </summary>
+33 -35
View File
@@ -2,41 +2,39 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System;
namespace MediaBrowser.Model.Extensions;
using global::System;
namespace MediaBrowser.Model.Extensions
{
/// <summary>
/// Helper methods for manipulating strings.
/// </summary>
public static class StringHelper
{
/// <summary>
/// Returns the string with the first character as uppercase.
/// </summary>
/// <param name="str">The input string.</param>
/// <returns>The string with the first character as uppercase.</returns>
public static string FirstToUpper(string str)
{
if (str.Length == 0)
{
return str;
}
/// <summary>
/// Helper methods for manipulating strings.
/// </summary>
public static class StringHelper
{
/// <summary>
/// Returns the string with the first character as uppercase.
/// </summary>
/// <param name="str">The input string.</param>
/// <returns>The string with the first character as uppercase.</returns>
public static string FirstToUpper(string str)
{
if (str.Length == 0)
{
return str;
}
// We check IsLower instead of IsUpper because both return false for non-letters
if (!char.IsLower(str[0]))
{
return str;
}
// We check IsLower instead of IsUpper because both return false for non-letters
if (!char.IsLower(str[0]))
{
return str;
}
return string.Create(
str.Length,
str.AsSpan(),
(chars, buf) =>
{
chars[0] = char.ToUpperInvariant(buf[0]);
buf.Slice(1).CopyTo(chars.Slice(1));
});
}
}
}
return string.Create(
str.Length,
str.AsSpan(),
(chars, buf) =>
{
chars[0] = char.ToUpperInvariant(buf[0]);
buf.Slice(1).CopyTo(chars.Slice(1));
});
}
}