@@ -10,6 +10,7 @@ import io.ktor.client.request.parameter
1010import io.ktor.http.URLBuilder
1111import io.ktor.http.Url
1212import io.ktor.http.appendPathSegments
13+ import io.ktor.http.buildUrl
1314import io.ktor.serialization.kotlinx.json.json
1415import kotlinx.serialization.json.Json
1516import ru.stersh.subsonic.api.model.AlbumList2Response
@@ -205,7 +206,9 @@ class SubsonicApi(
205206 ): SubsonicResponse <EmptyResponse > {
206207 return client
207208 .get(" rest/savePlayQueue" ) {
208- parameter(" id" , id)
209+ id.forEach {
210+ parameter(" id" , it)
211+ }
209212 parameter(" current" , current)
210213 parameter(" position" , position)
211214 }
@@ -219,9 +222,15 @@ class SubsonicApi(
219222 ): SubsonicResponse <EmptyResponse > {
220223 return client
221224 .get(" rest/star" ) {
222- parameter(" id" , id)
223- parameter(" albumId" , albumId)
224- parameter(" artistId" , artistId)
225+ id?.let {
226+ parameter(" id" , it)
227+ }
228+ albumId?.let {
229+ parameter(" albumId" , it)
230+ }
231+ artistId?.let {
232+ parameter(" artistId" , it)
233+ }
225234 }
226235 .body<SubsonicResponse <EmptyResponse >>()
227236 }
@@ -233,9 +242,15 @@ class SubsonicApi(
233242 ): SubsonicResponse <EmptyResponse > {
234243 return client
235244 .get(" rest/unstar" ) {
236- parameter(" id" , id)
237- parameter(" albumId" , albumId)
238- parameter(" artistId" , artistId)
245+ id?.let {
246+ parameter(" id" , it)
247+ }
248+ albumId?.let {
249+ parameter(" albumId" , it)
250+ }
251+ artistId?.let {
252+ parameter(" artistId" , it)
253+ }
239254 }
240255 .body<SubsonicResponse <EmptyResponse >>()
241256 }
0 commit comments