aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Emby.Server.Implementations/Localization/Core/cy.json43
-rw-r--r--Emby.Server.Implementations/Localization/Core/ta.json2
-rw-r--r--MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs27
-rw-r--r--tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs13
4 files changed, 72 insertions, 13 deletions
diff --git a/Emby.Server.Implementations/Localization/Core/cy.json b/Emby.Server.Implementations/Localization/Core/cy.json
index c41176f0f..1192f5c88 100644
--- a/Emby.Server.Implementations/Localization/Core/cy.json
+++ b/Emby.Server.Implementations/Localization/Core/cy.json
@@ -13,5 +13,46 @@
"Albums": "Albwmau",
"Genres": "Genres",
"Folders": "Ffolderi",
- "Favorites": "Ffefrynnau"
+ "Favorites": "Ffefrynnau",
+ "LabelRunningTimeValue": "Amser rhedeg: {0}",
+ "TaskOptimizeDatabase": "Cronfa ddata Optimeiddio",
+ "TaskRefreshChannels": "Adnewyddu Sianeli",
+ "TaskRefreshPeople": "Adnewyddu Pobl",
+ "TasksChannelsCategory": "Sianeli Internet",
+ "VersionNumber": "Fersiwn {0}",
+ "ScheduledTaskStartedWithName": "{0} wedi dechrau",
+ "ScheduledTaskFailedWithName": "{0} wedi methu",
+ "ProviderValue": "Darparwr: {0}",
+ "NotificationOptionInstallationFailed": "Fethu Gosod",
+ "NameSeasonUnknown": "Tymor Anhysbys",
+ "NameSeasonNumber": "Tymor {0}",
+ "MusicVideos": "Fideos Cerddoriaeth",
+ "MixedContent": "Cynnwys amrywiol",
+ "HomeVideos": "Fideos Cartref",
+ "HeaderNextUp": "Nesaf i Fyny",
+ "HeaderFavoriteArtists": "Ffefryn Artistiaid",
+ "HeaderFavoriteAlbums": "Ffefryn Albwmau",
+ "HeaderContinueWatching": "Parhewch i Weithio",
+ "TasksApplicationCategory": "Rhaglen",
+ "TasksLibraryCategory": "Llyfrgell",
+ "TasksMaintenanceCategory": "Cynnal a Chadw",
+ "System": "System",
+ "Plugin": "Ategyn",
+ "Music": "Cerddoriaeth",
+ "Latest": "Diweddaraf",
+ "Inherit": "Etifeddu",
+ "Forced": "Orfodi",
+ "Application": "Rhaglen",
+ "HeaderAlbumArtists": "Artistiaid albwm",
+ "Sync": "Cysoni",
+ "Songs": "Caneuon",
+ "Shows": "Rhaglenni",
+ "Playlists": "Rhestri Chwarae",
+ "Photos": "Lluniau",
+ "ValueSpecialEpisodeName": "Arbennig - {0}",
+ "Movies": "Ffilmiau",
+ "Undefined": "Heb ddiffiniad",
+ "TvShows": "Rhaglenni teledu",
+ "HeaderLiveTV": "Teledu Byw",
+ "User": "Defnyddiwr"
}
diff --git a/Emby.Server.Implementations/Localization/Core/ta.json b/Emby.Server.Implementations/Localization/Core/ta.json
index e3a993625..98d763fcd 100644
--- a/Emby.Server.Implementations/Localization/Core/ta.json
+++ b/Emby.Server.Implementations/Localization/Core/ta.json
@@ -21,7 +21,7 @@
"Inherit": "மரபுரிமையாகப் பெறு",
"HeaderRecordingGroups": "பதிவு குழுக்கள்",
"Folders": "கோப்புறைகள்",
- "FailedLoginAttemptWithUserName": "{0} இல் இருந்து உள்நுழைவு முயற்சி தோல்வியடைந்தது",
+ "FailedLoginAttemptWithUserName": "{0} இன் உள்நுழைவு முயற்சி தோல்வியடைந்தது",
"DeviceOnlineWithName": "{0} இணைக்கப்பட்டது",
"DeviceOfflineWithName": "{0} துண்டிக்கப்பட்டது",
"Collections": "தொகுப்புகள்",
diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
index 770881149..da76ff0f9 100644
--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
@@ -1027,27 +1027,32 @@ namespace MediaBrowser.MediaEncoding.Probing
/// </summary>
/// <param name="value">The value.</param>
/// <returns>System.Nullable{System.Single}.</returns>
- private float? GetFrameRate(string value)
+ internal static float? GetFrameRate(ReadOnlySpan<char> value)
{
- if (string.IsNullOrEmpty(value))
+ if (value.IsEmpty)
{
return null;
}
- var parts = value.Split('/');
-
- float result;
-
- if (parts.Length == 2)
+ int index = value.IndexOf('/');
+ if (index == -1)
{
- result = float.Parse(parts[0], CultureInfo.InvariantCulture) / float.Parse(parts[1], CultureInfo.InvariantCulture);
+ // REVIEW: is this branch actually required? (i.e. does ffprobe ever output something other than a fraction?)
+ if (float.TryParse(value, NumberStyles.AllowThousands | NumberStyles.Float, CultureInfo.InvariantCulture, out var result))
+ {
+ return result;
+ }
+
+ return null;
}
- else
+
+ if (!float.TryParse(value[..index], NumberStyles.Integer, CultureInfo.InvariantCulture, out var dividend)
+ || !float.TryParse(value[(index + 1)..], NumberStyles.Integer, CultureInfo.InvariantCulture, out var divisor))
{
- result = float.Parse(parts[0], CultureInfo.InvariantCulture);
+ return null;
}
- return float.IsNaN(result) ? null : result;
+ return divisor == 0f ? null : dividend / divisor;
}
private void SetAudioRuntimeTicks(InternalMediaInfoResult result, MediaInfo data)
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs
index 4504924cb..0fc8724b6 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs
+++ b/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs
@@ -18,6 +18,19 @@ namespace Jellyfin.MediaEncoding.Tests.Probing
private readonly JsonSerializerOptions _jsonOptions = JsonDefaults.Options;
private readonly ProbeResultNormalizer _probeResultNormalizer = new ProbeResultNormalizer(new NullLogger<EncoderValidatorTests>(), null);
+ [Theory]
+ [InlineData("2997/125", 23.976f)]
+ [InlineData("1/50", 0.02f)]
+ [InlineData("25/1", 25f)]
+ [InlineData("120/1", 120f)]
+ [InlineData("1704753000/71073479", 23.98578237601117f)]
+ [InlineData("0/0", null)]
+ [InlineData("1/1000", 0.001f)]
+ [InlineData("1/90000", 1.1111111E-05f)]
+ [InlineData("1/48000", 2.0833333E-05f)]
+ public void GetFrameRate_Success(string value, float? expected)
+ => Assert.Equal(expected, ProbeResultNormalizer.GetFrameRate(value));
+
[Fact]
public void GetMediaInfo_MetaData_Success()
{