Fixed: Ensure trailing slash is removed from drive letters when updating Plex Media Server

Closes #8414
This commit is contained in:
Mark McDowall 2026-02-16 09:18:21 -08:00
parent b94cf9b3b9
commit d8698d1c28

View file

@ -141,8 +141,9 @@ private void UpdateSectionPath(string seriesRelativePath, PlexSection section, P
var separator = location.Path.Contains('\\') ? "\\" : "/";
var locationRelativePath = seriesRelativePath.Replace("\\", separator).Replace("/", separator);
// Plex location paths trim trailing extraneous separator characters, so it doesn't need to be trimmed
var pathToUpdate = $"{location.Path}{separator}{locationRelativePath}";
// Plex location paths trim trailing extraneous separator characters,
// unless it's a Windows drive letter (S:\) that needs to be trimmed.
var pathToUpdate = $"{location.Path.TrimEnd(separator)}{separator}{locationRelativePath}";
_logger.Debug("Updating section location, {0}", location.Path);
_plexServerProxy.Update(section.Id, pathToUpdate, settings);