Fixed bad cluster scan on track update

This commit is contained in:
emeric
2018-09-26 22:44:52 +02:00
parent ed7b461c81
commit 995be9470d
3 changed files with 4 additions and 2 deletions
+1
View File
@@ -95,6 +95,7 @@ class Track : public Wt::Dbo::Dbo<Track>
void setCopyrightURL(const std::string& copyrightURL) { _copyrightURL = std::string(copyrightURL, 0, _maxCopyrightURLLength); }
void setArtist(Wt::Dbo::ptr<Artist> artist) { _artist = artist; }
void setRelease(Wt::Dbo::ptr<Release> release) { _release = release; }
void eraseClusters() { _clusters.clear(); }
std::size_t getScanVersion() const { return _scanVersion; }
boost::optional<std::size_t> getTrackNumber() const;
+1 -2
View File
@@ -504,8 +504,7 @@ MediaScanner::scanAudioFile(const boost::filesystem::path& file, bool forceScan,
LMS_LOG(DBUPDATER, INFO) << "Updating '" << file.string() << "'";
// Remove the songs from its clusters
for (auto cluster : track->getClusters())
cluster.remove();
track.modify()->eraseClusters();
stats.updates++;
}