Bring more diversity in the radio mode. fixes #54

This commit is contained in:
emeric
2022-10-19 13:56:32 +02:00
parent b85553af34
commit c816b0db45
21 changed files with 750 additions and 104 deletions
+28
View File
@@ -520,5 +520,33 @@ Track::getClusterGroups(const std::vector<ClusterType::pointer>& clusterTypes, s
return res;
}
namespace Debug
{
std::ostream&
operator<<(std::ostream& os, const TrackInfo& trackInfo)
{
auto transaction {trackInfo.session.createSharedTransaction()};
const Track::pointer track {Track::find(trackInfo.session, trackInfo.trackId)};
if (track)
{
os << track->getName();
if (const Release::pointer release {track->getRelease()})
os << " [" << release->getName() << "]";
for (auto artist : track->getArtists({TrackArtistLinkType::Artist}))
os << " - " << artist->getName();
for (auto cluster : track->getClusters())
os << " {" + cluster->getType()->getName() << "-" << cluster->getName() << "}";
}
else
{
os << "*unknown*";
}
return os;
}
}
} // namespace Database