ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #02537
[Merge] lp:~vthompson/music-app/decode-before-ms2-lookup into lp:music-app
Victor Thompson has proposed merging lp:~vthompson/music-app/decode-before-ms2-lookup into lp:music-app.
Commit message:
* Decode URI before passing to mediascanner lookup function
Requested reviews:
Music App Developers (music-app-dev)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot): continuous-integration
Related bugs:
Bug #1460916 in Ubuntu Music App: "[music] Could not find media. Possible unicode issue."
https://bugs.launchpad.net/music-app/+bug/1460916
For more details, see:
https://code.launchpad.net/~vthompson/music-app/decode-before-ms2-lookup/+merge/260891
* Decode URI before passing to mediascanner lookup function
ms2 should probably be doing the decoding, but this resolves the issue in the bug report.
--
Your team Music App Developers is requested to review the proposed merge of lp:~vthompson/music-app/decode-before-ms2-lookup into lp:music-app.
=== modified file 'app/components/Helpers/ContentHubHelper.qml'
--- app/components/Helpers/ContentHubHelper.qml 2015-04-06 17:06:50 +0000
+++ app/components/Helpers/ContentHubHelper.qml 2015-06-02 21:02:19 +0000
@@ -181,7 +181,7 @@
var model;
for (i=0; i < searchPaths.length; i++) {
- model = musicStore.lookup(searchPaths[i])
+ model = musicStore.lookup(decodeURIComponent(searchPaths[i]))
console.debug("MusicStore model from lookup", JSON.stringify(model))
@@ -206,7 +206,7 @@
trackQueue.clear();
for (i=0; i < searchPaths.length; i++) {
- model = musicStore.lookup(searchPaths[i])
+ model = musicStore.lookup(decodeURIComponent(searchPaths[i]))
trackQueue.append(makeDict(model));
}
=== modified file 'app/components/Player.qml'
--- app/components/Player.qml 2015-04-29 01:12:57 +0000
+++ app/components/Player.qml 2015-06-02 21:02:19 +0000
@@ -204,9 +204,9 @@
var obj;
if (source.toString().indexOf("file://") === 0) {
- obj = musicStore.lookup(source.toString().substring(7))
+ obj = musicStore.lookup(decodeURIComponent(source.toString().substring(7)))
} else {
- obj = musicStore.lookup(source.toString())
+ obj = musicStore.lookup(decodeURIComponent(source.toString()))
}
player.currentMetaAlbum = obj.album;
=== modified file 'app/logic/meta-database.js'
--- app/logic/meta-database.js 2015-02-03 23:00:14 +0000
+++ app/logic/meta-database.js 2015-06-02 21:02:19 +0000
@@ -156,8 +156,8 @@
db.transaction( function(tx) {
var rs = tx.executeSql("SELECT * FROM queue ORDER BY ind ASC");
for(var i = 0; i < rs.rows.length; i++) {
- if (musicStore.lookup(rs.rows.item(i).filename) != null) {
- res.push(makeDict(musicStore.lookup(rs.rows.item(i).filename)));
+ if (musicStore.lookup(decodeURIComponent(rs.rows.item(i).filename)) != null) {
+ res.push(makeDict(musicStore.lookup(decodeURIComponent(rs.rows.item(i).filename))));
}
}
});
=== modified file 'app/logic/playlists.js'
--- app/logic/playlists.js 2015-04-28 17:37:33 +0000
+++ app/logic/playlists.js 2015-06-02 21:02:19 +0000
@@ -230,7 +230,7 @@
for (j = 0; j < rs.rows.length; j++) {
var dbItem = rs.rows.item(j)
- if (musicStore.lookup(dbItem.filename) === null) {
+ if (musicStore.lookup(decodeURIComponent(dbItem.filename)) === null) {
erroneousTracks.push(dbItem.i);
} else {
res.push({
@@ -239,7 +239,7 @@
title: dbItem.title,
author: dbItem.author,
album: dbItem.album,
- art: musicStore.lookup(dbItem.filename).art
+ art: musicStore.lookup(decodeURIComponent(dbItem.filename)).art
})
}
}
@@ -298,11 +298,11 @@
for (var i = 0; i < rs.rows.length
&& i < (max || rs.rows.length); i++) {
- if (musicStore.lookup(rs.rows.item(i).filename) !== null) {
+ if (musicStore.lookup(decodeURIComponent(rs.rows.item(i).filename)) !== null) {
var row = {
author: rs.rows.item(i).author,
album: rs.rows.item(i).album,
- art: musicStore.lookup(rs.rows.item(i).filename).art
+ art: musicStore.lookup(decodeURIComponent(rs.rows.item(i).filename)).art
}
if (find(res, row) === null) {
=== modified file 'app/music-app.qml'
--- app/music-app.qml 2015-05-10 00:34:24 +0000
+++ app/music-app.qml 2015-06-02 21:02:19 +0000
@@ -438,7 +438,7 @@
// Find tracks from the queue that aren't in ms2 anymore
for (i=0; i < trackQueue.model.count; i++) {
- if (musicStore.lookup(trackQueue.model.get(i).filename) === null) {
+ if (musicStore.lookup(decodeURIComponent(trackQueue.model.get(i).filename)) === null) {
removed.push(i)
}
}
References