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