Merge pull request #4084 from BaronGreenback/PlayTo-url-corruption-fix

Unstable: PlayTo corruption url fix
This commit is contained in:
Bond-009 2020-09-10 15:35:06 +00:00 committed by GitHub
commit 18fe328979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,25 +130,21 @@ namespace Emby.Dlna.PlayTo
} }
} }
private string GetUuid(string usn) private static string GetUuid(string usn)
{ {
var found = false; const string UuidStr = "uuid:";
var index = usn.IndexOf("uuid:", StringComparison.OrdinalIgnoreCase); const string UuidColonStr = "::";
var index = usn.IndexOf(UuidStr, StringComparison.OrdinalIgnoreCase);
if (index != -1) if (index != -1)
{ {
usn = usn.Substring(index); return usn.Substring(index + UuidStr.Length);
found = true;
} }
index = usn.IndexOf("::", StringComparison.OrdinalIgnoreCase); index = usn.IndexOf(UuidColonStr, StringComparison.OrdinalIgnoreCase);
if (index != -1) if (index != -1)
{ {
usn = usn.Substring(0, index); usn = usn.Substring(0, index + UuidColonStr.Length);
}
if (found)
{
return usn;
} }
return usn.GetMD5().ToString("N", CultureInfo.InvariantCulture); return usn.GetMD5().ToString("N", CultureInfo.InvariantCulture);