aboutsummaryrefslogtreecommitdiff
path: root/Emby.Naming
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2023-02-20 11:09:54 +0100
committerGitHub <noreply@github.com>2023-02-20 11:09:54 +0100
commit720852f7087e32053407cd849470d3f13f57159c (patch)
treea3c8d8aff92aeb5f107b724513a3ed775d71b3be /Emby.Naming
parent69379d80a1f3352972a80b06815038ee853622eb (diff)
parentb119c6d868c24212300285c501f43af91b31d404 (diff)
Merge pull request #9356 from Bond-009/tryparse
Diffstat (limited to 'Emby.Naming')
-rw-r--r--Emby.Naming/Audio/AlbumParser.cs9
1 files changed, 2 insertions, 7 deletions
diff --git a/Emby.Naming/Audio/AlbumParser.cs b/Emby.Naming/Audio/AlbumParser.cs
index bbfdccc90..86a564153 100644
--- a/Emby.Naming/Audio/AlbumParser.cs
+++ b/Emby.Naming/Audio/AlbumParser.cs
@@ -3,6 +3,7 @@ using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
using Emby.Naming.Common;
+using Jellyfin.Extensions;
namespace Emby.Naming.Audio
{
@@ -58,13 +59,7 @@ namespace Emby.Naming.Audio
var tmp = trimmedFilename.Slice(prefix.Length).Trim();
- int index = tmp.IndexOf(' ');
- if (index != -1)
- {
- tmp = tmp.Slice(0, index);
- }
-
- if (int.TryParse(tmp, NumberStyles.Integer, CultureInfo.InvariantCulture, out _))
+ if (int.TryParse(tmp.LeftPart(' '), CultureInfo.InvariantCulture, out _))
{
return true;
}