Updated readme + sanitize subtitle file names before matching, ref #699
This commit is contained in:
@@ -73,7 +73,7 @@ namespace lms::scanner
|
||||
{
|
||||
db::Image::FindParameters params;
|
||||
params.setDirectory(directory->getId());
|
||||
params.setFileStem(fileStem);
|
||||
params.setFileStem(fileStem); // no need to sanitize here, user is responsible for providing sanitized file stems in conf file
|
||||
|
||||
db::Image::find(session, params, [&](const db::Image::pointer foundImg) {
|
||||
if (!image)
|
||||
@@ -135,13 +135,11 @@ namespace lms::scanner
|
||||
{
|
||||
// Expect layout like this:
|
||||
// ReleaseArtist/Release/Tracks'
|
||||
// /artist.jpg
|
||||
// /someOtherUserConfiguredArtistFile.jpg
|
||||
// /someUserConfiguredArtistFile.jpg
|
||||
//
|
||||
// Or:
|
||||
// ReleaseArtist/SomeGrouping/Release/Tracks'
|
||||
// /artist.jpg
|
||||
// /someOtherUserConfiguredArtistFile.jpg
|
||||
// /someUserConfiguredArtistFile.jpg
|
||||
//
|
||||
std::filesystem::path directoryToInspect{ core::pathUtils::getLongestCommonPath(std::cbegin(releasePaths), std::cend(releasePaths)) };
|
||||
while (true)
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "core/IConfig.hpp"
|
||||
#include "core/IJob.hpp"
|
||||
#include "core/ILogger.hpp"
|
||||
#include "core/Path.hpp"
|
||||
#include "database/IDb.hpp"
|
||||
#include "database/Session.hpp"
|
||||
#include "database/Types.hpp"
|
||||
@@ -105,8 +106,11 @@ namespace lms::scanner
|
||||
if (image)
|
||||
return;
|
||||
|
||||
if (const std::string_view mediumName{ medium->getName() }; !mediumName.empty())
|
||||
image = findImageInDirectory(session, directory, std::span{ &mediumName, 1 });
|
||||
if (const std::string mediumName{ core::pathUtils::sanitizeFileStem(medium->getName()) }; !mediumName.empty())
|
||||
{
|
||||
std::string_view mediumNameView{ mediumName };
|
||||
image = findImageInDirectory(session, directory, std::span{ &mediumNameView, 1 });
|
||||
}
|
||||
|
||||
if (!image)
|
||||
image = findImageInDirectory(session, directory, searchParams.mediumFileNames);
|
||||
|
||||
Reference in New Issue
Block a user