Merge lp:~danielholm/music-app/search into lp:music-app/trusty

Proposed by Daniel Holm
Status: Merged
Approved by: Daniel Holm
Approved revision: 345
Merged at revision: 346
Proposed branch: lp:~danielholm/music-app/search
Merge into: lp:music-app/trusty
Diff against target: 735 lines (+653/-4)
7 files modified
LibraryListModel.qml (+6/-0)
MusicSearch.qml (+441/-0)
MusicStart.qml (+20/-1)
MusicaddtoPlaylist.qml (+2/-2)
images/search.svg (+153/-0)
meta-database.js (+16/-0)
music-app.qml (+15/-1)
To merge this branch: bzr merge lp:~danielholm/music-app/search
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Daniel Holm Approve
Andrew Hayzen Approve
Victor Thompson Approve
Review via email: mp+204098@code.launchpad.net

Commit message

Search functionality.

Description of the change

Added a basic search functions that searches for tracks based on artist, album, title and genre. Displays them in a sheet just like in the Songs tab. Queries the meta-database.

To post a comment you must log in.
Revision history for this message
Daniel Holm (danielholm) wrote :

I know I have to fix the manifest.json file. I really have to get that one fixed.

Revision history for this message
Daniel Holm (danielholm) wrote :

Also the search button will go away later.

lp:~danielholm/music-app/search updated
339. By Daniel Holm

Restored manifest.json

Revision history for this message
Daniel Holm (danielholm) wrote :

Removed the search button and restored the manifest file. Give it a go so we can merge .)

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

There is currently no way of showing the search sheet?

When searching if you start typing a value and then clear the text, it attempts to show everything - maybe it should return no results?

review: Needs Fixing
Revision history for this message
Victor Thompson (vthompson) wrote :

I think we need a desktop shortcut in addition to the HUD action you added.

1. Fix HUD action to do show the search sheet.
2. Add a shortcut to show the sheet. I vote for "CTRL + F"
3. I think it makes sense to have the expander on the search results so you can easily add multiple tracks to the queue/playlist.
4. I think the search textfield should get autofocus when the sheet is made visible.

Revision history for this message
Victor Thompson (vthompson) :
review: Needs Fixing
Revision history for this message
Victor Thompson (vthompson) wrote :

I agree that when the text is cleared the results should be 0. Same if the user started typing and then deleted his/her search terms.

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

I can add the keyboard shortcut to my branch [1] if that is easier?

1 - https://code.launchpad.net/~andrew-hayzen/music-app/convergence-keyboard-shortcuts

Revision history for this message
Victor Thompson (vthompson) wrote :

That might be easier, but it'd need this branch to land first--which is possible because I believe you are currently blocked, Andrew. I wouldn't want to make this branch depend on your's, so I agree.

Revision history for this message
Daniel Holm (danielholm) wrote :

Hi, I'll take a look at it this evening again.

lp:~danielholm/music-app/search updated
340. By Daniel Holm

If no search term is entered, don't search at all.

341. By Daniel Holm

Commented out the dev search button.

Revision history for this message
Daniel Holm (danielholm) wrote :

Resolved that search is made when no search terms are entered. If this is a stopper I think we should merge and then add the expander in another branch, because I don't know when I will be able to add it.

lp:~danielholm/music-app/search updated
342. By Daniel Holm

HUD action Search now actually opens the search sheet.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

You need to add your "searchAction" to the list of actions in MainView called "actions" in order for it to work.

review: Needs Fixing
lp:~danielholm/music-app/search updated
343. By Daniel Holm

Added the HUD action to enable search action; added highlight on start for search field.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel Holm (danielholm) wrote :

Victor, I forgot about that. Added now, as well as highlight for the text field.

Revision history for this message
Victor Thompson (vthompson) wrote :

What does setting highlighted do? Does it force auto focus? If not do you plan on setting auto focus so the keyboard is automatically displayed when the sheet is shown? If not, this is probably good. I'll test in a few hours.

Revision history for this message
Victor Thompson (vthompson) wrote :

I approve. I'd prefer we auto focus the TextField, but I'm not going to require we do so now. Andrew, please chime in when you have time whether you think we should clear the results when no search terms exist. Currently, it just doesn't update the query to return every song--so the most recent results are shown. Perhaps not ideal, but I think it's OK.

review: Approve
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Ok its looking good :)

I agree that ideally the TextField should auto focus.
I think that the results should clear when the search box is empty.

Also I think the delay of 2 seconds maybe to high (at least for desktop, maybe it is ok for mobile with the touch keyboard?), what do you guys think?

Another feature we could add is a count of how many tracks were returned.

Other than these minor points, which can either be done in this branch or another, I approve.

review: Approve
lp:~danielholm/music-app/search updated
344. By Daniel Holm

Added expander to search results; shortned down the search timer; added search icon to file and field; moved add to playlist button to bottom in sheet; when no search word, no results; only allow input without word help.

345. By Daniel Holm

Removed dev search button for the 100th time; and restored the manifest for the 1000th.

Revision history for this message
Daniel Holm (danielholm) wrote :

There, I've shortned the search timer, added the expander, made it so that no results are visible when there are no search terms. Also I added a keyboard hint so that individual characters are mede possible to enter - no word help since that only make searching worse/harder. Also I moved the "Add to playlist" button to parent.bottom. Added a search icon to the field to more look like the other core apps' search fields.
Finally I cant seem to get the text field to auto focus, but neither does Weather or Clock app.

Approving.

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'LibraryListModel.qml'
--- LibraryListModel.qml 2013-12-29 01:24:50 +0000
+++ LibraryListModel.qml 2014-02-20 01:28:57 +0000
@@ -219,4 +219,10 @@
219 worker.sendMessage({'clear': true, 'model': libraryModel})219 worker.sendMessage({'clear': true, 'model': libraryModel})
220 }220 }
221 }221 }
222
223 function filterSearch(searchQuery) {
224 query = Library.search
225 param = searchQuery
226 worker.list = Library.search(searchQuery)
227 }
222}228}
223229
=== added file 'MusicSearch.qml'
--- MusicSearch.qml 1970-01-01 00:00:00 +0000
+++ MusicSearch.qml 2014-02-20 01:28:57 +0000
@@ -0,0 +1,441 @@
1/*
2 * Copyright (C) 2014 Andrew Hayzen <ahayzen@gmail.com>
3 * Daniel Holm <d.holmen@gmail.com>
4 * Victor Thompson <victor.thompson@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 3.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtMultimedia 5.0
20import QtQuick 2.0
21import Ubuntu.Components 0.1
22import Ubuntu.Components.ListItems 0.1 as ListItem
23import Ubuntu.Components.Popups 0.1
24import QtQuick.LocalStorage 2.0
25import "playlists.js" as Playlists
26import "meta-database.js" as Library
27import "common"
28
29// Sheet to search for music tracks
30 DefaultSheet {
31 id: searchTrack
32 title: i18n.tr("Search")
33 contentsHeight: units.gu(80)
34
35 onDoneClicked: PopupUtils.close(searchTrack)
36
37 Component.onCompleted: {
38 }
39
40 onVisibleChanged: {
41 if (visible === true)
42 {
43 musicToolbar.disableToolbar()
44 }
45 else
46 {
47 musicToolbar.enableToolbar()
48 }
49 }
50
51 TextField {
52 id: searchField
53 anchors {
54 left: parent.left;
55 leftMargin: units.gu(2);
56 top: parent.top;
57 right: parent.right;
58 rightMargin: units.gu(2);
59 }
60
61 width: parent.width/1.5
62 placeholderText: "Search"
63 hasClearButton: true
64 highlighted: true
65 focus: true
66 inputMethodHints: Qt.ImhNoPredictiveText
67 //canPaste: true // why work, you do not, hrm?
68
69 // search icon
70 primaryItem: Image {
71 height: parent.height*0.5
72 width: parent.height*0.5
73 anchors.verticalCenter: parent.verticalCenter
74 anchors.verticalCenterOffset: -units.gu(0.2)
75 source: Qt.resolvedUrl("images/search.svg")
76 }
77
78 onTextChanged: {
79 searchTimer.start() // start the countdown, baby!
80 }
81
82 // Provide a small pause before search
83 Timer {
84 id: searchTimer
85 interval: 1500
86 repeat: false
87 onTriggered: {
88 if(searchField.text) {
89 searchModel.filterSearch(searchField.text) // query the databse
90 searchActivity.running = true // start the activity indicator
91 }
92 else {
93 customdebug("No search terms.")
94 searchModel.filterSearch("empty somehow?")
95 }
96 indicatorTimer.start()
97 }
98 }
99 // and onother one for the indicator
100 Timer {
101 id: indicatorTimer
102 interval: 500
103 repeat: false
104 onTriggered: {
105 searchActivity.running = false
106 }
107 }
108
109 // Indicator to show search activity
110 ActivityIndicator {
111 id: searchActivity
112 anchors {
113 verticalCenter: searchField.verticalCenter;
114 right: searchField.right;
115 rightMargin: units.gu(1)
116 }
117 running: false
118 }
119 }
120
121 Rectangle {
122 width: parent.width
123 height: parent.height
124 color: "transparent"
125 clip: true
126 anchors {
127 top: searchField.bottom
128 bottom: parent.bottom
129 left: parent.left
130 right: parent.right
131 }
132
133 // show each playlist and make them chosable
134 ListView {
135 id: searchTrackView
136 objectName: "searchtrackview"
137 width: parent.width
138 height: parent.width
139 model: searchModel.model
140 delegate: ListItem.Standard {
141 id: search
142 objectName: "playlist"
143 width: parent.width
144 height: styleMusic.common.itemHeight
145 property string title: model.title
146 property string artist: model.artist
147 property string file: model.file
148 property string album: model.album
149 property string cover: model.cover
150 property string genre: model.genre
151
152 onClicked: {
153 console.debug("Debug: "+title+" added to queue")
154 // now play this track, but keep current queue
155 trackQueue.model.append({"title": title, "artist": artist, "file": file, "album": album, "cover": cover, "genre": genre})
156 trackClicked(trackQueue, trackQueue.model.count - 1, true)
157 onDoneClicked: PopupUtils.close(searchTrack)
158 }
159
160 UbuntuShape {
161 id: trackCover
162 anchors.left: parent.left
163 anchors.leftMargin: units.gu(2)
164 anchors.top: parent.top
165 anchors.topMargin: units.gu(1)
166 width: styleMusic.common.albumSize
167 height: styleMusic.common.albumSize
168 image: Image {
169 source: cover !== "" ? cover : Qt.resolvedUrl("images/cover_default_icon.png")
170 }
171 }
172
173 Label {
174 id: trackArtist
175 wrapMode: Text.NoWrap
176 maximumLineCount: 2
177 fontSize: "x-small"
178 anchors.left: trackCover.left
179 anchors.leftMargin: units.gu(11)
180 anchors.top: parent.top
181 anchors.topMargin: units.gu(1.5)
182 anchors.right: expandItem.left
183 anchors.rightMargin: units.gu(1.5)
184 elide: Text.ElideRight
185 text: artist
186 }
187 Label {
188 id: trackTitle
189 objectName: "tracktitle"
190 wrapMode: Text.NoWrap
191 maximumLineCount: 1
192 fontSize: "small"
193 color: styleMusic.common.music
194 anchors.left: trackCover.left
195 anchors.leftMargin: units.gu(11)
196 anchors.top: trackArtist.bottom
197 anchors.topMargin: units.gu(1)
198 anchors.right: expandItem.left
199 anchors.rightMargin: units.gu(1.5)
200 elide: Text.ElideRight
201 text: title
202 }
203 Label {
204 id: trackAlbum
205 wrapMode: Text.NoWrap
206 maximumLineCount: 2
207 fontSize: "xx-small"
208 anchors.left: trackCover.left
209 anchors.leftMargin: units.gu(11)
210 anchors.top: trackTitle.bottom
211 anchors.topMargin: units.gu(2)
212 anchors.right: expandItem.left
213 anchors.rightMargin: units.gu(1.5)
214 elide: Text.ElideRight
215 text: album
216 }
217 Label {
218 id: trackDuration
219 wrapMode: Text.NoWrap
220 maximumLineCount: 2
221 fontSize: "small"
222 color: styleMusic.common.music
223 anchors.left: trackCover.left
224 anchors.leftMargin: units.gu(12)
225 anchors.top: trackAlbum.bottom
226 anchors.right: expandItem.left
227 anchors.rightMargin: units.gu(1.5)
228 elide: Text.ElideRight
229 visible: false
230 text: ""
231 }
232
233 //Icon { // use for 1.0
234 Image {
235 id: expandItem
236 objectName: "trackimage"
237 anchors.right: parent.right
238 anchors.rightMargin: units.gu(2)
239 // name: "dropdown-menu" Use for 1.0
240 source: expandable.visible ? "images/dropdown-menu-up.svg" : "images/dropdown-menu.svg"
241 height: styleMusic.common.expandedItem
242 width: styleMusic.common.expandedItem
243 y: parent.y + (styleMusic.common.itemHeight / 2) - (height / 2)
244 }
245
246 MouseArea {
247 anchors.bottom: parent.bottom
248 anchors.right: parent.right
249 anchors.top: parent.top
250 width: styleMusic.common.expandedItem * 3
251 onClicked: {
252 if(expandable.visible) {
253 customdebug("clicked collapse")
254 expandable.visible = false
255 search.height = styleMusic.common.itemHeight
256 Rotation: {
257 source: expandItem;
258 angle: 0;
259 }
260 }
261 else {
262 customdebug("clicked expand")
263 collapseExpand(-1); // collapse all others
264 expandable.visible = true
265 search.height = styleMusic.common.expandedHeight
266 Rotation: {
267 source: expandItem;
268 angle: 180;
269 }
270 }
271 }
272 }
273
274 Rectangle {
275 id: expandable
276 color: "transparent"
277 height: styleMusic.common.expandHeight
278 visible: false
279 MouseArea {
280 anchors.fill: parent
281 onClicked: {
282 customdebug("User pressed outside the playlist item and expanded items.")
283 }
284 }
285
286 Component.onCompleted: {
287 collapseExpand.connect(onCollapseExpand);
288 }
289
290 function onCollapseExpand(indexCol)
291 {
292 if ((indexCol === index || indexCol === -1) && expandable !== undefined && expandable.visible === true)
293 {
294 customdebug("auto collapse")
295 expandable.visible = false
296 search.height = styleMusic.common.itemHeight
297 }
298 }
299
300 // background for expander
301 Rectangle {
302 id: expandedBackground
303 anchors.top: parent.top
304 anchors.topMargin: styleMusic.common.itemHeight
305 color: styleMusic.common.black
306 height: styleMusic.common.expandedHeight - styleMusic.common.itemHeight
307 width: search.width
308 opacity: 0.4
309 }
310
311 // add to playlist
312 Rectangle {
313 id: playlistRow
314 anchors.top: expandedBackground.top
315 anchors.left: parent.left
316 anchors.leftMargin: styleMusic.common.expandedLeftMargin
317 color: "transparent"
318 height: expandedBackground.height
319 width: units.gu(15)
320 Icon {
321 id: playlistTrack
322 anchors.verticalCenter: parent.verticalCenter
323 color: styleMusic.common.white
324 name: "add"
325 height: styleMusic.common.expandedItem
326 width: styleMusic.common.expandedItem
327 }
328 Label {
329 objectName: "songstab_addtoplaylist"
330 anchors.left: playlistTrack.right
331 anchors.leftMargin: units.gu(0.5)
332 anchors.verticalCenter: parent.verticalCenter
333 color: styleMusic.common.white
334 fontSize: "small"
335 width: parent.width - playlistTrack.width - units.gu(1)
336 text: i18n.tr("Add to playlist")
337 wrapMode: Text.WordWrap
338 maximumLineCount: 3
339 }
340 MouseArea {
341 anchors.fill: parent
342 onClicked: {
343 expandable.visible = false
344 search.height = styleMusic.common.itemHeight
345 chosenArtist = artist
346 chosenTitle = title
347 chosenTrack = file
348 chosenAlbum = album
349 chosenCover = cover
350 chosenGenre = genre
351 chosenIndex = index
352 console.debug("Debug: Add track to playlist")
353 PopupUtils.open(Qt.resolvedUrl("MusicaddtoPlaylist.qml"), mainView,
354 {
355 title: i18n.tr("Select playlist")
356 } )
357 }
358 }
359 }
360 // Queue
361 Rectangle {
362 id: queueRow
363 anchors.top: expandedBackground.top
364 anchors.left: playlistRow.left
365 anchors.leftMargin: units.gu(15)
366 color: "transparent"
367 height: expandedBackground.height
368 width: units.gu(15)
369 Image {
370 id: queueTrack
371 anchors.verticalCenter: parent.verticalCenter
372 source: "images/queue.png"
373 height: styleMusic.common.expandedItem
374 width: styleMusic.common.expandedItem
375 }
376 Label {
377 objectName: "songstab_addtoqueue"
378 anchors.left: queueTrack.right
379 anchors.leftMargin: units.gu(0.5)
380 anchors.verticalCenter: parent.verticalCenter
381 color: styleMusic.common.white
382 fontSize: "small"
383 width: parent.width - queueTrack.width - units.gu(1)
384 text: i18n.tr("Add to queue")
385 wrapMode: Text.WordWrap
386 maximumLineCount: 3
387 }
388 MouseArea {
389 anchors.fill: parent
390 onClicked: {
391 expandable.visible = false
392 search.height = styleMusic.common.itemHeight
393 console.debug("Debug: Add track to queue: " + title)
394 trackQueue.model.append({"title": title, "artist": artist, "file": file, "album": album, "cover": cover, "genre": genre})
395 }
396 }
397 }
398 // Share
399 Rectangle {
400 id: shareRow
401 anchors.top: expandedBackground.top
402 anchors.left: queueRow.left
403 anchors.leftMargin: units.gu(15)
404 color: "transparent"
405 height: expandedBackground.height
406 width: units.gu(15)
407 visible: false
408 Icon {
409 id: shareTrack
410 color: styleMusic.common.white
411 name: "share"
412 height: styleMusic.common.expandedItem
413 width: styleMusic.common.expandedItem
414 }
415 Label {
416 anchors.left: shareTrack.right
417 anchors.leftMargin: units.gu(0.5)
418 anchors.top: parent.top
419 anchors.topMargin: units.gu(0.5)
420 color: styleMusic.common.white
421 fontSize: "small"
422 text: i18n.tr("Share")
423 width: units.gu(5)
424 height: parent.height
425 wrapMode: Text.WordWrap
426 }
427 MouseArea {
428 anchors.fill: parent
429 onClicked: {
430 expandable.visible = false
431 search.height = styleMusic.common.itemHeight
432 customdebug("Share")
433 }
434 }
435 }
436 }
437 }
438 }
439
440 }
441 }
0442
=== modified file 'MusicStart.qml'
--- MusicStart.qml 2014-01-16 19:22:52 +0000
+++ MusicStart.qml 2014-02-20 01:28:57 +0000
@@ -39,12 +39,31 @@
39 }39 }
40 }40 }
4141
42 /* Dev button for search.
43 Button {
44 id: searchButton
45 text: "Search"
46 anchors.top: parent.top
47 anchors.topMargin: units.gu(2)
48 anchors.bottom: recentlyPlayed.top
49 anchors.bottomMargin: units.gu(1)
50 height: units.gu(4)
51 onClicked: {
52 PopupUtils.open(Qt.resolvedUrl("MusicSearch.qml"), mainView,
53 {
54 title: i18n.tr("Search")
55 } )
56 }
57 }
58 */
59
60
42 ListItem.Standard {61 ListItem.Standard {
43 id: recentlyPlayed62 id: recentlyPlayed
44 text: i18n.tr("Recent")63 text: i18n.tr("Recent")
45 }64 }
46 Item {65 Item {
47 id: recentlistempty66 id: recentlistempty
48 anchors.top: recentlyPlayed.bottom67 anchors.top: recentlyPlayed.bottom
49 anchors.topMargin: units.gu(1)68 anchors.topMargin: units.gu(1)
50 height: units.gu(22)69 height: units.gu(22)
5170
=== modified file 'MusicaddtoPlaylist.qml'
--- MusicaddtoPlaylist.qml 2014-01-24 19:13:11 +0000
+++ MusicaddtoPlaylist.qml 2014-02-20 01:28:57 +0000
@@ -124,8 +124,8 @@
124 iconSource: "images/add.svg"124 iconSource: "images/add.svg"
125 iconPosition: "left"125 iconPosition: "left"
126 width: parent.width126 width: parent.width
127 anchors.top: addtoPlaylistView.bottom127 anchors.bottom: parent.bottom
128 anchors.topMargin: units.gu(5)128 anchors.bottomMargin: units.gu(0.5)
129 onClicked: {129 onClicked: {
130 customdebug("New playlist.")130 customdebug("New playlist.")
131 PopupUtils.open(newPlaylistDialog, mainView)131 PopupUtils.open(newPlaylistDialog, mainView)
132132
=== added file 'images/search.svg'
--- images/search.svg 1970-01-01 00:00:00 +0000
+++ images/search.svg 2014-02-20 01:28:57 +0000
@@ -0,0 +1,153 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3
4<svg
5 xmlns:dc="http://purl.org/dc/elements/1.1/"
6 xmlns:cc="http://creativecommons.org/ns#"
7 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 xmlns:svg="http://www.w3.org/2000/svg"
9 xmlns="http://www.w3.org/2000/svg"
10 xmlns:xlink="http://www.w3.org/1999/xlink"
11 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
12 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
13 width="90"
14 height="90.000015"
15 id="svg3133"
16 version="1.1"
17 inkscape:version="0.48+devel r12262"
18 sodipodi:docname="search.svg">
19 <defs
20 id="defs3135">
21 <linearGradient
22 inkscape:collect="always"
23 id="linearGradient3803">
24 <stop
25 style="stop-color:#e7e5e5;stop-opacity:1;"
26 offset="0"
27 id="stop3805" />
28 <stop
29 style="stop-color:#e2dfdf;stop-opacity:1"
30 offset="1"
31 id="stop3807" />
32 </linearGradient>
33 <linearGradient
34 inkscape:collect="always"
35 xlink:href="#linearGradient3803"
36 id="linearGradient3809"
37 x1="53.012165"
38 y1="-102.79017"
39 x2="53.012165"
40 y2="-66.661224"
41 gradientUnits="userSpaceOnUse" />
42 <linearGradient
43 inkscape:collect="always"
44 xlink:href="#linearGradient3803"
45 id="linearGradient3813"
46 gradientUnits="userSpaceOnUse"
47 x1="53.012165"
48 y1="-102.79017"
49 x2="53.012165"
50 y2="-66.661224"
51 gradientTransform="translate(-625,0)" />
52 </defs>
53 <sodipodi:namedview
54 id="base"
55 pagecolor="#ffffff"
56 bordercolor="#666666"
57 borderopacity="1.0"
58 inkscape:pageopacity="0.0"
59 inkscape:pageshadow="2"
60 inkscape:zoom="7.9580781"
61 inkscape:cx="47.57328"
62 inkscape:cy="40.531144"
63 inkscape:document-units="px"
64 inkscape:current-layer="g3842"
65 showgrid="true"
66 inkscape:window-width="1920"
67 inkscape:window-height="1029"
68 inkscape:window-x="0"
69 inkscape:window-y="24"
70 inkscape:window-maximized="1"
71 inkscape:snap-grids="true"
72 inkscape:snap-global="true"
73 fit-margin-top="0"
74 fit-margin-left="0"
75 fit-margin-right="0"
76 fit-margin-bottom="0"
77 inkscape:snap-bbox="true"
78 inkscape:bbox-paths="true"
79 inkscape:bbox-nodes="true"
80 inkscape:snap-bbox-edge-midpoints="true"
81 inkscape:snap-bbox-midpoints="true"
82 inkscape:object-paths="true"
83 inkscape:snap-intersection-paths="true"
84 inkscape:snap-midpoints="true"
85 inkscape:snap-smooth-nodes="true"
86 inkscape:object-nodes="true"
87 inkscape:snap-object-midpoints="true"
88 inkscape:snap-center="true">
89 <inkscape:grid
90 type="xygrid"
91 id="grid3016"
92 empspacing="6"
93 visible="true"
94 enabled="true"
95 snapvisiblegridlinesonly="true"
96 originx="-2.98e-06px"
97 originy="2.6171874e-06px" />
98 </sodipodi:namedview>
99 <metadata
100 id="metadata3138">
101 <rdf:RDF>
102 <cc:Work
103 rdf:about="">
104 <dc:format>image/svg+xml</dc:format>
105 <dc:type
106 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
107 <dc:title />
108 </cc:Work>
109 </rdf:RDF>
110 </metadata>
111 <g
112 inkscape:label="Layer 1"
113 inkscape:groupmode="layer"
114 id="layer1"
115 transform="translate(-2.98e-6,-962.36219)"
116 style="display:inline">
117 <g
118 transform="matrix(0.99934414,0,0,1,-106.92982,549.00002)"
119 id="g3842"
120 style="display:inline">
121 <rect
122 style="opacity:0.05;color:#000000;fill:none;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
123 id="rect3844"
124 width="90.059067"
125 height="90.000015"
126 x="107"
127 y="-503.36218"
128 transform="scale(1,-1)" />
129 <path
130 sodipodi:type="arc"
131 style="color:#000000;fill:none;stroke:#808080;stroke-width:10.49972248;stroke-miterlimit:4;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
132 id="path2995"
133 sodipodi:cx="35.999996"
134 sodipodi:cy="36.500011"
135 sodipodi:rx="33"
136 sodipodi:ry="33.5"
137 d="m 68.999996,36.500011 a 33,33.5 0 1 1 -65.9999998,0 A 33,33.5 0 1 1 68.999996,36.500011 Z"
138 transform="matrix(0.86331274,0,0,0.85161915,120.95028,427.27807)" />
139 <path
140 style="font-size:xx-small;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#808080;fill-opacity:1;stroke:none;stroke-width:6;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"
141 d="m 175.1697,477.23717 -4.25279,4.25 12.00787,12 L 187.17757,489.23717 Z"
142 id="path3765"
143 inkscape:connector-curvature="0"
144 sodipodi:nodetypes="ccccc" />
145 <path
146 style="font-size:xx-small;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#808080;fill-opacity:1;stroke:none;stroke-width:11.80387211;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"
147 d="m 180.97203,481.40625 c -2.32437,0.012 -4.57033,1.53501 -5.44162,3.68994 -0.87128,2.15492 -0.31496,4.81092 1.34787,6.43506 l 8.79632,8.79991 c 4.02735,4.27401 4.89575,3.69726 8.46955,0.1258 3.57381,-3.57146 4.15747,-4.18909 -0.1258,-8.46955 l -8.79632,-8.79991 C 184.12024,482.05781 182.55003,481.39971 180.97203,481.40625 Z"
148 id="path3767"
149 inkscape:connector-curvature="0"
150 sodipodi:nodetypes="cscczccc" />
151 </g>
152 </g>
153</svg>
0154
=== modified file 'meta-database.js'
--- meta-database.js 2014-01-16 19:22:52 +0000
+++ meta-database.js 2014-02-20 01:28:57 +0000
@@ -461,3 +461,19 @@
461 return res === 0;461 return res === 0;
462}462}
463463
464// Search track LIKE
465function search(input) {
466 console.debug("Got a new search: "+input)
467 input = "%" + input + "%" // workaround
468 var res = [];
469 var db = getDatabase();
470 db.transaction( function(tx) {
471 var rs = tx.executeSql("SELECT * FROM metadata WHERE title LIKE ? OR artist LIKE ? OR album LIKE ? OR genre LIKE ?;", [input,input,input,input]); // WRONG! WHy?
472 for(var i = 0; i < rs.rows.length; i++) {
473 var dbItem = rs.rows.item(i);
474 console.log("Artist:"+ dbItem.artist + ", Album:"+dbItem.album + ", Title:"+dbItem.title + ", File:"+dbItem.file + ", Art:"+dbItem.cover + ", Genre:"+dbItem.genre);
475 res.push({artist:dbItem.artist, album:dbItem.album, title:dbItem.title, file:dbItem.file, cover:dbItem.cover, length:dbItem.length, year:dbItem.year, genre:dbItem.genre});
476 }
477 });
478 return res;
479}
464480
=== modified file 'music-app.qml'
--- music-app.qml 2014-01-24 23:33:12 +0000
+++ music-app.qml 2014-02-20 01:28:57 +0000
@@ -71,6 +71,15 @@
7171
72 // HUD Actions72 // HUD Actions
73 Action {73 Action {
74 id: searchAction
75 text: i18n.tr("Search")
76 keywords: i18n.tr("Search Track")
77 onTriggered: PopupUtils.open(Qt.resolvedUrl("MusicSearch.qml"), mainView,
78 {
79 title: i18n.tr("Search")
80 } )
81 }
82 Action {
74 id: nextAction83 id: nextAction
75 text: i18n.tr("Next")84 text: i18n.tr("Next")
76 keywords: i18n.tr("Next Track")85 keywords: i18n.tr("Next Track")
@@ -124,7 +133,7 @@
124 onTriggered: Qt.quit()133 onTriggered: Qt.quit()
125 }134 }
126135
127 actions: [nextAction, playsAction, prevAction, stopAction, backAction, settingsAction, quitAction]136 actions: [searchAction, nextAction, playsAction, prevAction, stopAction, backAction, settingsAction, quitAction]
128137
129 // signal to open new URIs138 // signal to open new URIs
130 // TODO currently this only allows playing file:// URIs of known files139 // TODO currently this only allows playing file:// URIs of known files
@@ -984,6 +993,11 @@
984 }993 }
985 }994 }
986995
996 // search model
997 LibraryListModel {
998 id: searchModel
999 }
1000
987 // Blurred background1001 // Blurred background
988 BlurredBackground {1002 BlurredBackground {
989 }1003 }

Subscribers

People subscribed via source and target branches

to status/vote changes: