diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2020-09-08 07:53:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-08 07:53:53 +0100 |
| commit | 544db8cc064f445ff58cd6f43610940164cb84fa (patch) | |
| tree | 4f179f8989b56dd687c256d3040542819a313d5d | |
| parent | ed9021f40b19dddc3029bf263c337a9d3fb0ab2c (diff) | |
Update PlayToManager.cs
made code more readable.
| -rw-r--r-- | Emby.Dlna/PlayTo/PlayToManager.cs | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/Emby.Dlna/PlayTo/PlayToManager.cs b/Emby.Dlna/PlayTo/PlayToManager.cs index 9b242c2c4..182836c2b 100644 --- a/Emby.Dlna/PlayTo/PlayToManager.cs +++ b/Emby.Dlna/PlayTo/PlayToManager.cs @@ -132,23 +132,19 @@ namespace Emby.Dlna.PlayTo 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 + 5); - 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 + 2); - } - - if (found) - { - return usn; + usn = usn.Substring(0, index + uuidColonStr.Length); } return usn.GetMD5().ToString("N", CultureInfo.InvariantCulture); |
