Commit 1dcc35c5 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MetadataParser: Handle playlist refresh

Untested for now, as we need either a mock file with valid content for
unit testing, or to fiddle with the actual filesystem for functional tests
parent 678a89fe
Pipeline #3471 passed with stages
in 13 minutes and 34 seconds
...@@ -507,10 +507,22 @@ std::tuple<bool, bool> MetadataAnalyzer::refreshFile( IItem& item ) const ...@@ -507,10 +507,22 @@ std::tuple<bool, bool> MetadataAnalyzer::refreshFile( IItem& item ) const
{ {
case IFile::Type::Main: case IFile::Type::Main:
return refreshMedia( item ); return refreshMedia( item );
case IFile::Type::Playlist:
{
auto playlist = Playlist::fromFile( m_ml, file->id() );
if ( playlist == nullptr )
{
LOG_WARN( "Failed to find playlist associated to modified playlist file ",
item.mrl() );
return { false, false };
}
LOG_INFO( "Reloading playlist ", playlist->name(), " on ", item.mrl() );
Playlist::destroy( m_ml, playlist->id() );
return { true, true };
}
case IFile::Type::Part: case IFile::Type::Part:
case IFile::Type::Soundtrack: case IFile::Type::Soundtrack:
case IFile::Type::Subtitles: case IFile::Type::Subtitles:
case IFile::Type::Playlist:
case IFile::Type::Disc: case IFile::Type::Disc:
case IFile::Type::Unknown: case IFile::Type::Unknown:
break; break;
......
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