Merge lp:~xerosis/nuvola-player/squeezebox-integration into lp:nuvola-player/releases-1.x
Proposed by
Kieran Hogg
Status: | Rejected |
---|---|
Rejected by: | Jiří Janoušek |
Proposed branch: | lp:~xerosis/nuvola-player/squeezebox-integration |
Merge into: | lp:nuvola-player/releases-1.x |
Diff against target: |
155 lines (+140/-0) 3 files modified
data/nuvolaplayer/services/squeezebox/description.html (+12/-0) data/nuvolaplayer/services/squeezebox/integration.js (+122/-0) data/nuvolaplayer/services/squeezebox/metadata.conf (+6/-0) |
To merge this branch: | bzr merge lp:~xerosis/nuvola-player/squeezebox-integration |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jiří Janoušek | Disapprove | ||
Review via email: mp+109526@code.launchpad.net |
This proposal supersedes a proposal from 2012-06-10.
Description of the change
Thanks for the review, javascript isn't my strongest language as you can tell...
To post a comment you must log in.
Unmerged revisions
- 233. By Kieran Hogg
-
Fixed issues from review
- 232. By Kieran Hogg
-
Add initial Squeezebox service
Here is a review:
----8<----
6 +<p>The <strong> Squeezebox< /strong> is a network music player from Logitech. It plays internet radio or digital ...
This line is too long, wrap it to 80 characters.
----8<----
40 + * @param Nuvola Nuvola JS API
This line can be removed (function does not have any arguments)
----8<----
60 + var state = Nuvola. STATE_PAUSED;
Default state should be Nuvola.STATE_NONE
----8<----
72 + var album_art = document. getElementById( 'ctrlCurrentArt ').firstChild. firstChild. src; getElementById( 'ctrlCurrentArt ist').lastChild .innerText; getElementById( 'ctrlCurrentTit le').firstChild .innerText; /\.(.+) ?/)[1]. trim(); getElementById( 'ctrlCurrentAlb um').firstChild .innerText;
73 + var artist = document.
74 + var song = document.
75 + // Squeezebox prepends the song number to the song name, remove this
76 + var song = song.split(
77 + var album = document.
No need to use "var" since all variables are already declared at the beginning of the function.
----8<----
83 + var play_pause = document. getElementById( 'ext-gen42' ); getAttribute( "title" ); STATE_PLAYING; STATE_PAUSED;
84 + var pp_pressed = play_pause.
85 + var state;
86 + if(pp_pressed == "Pause"){
87 + state = Nuvola.
88 + }
89 + else{
90 + state = Nuvola.
91 + }
If play_pause is null, line 84 raises exception. This is better:
var play_pause = document. getElementById( 'ext-gen42' ); getAttribute( "title" ); STATE_PLAYING : Nuvola. STATE_PAUSED;
try{
var pp_pressed = play_pause.
state = (pp_pressed == "Pause") ? Nuvola.
}
catch(e){
// state stays Nuvola.STATE_NONE
}