Fix a few narrowing conversions (#761)
* Fix narrowing conversion in album cover loader
* Fix narrowing conversions in discogs cover provider
* Fix narrowing conversions in spotify cover provider
* Add explicit conversion in moodbarbuilder
* Fix narrowing conversions in osd dbus
* Make WordyTimeNanosec use unsigned quint64
* Fix narrowing conversions in song
* Fix narrowing conversions in qobuz stream url request
* Make ConnectionInfo.msgLen use unsigned quint64
* Make AnalizerBase.timeout to signed int
* Fix narrowing conversions in album cover fetcher
* Make fht type be unsigned int
* Correct for type in blockanalizer and use std::fill where possible
* Revert "Fix narrowing conversions in song"
This reverts commit 3de291394d.
This commit is contained in:
@@ -75,7 +75,7 @@ AlbumCoverFetcherSearch::~AlbumCoverFetcherSearch() {
|
||||
void AlbumCoverFetcherSearch::TerminateSearch() {
|
||||
|
||||
QList<int> ids = pending_requests_.keys();
|
||||
for (const quint64 id : ids) {
|
||||
for (const int id : ids) {
|
||||
pending_requests_.take(id)->CancelSearch(id);
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ float AlbumCoverFetcherSearch::ScoreImage(const QSize size) {
|
||||
const float size_score = std::sqrt(float(size.width() * size.height())) / kTargetSize;
|
||||
|
||||
// A 1:1 image scores 1.0, anything else scores less
|
||||
const float aspect_score = float(1.0) - float(std::max(size.width(), size.height()) - std::min(size.width(), size.height())) / std::max(size.height(), size.width());
|
||||
const float aspect_score = float(1.0) - float(std::max(size.width(), size.height()) - std::min(size.width(), size.height())) / float(std::max(size.height(), size.width()));
|
||||
|
||||
return size_score + aspect_score;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user