comparison src/beefweb.rs @ 3:18f743c980fa

make this a bit more sane
author Paper <paper@tflc.us>
date Sat, 04 Apr 2026 17:03:22 -0400
parents 594c0f9d7972
children 26f695129c86
comparison
equal deleted inserted replaced
2:594c0f9d7972 3:18f743c980fa
382 options: 382 options:
383 }) 383 })
384 } 384 }
385 */ 385 */
386 386
387 pub async fn playlist_items(&self, playlist_id: &str, offset: i64, count: i64, columns: Vec<&str>) -> Result<PlaylistItems, anyhow::Error> 387 pub async fn playlist_items(&self, playlist_id: &str, offset: i64, count: i64, columns: &Vec<&str>) -> Result<PlaylistItems, anyhow::Error>
388 { 388 {
389 return Ok(self.client 389 return Ok(self.client
390 .get(format!("{}/playlists/{}/items/{}:{}", self.base_url, playlist_id, offset, count)) 390 .get(format!("{}/playlists/{}/items/{}:{}", self.base_url, playlist_id, offset, count))
391 .query(&[("columns", columns.join(","))]) 391 .query(&[("columns", columns.join(","))])
392 .send() 392 .send()
394 .json::<PlaylistItemsHelper>() 394 .json::<PlaylistItemsHelper>()
395 .await? 395 .await?
396 .playlist_items); 396 .playlist_items);
397 } 397 }
398 398
399 pub async fn playlist_item(&self, playlist_id: &str, index: i64, columns: &Vec<&str>) -> Result<PlaylistItems, anyhow::Error>
400 {
401 return self.playlist_items(playlist_id, index, 1, columns).await;
402 }
403
399 pub async fn artwork(&self, playlist_id: &str, index: i64) -> Result<bytes::Bytes, anyhow::Error> 404 pub async fn artwork(&self, playlist_id: &str, index: i64) -> Result<bytes::Bytes, anyhow::Error>
400 { 405 {
401 return Ok(self.client 406 return Ok(self.client
402 .get(format!("{}/artwork/{}/{}", self.base_url, playlist_id, index)) 407 .get(format!("{}/artwork/{}/{}", self.base_url, playlist_id, index))
403 .send() 408 .send()