Commit 2dc572a8 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MediaLibrary: Fix first USB device plugging handling

parent 300b0ef1
......@@ -816,10 +816,6 @@ bool MediaLibrary::onDevicePlugged( const std::string& uuid, const std::string&
auto currentDevice = Device::fromUuid( this, uuid );
LOG_INFO( "Device ", uuid, " was plugged and mounted on ", mountpoint );
assert( currentDevice == nullptr || currentDevice->isPresent() == false );
// If we don't know the device yet, simply postpone the device creation to the first
// discovery/reload, and inform the caller that we didn't know this device yet.
if ( currentDevice == nullptr )
return true;
for ( const auto& fsFactory : m_fsFactories )
{
if ( fsFactory->isMrlSupported( "file://" ) )
......@@ -832,7 +828,7 @@ bool MediaLibrary::onDevicePlugged( const std::string& uuid, const std::string&
break;
}
}
return false;
return currentDevice == nullptr;
}
void MediaLibrary::onDeviceUnplugged( const std::string& uuid )
......
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