javascript-ampache 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,9 +28,7 @@ export declare class Podcasts extends Base {
28
28
  podcast(params?: {
29
29
  filter: UID;
30
30
  include?: 'episodes';
31
- } & Pagination): Promise<Podcast[] | {
32
- podcast: Podcast[];
33
- }>;
31
+ } & Pagination): Promise<Podcast>;
34
32
  /**
35
33
  * Create a podcast that can be used by anyone to stream media.
36
34
  * @remarks MINIMUM_API_VERSION=420000
@@ -305,7 +305,7 @@ export declare class System extends Base {
305
305
  */
306
306
  advancedSearch(params: {
307
307
  operator: 'and' | 'or';
308
- type: 'song' | 'album' | 'album_disk' | 'artist' | 'label' | 'playlist' | 'podcast' | 'podcast_episode' | 'genre' | 'user' | 'video';
308
+ type: 'song' | 'album' | 'album_disk' | 'artist' | 'album_artist' | 'song_artist' | 'label' | 'playlist' | 'podcast' | 'podcast_episode' | 'genre' | 'user' | 'video';
309
309
  rules: Array<Array<string>>;
310
310
  random?: BinaryBoolean;
311
311
  } & Pagination): Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "javascript-ampache",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A JS library for the Ampache API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.m.js",
@@ -33,7 +33,6 @@ export class Genres extends Base {
33
33
  }) {
34
34
  let query = 'genre';
35
35
  query += qs.stringify(params, '&');
36
- let data = await this.request<{genre: Genre[]}>(query);
37
- return (data.genre) ? data.genre : data;
36
+ return this.request<Genre>(query);
38
37
  }
39
38
  }
@@ -37,8 +37,7 @@ export class Podcasts extends Base {
37
37
  } & Pagination) {
38
38
  let query = 'podcast';
39
39
  query += qs.stringify(params, '&');
40
- let data = await this.request<{podcast: Podcast[]}>(query);
41
- return (data.podcast) ? data.podcast : data;
40
+ return this.request<Podcast>(query);
42
41
  }
43
42
 
44
43
  /**
@@ -470,7 +470,7 @@ export class System extends Base {
470
470
  */
471
471
  async advancedSearch (params: {
472
472
  operator: 'and' | 'or',
473
- type: 'song' | 'album' | 'album_disk' | 'artist' | 'label' | 'playlist' | 'podcast' | 'podcast_episode' | 'genre' | 'user' | 'video',
473
+ type: 'song' | 'album' | 'album_disk' | 'artist' | 'album_artist' | 'song_artist' | 'label' | 'playlist' | 'podcast' | 'podcast_episode' | 'genre' | 'user' | 'video',
474
474
  rules: Array<Array<string>>,
475
475
  random?: BinaryBoolean,
476
476
  } & Pagination) {
@@ -504,6 +504,8 @@ export class System extends Base {
504
504
  data = await this.request<{album: Album[]}>(query);
505
505
  return (data.album) ? data.album : data;
506
506
  case "artist":
507
+ case "album_artist":
508
+ case "song_artist":
507
509
  data = await this.request<{artist: Artist[]}>(query);
508
510
  return (data.artist) ? data.artist : data;
509
511
  case "label":