mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
Update PlayToManager.cs
made code more readable.
This commit is contained in:
parent
ed9021f40b
commit
544db8cc06
1 changed files with 7 additions and 11 deletions
|
@ -132,23 +132,19 @@ namespace Emby.Dlna.PlayTo
|
||||||
|
|
||||||
private static 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 + 5);
|
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 + 2);
|
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);
|
||||||
|
|
Loading…
Reference in a new issue