1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-21 23:32:27 +00:00

Handle library path locations that are parent paths; Fix fallback library scan to remove artist relative path to prevent not finding new media

This commit is contained in:
Hossy 2024-08-06 15:00:35 -05:00 committed by Hossy
parent d2bd9b4849
commit 7778eec709

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using FluentValidation.Results;
@ -119,6 +120,17 @@ private void UpdateSections(Artist artist, List<PlexSection> sections, PlexServe
return;
}
if (location.Path.IsParentPath(mappedPath.FullPath))
{
var subfolderPath = location.Path.GetRelativePath(mappedPath.FullPath);
var newArtistRelativePath = Path.Combine(subfolderPath, artistRelativePath);
_logger.Debug("Updating matching section with parent location match, {0}", location.Path);
_logger.Debug("Prepending artist relative path with subfolder : {0} => {1}", artistRelativePath, newArtistRelativePath);
UpdateSectionPath(newArtistRelativePath, section, location, settings);
return;
}
}
}
@ -128,7 +140,8 @@ private void UpdateSections(Artist artist, List<PlexSection> sections, PlexServe
{
foreach (var location in section.Locations)
{
UpdateSectionPath(artistRelativePath, section, location, settings);
// Do not include artistRelativePath so we trigger a full library scan since we aren't sure where the files actually are!
UpdateSectionPath("", section, location, settings);
}
}
}