Merge pull request #5025 from BaronGreenback/DlnaFix

This commit is contained in:
Claus Vium 2021-01-18 14:24:35 +01:00 committed by GitHub
commit b9691e8712
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -96,6 +96,7 @@ namespace Emby.Dlna.Didl
using (StringWriter builder = new StringWriterWithEncoding(Encoding.UTF8))
{
// If this using are changed to single lines, then write.Flush needs to be appended before the return.
using (var writer = XmlWriter.Create(builder, settings))
{
// writer.WriteStartDocument();

View File

@ -896,16 +896,16 @@ namespace Emby.Dlna.PlayTo
var parts = url.Split('/');
for (var i = 0; i < parts.Length; i++)
for (var i = 0; i < parts.Length - 1; i++)
{
var part = parts[i];
if (string.Equals(part, "audio", StringComparison.OrdinalIgnoreCase) ||
string.Equals(part, "videos", StringComparison.OrdinalIgnoreCase))
{
if (parts.Length > i + 1)
if (Guid.TryParse(parts[i + 1], out var result))
{
return Guid.Parse(parts[i + 1]);
return result;
}
}
}