MCPcopy Create free account
hub / github.com/Moosync/Moosync / parse_playlist_item

Method parse_playlist_item

src-tauri/src/providers/spotify.rs:278–306  ·  view source on GitHub ↗
(&self, item: FullTrack)

Source from the content-addressed store, hash-verified

276
277 #[tracing::instrument(level = "debug", skip(self, item))]
278 fn parse_playlist_item(&self, item: FullTrack) -> Song {
279 let id = item.id.unwrap().to_string();
280 Song {
281 song: QueryableSong {
282 _id: Some(format!("spotify:{}", id)),
283 title: Some(item.name),
284 duration: Some(item.duration.num_seconds() as f64),
285 type_: SongType::SPOTIFY,
286 url: Some(id.clone()),
287 song_cover_path_high: item.album.images.first().map(|i| i.url.clone()),
288 playback_url: Some(id),
289 track_no: Some(item.disc_number as f64),
290 provider_extension: Some(self.key()),
291 ..Default::default()
292 },
293 album: if item.album.id.is_some() {
294 Some(Self::parse_album(item.album))
295 } else {
296 None
297 },
298 artists: Some(
299 item.artists
300 .into_iter()
301 .map(|a| Self::parse_artists(a, None))
302 .collect(),
303 ),
304 ..Default::default()
305 }
306 }
307
308 #[tracing::instrument(level = "debug", skip(self))]
309 async fn fetch_user_details(&self) -> Result<(ProviderStatus, bool)> {

Callers 5

get_playlist_contentMethod · 0.80
song_from_urlMethod · 0.80
get_suggestionsMethod · 0.80
get_album_contentMethod · 0.80
get_artist_contentMethod · 0.80

Calls 2

cloneMethod · 0.80
keyMethod · 0.45

Tested by

no test coverage detected