1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-04 12:35:46 +01:00

Clean up Xulmus.

This commit is contained in:
Doug Kearns
2009-11-18 06:41:35 +11:00
parent 5fb9140b66
commit 3dd702f6da
4 changed files with 208 additions and 125 deletions

View File

@@ -5,14 +5,20 @@
// given in the LICENSE.txt file included with this file.
// TODO: flesh this out
const Library = Module("library", {
init: function () {
this.MAIN_LIBRARY = LibraryUtils.mainLibrary;
},
/**
* Converts an XPCOM enumerator to a JavaScript array.
*
* @param {nsISimpleEnumerator|nsIStringEnumerator|nsIArray} enum The enumerator to convert.
* @returns {Array}
*/
_toJSArray: function _toJSArray(enum) ArrayConverter.JSArray(enum),
// TODO: return some actually useful objects. ;-)
/**
* Returns an array of all the artist names in the main library.
*
@@ -20,12 +26,12 @@ const Library = Module("library", {
*/
getArtists: function getArtists() this._toJSArray(this.MAIN_LIBRARY.getDistinctValuesForProperty(SBProperties.artistName)),
// FIXME: ken do we really want to remove duplicates? If so, why not tracks too? --djk
// FIXME: Prathyush do we really want to remove duplicates? If so, why not tracks too? --djk
/**
* Returns an array of all the album names for <b>artist</b> in the
* main library.
*
* @param {param} artist The artist name.
* @param {string} artist The artist's name.
* @returns {string[]}
*/
getAlbums: function getAlbums(artist) {
@@ -38,8 +44,8 @@ const Library = Module("library", {
* Returns an array of all the track names for <b>artist</b> and
* <b>album</b> in the main library.
*
* @param {param} artist The artist name.
* @param {param} album The album name.
* @param {string} artist The artist's name.
* @param {string} album The album's name.
* @returns {string[]}
*/
getTracks: function getTracks(artist, album) {