Try to migrate audio files in DB instead of deleting/creating entries. fixes #308

This commit is contained in:
emeric
2023-02-22 20:58:06 +01:00
parent 8a69d3e309
commit 492e2d4fc6
3 changed files with 46 additions and 26 deletions
@@ -78,7 +78,7 @@ namespace Scanner
if (_abortScan)
return;
if (!checkFile(trackPath.path, _settings.mediaDirectory))
if (!checkFile(trackPath.path))
tracksToRemove.push_back(trackPath.trackId);
context.currentStepStats.processedElems++;
@@ -166,7 +166,7 @@ namespace Scanner
}
bool
ScanStepRemoveOrphanDbFiles::checkFile(const std::filesystem::path& p, const std::filesystem::path& mediaDirectory)
ScanStepRemoveOrphanDbFiles::checkFile(const std::filesystem::path& p)
{
try
{
@@ -179,7 +179,7 @@ namespace Scanner
return false;
}
if (!PathUtils::isPathInRootPath(p, mediaDirectory, &excludeDirFileName))
if (!PathUtils::isPathInRootPath(p, _settings.mediaDirectory, &excludeDirFileName))
{
LMS_LOG(DBUPDATER, INFO) << "Removing '" << p.string() << "': out of media directory";
return false;