try/catch around tag reading, and also disable the multi-threaded indexing

for now.
This commit is contained in:
casey langen 2016-11-01 21:42:36 -07:00
parent 472e3ef2a8
commit ae6775fc21

View File

@ -52,7 +52,7 @@
#include <boost/thread/xtime.hpp>
#include <boost/bind.hpp>
#define MULTI_THREADED_INDEXER 1
#define MULTI_THREADED_INDEXER 0
#define STRESS_TEST_DB 0
static const std::string TAG = "Indexer";
@ -233,12 +233,19 @@ void Indexer::ReadMetadataFromFile(
typedef MetadataReaderList::iterator Iterator;
Iterator it = this->metadataReaders.begin();
while (it != this->metadataReaders.end()) {
if ((*it)->CanRead(track.GetValue("extension").c_str())) {
if ((*it)->Read(file.string().c_str(), &track)) {
saveToDb = true;
break;
try {
if ((*it)->CanRead(track.GetValue("extension").c_str())) {
if ((*it)->Read(file.string().c_str(), &track)) {
saveToDb = true;
break;
}
}
}
catch (...) {
/* sometimes people have files with crazy tags that cause the
tag reader to throw fits. not a lot we can do. just move on. */
}
it++;
}