javascript-ampache 1.1.3 → 1.1.4
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.
- package/package.json +1 -1
- package/src/albums/index.ts +2 -0
- package/src/albums/types.ts +2 -0
- package/src/artists/types.ts +2 -2
- package/src/auth/types.ts +7 -0
- package/src/base.ts +1 -1
- package/src/bookmarks/index.ts +116 -116
- package/src/catalogs/index.ts +130 -130
- package/src/playlists/index.ts +280 -262
- package/src/playlists/types.ts +7 -0
- package/src/shouts/types.ts +2 -0
- package/src/songs/index.ts +221 -221
- package/src/system/index.ts +843 -689
- package/src/system/types.ts +9 -0
package/src/playlists/index.ts
CHANGED
|
@@ -1,262 +1,280 @@
|
|
|
1
|
-
import qs from "querystringify";
|
|
2
|
-
import { PlaylistResponse, PlaylistsResponse } from "./types";
|
|
3
|
-
import { SongsResponse } from "../songs/types";
|
|
4
|
-
import {
|
|
5
|
-
Base,
|
|
6
|
-
BinaryBoolean,
|
|
7
|
-
ExtendedPagination,
|
|
8
|
-
Pagination,
|
|
9
|
-
Success,
|
|
10
|
-
UID,
|
|
11
|
-
} from "../base";
|
|
12
|
-
|
|
13
|
-
export class Playlists extends Base {
|
|
14
|
-
/**
|
|
15
|
-
* This returns playlists based on the specified filter
|
|
16
|
-
* @remarks MINIMUM_API_VERSION=380001
|
|
17
|
-
* @param [params.filter] Filter results to match this string
|
|
18
|
-
* @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
|
|
19
|
-
* @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
|
|
20
|
-
* @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
|
|
21
|
-
* @param [params.hide_search] 0, 1 (if true do not include searches/smartlists in the result)
|
|
22
|
-
* @param [params.show_dupes] 0, 1 (if true ignore 'api_hide_dupe_searches' setting)
|
|
23
|
-
* @param [params.
|
|
24
|
-
* @param [params.
|
|
25
|
-
* @param [params.
|
|
26
|
-
* @param [params.
|
|
27
|
-
* @
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
*
|
|
48
|
-
* @
|
|
49
|
-
* @param [params.
|
|
50
|
-
* @param [params.
|
|
51
|
-
* @param [params.
|
|
52
|
-
* @
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
*
|
|
78
|
-
* @
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
*
|
|
90
|
-
* @
|
|
91
|
-
* @param [params.
|
|
92
|
-
* @param [params.
|
|
93
|
-
* @param [params.
|
|
94
|
-
* @param [params.
|
|
95
|
-
* @param [params.
|
|
96
|
-
* @param [params.
|
|
97
|
-
* @
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
*
|
|
116
|
-
* @
|
|
117
|
-
* @param [params.
|
|
118
|
-
* @param [params.
|
|
119
|
-
* @param [params.
|
|
120
|
-
* @param [params.
|
|
121
|
-
* @param [params.
|
|
122
|
-
* @param [params.
|
|
123
|
-
* @
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
*
|
|
142
|
-
* @
|
|
143
|
-
* @
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
*
|
|
155
|
-
* @
|
|
156
|
-
* @param params.
|
|
157
|
-
* @
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
* @
|
|
175
|
-
* @param
|
|
176
|
-
* @param [params.
|
|
177
|
-
* @param [params.
|
|
178
|
-
* @param [params.
|
|
179
|
-
* @
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
*
|
|
198
|
-
* @
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
*
|
|
210
|
-
* @
|
|
211
|
-
* @param
|
|
212
|
-
* @
|
|
213
|
-
* @
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
*
|
|
225
|
-
* @
|
|
226
|
-
* @param
|
|
227
|
-
* @
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
*
|
|
239
|
-
* @
|
|
240
|
-
* @param [params.
|
|
241
|
-
* @param [params.
|
|
242
|
-
* @param [params.
|
|
243
|
-
* @param [params.
|
|
244
|
-
* @param [params.
|
|
245
|
-
* @param [params.
|
|
246
|
-
* @
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
1
|
+
import qs from "querystringify";
|
|
2
|
+
import { HashResponse, PlaylistResponse, PlaylistsResponse } from "./types";
|
|
3
|
+
import { SongsResponse } from "../songs/types";
|
|
4
|
+
import {
|
|
5
|
+
Base,
|
|
6
|
+
BinaryBoolean,
|
|
7
|
+
ExtendedPagination,
|
|
8
|
+
Pagination,
|
|
9
|
+
Success,
|
|
10
|
+
UID,
|
|
11
|
+
} from "../base";
|
|
12
|
+
|
|
13
|
+
export class Playlists extends Base {
|
|
14
|
+
/**
|
|
15
|
+
* This returns playlists based on the specified filter
|
|
16
|
+
* @remarks MINIMUM_API_VERSION=380001
|
|
17
|
+
* @param [params.filter] Filter results to match this string
|
|
18
|
+
* @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
|
|
19
|
+
* @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
|
|
20
|
+
* @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
|
|
21
|
+
* @param [params.hide_search] 0, 1 (if true do not include searches/smartlists in the result)
|
|
22
|
+
* @param [params.show_dupes] 0, 1 (if true ignore 'api_hide_dupe_searches' setting)
|
|
23
|
+
* @param [params.include] 0, 1 (if true include the objects in the playlist)
|
|
24
|
+
* @param [params.offset]
|
|
25
|
+
* @param [params.limit]
|
|
26
|
+
* @param [params.cond]
|
|
27
|
+
* @param [params.sort]
|
|
28
|
+
* @see {@link https://ampache.org/api/api-json-methods#playlists}
|
|
29
|
+
*/
|
|
30
|
+
playlists(
|
|
31
|
+
params?: {
|
|
32
|
+
filter?: string;
|
|
33
|
+
exact?: BinaryBoolean;
|
|
34
|
+
add?: Date;
|
|
35
|
+
update?: Date;
|
|
36
|
+
hide_search?: BinaryBoolean;
|
|
37
|
+
show_dupes?: BinaryBoolean;
|
|
38
|
+
include?: BinaryBoolean;
|
|
39
|
+
} & ExtendedPagination,
|
|
40
|
+
) {
|
|
41
|
+
let query = "playlists";
|
|
42
|
+
query += qs.stringify(params, "&");
|
|
43
|
+
return this.request<PlaylistsResponse>(query);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* This returns smartlists based on the specified filter. NOTE: Filtered from Playlists() so pagination is invalid.
|
|
48
|
+
* @remarks MINIMUM_API_VERSION=380001
|
|
49
|
+
* @param [params.filter] Filter results to match this string
|
|
50
|
+
* @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
|
|
51
|
+
* @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
|
|
52
|
+
* @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
|
|
53
|
+
* @param [params.show_dupes] 0, 1 (if true ignore 'api_hide_dupe_searches' setting)
|
|
54
|
+
* @see {@link https://ampache.org/api/api-json-methods#playlists}
|
|
55
|
+
*/
|
|
56
|
+
smartlists(params?: {
|
|
57
|
+
filter?: string;
|
|
58
|
+
exact?: BinaryBoolean;
|
|
59
|
+
add?: Date;
|
|
60
|
+
update?: Date;
|
|
61
|
+
show_dupes?: BinaryBoolean;
|
|
62
|
+
}) {
|
|
63
|
+
let query = "playlists";
|
|
64
|
+
query += qs.stringify(params, "&");
|
|
65
|
+
return this.request<PlaylistsResponse>(query).then((response) => {
|
|
66
|
+
// filter out regular playlists
|
|
67
|
+
if (Array.isArray(response.playlist)) {
|
|
68
|
+
response.playlist = response.playlist.filter((item) =>
|
|
69
|
+
item.id.toString().startsWith("smart_"),
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
return response;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* This returns a single playlist
|
|
78
|
+
* @remarks MINIMUM_API_VERSION=380001
|
|
79
|
+
* @param params.filter UID to find
|
|
80
|
+
* @see {@link https://ampache.org/api/api-json-methods#playlist}
|
|
81
|
+
*/
|
|
82
|
+
playlist(params: { filter: UID }) {
|
|
83
|
+
let query = "playlist";
|
|
84
|
+
query += qs.stringify(params, "&");
|
|
85
|
+
return this.request<PlaylistResponse>(query);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* This returns a user's playlists based on the specified filter
|
|
90
|
+
* @remarks MINIMUM_API_VERSION=6.3.0
|
|
91
|
+
* @param [params.filter] Filter results to match this string
|
|
92
|
+
* @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
|
|
93
|
+
* @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
|
|
94
|
+
* @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
|
|
95
|
+
* @param [params.offset]
|
|
96
|
+
* @param [params.limit]
|
|
97
|
+
* @param [params.cond]
|
|
98
|
+
* @param [params.sort]
|
|
99
|
+
* @see {@link https://ampache.org/api/api-json-methods#user_playlists}
|
|
100
|
+
*/
|
|
101
|
+
userPlaylists(
|
|
102
|
+
params?: {
|
|
103
|
+
filter?: string;
|
|
104
|
+
exact?: BinaryBoolean;
|
|
105
|
+
add?: Date;
|
|
106
|
+
update?: Date;
|
|
107
|
+
} & ExtendedPagination,
|
|
108
|
+
) {
|
|
109
|
+
let query = "user_playlists";
|
|
110
|
+
query += qs.stringify(params, "&");
|
|
111
|
+
return this.request<PlaylistsResponse>(query);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* This returns a user's smartlists based on the specified filter
|
|
116
|
+
* @remarks MINIMUM_API_VERSION=6.3.0
|
|
117
|
+
* @param [params.filter] Filter results to match this string
|
|
118
|
+
* @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
|
|
119
|
+
* @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
|
|
120
|
+
* @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
|
|
121
|
+
* @param [params.offset]
|
|
122
|
+
* @param [params.limit]
|
|
123
|
+
* @param [params.cond]
|
|
124
|
+
* @param [params.sort]
|
|
125
|
+
* @see {@link https://ampache.org/api/api-json-methods#user_smartlists}
|
|
126
|
+
*/
|
|
127
|
+
userSmartlists(
|
|
128
|
+
params?: {
|
|
129
|
+
filter?: string;
|
|
130
|
+
exact?: BinaryBoolean;
|
|
131
|
+
add?: Date;
|
|
132
|
+
update?: Date;
|
|
133
|
+
} & ExtendedPagination,
|
|
134
|
+
) {
|
|
135
|
+
let query = "user_smartlists";
|
|
136
|
+
query += qs.stringify(params, "&");
|
|
137
|
+
return this.request<PlaylistsResponse>(query);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* This creates a new playlist and returns it
|
|
142
|
+
* @remarks MINIMUM_API_VERSION=380001
|
|
143
|
+
* @param params.name Playlist name
|
|
144
|
+
* @param [params.type] public, private (Playlist type)
|
|
145
|
+
* @see {@link https://ampache.org/api/api-json-methods#playlist_create}
|
|
146
|
+
*/
|
|
147
|
+
playlistCreate(params: { name: string; type?: "public" | "private" }) {
|
|
148
|
+
let query = "playlist_create";
|
|
149
|
+
query += qs.stringify(params, "&");
|
|
150
|
+
return this.request<PlaylistResponse>(query);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* This adds an item to a playlist
|
|
155
|
+
* @remarks MINIMUM_API_VERSION=6.3.0
|
|
156
|
+
* @param params.filter UID of Playlist
|
|
157
|
+
* @param params.id UID of the object to add to playlist
|
|
158
|
+
* @param params.type 'song', 'album', 'artist', 'playlist'
|
|
159
|
+
* @see {@link https://ampache.org/api/api-json-methods#playlist_add}
|
|
160
|
+
*/
|
|
161
|
+
playlistAdd(params: {
|
|
162
|
+
filter: UID;
|
|
163
|
+
id: UID;
|
|
164
|
+
type: "song" | "album" | "artist" | "playlist";
|
|
165
|
+
}) {
|
|
166
|
+
let query = "playlist_add";
|
|
167
|
+
query += qs.stringify(params, "&");
|
|
168
|
+
return this.request<Success>(query);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* This modifies name and type of the playlist.
|
|
173
|
+
* NOTE items and tracks must be sent together and be of equal length.
|
|
174
|
+
* @remarks MINIMUM_API_VERSION=400001
|
|
175
|
+
* @param params.filter UID to find
|
|
176
|
+
* @param [params.name] Playlist name
|
|
177
|
+
* @param [params.type] public, private (Playlist type)
|
|
178
|
+
* @param [params.owner] Change playlist owner to the user id (-1 = System playlist)
|
|
179
|
+
* @param [params.items] comma-separated song_id's (replaces existing items with a new id)
|
|
180
|
+
* @param [params.tracks] comma-separated playlisttrack numbers matched to 'items' in order
|
|
181
|
+
* @see {@link https://ampache.org/api/api-json-methods#playlist_edit}
|
|
182
|
+
*/
|
|
183
|
+
playlistEdit(params: {
|
|
184
|
+
filter: UID;
|
|
185
|
+
name?: string;
|
|
186
|
+
type?: "public" | "private";
|
|
187
|
+
owner?: string;
|
|
188
|
+
items?: string;
|
|
189
|
+
tracks?: string;
|
|
190
|
+
}) {
|
|
191
|
+
let query = "playlist_edit";
|
|
192
|
+
query += qs.stringify(params, "&");
|
|
193
|
+
return this.request<Success>(query);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* This deletes a playlist
|
|
198
|
+
* @remarks MINIMUM_API_VERSION=380001
|
|
199
|
+
* @param params.filter UID of playlist to delete
|
|
200
|
+
* @see {@link https://ampache.org/api/api-json-methods#playlist_delete}
|
|
201
|
+
*/
|
|
202
|
+
playlistDelete(params: { filter: UID }) {
|
|
203
|
+
let query = "playlist_delete";
|
|
204
|
+
query += qs.stringify(params, "&");
|
|
205
|
+
return this.request<Success>(query);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* This adds a song to a playlist
|
|
210
|
+
* @remarks MINIMUM_API_VERSION=380001; CHANGED_IN_API_VERSION=400003
|
|
211
|
+
* @param params.filter UID of Playlist
|
|
212
|
+
* @param params.song UID of song to add to playlist
|
|
213
|
+
* @param [params.check] 0, 1 Whether to check and ignore duplicates (default = 0)
|
|
214
|
+
* @see {@link https://ampache.org/api/api-json-methods#playlist_add_song}
|
|
215
|
+
* @deprecated Being removed in 7.0.0. Use `playlist_add` instead.
|
|
216
|
+
*/
|
|
217
|
+
playlistAddSong(params: { filter: UID; song: UID; check?: BinaryBoolean }) {
|
|
218
|
+
let query = "playlist_add_song";
|
|
219
|
+
query += qs.stringify(params, "&");
|
|
220
|
+
return this.request<Success>(query);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* This remove a song from a playlist
|
|
225
|
+
* @remarks MINIMUM_API_VERSION=380001; CHANGED_IN_API_VERSION=400001
|
|
226
|
+
* @param params.filter UID of Playlist
|
|
227
|
+
* @param [params.song] UID of song to remove from playlist
|
|
228
|
+
* @param [params.track] Track number to remove from playlist
|
|
229
|
+
* @see {@link https://ampache.org/api/api-json-methods#playlist_remove_song}
|
|
230
|
+
*/
|
|
231
|
+
playlistRemoveSong(params: { filter: UID; song?: UID; track?: number }) {
|
|
232
|
+
let query = "playlist_remove_song";
|
|
233
|
+
query += qs.stringify(params, "&");
|
|
234
|
+
return this.request<Success>(query);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Get a list of song JSON, indexes or id's based on some simple search criteria
|
|
239
|
+
* @remarks MINIMUM_API_VERSION=400001; CHANGED_IN_API_VERSION=400002; 'recent' will search for tracks played after 'Popular Threshold' days; 'forgotten' will search for tracks played before 'Popular Threshold' days; 'unplayed' added in 400002 for searching unplayed tracks
|
|
240
|
+
* @param [params.mode] (default = 'random')
|
|
241
|
+
* @param [params.filter] string LIKE matched to song title
|
|
242
|
+
* @param [params.album] UID of album
|
|
243
|
+
* @param [params.artist] UID of artist
|
|
244
|
+
* @param [params.flag] 0, 1 (get flagged songs only. default = 0)
|
|
245
|
+
* @param [params.format] song, index, id (default = 'song')
|
|
246
|
+
* @param [params.offset]
|
|
247
|
+
* @param [params.limit]
|
|
248
|
+
* @see {@link https://ampache.org/api/api-json-methods#playlist_generate}
|
|
249
|
+
*/
|
|
250
|
+
playlistGenerate(
|
|
251
|
+
params?: {
|
|
252
|
+
mode?: "recent" | "forgotten" | "unplayed" | "random";
|
|
253
|
+
filter?: string;
|
|
254
|
+
album?: number;
|
|
255
|
+
artist?: number;
|
|
256
|
+
flag?: BinaryBoolean;
|
|
257
|
+
format?: "song" | "index" | "id";
|
|
258
|
+
} & Pagination,
|
|
259
|
+
) {
|
|
260
|
+
let query = "playlist_generate";
|
|
261
|
+
query += qs.stringify(params, "&");
|
|
262
|
+
return this.request<SongsResponse>(query);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* This returns the md5 hash for the songs in a playlist
|
|
267
|
+
* @remarks MINIMUM_API_VERSION=6.6.0
|
|
268
|
+
* @param params.filter string UID of Playlist
|
|
269
|
+
* @see {@link https://ampache.org/api/api-json-methods#playlist_hash}
|
|
270
|
+
*/
|
|
271
|
+
playlistHash(
|
|
272
|
+
params: {
|
|
273
|
+
filter: UID;
|
|
274
|
+
},
|
|
275
|
+
) {
|
|
276
|
+
let query = "playlist_hash";
|
|
277
|
+
query += qs.stringify(params, "&");
|
|
278
|
+
return this.request<HashResponse>(query);
|
|
279
|
+
}
|
|
280
|
+
}
|
package/src/playlists/types.ts
CHANGED
|
@@ -13,6 +13,9 @@ export type PlaylistResponse = {
|
|
|
13
13
|
rating: number | null;
|
|
14
14
|
averagerating: number | null;
|
|
15
15
|
user: UserSummary;
|
|
16
|
+
has_access: boolean;
|
|
17
|
+
has_collaborate: boolean;
|
|
18
|
+
last_update: number;
|
|
16
19
|
};
|
|
17
20
|
|
|
18
21
|
export type PlaylistsResponse = {
|
|
@@ -20,3 +23,7 @@ export type PlaylistsResponse = {
|
|
|
20
23
|
md5: string;
|
|
21
24
|
playlist: PlaylistResponse[];
|
|
22
25
|
};
|
|
26
|
+
|
|
27
|
+
export type HashResponse = {
|
|
28
|
+
md5: string;
|
|
29
|
+
};
|