db/simple: purge songs for unavailable decoder plugins on update

This commit is contained in:
Max Kellermann
2020-10-28 14:24:44 +01:00
parent bf97d13d0b
commit bbfa6fe632
5 changed files with 34 additions and 2 deletions

View File

@@ -23,6 +23,7 @@
#include "db/plugins/simple/Directory.hxx"
#include "storage/StorageInterface.hxx"
#include "storage/FileInfo.hxx"
#include "decoder/DecoderList.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/FileInfo.hxx"
#include "tag/Builder.hxx"
@@ -40,6 +41,14 @@
#ifdef ENABLE_DATABASE
bool
Song::IsPluginAvailable() const noexcept
{
const char *suffix = GetFilenameSuffix();
return suffix != nullptr &&
decoder_plugins_supports_suffix(suffix);
}
SongPtr
Song::LoadFile(Storage &storage, const char *path_utf8, Directory &parent)
{