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 setCopyrightURL(const std::string& copyrightURL) { _copyrightURL = std::string(copyrightURL, 0, _maxCopyrightURLLength); }
|
||||||
void setArtist(Wt::Dbo::ptr<Artist> artist) { _artist = artist; }
|
void setArtist(Wt::Dbo::ptr<Artist> artist) { _artist = artist; }
|
||||||
void setRelease(Wt::Dbo::ptr<Release> release) { _release = release; }
|
void setRelease(Wt::Dbo::ptr<Release> release) { _release = release; }
|
||||||
|
void eraseClusters() { _clusters.clear(); }
|
||||||
|
|
||||||
std::size_t getScanVersion() const { return _scanVersion; }
|
std::size_t getScanVersion() const { return _scanVersion; }
|
||||||
boost::optional<std::size_t> getTrackNumber() const;
|
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() << "'";
|
LMS_LOG(DBUPDATER, INFO) << "Updating '" << file.string() << "'";
|
||||||
|
|
||||||
// Remove the songs from its clusters
|
// Remove the songs from its clusters
|
||||||
for (auto cluster : track->getClusters())
|
track.modify()->eraseClusters();
|
||||||
cluster.remove();
|
|
||||||
|
|
||||||
stats.updates++;
|
stats.updates++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
MetaData::TagLibParser parser;
|
MetaData::TagLibParser parser;
|
||||||
|
|
||||||
|
parser.setClusterTypeNames( {"MOOD", "GENRE"} );
|
||||||
|
|
||||||
boost::optional<MetaData::Items> items = parser.parse(argv[1], true);
|
boost::optional<MetaData::Items> items = parser.parse(argv[1], true);
|
||||||
if (!items)
|
if (!items)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user