Import Error - Input string was not in a correct format

Sonarr version (exact version): 2.0.0.5054
Mono version (if Sonarr is not running on Windows):
OS: Windows
((Debug logs)): https://hastebin.com/lupudoxuzi.tex
Description of issue: All episodes of the show Dark are failing to import with a Format Exception coming from MediaInfoFormatter.FormatAudioChannels

Sounds a lot like this issue:

The release name should help track down the issue.

mediainfo output: https://hastebin.com/ewiwivoduw.pas

The audio format is E-AC-3+Atmos / E-AC-3, maybe that’s a new format that the MediaInfoFormatter doesn’t know about.

Nevermind it’s the ‘Channel positions’ string:

audioChannelPositions = “15 objects / Front: L C R, Side: L R, LFE”

in MediaInfoFormatter.cs line 48 (line 50 in the latest) :
return audioChannelPositions.Replace("Object Based / ", “”)
.Split(new string[] { " / " }, StringSplitOptions.RemoveEmptyEntries)
.First()
.Split(’/’)
.Sum(s => decimal.Parse(s, CultureInfo.InvariantCulture));

The first split splits it into “15 objects” and "Front: L C R, Side: L R, LFE"
then it gets the first part, 15 objects, and calls decimal.Parse on the string “15 objects” and dies.

I’m guessing the code wants the ‘15’ so another replace at the beginning would fix it:
return audioChannelPositions.Replace(“Object Based / “, “”).Replace(” objects”,"")
.Split(new string[] { " / " }, StringSplitOptions.RemoveEmptyEntries)
.First()
.Split(’/’)
.Sum(s => decimal.Parse(s, CultureInfo.InvariantCulture));

mastyman here

same issue on 2.0.0.5074 develop Win10 x64

System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseDecimal(String value, NumberStyles options, NumberFormatInfo numfmt)
at NzbDrone.Core.MediaFiles.MediaInfo.MediaInfoFormatter.<>c.b__1_1(String s) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\MediaFiles\MediaInfo\MediaInfoFormatter.cs:line 48
at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Enumerable.Sum(IEnumerable1 source)
at NzbDrone.Core.MediaFiles.MediaInfo.MediaInfoFormatter.FormatAudioChannels(MediaInfoModel mediaInfo) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\MediaFiles\MediaInfo\MediaInfoFormatter.cs:line 44
at NzbDrone.Core.Organizer.FileNameBuilder.AddMediaInfoTokens(Dictionary2 tokenHandlers, EpisodeFile episodeFile) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Organizer\FileNameBuilder.cs:line 496 at NzbDrone.Core.Organizer.FileNameBuilder.BuildFileName(List1 episodes, Series series, EpisodeFile episodeFile, NamingConfig namingConfig) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Organizer\FileNameBuilder.cs:line 133
at NzbDrone.Core.MediaFiles.EpisodeFileMovingService.MoveEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\MediaFiles\EpisodeFileMovingService.cs:line 74
at NzbDrone.Core.MediaFiles.UpgradeMediaFileService.UpgradeEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode, Boolean copyOnly) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\MediaFiles\UpgradeMediaFileService.cs:line 76
at NzbDrone.Core.MediaFiles.EpisodeImport.ImportApprovedEpisodes.Import(List`1 decisions, Boolean newDownload, DownloadClientItem downloadClientItem, ImportMode importMode) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\MediaFiles\EpisodeImport\ImportApprovedEpisodes.cs:line 103

mediainfo here https://hastebin.com/vezoqiwora.pas

audioChannelPositions is just 15 Objects. audioChannelPositionsText is 15 objects / Front: L C R, Side: L R, LFE, but audioChannelPositions is present and preferred, so audioChannelPositionsText is never hit.

Shouldn’t be a big deal to improve this further though and should result in better handling of future parsing problems.

Sonarr version (exact version): 2.0.0.5054
OS: Windows Server 2008 R2
Description of issue:
I’m getting this Format Exception for a particular completed file when it’s being imported. Seems to be a problem with what media info is returning for audio channels isn’t correctly parsed into a decimal.

[v2.0.0.5054] System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseDecimal(String value, NumberStyles options, NumberFormatInfo numfmt)
   at NzbDrone.Core.MediaFiles.MediaInfo.MediaInfoFormatter.<>c.<FormatAudioChannels>b__1_1(String s) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\MediaFiles\MediaInfo\MediaInfoFormatter.cs:line 48
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Enumerable.Sum(IEnumerable`1 source)
   at NzbDrone.Core.MediaFiles.MediaInfo.MediaInfoFormatter.FormatAudioChannels(MediaInfoModel mediaInfo) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\MediaFiles\MediaInfo\MediaInfoFormatter.cs:line 44
   at NzbDrone.Core.Organizer.FileNameBuilder.AddMediaInfoTokens(Dictionary`2 tokenHandlers, EpisodeFile episodeFile) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Organizer\FileNameBuilder.cs:line 496
   at NzbDrone.Core.Organizer.FileNameBuilder.BuildFileName(List`1 episodes, Series series, EpisodeFile episodeFile, NamingConfig namingConfig) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Organizer\FileNameBuilder.cs:line 133
   at NzbDrone.Core.MediaFiles.EpisodeFileMovingService.MoveEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\MediaFiles\EpisodeFileMovingService.cs:line 74
   at NzbDrone.Core.MediaFiles.UpgradeMediaFileService.UpgradeEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode, Boolean copyOnly) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\MediaFiles\UpgradeMediaFileService.cs:line 76
   at NzbDrone.Core.MediaFiles.EpisodeImport.ImportApprovedEpisodes.Import(List`1 decisions, Boolean newDownload, DownloadClientItem downloadClientItem, ImportMode importMode) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\MediaFiles\EpisodeImport\ImportApprovedEpisodes.cs:line 103

This is what the media info cli is returning for the audio info:

Audio
ID                                       : 2
Format                                   : E-AC-3
Format/Info                              : Enhanced Audio Coding 3
Format profile                           : E-AC-3+Atmos / E-AC-3
Format settings, Endianness              : Big
Codec ID                                 : A_EAC3
Duration                                 : 51 min 16 s
Bit rate mode                            : Constant
Bit rate                                 : 448 kb/s
Channel(s)                               : 15 objects / 6 channels
Channel positions                        : 15 objects / Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 kHz
Frame rate                               : 187.500 FPS (256 SPF)
Compression mode                         : Lossy
Stream size                              : 164 MiB (5%)
Language                                 : German
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No

Exact same issue, with the Media Info on the Dark Series.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.