Skip to content

Commit

Permalink
Fix plcmd user search.
Browse files Browse the repository at this point in the history
  • Loading branch information
kruppel committed Feb 13, 2011
2 parents 92f2f96 + af96269 commit 5307b2b
Show file tree
Hide file tree
Showing 16 changed files with 641 additions and 150 deletions.
12 changes: 2 additions & 10 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Options for updating Dashboard/Favorites ###
A) Update periodically via nsIObserver/nsITimer
A) Update periodically via nsIObserver/nsITimer [done]
- Makes sense for the Dashboard
B) Flag update and post event
B) Flag update and post event [done]
- Maybe makes more sense for Favorites? Still a usecase where a user
could go through another client, favorite, and not see the update in
Songbird.
Expand All @@ -11,14 +11,6 @@ Related issue around losing view state... i.e. User plays from favorites
library and then library is refreshed (clear/populate) - Is that ok? Is
there another way to go about this?

### "Secure" information accessible via service interface ###
I didn't have a good solution in mind for restricting access to login
credentials. Both LastFM and Rhapsody I believe surface this information.
Especially when accounting for the autologin process, is there a way
to obfuscate these? Or is it not even worth the trouble?
[DONE] Also set prefs for oauth_token and token_secret... Should probably
encode/decode these strings.

### Blur searchbox once search is triggered ###

### Display informative message when no results are found ###
Expand Down
12 changes: 12 additions & 0 deletions chrome/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ include $(DEPTH)/build/autodefs.mk

IS_EXTENSION = 1

SONGBIRD_PP_RESOURCES = $(srcdir)/content/main.js.in \
$(NULL)

SONGBIRD_PP_DIR = $(EXTENSION_TMP_DIR)

# make-jars wants relative paths in its jar.mn's...
SONGBIRD_PP_RELATIVE_PATH = $(subst $(topsrcdir),$(DEPTH),$(SONGBIRD_PP_DIR))

PPDEFINES = -DSONGBIRD_PP_RELATIVE_PATH="$(SONGBIRD_PP_RELATIVE_PATH)" \
-DEXTENSION_UUID="$(EXTENSION_UUID)" \
$(NULL)

JAR_MANIFEST = jar.mn.in

include $(topsrcdir)/build/rules.mk
42 changes: 27 additions & 15 deletions chrome/content/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ CloudDirectory.onLoad = function CloudDirectory_onLoad() {
var params = {};
URLUtils.extractQuery(uri, params);
if (params.type) {
switch(params.type) {
this._page = params.type;
switch(this._page) {
case "dashboard":
this._library = this._service.dashboard;
search.hidden = true
Expand All @@ -139,9 +140,11 @@ CloudDirectory.onLoad = function CloudDirectory_onLoad() {
this._library = this._service.library;
}
} else {
this._page = "main";
this._library = this._service.library;
}


var node = gServicePane.activeNode;
document.title = node.displayName;

Expand Down Expand Up @@ -172,26 +175,20 @@ CloudDirectory.onLoad = function CloudDirectory_onLoad() {

var itemCount = this._library.getItemCountByProperty(SBProperties.hidden,
"0");
var firstrun = Application.prefs.getValue(SOUNDCLOUD_FIRST_RUN, false);
if (itemCount == 0) {
this._directory.setAttribute("disabled", true);
this._topLayer.hidden = false;
if (firstrun) {
this._idleDeck.selectedIndex = 0;
} else {
this._idleDeck.selectedIndex = 2;
}
}

this.listener = {
onLoginBegins: function listener_onLoginBegins() { },
onLogout: function listener_onLogout() { },
onAutoLoginChanged: function listener_onAutoLoginChanged() { },
onLoggedInStateChanged: function listener_onLoggedInStateChanged() { },
onProfileUpdated: function listener_onProfileUpdated() { },
onSearchTriggered: function listener_onSearchTriggered() {
self._searchBox.value = decodeURIComponent(self._service.lastSearch);
self._directory.setAttribute("disabled", true);
self._topLayer.hidden = false;
self._idleDeck.selectedIndex = 1;
if (firstrun) {
Application.prefs.setValue(SOUNDCLOUD_FIRST_RUN, false);
}
},
onSearchCompleted: function listener_onSearchCompleted() {
var count = self._library
Expand All @@ -202,8 +199,8 @@ CloudDirectory.onLoad = function CloudDirectory_onLoad() {
self._idleDeck.selectedIndex = 2;
}
},
onTracksAdded: function listener_onTracksAdded() {
if (!self._library)
onTracksAdded: function listener_onTracksAdded(aLibrary) {
if (!self._library || self._library != aLibrary)
return;

var count = self._library
Expand Down Expand Up @@ -232,11 +229,26 @@ CloudDirectory.onLoad = function CloudDirectory_onLoad() {
}
statusOverrideType.stringValue = "report"
},
//onNowFollowing: function listener_onNowFollowing(aUser) { },
QueryInterface: XPCOMUtils.generateQI([Ci.sbISoundCloudListener])
}

this._service.addListener(this.listener);
this.listener.onTracksAdded();

var firstrun = Application.prefs.getValue(SOUNDCLOUD_FIRST_RUN, false);
if (itemCount == 0) {
this._directory.setAttribute("disabled", true);
this._topLayer.hidden = false;
if (firstrun) {
this._idleDeck.selectedIndex = 0;
} else {
this._idleDeck.selectedIndex = 2;
this.listener.onTracksAdded(self._library);
}
} else {
this.listener.onTracksAdded(self._library);
}


// Add listener for playlist "Download" clicks
this._directory.addEventListener("PlaylistCellClick", function(e) {
Expand Down
2 changes: 1 addition & 1 deletion chrome/content/directory.xul
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<spacer flex="4" />
<deck id="idle-deck" selectedIndex="0">
<box id="soundcloud-intro">
<description>Experience SoundCloud in Songbird.</description>
<description><!--Experience SoundCloud in Songbird.--></description>
</box>
<box id="soundcloud-loading"/>
<box id="soundcloud-none-found">
Expand Down
Loading

0 comments on commit 5307b2b

Please sign in to comment.