Commit 0ec84e4a authored by camilo higuita's avatar camilo higuita

rate now workign again

parent 8a7c4192
......@@ -229,3 +229,20 @@ bool TracksModel::fav(const int &index, const bool &value)
return false;
}
bool TracksModel::rate(const int &index, const int &value)
{
if(index >= this->list.size() || index < 0)
return false;
auto item = this->list[index];
if(this->db->rateTrack(item[FMH::MODEL_KEY::URL], value))
{
this->list[index][FMH::MODEL_KEY::RATE] = QString::number(value);
emit this->updateModel(index, {FMH::MODEL_KEY::RATE});
return true;
}
return false;
}
......@@ -59,6 +59,7 @@ public slots:
void clear();
bool color(const int &index, const QString &color);
bool fav(const int &index, const bool &value);
bool rate(const int &index, const int &value);
};
#endif // TRACKSMODEL_H
......@@ -230,14 +230,12 @@ BabeList
onRateClicked:
{
var value = H.rateIt(paths, rate)
listView.currentItem.rate(H.setStars(value))
listView.model.get(listView.currentIndex).rate = value
list.rate(listView.currentIndex, rate);
}
onColorClicked:
{
list.color(listView.currentIndex, color);
list.color(listView.currentIndex, color);
}
}
......
......@@ -196,7 +196,6 @@ Maui.Menu
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment