allow trailing slash in plex path replacement (#108)

* add test for unc path replacement

* allow trailing slash in plex path replacement
This commit is contained in:
Jason Dove
2021-03-28 11:32:32 +00:00
committed by GitHub
parent 9ba6686c44
commit a5e1cc7c3d
2 changed files with 66 additions and 1 deletions
@@ -36,7 +36,8 @@ namespace ErsatzTV.Core.Plex
r =>
{
string separatorChar = IsWindows(r.PlexMediaSource) ? @"\" : @"/";
return path.StartsWith(r.PlexPath + separatorChar);
string prefix = r.PlexPath.EndsWith(separatorChar) ? r.PlexPath : r.PlexPath + separatorChar;
return path.StartsWith(prefix);
});
return maybeReplacement.Match(
replacement =>