Commit 9827bbb8 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MediaLibrary: Allow startParser to return an error

parent 59976140
......@@ -327,7 +327,8 @@ bool MediaLibrary::start()
for ( auto& fsFactory : m_fsFactories )
refreshDevices( *fsFactory );
startDiscoverer();
startParser();
if ( startParser() == false )
return false;
startThumbnailer();
return true;
}
......@@ -710,7 +711,7 @@ SearchAggregate MediaLibrary::search( const std::string& pattern,
return res;
}
void MediaLibrary::startParser()
bool MediaLibrary::startParser()
{
m_parser.reset( new parser::Parser( this ) );
......@@ -725,6 +726,7 @@ void MediaLibrary::startParser()
}
m_parser->addService( std::make_shared<parser::MetadataAnalyzer>() );
m_parser->start();
return true;
}
void MediaLibrary::startDiscoverer()
......
......@@ -178,7 +178,7 @@ class MediaLibrary : public IMediaLibrary, public IDeviceListerCb
static const size_t NbSupportedExtensions;
protected:
virtual void startParser();
virtual bool startParser();
virtual void startDiscoverer();
virtual void startDeletionNotifier();
virtual void startThumbnailer();
......
......@@ -38,7 +38,7 @@ class MediaLibraryTester : public MediaLibrary
{
public:
MediaLibraryTester();
virtual void startParser() override {}
virtual bool startParser() override { return true; }
virtual void startDiscoverer() override {}
virtual void startDeletionNotifier() override {}
std::vector<MediaPtr> files();
......
......@@ -563,7 +563,8 @@ void ResumeTests::MediaLibraryResumeTest::forceParserStart()
MediaLibrary::startParser();
}
void ResumeTests::MediaLibraryResumeTest::startParser()
bool ResumeTests::MediaLibraryResumeTest::startParser()
{
return true;
}
......@@ -108,7 +108,7 @@ public:
public:
void forceParserStart();
protected:
virtual void startParser() override;
virtual bool startParser() override;
};
virtual void InitializeMediaLibrary() override;
......
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