Commit 5a02984c authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Parser: Let the individual parsers signal media modification

This makes more sense since we now notify of a media creation from the
2nd parser, so the previous notifications were likely to be no-ops from
the calling application
parent 68b4f3ea
......@@ -31,6 +31,7 @@
#include "logging/Logger.h"
#include "MediaLibrary.h"
#include "utils/VLCInstance.h"
#include "utils/ModificationsNotifier.h"
#ifdef HAVE_JPEG
#include "imagecompressors/JpegCompressor.h"
......@@ -249,6 +250,7 @@ parser::Task::Status VLCThumbnailer::compress( std::shared_ptr<Media> media, std
LOG_INFO( "Done generating ", file->mrl(), " thumbnail" );
if ( media->save() == false )
return parser::Task::Status::Error;
m_notifier->notifyMediaModification( media );
return parser::Task::Status::Success;
}
......
......@@ -31,7 +31,6 @@
#include "medialibrary/IMediaLibrary.h"
#include "Media.h"
#include "File.h"
#include "utils/ModificationsNotifier.h"
namespace medialibrary
{
......@@ -142,11 +141,6 @@ void Parser::done( std::unique_ptr<parser::Task> t, parser::Task::Status status
}
updateStats();
if ( status == parser::Task::Status::Success )
{
m_notifier->notifyMediaModification( t->media );
}
if ( serviceIdx == m_services.size() )
{
t->file->markParsed();
......
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