Commit aa2e48aa authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

IParserService: use the step stored in DB to compute completion

parent 1f3d0b95
......@@ -876,12 +876,6 @@ void MetadataParser::onRestarted()
cacheUnknownArtist();
}
bool MetadataParser::isCompleted( const parser::Task& task ) const
{
// We always need to run this task if the metadata extraction isn't completed
return task.isStepCompleted( parser::Task::ParserStep::MetadataAnalysis );
}
parser::Task::ParserStep MetadataParser::targetedStep() const
{
return parser::Task::ParserStep::MetadataAnalysis;
......
......@@ -43,7 +43,6 @@ protected:
virtual uint8_t nbThreads() const override;
virtual void onFlushing() override;
virtual void onRestarted() override;
virtual bool isCompleted( const parser::Task& task ) const override;
virtual parser::Task::ParserStep targetedStep() const override;
bool addPlaylistMedias( parser::Task::Item& item ) const;
......
......@@ -102,12 +102,6 @@ uint8_t VLCMetadataService::nbThreads() const
return 1;
}
bool VLCMetadataService::isCompleted( const parser::Task& ) const
{
// We always need to run this task if the metadata extraction isn't completed
return false;
}
void VLCMetadataService::onFlushing()
{
}
......
......@@ -46,7 +46,6 @@ private:
virtual parser::Task::Status run( parser::Task::Item& item ) override;
virtual const char* name() const override;
virtual uint8_t nbThreads() const override;
virtual bool isCompleted( const parser::Task& task ) const override;
virtual void onFlushing() override;
virtual void onRestarted() override;
virtual parser::Task::ParserStep targetedStep() const override;
......
......@@ -51,12 +51,6 @@ public:
* responsibility.
*/
virtual uint8_t nbThreads() const = 0;
/**
* @brief isCompleted Probes a task for completion with regard to this service.
* @param task The task probed for completion
* @return true if the task is completed, false otherwise.
*/
virtual bool isCompleted( const parser::Task& task ) const = 0;
/**
* @brief targetedStep Returns the ParserStep targeted by this service.
......
......@@ -163,7 +163,7 @@ void ParserWorker::mainloop()
task = std::move( m_tasks.front() );
m_tasks.pop();
}
if ( m_service->isCompleted( *task ) == true )
if ( task->isStepCompleted( m_service->targetedStep() ) == true )
{
LOG_INFO( "Skipping completed task [", serviceName, "] on ", task->item().mrl() );
m_parserCb->done( std::move( task ), parser::Task::Status::Success );
......
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