Fixed bad cluster scan on track update
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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++;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
MetaData::TagLibParser parser;
|
||||
|
||||
parser.setClusterTypeNames( {"MOOD", "GENRE"} );
|
||||
|
||||
boost::optional<MetaData::Items> items = parser.parse(argv[1], true);
|
||||
if (!items)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user