Commit 9e81d711 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

FsDiscoverer: Use folder MRL instead of entryPoint.

The folderMrl is expected to be sanitized, while the entrypoint is user
specified
parent 97fefd9a
...@@ -75,7 +75,7 @@ bool FsDiscoverer::discover( const std::string& entryPoint ) ...@@ -75,7 +75,7 @@ bool FsDiscoverer::discover( const std::string& entryPoint )
std::shared_ptr<fs::IDirectory> fsDir = m_fsFactory->createDirectory( entryPoint ); std::shared_ptr<fs::IDirectory> fsDir = m_fsFactory->createDirectory( entryPoint );
auto fsDirMrl = fsDir->mrl(); // Saving MRL now since we might need it after fsDir is moved auto fsDirMrl = fsDir->mrl(); // Saving MRL now since we might need it after fsDir is moved
auto f = Folder::fromMrl( m_ml, entryPoint ); auto f = Folder::fromMrl( m_ml, fsDirMrl );
// If the folder exists, we assume it will be handled by reload() // If the folder exists, we assume it will be handled by reload()
if ( f != nullptr ) if ( f != nullptr )
return true; return true;
...@@ -89,11 +89,11 @@ bool FsDiscoverer::discover( const std::string& entryPoint ) ...@@ -89,11 +89,11 @@ bool FsDiscoverer::discover( const std::string& entryPoint )
} }
catch ( std::system_error& ex ) catch ( std::system_error& ex )
{ {
LOG_WARN( entryPoint, " discovery aborted because of a filesystem error: ", ex.what() ); LOG_WARN( fsDirMrl, " discovery aborted because of a filesystem error: ", ex.what() );
} }
catch ( sqlite::errors::ConstraintViolation& ex ) catch ( sqlite::errors::ConstraintViolation& ex )
{ {
LOG_WARN( entryPoint, " discovery aborted (assuming blacklisted folder): ", ex.what() ); LOG_WARN( fsDirMrl, " discovery aborted (assuming blacklisted folder): ", ex.what() );
} }
catch ( DeviceRemovedException& ) catch ( DeviceRemovedException& )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment