Merge lp:~robru/unity-webapps-deezer/packaging-fixups into lp:unity-webapps-deezer

Proposed by Robert Bruce Park
Status: Merged
Approved by: Robert Bruce Park
Approved revision: 5
Merged at revision: 5
Proposed branch: lp:~robru/unity-webapps-deezer/packaging-fixups
Merge into: lp:unity-webapps-deezer
Diff against target: 251 lines (+52/-60)
3 files modified
Deezer.user.js (+45/-52)
debian/control (+7/-3)
debian/copyright (+0/-5)
To merge this branch: bzr merge lp:~robru/unity-webapps-deezer/packaging-fixups
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
WebApps Pending
Review via email: mp+169875@code.launchpad.net

Commit message

Minor packaging fixes.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
4. By Robert Bruce Park

Replace const with var.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
5. By Robert Bruce Park

Appease jslint.

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Deezer.user.js'
--- Deezer.user.js 2013-05-16 19:02:04 +0000
+++ Deezer.user.js 2013-06-18 00:14:26 +0000
@@ -4,7 +4,7 @@
4// ==/UserScript==4// ==/UserScript==
55
6// This placeholder gets munged with real data at build time.6// This placeholder gets munged with real data at build time.
7const WebappsGettextDict = JSON.parse(unescape(7var WebappsGettextDict = JSON.parse(unescape(
8 "%7B%22GETTEXT%22%3A%22PLACEHOLDER%22%7D"8 "%7B%22GETTEXT%22%3A%22PLACEHOLDER%22%7D"
9));9));
1010
@@ -12,25 +12,25 @@
12window.Unity = Unity;12window.Unity = Unity;
13var trackInfo;13var trackInfo;
1414
15if ( typeof unsafeWindow === "undefined") {15if (typeof unsafeWindow === "undefined") {
16 unsafeWindow = evalInPageContext( function () {16 unsafeWindow = evalInPageContext(function () {
17 return window;17 return window;
18 });18 });
19}19}
20unsafeWindow.Unity = window.Unity;20unsafeWindow.Unity = window.Unity;
2121
22function log(txt) {22function log(txt) {
23 if(typeof(console) !== 'undefined' && typeof(console.log) != 'undefined') {23 if (typeof (console) !== 'undefined' && typeof (console.log) !== 'undefined') {
24 console.log(txt);24 console.log(txt);
25 }25 }
26}26}
2727
28function isCorrectPage() {28function isCorrectPage() {
29 var i, ids = ['h_previous', 'h_next', 'h_play'];29 var i, ids = ['h_previous', 'h_next', 'h_play'];
30 if(!unsafeWindow.dzPlayer) {30 if (!unsafeWindow.dzPlayer) {
31 log("deezer not valid. unsafeWindow");31 log("deezer not valid. unsafeWindow");
3232
33 return false;33 return false;
34 }34 }
35 for (i = 0; i < ids.length; i++) {35 for (i = 0; i < ids.length; i++) {
36 if (!document.getElementById(ids[i])) {36 if (!document.getElementById(ids[i])) {
@@ -52,7 +52,7 @@
52 artist = unsafeWindow.dzPlayer.artistName;52 artist = unsafeWindow.dzPlayer.artistName;
53 title = unsafeWindow.dzPlayer.songTitle;53 title = unsafeWindow.dzPlayer.songTitle;
54 album = unsafeWindow.dzPlayer.albumTitle;54 album = unsafeWindow.dzPlayer.albumTitle;
55 artLocation = unsafeWindow.SETTING_DOMAIN_IMG + '/cover/' + ((typeof (unsafeWindow.dzPlayer) == 'undefined') ? '' : unsafeWindow.dzPlayer.cover) + '/315x315-000000-80-0-0.jpg';55 artLocation = unsafeWindow.SETTING_DOMAIN_IMG + '/cover/' + ((typeof (unsafeWindow.dzPlayer) === 'undefined') ? '' : unsafeWindow.dzPlayer.cover) + '/315x315-000000-80-0-0.jpg';
56 } catch (x) {56 } catch (x) {
57 log(x);57 log(x);
58 }58 }
@@ -67,16 +67,16 @@
6767
68}68}
6969
70function refreshInfos () {70function refreshInfos() {
7171
72 //track info72 //track info
73 var oldTrackInfo;73 var oldTrackInfo;
74 if(trackInfo) {74 if (trackInfo) {
75 oldTrackInfo = trackInfo;75 oldTrackInfo = trackInfo;
76 }76 }
77 trackInfo = getTrackInfo();77 trackInfo = getTrackInfo();
78 if(oldTrackInfo) {78 if (oldTrackInfo) {
79 if (oldTrackInfo.artist != trackInfo.artist || oldTrackInfo.title != trackInfo.title) {79 if (oldTrackInfo.artist !== trackInfo.artist || oldTrackInfo.title !== trackInfo.title) {
80 Unity.Notification.showNotification(trackInfo.title, trackInfo.artist, trackInfo.artLocation);80 Unity.Notification.showNotification(trackInfo.title, trackInfo.artist, trackInfo.artLocation);
81 }81 }
82 }82 }
@@ -97,8 +97,7 @@
97 Unity.Launcher.setCount(unsafeWindow.dzPlayer.getNbSongs() - unsafeWindow.dzPlayer.getNumSong());97 Unity.Launcher.setCount(unsafeWindow.dzPlayer.getNbSongs() - unsafeWindow.dzPlayer.getNumSong());
98 if (unsafeWindow.dzPlayer.isPlaying()) {98 if (unsafeWindow.dzPlayer.isPlaying()) {
99 Unity.Launcher.setProgress(unsafeWindow.dzPlayer.getPosition() / unsafeWindow.dzPlayer.getDuration());99 Unity.Launcher.setProgress(unsafeWindow.dzPlayer.getPosition() / unsafeWindow.dzPlayer.getDuration());
100 }100 } else {
101 else {
102 Unity.Launcher.clearProgress();101 Unity.Launcher.clearProgress();
103 }102 }
104103
@@ -118,26 +117,27 @@
118// }117// }
119118
120function playAlbumCallback(id) {119function playAlbumCallback(id) {
121 return wrapCallback(function() {120 return wrapCallback(function () {
122 unsafeWindow.dzPlayer.playAlbum(id);121 unsafeWindow.dzPlayer.playAlbum(id);
123 });122 });
124}123}
125124
126function playPlaylistCallback(id) {125function playPlaylistCallback(id) {
127 return wrapCallback(function() {126 return wrapCallback(function () {
128 unsafeWindow.dzPlayer.playPlaylist(id);127 unsafeWindow.dzPlayer.playPlaylist(id);
129 });128 });
130}129}
131130
132function populateUserInfos() {131function populateUserInfos() {
133
134 log("populating user infos");
135
136 //put favorite album in the HUD132 //put favorite album in the HUD
137 var datas = unsafeWindow.userData.data.FAVORITES_ALBUMS.data;133 var datas = unsafeWindow.userData.data.FAVORITES_ALBUMS.data;
138134 var current;
139 for (var i = datas.length - 1; i >= 0; i--) {135 var i;
140 var current = datas[i];136
137 log("populating user infos");
138
139 for (i = datas.length - 1; i >= 0; i--) {
140 current = datas[i];
141 Unity.addAction("/Album/Play/" + current.ALB_TITLE + " - " + current.ART_NAME,141 Unity.addAction("/Album/Play/" + current.ALB_TITLE + " - " + current.ART_NAME,
142 playAlbumCallback(current.ALB_ID));142 playAlbumCallback(current.ALB_ID));
143 log("added");143 log("added");
@@ -147,39 +147,31 @@
147147
148 //playlist favorite (not actual user playlist)148 //playlist favorite (not actual user playlist)
149 datas = unsafeWindow.userData.data.FAVORITES_PLAYLISTS.data;149 datas = unsafeWindow.userData.data.FAVORITES_PLAYLISTS.data;
150 for (var i = datas.length - 1; i >= 0; i--) {150 for (i = datas.length - 1; i >= 0; i--) {
151 var current = datas[i];151 current = datas[i];
152 Unity.addAction("/Playlist/Play/" + current.TITLE,152 Unity.addAction("/Playlist/Play/" + current.TITLE,
153 playPlaylistCallback(current.PLAYLIST_ID));153 playPlaylistCallback(current.PLAYLIST_ID));
154 }154 }
155
156 //view
157}155}
158156
159function selfTest() {157function selfTest() {
160158 if (!unsafeWindow.dzPlayer) {
161 if(!unsafeWindow.dzPlayer) {159 reportTestState('FAILED: dzPlayer is null');
162 reportTestState('FAILED: dzPlayer is null');160 }
163 }161 if (!unsafeWindow.userData) {
164 if(!unsafeWindow.userData) {162 reportTestState('FAILED: userData is null');
165 reportTestState('FAILED: userData is null');163 }
166 }164
167165 reportTestState('PASS SELF TEST');
168 reportTestState('PASS SELF TEST');
169
170}166}
171167
172function musicPlayerSetup() {168function musicPlayerSetup() {
173
174 log("start init deezer");169 log("start init deezer");
175170
176
177 Unity.MediaPlayer.init("Deezer");171 Unity.MediaPlayer.init("Deezer");
178172
179
180 if (!isCorrectPage()) {173 if (!isCorrectPage()) {
181174 return;
182 return;
183 }175 }
184176
185 setInterval(wrapCallback(function retry() {177 setInterval(wrapCallback(function retry() {
@@ -191,13 +183,12 @@
191 }), 1000);183 }), 1000);
192184
193185
194 Unity.MediaPlayer.onPlayPause(wrapCallback(function() {186 Unity.MediaPlayer.onPlayPause(wrapCallback(function () {
195 if (!unsafeWindow.dzPlayer.isPlaying()) {187 if (!unsafeWindow.dzPlayer.isPlaying()) {
196 unsafeWindow.playercontrol.doAction('play');188 unsafeWindow.playercontrol.doAction('play');
197 //I don't like the little delay before the button updates.189 //I don't like the little delay before the button updates.
198 Unity.MediaPlayer.setPlaybackState(Unity.MediaPlayer.PlaybackState.PLAYING);190 Unity.MediaPlayer.setPlaybackState(Unity.MediaPlayer.PlaybackState.PLAYING);
199 }191 } else {
200 else {
201 unsafeWindow.playercontrol.doAction('pause');192 unsafeWindow.playercontrol.doAction('pause');
202 Unity.MediaPlayer.setPlaybackState(Unity.MediaPlayer.PlaybackState.PAUSED);193 Unity.MediaPlayer.setPlaybackState(Unity.MediaPlayer.PlaybackState.PAUSED);
203 }194 }
@@ -220,8 +211,10 @@
220211
221}212}
222213
223Unity.init({ name: "Deezer",214Unity.init({
224 domain: 'deezer.com',215 name: "Deezer",
225 homepage: 'http://deezer.com',216 domain: 'deezer.com',
226 iconUrl: "icon://unity-webapps-deezer",217 homepage: 'http://deezer.com',
227 onInit: musicPlayerSetup });218 iconUrl: "icon://unity-webapps-deezer",
219 onInit: musicPlayerSetup
220});
228221
=== modified file 'debian/control'
--- debian/control 2013-05-16 19:02:04 +0000
+++ debian/control 2013-06-18 00:14:26 +0000
@@ -1,17 +1,21 @@
1Source: unity-webapps-deezer1Source: unity-webapps-deezer
2Section: web2Section: web
3Priority: extra3Priority: optional
4Standards-Version: 3.9.44Standards-Version: 3.9.4
5Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>5Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
6Build-Depends: debhelper (>=9),6Build-Depends: debhelper (>=9),
7 unity-webapps-dev (>=2.4.16),7 unity-webapps-dev (>=2.4.16),
8Homepage: https://deezer.com/8Homepage: https://deezer.com/
9# If you aren't a member of ~webapps but need to upload packaging changes,
10# just go ahead. ~webapps will notice and sync up the code again.
11Vcs-Bzr: https://code.launchpad.net/~webapps/unity-webapps-deezer/trunk
912
10Package: unity-webapps-deezer13Package: unity-webapps-deezer
11Architecture: all14Architecture: all
12Section: web15Section: web
13Priority: extra16Depends: unity-webapps-common,
14Depends: unity-webapps-common, xdg-utils, ${misc:Depends}17 xdg-utils,
18 ${misc:Depends},
15XB-Ubuntu-Webapps-Includes: https://*.deezer.com/*19XB-Ubuntu-Webapps-Includes: https://*.deezer.com/*
16XB-Ubuntu-Webapps-Name: Deezer20XB-Ubuntu-Webapps-Name: Deezer
17XB-Ubuntu-Webapps-Domain: deezer.com21XB-Ubuntu-Webapps-Domain: deezer.com
1822
=== modified file 'debian/copyright'
--- debian/copyright 2013-05-16 19:02:04 +0000
+++ debian/copyright 2013-06-18 00:14:26 +0000
@@ -22,11 +22,6 @@
22 The full text of the can be found in the file22 The full text of the can be found in the file
23 '/usr/share/common-licenses/GPL-3'.23 '/usr/share/common-licenses/GPL-3'.
2424
25Files: debian/*
26Copyright: 2012 The friendly pkgme.net robot
27License: public-domain
28 This automatically generated code which is free from copyright restrictions.
29
3025
31Files: */*.png */*.svg26Files: */*.png */*.svg
32Copyright: various27Copyright: various

Subscribers

People subscribed via source and target branches

to all changes: