1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-30 23:42:33 +01:00

Decimal.TryParse the frame rate instead of Decimal.Parse

This commit is contained in:
Mark McDowall 2013-12-02 23:31:31 -08:00
parent 76bc4aaa9c
commit d4a9bd25bd

View File

@ -49,12 +49,15 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
int runTime; int runTime;
int streamCount; int streamCount;
int audioChannels; int audioChannels;
decimal videoFrameRate;
string subtitles = mediaInfo.Get(StreamKind.General, 0, "Text_Language_List"); string subtitles = mediaInfo.Get(StreamKind.General, 0, "Text_Language_List");
string scanType = mediaInfo.Get(StreamKind.Video, 0, "ScanType"); string scanType = mediaInfo.Get(StreamKind.Video, 0, "ScanType");
Int32.TryParse(mediaInfo.Get(StreamKind.Video, 0, "Width"), out width); Int32.TryParse(mediaInfo.Get(StreamKind.Video, 0, "Width"), out width);
Int32.TryParse(mediaInfo.Get(StreamKind.Video, 0, "Height"), out height); Int32.TryParse(mediaInfo.Get(StreamKind.Video, 0, "Height"), out height);
Int32.TryParse(mediaInfo.Get(StreamKind.Video, 0, "BitRate"), out videoBitRate); Int32.TryParse(mediaInfo.Get(StreamKind.Video, 0, "BitRate"), out videoBitRate);
Int32.TryParse(mediaInfo.Get(StreamKind.Video, 0, "PlayTime"), out runTime);
Decimal.TryParse(mediaInfo.Get(StreamKind.Video, 0, "FrameRate"), out videoFrameRate);
string aBitRate = mediaInfo.Get(StreamKind.Audio, 0, "BitRate"); string aBitRate = mediaInfo.Get(StreamKind.Audio, 0, "BitRate");
int aBindex = aBitRate.IndexOf(" /", StringComparison.InvariantCultureIgnoreCase); int aBindex = aBitRate.IndexOf(" /", StringComparison.InvariantCultureIgnoreCase);
@ -62,8 +65,8 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
aBitRate = aBitRate.Remove(aBindex); aBitRate = aBitRate.Remove(aBindex);
Int32.TryParse(aBitRate, out audioBitRate); Int32.TryParse(aBitRate, out audioBitRate);
Int32.TryParse(mediaInfo.Get(StreamKind.Video, 0, "PlayTime"), out runTime);
Int32.TryParse(mediaInfo.Get(StreamKind.Audio, 0, "StreamCount"), out streamCount); Int32.TryParse(mediaInfo.Get(StreamKind.Audio, 0, "StreamCount"), out streamCount);
string audioChannelsStr = mediaInfo.Get(StreamKind.Audio, 0, "Channel(s)"); string audioChannelsStr = mediaInfo.Get(StreamKind.Audio, 0, "Channel(s)");
int aCindex = audioChannelsStr.IndexOf(" /", StringComparison.InvariantCultureIgnoreCase); int aCindex = audioChannelsStr.IndexOf(" /", StringComparison.InvariantCultureIgnoreCase);
@ -71,7 +74,6 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
audioChannelsStr = audioChannelsStr.Remove(aCindex); audioChannelsStr = audioChannelsStr.Remove(aCindex);
string audioLanguages = mediaInfo.Get(StreamKind.General, 0, "Audio_Language_List"); string audioLanguages = mediaInfo.Get(StreamKind.General, 0, "Audio_Language_List");
decimal videoFrameRate = Decimal.Parse(mediaInfo.Get(StreamKind.Video, 0, "FrameRate"));
string audioProfile = mediaInfo.Get(StreamKind.Audio, 0, "Format_Profile"); string audioProfile = mediaInfo.Get(StreamKind.Audio, 0, "Format_Profile");
int aPindex = audioProfile.IndexOf(" /", StringComparison.InvariantCultureIgnoreCase); int aPindex = audioProfile.IndexOf(" /", StringComparison.InvariantCultureIgnoreCase);