@@ -91,7 +91,7 @@ class Source {
9191 }
9292
9393 get apiVersion ( ) {
94- return this . plugin . api || this . plugin . constructor . api || 1 ;
94+ return this . plugin . api || 1 ;
9595 }
9696
9797 /**
@@ -115,11 +115,11 @@ class Source {
115115 *
116116 * @param {User } user
117117 * @param {string } id
118- * @returns {Promise<PlaylistItemDesc? > }
118+ * @returns {Promise<PlaylistItemDesc | undefined > }
119119 */
120- getOne ( user , id ) {
121- return this . get ( user , [ id ] )
122- . then ( ( items ) => items [ 0 ] ) ;
120+ async getOne ( user , id ) {
121+ const [ item ] = await this . get ( user , [ id ] ) ;
122+ return item ;
123123 }
124124
125125 /**
@@ -164,6 +164,10 @@ class Source {
164164
165165 /**
166166 * Get playlists for a specific user from this media source.
167+ *
168+ * @param {User } user
169+ * @param {string } userID
170+ * @returns {Promise<unknown> }
167171 */
168172 async getUserPlaylists ( user , userID ) {
169173 if ( this . apiVersion < 3 || ! this . plugin . getUserPlaylists ) {
@@ -177,6 +181,10 @@ class Source {
177181
178182 /**
179183 * Get playlists for a specific user from this media source.
184+ *
185+ * @param {User } user
186+ * @param {string } playlistID
187+ * @returns {Promise<unknown> }
180188 */
181189 async getPlaylistItems ( user , playlistID ) {
182190 if ( this . apiVersion < 3 || ! this . plugin . getPlaylistItems ) {
@@ -203,6 +211,9 @@ class Source {
203211 throw new SourceNoImportError ( { name : this . type } ) ;
204212 }
205213
214+ /**
215+ * @param {import('./Uwave') } uw
216+ */
206217 static async plugin ( uw , { source : SourcePlugin , baseOptions = { } } ) {
207218 debug ( 'registering plugin' , SourcePlugin ) ;
208219 if ( SourcePlugin . api == null || SourcePlugin . api < 3 ) {
0 commit comments