Merge pull request #2266 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-11-02 13:09:35 -04:00 committed by GitHub
commit 86d786e4b0
10 changed files with 76 additions and 21 deletions

View File

@ -906,8 +906,10 @@ namespace MediaBrowser.LocalMetadata.Parsers
private void FetchFromTaglinesNode(XmlReader reader, T item) private void FetchFromTaglinesNode(XmlReader reader, T item)
{ {
reader.MoveToContent(); reader.MoveToContent();
reader.Read();
while (reader.Read()) // Loop through each element
while (!reader.EOF)
{ {
if (reader.NodeType == XmlNodeType.Element) if (reader.NodeType == XmlNodeType.Element)
{ {
@ -923,12 +925,15 @@ namespace MediaBrowser.LocalMetadata.Parsers
} }
break; break;
} }
default: default:
reader.Skip(); reader.Skip();
break; break;
} }
} }
else
{
reader.Read();
}
} }
} }

View File

@ -718,8 +718,10 @@ namespace MediaBrowser.LocalMetadata.Savers
return; return;
} }
reader.Read();
// Loop through each element // Loop through each element
while (reader.Read()) while (!reader.EOF)
{ {
if (reader.NodeType == XmlNodeType.Element) if (reader.NodeType == XmlNodeType.Element)
{ {
@ -734,6 +736,10 @@ namespace MediaBrowser.LocalMetadata.Savers
reader.Skip(); reader.Skip();
} }
} }
else
{
reader.Read();
}
} }
} }
} }

View File

@ -915,7 +915,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
var mapArg = imageStreamIndex.HasValue ? (" -map 0:v:" + imageStreamIndex.Value.ToString(CultureInfo.InvariantCulture)) : string.Empty; var mapArg = imageStreamIndex.HasValue ? (" -map 0:v:" + imageStreamIndex.Value.ToString(CultureInfo.InvariantCulture)) : string.Empty;
var enableThumbnail = !new List<string> { "wtv" }.Contains(container ?? string.Empty, StringComparer.OrdinalIgnoreCase); var enableThumbnail = !new List<string> { "wtv" }.Contains(container ?? string.Empty, StringComparer.OrdinalIgnoreCase);
var thumbnail = enableThumbnail ? ",thumbnail=30" : string.Empty; var thumbnail = enableThumbnail ? ",thumbnail=24" : string.Empty;
// Use ffmpeg to sample 100 (we can drop this if required using thumbnail=50 for 50 frames) frames and pick the best thumbnail. Have a fall back just in case. // Use ffmpeg to sample 100 (we can drop this if required using thumbnail=50 for 50 frames) frames and pick the best thumbnail. Have a fall back just in case.
var args = useIFrame ? string.Format("-i {0}{3} -threads 0 -v quiet -vframes 1 -vf \"{2}{4}\" -f image2 \"{1}\"", inputPath, tempExtractPath, vf, mapArg, thumbnail) : var args = useIFrame ? string.Format("-i {0}{3} -threads 0 -v quiet -vframes 1 -vf \"{2}{4}\" -f image2 \"{1}\"", inputPath, tempExtractPath, vf, mapArg, thumbnail) :

View File

@ -200,9 +200,10 @@ namespace MediaBrowser.MediaEncoding.Probing
using (var reader = XmlReader.Create(streamReader)) using (var reader = XmlReader.Create(streamReader))
{ {
reader.MoveToContent(); reader.MoveToContent();
reader.Read();
// Loop through each element // Loop through each element
while (reader.Read()) while (!reader.EOF)
{ {
if (reader.NodeType == XmlNodeType.Element) if (reader.NodeType == XmlNodeType.Element)
{ {
@ -219,6 +220,10 @@ namespace MediaBrowser.MediaEncoding.Probing
break; break;
} }
} }
else
{
reader.Read();
}
} }
} }
} }
@ -227,13 +232,14 @@ namespace MediaBrowser.MediaEncoding.Probing
private void ReadFromDictNode(XmlReader reader, MediaInfo info) private void ReadFromDictNode(XmlReader reader, MediaInfo info)
{ {
reader.MoveToContent();
string currentKey = null; string currentKey = null;
List<NameValuePair> pairs = new List<NameValuePair>(); List<NameValuePair> pairs = new List<NameValuePair>();
reader.MoveToContent();
reader.Read();
// Loop through each element // Loop through each element
while (reader.Read()) while (!reader.EOF)
{ {
if (reader.NodeType == XmlNodeType.Element) if (reader.NodeType == XmlNodeType.Element)
{ {
@ -272,17 +278,23 @@ namespace MediaBrowser.MediaEncoding.Probing
break; break;
} }
} }
else
{
reader.Read();
}
} }
} }
private List<NameValuePair> ReadValueArray(XmlReader reader) private List<NameValuePair> ReadValueArray(XmlReader reader)
{ {
reader.MoveToContent();
List<NameValuePair> pairs = new List<NameValuePair>(); List<NameValuePair> pairs = new List<NameValuePair>();
reader.MoveToContent();
reader.Read();
// Loop through each element // Loop through each element
while (reader.Read()) while (!reader.EOF)
{ {
if (reader.NodeType == XmlNodeType.Element) if (reader.NodeType == XmlNodeType.Element)
{ {
@ -303,6 +315,10 @@ namespace MediaBrowser.MediaEncoding.Probing
break; break;
} }
} }
else
{
reader.Read();
}
} }
return pairs; return pairs;
@ -360,13 +376,14 @@ namespace MediaBrowser.MediaEncoding.Probing
private NameValuePair GetNameValuePair(XmlReader reader) private NameValuePair GetNameValuePair(XmlReader reader)
{ {
reader.MoveToContent();
string name = null; string name = null;
string value = null; string value = null;
reader.MoveToContent();
reader.Read();
// Loop through each element // Loop through each element
while (reader.Read()) while (!reader.EOF)
{ {
if (reader.NodeType == XmlNodeType.Element) if (reader.NodeType == XmlNodeType.Element)
{ {
@ -383,6 +400,10 @@ namespace MediaBrowser.MediaEncoding.Probing
break; break;
} }
} }
else
{
reader.Read();
}
} }
if (string.IsNullOrWhiteSpace(name) || if (string.IsNullOrWhiteSpace(name) ||

View File

@ -265,6 +265,7 @@ namespace MediaBrowser.Providers.Music
var list = new List<ReleaseResult>(); var list = new List<ReleaseResult>();
reader.MoveToContent(); reader.MoveToContent();
reader.Read();
// Loop through each element // Loop through each element
while (!reader.EOF) while (!reader.EOF)
@ -302,6 +303,7 @@ namespace MediaBrowser.Providers.Music
var list = new List<ReleaseResult>(); var list = new List<ReleaseResult>();
reader.MoveToContent(); reader.MoveToContent();
reader.Read();
// Loop through each element // Loop through each element
while (!reader.EOF) while (!reader.EOF)
@ -348,7 +350,6 @@ namespace MediaBrowser.Providers.Music
}; };
reader.MoveToContent(); reader.MoveToContent();
reader.Read(); reader.Read();
// http://stackoverflow.com/questions/2299632/why-does-xmlreader-skip-every-other-element-if-there-is-no-whitespace-separator // http://stackoverflow.com/questions/2299632/why-does-xmlreader-skip-every-other-element-if-there-is-no-whitespace-separator
@ -428,6 +429,7 @@ namespace MediaBrowser.Providers.Music
using (var reader = XmlReader.Create(oReader, settings)) using (var reader = XmlReader.Create(oReader, settings))
{ {
reader.MoveToContent(); reader.MoveToContent();
reader.Read();
// Loop through each element // Loop through each element
while (!reader.EOF) while (!reader.EOF)
@ -464,6 +466,7 @@ namespace MediaBrowser.Providers.Music
private string GetFirstReleaseGroupId(XmlReader reader) private string GetFirstReleaseGroupId(XmlReader reader)
{ {
reader.MoveToContent(); reader.MoveToContent();
reader.Read();
// Loop through each element // Loop through each element
while (!reader.EOF) while (!reader.EOF)

View File

@ -86,6 +86,7 @@ namespace MediaBrowser.Providers.Music
using (var reader = XmlReader.Create(oReader, settings)) using (var reader = XmlReader.Create(oReader, settings))
{ {
reader.MoveToContent(); reader.MoveToContent();
reader.Read();
// Loop through each element // Loop through each element
while (!reader.EOF) while (!reader.EOF)
@ -124,6 +125,7 @@ namespace MediaBrowser.Providers.Music
var list = new List<RemoteSearchResult>(); var list = new List<RemoteSearchResult>();
reader.MoveToContent(); reader.MoveToContent();
reader.Read();
// Loop through each element // Loop through each element
while (!reader.EOF) while (!reader.EOF)

View File

@ -195,9 +195,10 @@ namespace MediaBrowser.Providers.TV
using (var reader = XmlReader.Create(streamReader, settings)) using (var reader = XmlReader.Create(streamReader, settings))
{ {
reader.MoveToContent(); reader.MoveToContent();
reader.Read();
// Loop through each element // Loop through each element
while (reader.Read()) while (!reader.EOF)
{ {
if (reader.NodeType == XmlNodeType.Element) if (reader.NodeType == XmlNodeType.Element)
{ {
@ -212,6 +213,10 @@ namespace MediaBrowser.Providers.TV
break; break;
} }
} }
else
{
reader.Read();
}
} }
} }
} }
@ -266,9 +271,10 @@ namespace MediaBrowser.Providers.TV
using (var reader = XmlReader.Create(streamReader, settings)) using (var reader = XmlReader.Create(streamReader, settings))
{ {
reader.MoveToContent(); reader.MoveToContent();
reader.Read();
// Loop through each element // Loop through each element
while (reader.Read()) while (!reader.EOF)
{ {
if (reader.NodeType == XmlNodeType.Element) if (reader.NodeType == XmlNodeType.Element)
{ {
@ -290,6 +296,10 @@ namespace MediaBrowser.Providers.TV
break; break;
} }
} }
else
{
reader.Read();
}
} }
} }
} }

View File

@ -334,9 +334,10 @@ namespace MediaBrowser.Providers.TV
private string FindSeriesId(XmlReader reader) private string FindSeriesId(XmlReader reader)
{ {
reader.MoveToContent(); reader.MoveToContent();
reader.Read();
// Loop through each element // Loop through each element
while (reader.Read()) while (!reader.EOF)
{ {
if (reader.NodeType == XmlNodeType.Element) if (reader.NodeType == XmlNodeType.Element)
{ {
@ -359,6 +360,10 @@ namespace MediaBrowser.Providers.TV
break; break;
} }
} }
else
{
reader.Read();
}
} }
return null; return null;

View File

@ -71,9 +71,6 @@
<Reference Include="ServiceStack.Api.Swagger"> <Reference Include="ServiceStack.Api.Swagger">
<HintPath>..\ThirdParty\ServiceStack\ServiceStack.Api.Swagger.dll</HintPath> <HintPath>..\ThirdParty\ServiceStack\ServiceStack.Api.Swagger.dll</HintPath>
</Reference> </Reference>
<Reference Include="ServiceStack.Common">
<HintPath>..\ThirdParty\ServiceStack\ServiceStack.Common.dll</HintPath>
</Reference>
<Reference Include="SharpCompress, Version=0.10.3.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="SharpCompress, Version=0.10.3.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\ThirdParty\SharpCompress\SharpCompress.dll</HintPath> <HintPath>..\ThirdParty\SharpCompress\SharpCompress.dll</HintPath>

View File

@ -1057,8 +1057,10 @@ namespace MediaBrowser.XbmcMetadata.Savers
return; return;
} }
reader.Read();
// Loop through each element // Loop through each element
while (reader.Read()) while (!reader.EOF)
{ {
if (reader.NodeType == XmlNodeType.Element) if (reader.NodeType == XmlNodeType.Element)
{ {
@ -1073,6 +1075,10 @@ namespace MediaBrowser.XbmcMetadata.Savers
reader.Skip(); reader.Skip();
} }
} }
else
{
reader.Read();
}
} }
} }
} }