Remove orphaned cluster types
This commit is contained in:
@@ -725,6 +725,7 @@ MediaScanner::checkAudioFiles( Stats& stats )
|
||||
{
|
||||
Wt::Dbo::Transaction transaction(_db.getSession());
|
||||
|
||||
// TODO better query for this
|
||||
// Now process orphan Cluster (no track)
|
||||
auto clusters = Cluster::getAll(_db.getSession());
|
||||
for (auto cluster : clusters)
|
||||
@@ -735,6 +736,14 @@ MediaScanner::checkAudioFiles( Stats& stats )
|
||||
cluster.remove();
|
||||
}
|
||||
}
|
||||
|
||||
// Now process orphan cluster types
|
||||
auto clusterTypes = ClusterType::getAllOrphans(_db.getSession());
|
||||
for (auto clusterType : clusterTypes)
|
||||
{
|
||||
LMS_LOG(DBUPDATER, DEBUG) << "Removing orphan cluster type '" << clusterType->getName() << "'";
|
||||
clusterType.remove();
|
||||
}
|
||||
}
|
||||
|
||||
LMS_LOG(DBUPDATER, DEBUG) << "Checking artists...";
|
||||
|
||||
Reference in New Issue
Block a user