Commit ada6b380 authored by Camilo Higuita's avatar Camilo Higuita

more work on playlist and searchview

parent caadd30f
......@@ -628,7 +628,7 @@ QVariantList CollectionDB::getSearchedTracks(const KEY &where, const QString &se
QString queryTxt;
if(where == KEY::PLAYED || where == KEY::STARS || where == KEY::BABE)
queryTxt = QString("SELECT * FROM %1 WHERE %2 = \"%3\"").arg(TABLEMAP[TABLE::TRACKS],
queryTxt = QString("SELECT t.*, al.artwork FROM %1 t inner join albums al on al.album = t.album and t.artist = al.artist WHERE %2 = \"%3\"").arg(TABLEMAP[TABLE::TRACKS],
KEYMAP[where],
search);
else if(where == KEY::WIKI)
......@@ -668,7 +668,7 @@ QVariantList CollectionDB::getSearchedTracks(const KEY &where, const QString &se
TABLEMAP[TABLE::ARTISTS_TAGS]);
else
queryTxt = QString("SELECT * FROM %1 WHERE %2 LIKE \"%%3%\"").arg(TABLEMAP[TABLE::TRACKS],
queryTxt = QString("SELECT t.*, al.artwork FROM %1 t inner join albums al on al.album = t.album and t.artist = al.artist WHERE %2 LIKE \"%%3%\"").arg(TABLEMAP[TABLE::TRACKS],
KEYMAP[where],
search);
......
......@@ -8,7 +8,7 @@ Text
property int iconSize
property string icon
readonly property string defaultColor : iconColor
text: MdiFont.Babe[babeIcon.icon] || MdiFont.Icon[babeIcon.icon]
text: MdiFont.Babe[babeIcon.icon]
font.family: "Material Design Icons"
font.pixelSize: babeIcon.iconSize
anchors.centerIn: parent
......
......@@ -146,7 +146,7 @@ ItemDelegate
{
anchors.fill: parent
rows:2
columns:3
columns: sameAlbum ? 4 : 3
Label
{
......@@ -182,7 +182,6 @@ ItemDelegate
text: title
font.bold: !sameAlbum
elide: Text.ElideRight
visible: true
font.pointSize: 10
color: textColor
......@@ -237,7 +236,7 @@ ItemDelegate
Layout.fillWidth: true
Layout.fillHeight: true
Layout.row: 1
Layout.column: 3
Layout.column: trackDurationVisible && sameAlbum ? 4 : 3
horizontalAlignment: Qt.AlignRight
verticalAlignment: Qt.AlignVCenter
text: player.transformTime(duration)
......@@ -253,11 +252,12 @@ ItemDelegate
visible: trackRatingVisible
Layout.fillWidth: true
Layout.fillHeight: true
Layout.row: 2
Layout.row: trackRatingVisible && sameAlbum ? 1 : 2
Layout.column: 3
horizontalAlignment: Qt.AlignRight
verticalAlignment: Qt.AlignVCenter
text: stars
font.family: "Material Design Icons"
text: setStars(stars)
font.bold: false
elide: Text.ElideRight
font.pointSize: 8
......@@ -285,26 +285,31 @@ ItemDelegate
function setStars(stars)
{
switch (parseInt(stars))
switch (stars)
{
case "0":
case 0:
return " ";
case "1":
case 1:
return "\xe2\x98\x86 ";
return "\uf4CE";
case "2":
case 2:
return "\xe2\x98\x86 \xe2\x98\x86 ";
return "\uf4CE \uf4CE";
case "3":
case 3:
return "\xe2\x98\x86 \xe2\x98\x86 \xe2\x98\x86 ";
return "\uf4CE \uf4CE \uf4CE";
case "4":
case 4:
return "\xe2\x98\x86 \xe2\x98\x86 \xe2\x98\x86 \xe2\x98\x86 ";
return "\uf4CE \uf4CE \uf4CE \uf4CE";
case "5":
case 5:
return "\xe2\x98\x86 \xe2\x98\x86 \xe2\x98\x86 \xe2\x98\x86 \xe2\x98\x86 ";
return "\uf4CE \uf4CE \uf4CE \uf4CE \uf4CE";
default: return "error";
}
......
......@@ -32,7 +32,7 @@ Menu
rate = rank
if(bae.rateTrack(list.model.get(list.currentIndex).url, rate))
{
list.currentItem.trackRating.text = rate
list.currentItem.trackRating.text = list.currentItem.setStars(rate)
list.model.get(list.currentIndex).stars = rate
}
if(!root.isMobile)
......
......@@ -27,7 +27,7 @@ Kirigami.PageRow
separatorVisible: wideMode
initialPage:[playlistList, playlistViewDrawer]
defaultColumnWidth: Kirigami.Units.gridUnit * 15
interactive: false
interactive: false
Page
{
id: playlistList
......@@ -97,8 +97,8 @@ interactive: false
height: parent.height
quickPlayVisible: true
coverArtVisible: true
// trackRating: true
// trackDuration: true
trackRating: true
trackDuration: false
headerBar: true
headerClose: !playlistViewRoot.wideMode
headerTitle: playlistViewRoot.wideMode ? "" : playlistViewModel.model.get(playlistViewModel.currentIndex).playlist
......
......@@ -11,6 +11,8 @@ BabeTable
headerClose: true
holder.message: "No search results!"
coverArtVisible: true
trackDuration: true
trackRating: true
function populate(tracks)
{
searchTable.clearTable()
......
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