Merge pull request #4084 from BaronGreenback/PlayTo-url-corruption-fix
Unstable: PlayTo corruption url fix
This commit is contained in:
commit
18fe328979
|
@ -130,25 +130,21 @@ namespace Emby.Dlna.PlayTo
|
|||
}
|
||||
}
|
||||
|
||||
private string GetUuid(string usn)
|
||||
private static string GetUuid(string usn)
|
||||
{
|
||||
var found = false;
|
||||
var index = usn.IndexOf("uuid:", StringComparison.OrdinalIgnoreCase);
|
||||
const string UuidStr = "uuid:";
|
||||
const string UuidColonStr = "::";
|
||||
|
||||
var index = usn.IndexOf(UuidStr, StringComparison.OrdinalIgnoreCase);
|
||||
if (index != -1)
|
||||
{
|
||||
usn = usn.Substring(index);
|
||||
found = true;
|
||||
return usn.Substring(index + UuidStr.Length);
|
||||
}
|
||||
|
||||
index = usn.IndexOf("::", StringComparison.OrdinalIgnoreCase);
|
||||
index = usn.IndexOf(UuidColonStr, StringComparison.OrdinalIgnoreCase);
|
||||
if (index != -1)
|
||||
{
|
||||
usn = usn.Substring(0, index);
|
||||
}
|
||||
|
||||
if (found)
|
||||
{
|
||||
return usn;
|
||||
usn = usn.Substring(0, index + UuidColonStr.Length);
|
||||
}
|
||||
|
||||
return usn.GetMD5().ToString("N", CultureInfo.InvariantCulture);
|
||||
|
|
Loading…
Reference in New Issue
Block a user