mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-20 15:55:25 +03:00
update translations
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Common.IO;
|
||||
using System.Globalization;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using System;
|
||||
@@ -188,6 +189,44 @@ namespace MediaBrowser.Controller.Resolvers
|
||||
return string.Equals(extension, ".disc", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether [is multi disc album folder] [the specified path].
|
||||
/// </summary>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <returns><c>true</c> if [is multi disc album folder] [the specified path]; otherwise, <c>false</c>.</returns>
|
||||
public static bool IsMultiDiscAlbumFolder(string path)
|
||||
{
|
||||
var filename = Path.GetFileName(path);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(filename))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Normalize
|
||||
// Remove whitespace
|
||||
filename = filename.Replace("-", string.Empty);
|
||||
filename = Regex.Replace(filename, @"\s+", "");
|
||||
|
||||
var prefixes = new[] { "disc", "cd", "disk" };
|
||||
|
||||
foreach (var prefix in prefixes)
|
||||
{
|
||||
if (filename.IndexOf(prefix, StringComparison.OrdinalIgnoreCase) == 0)
|
||||
{
|
||||
var tmp = filename.Substring(prefix.Length);
|
||||
|
||||
int val;
|
||||
if (int.TryParse(tmp, NumberStyles.Any, CultureInfo.InvariantCulture, out val))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ensures DateCreated and DateModified have values
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user