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

parser: Task: Remove Error status

There's no clear distinction with Fatal status for now
parent 241c8d3f
......@@ -121,10 +121,10 @@ parser::Task::Status MetadataParser::run( parser::Task& task )
auto t = m_ml->getConn()->newTransaction();
if ( media->save() == false )
return parser::Task::Status::Error;
return parser::Task::Status::Fatal;
task.file->markStepCompleted( File::ParserStep::MetadataAnalysis );
if ( task.file->saveParserStep() == false )
return parser::Task::Status::Error;
return parser::Task::Status::Fatal;
t->commit();
m_notifier->notifyMediaCreation( media );
return parser::Task::Status::Success;
......
......@@ -163,7 +163,7 @@ parser::Task::Status VLCThumbnailer::startPlayback( parser::Task& task, VLC::Med
// We still return an error since we don't want to attempt the thumbnail generation for a
// file without video tracks
}
return parser::Task::Status::Error;
return parser::Task::Status::Fatal;
}
parser::Task::Status VLCThumbnailer::seekAhead( VLC::MediaPlayer& mp )
......@@ -182,7 +182,7 @@ parser::Task::Status VLCThumbnailer::seekAhead( VLC::MediaPlayer& mp )
// Since we're locking a mutex for each position changed, let's unregister ASAP
event->unregister();
if ( success == false )
return parser::Task::Status::Error;
return parser::Task::Status::Fatal;
return parser::Task::Status::Success;
}
......@@ -251,7 +251,7 @@ parser::Task::Status VLCThumbnailer::takeThumbnail( std::shared_ptr<Media> media
if ( success == false )
{
LOG_WARN( "Timed out while computing ", file->mrl(), " snapshot" );
return parser::Task::Status::Error;
return parser::Task::Status::Fatal;
}
}
mp.stop();
......@@ -275,10 +275,10 @@ parser::Task::Status VLCThumbnailer::compress( std::shared_ptr<Media> media, std
LOG_INFO( "Done generating ", file->mrl(), " thumbnail" );
auto t = m_ml->getConn()->newTransaction();
if ( media->save() == false )
return parser::Task::Status::Error;
return parser::Task::Status::Fatal;
file->markStepCompleted( File::ParserStep::Thumbnailer );
if ( file->saveParserStep() == false )
return parser::Task::Status::Error;
return parser::Task::Status::Fatal;
t->commit();
m_notifier->notifyMediaModification( media );
return parser::Task::Status::Success;
......
......@@ -45,9 +45,6 @@ struct Task
Unknown,
/// All good
Success,
/// Something failed, but it's not critical (For instance, no internet connection for a
/// module that uses an online database)
Error,
/// We can't compute this file for now (for instance the file was on a network drive which
/// isn't connected anymore)
TemporaryUnavailable,
......
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