mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
added more card layouts
This commit is contained in:
@@ -139,14 +139,14 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
{
|
||||
var id = this.GetProviderId(MetadataProviders.MusicBrainzReleaseGroup);
|
||||
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
if (!string.IsNullOrWhiteSpace(id))
|
||||
{
|
||||
return "MusicAlbum-MusicBrainzReleaseGroup-" + id;
|
||||
}
|
||||
|
||||
id = this.GetProviderId(MetadataProviders.MusicBrainzAlbum);
|
||||
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
if (!string.IsNullOrWhiteSpace(id))
|
||||
{
|
||||
return "MusicAlbum-Musicbrainz-" + id;
|
||||
}
|
||||
|
||||
@@ -157,18 +157,24 @@ namespace MediaBrowser.Controller.Resolvers
|
||||
|
||||
// Normalize
|
||||
// Remove whitespace
|
||||
filename = filename.Replace("-", string.Empty);
|
||||
filename = filename.Replace(".", string.Empty);
|
||||
filename = Regex.Replace(filename, @"\s+", "");
|
||||
filename = filename.Replace("-", " ");
|
||||
filename = filename.Replace(".", " ");
|
||||
filename = filename.Replace("(", " ");
|
||||
filename = filename.Replace(")", " ");
|
||||
filename = Regex.Replace(filename, @"\s+", " ");
|
||||
|
||||
var prefixes = new[] { "disc", "cd", "disk", "vol", "volume" };
|
||||
|
||||
filename = filename.TrimStart();
|
||||
|
||||
foreach (var prefix in prefixes)
|
||||
{
|
||||
if (filename.IndexOf(prefix, StringComparison.OrdinalIgnoreCase) == 0)
|
||||
{
|
||||
var tmp = filename.Substring(prefix.Length);
|
||||
|
||||
tmp = tmp.Trim().Split(' ').FirstOrDefault() ?? string.Empty;
|
||||
|
||||
int val;
|
||||
if (int.TryParse(tmp, NumberStyles.Any, CultureInfo.InvariantCulture, out val))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user