diff --git a/chrome/content/directory.js b/chrome/content/directory.js index 8d8e1d1..047ed09 100644 --- a/chrome/content/directory.js +++ b/chrome/content/directory.js @@ -306,7 +306,9 @@ CloudDirectory.onUnload = function CloudDirectory_onUnload() { this._directory = null; } - this._service.removeListener(this.listener); + if (this._service) { + this._service.removeListener(this.listener); + } if (this._domEventListenerSet) { this._domEventListenerSet.removeAll(); diff --git a/chrome/content/main.js.in b/chrome/content/main.js.in index 7619c4c..337d985 100644 --- a/chrome/content/main.js.in +++ b/chrome/content/main.js.in @@ -897,8 +897,6 @@ function SoundCloud_onShowCurrentTrack(aEvent) { .getService(Ci.sbIMediacoreManager); var item = mediacoreManager.sequencer.currentItem; var streamSrc = SoundCloud._service.soundcloudURL; - Cu.reportError(item.contentSrc.spec); - Cu.reportError(streamSrc); // This could potentially problematic if we have a SoundCloud streaming item // outside of the addon context... meh don't care. if (item.contentSrc.spec.indexOf(streamSrc) != -1) { @@ -920,9 +918,10 @@ function SoundCloud_onShowCurrentTrack(aEvent) { if (node != gServicePane.activeNode) { gServicePane.activateAndLoadNode(node); } + var view = mediacoreManager.sequencer.view; var row = mediacoreManager.sequencer.viewPosition; - view.selection.selectOnly(row); + view.treeView.selection.select(row); view.treeView.selection.tree.ensureRowIsVisible(row); } @@ -956,9 +955,6 @@ function SoundCloud_observe(aSubject, aTopic, aData) { case "em-action-requested": // Extension flagged for uninstall aSubject.QueryInterface(Ci.nsIUpdateItem); - Cu.reportError(aSubject.id); - Cu.reportError("@EXTENSION_UUID@"); - Cu.reportError(data); if (aSubject.id == "@EXTENSION_UUID@") { if (data == "item-uninstalled") { diff --git a/chrome/skin/waveform.css b/chrome/skin/waveform.css index 412fa4d..d96a930 100644 --- a/chrome/skin/waveform.css +++ b/chrome/skin/waveform.css @@ -62,7 +62,7 @@ body#socl-wf-body { border-right: 1px solid rgb(255,85,0); position: absolute; height: 100%; - width: 0%; + width: 0; z-index: 1; } diff --git a/components/src/sbSoundCloud.js b/components/src/sbSoundCloud.js index 246f45e..abb1745 100644 --- a/components/src/sbSoundCloud.js +++ b/components/src/sbSoundCloud.js @@ -587,10 +587,11 @@ function sbSoundCloudService() { * * \param aItems JSON object of items to add. * \param aLibrary Target library for added items. + * \param aComplete Boolean to dispatch search completed event. * */ this._addItemsToLibrary = - function sbSoundCloudService__addItemsToLibrary(aItems, aLibrary) { + function sbSoundCloudService__addItemsToLibrary(aItems, aLibrary, aComplete) { var self = this; if (aItems != null) { var itemArray = Cc["@songbirdnest.com/moz/xpcom/threadsafe-array;1"] @@ -687,6 +688,9 @@ function sbSoundCloudService() { var batchListener = { onProgress: function(aIndex) {}, onComplete: function(aMediaItems, aResult) { + if (aComplete) { + self.notifyListeners("onSearchCompleted"); + } self.notifyListeners("onTracksAdded", [aLibrary]); if (aLibrary == self.dashboard) { self.updateDashboardCount(); @@ -1337,7 +1341,7 @@ sbSoundCloudService.prototype = { } } - self._addItemsToLibrary(tracks, self._library); + var completed = false; if (tracks.length > 40) { self._track_retries = 0; @@ -1345,8 +1349,10 @@ sbSoundCloudService.prototype = { self.getTracks(aUser, aQuery, aFlags, aOffset); } else { self._track_xhr = null; - self.notifyListeners("onSearchCompleted"); + completed = true; } + + self._addItemsToLibrary(tracks, self._library, completed); } var failure = function(xhr) { @@ -1405,9 +1411,8 @@ sbSoundCloudService.prototype = { } } - self._addItemsToLibrary(activities.collection, self._dashboard); - - let next_href = activities.next_href; + var next_href = activities.next_href; + var completed = (next_href == null); self._dash_retries = null; if (next_href) { @@ -1418,6 +1423,10 @@ sbSoundCloudService.prototype = { } else { self._dash_xhr = null; } + + self._addItemsToLibrary(activities.collection, + self._dashboard, + completed); } var failure = function(xhr) { @@ -1518,15 +1527,18 @@ sbSoundCloudService.prototype = { } } - self._addItemsToLibrary(favorites, self._favorites); + var completed = false; if (favorites.length < 50) { self._fav_xhr = null; self._fav_retries = null; + completed = true; } else { self._fav_retries = 0; self._fav_xhr = self.getFavorites(aUserId, offset + favorites.length); } + + self._addItemsToLibrary(favorites, self._favorites, completed); } var failure = function(xhr) {