A decentralized music tracking and discovery platform built on AT Protocol 🎵 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz

refactor: replace album_art processing with album_art_url in scrobble-related functions and types

+14 -48
+6 -48
crates/jetstream/src/repo.rs
··· 116 116 artist: scrobble_record.artist.clone(), 117 117 album: scrobble_record.album.clone(), 118 118 duration: scrobble_record.duration, 119 - artwork_url: scrobble_record.album_art.clone().map(|x| { 120 - format!( 121 - "https://cdn.bsky.app/img/feed_thumbnail/plain/{}/{}@{}", 122 - did, 123 - x.r#ref.link, 124 - x.mime_type.split('/').last().unwrap_or("jpeg") 125 - ) 126 - }), 119 + artwork_url: scrobble_record.album_art_url.clone(), 127 120 spotify_url: scrobble_record.spotify_link.clone(), 128 121 tidal_url: scrobble_record.tidal_link.clone(), 129 122 youtube_url: scrobble_record.youtube_link.clone(), ··· 281 274 .bind(scrobble_record.title) 282 275 .bind(scrobble_record.artist) 283 276 .bind(scrobble_record.album) 284 - .bind(scrobble_record.album_art.map(|x| { 285 - format!( 286 - "https://cdn.bsky.app/img/feed_thumbnail/plain/{}/{}@{}", 287 - did, 288 - x.r#ref.link, 289 - x.mime_type.split('/').last().unwrap_or("jpeg") 290 - ) 291 - })) 277 + .bind(scrobble_record.album_art_url) 292 278 .bind(scrobble_record.album_artist) 293 279 .bind(scrobble_record.track_number) 294 280 .bind(scrobble_record.duration) ··· 360 346 ) 361 347 .bind(scrobble_record.album) 362 348 .bind(scrobble_record.album_artist) 363 - .bind(scrobble_record.album_art.map(|x| { 364 - format!( 365 - "https://cdn.bsky.app/img/feed_thumbnail/plain/{}/{}@{}", 366 - did, 367 - x.r#ref.link, 368 - x.mime_type.split('/').last().unwrap_or("jpeg") 369 - ) 370 - })) 349 + .bind(scrobble_record.album_art_url) 371 350 .bind(scrobble_record.year) 372 351 .bind(scrobble_record.release_date) 373 352 .bind(&hash) ··· 579 558 .bind(record.name) 580 559 .bind(&hash) 581 560 .bind(uri) 582 - .bind(record.picture.map(|x| { 583 - format!( 584 - "https://cdn.bsky.app/img/avatar/plain/{}/{}@{}", 585 - did, 586 - x.r#ref.link, 587 - x.mime_type.split('/').last().unwrap_or("jpeg") 588 - ) 589 - })) 561 + .bind(record.picture_url) 590 562 .execute(&mut **tx) 591 563 .await?; 592 564 ··· 689 661 ) 690 662 .bind(record.title) 691 663 .bind(record.artist) 692 - .bind(record.album_art.map(|x| { 693 - format!( 694 - "https://cdn.bsky.app/img/feed_thumbnail/plain/{}/{}@{}", 695 - did, 696 - x.r#ref.link, 697 - x.mime_type.split('/').last().unwrap_or("jpeg") 698 - ) 699 - })) 664 + .bind(record.album_art_url) 700 665 .bind(record.year) 701 666 .bind(record.release_date) 702 667 .bind(&hash) ··· 816 781 .bind(record.title) 817 782 .bind(record.artist) 818 783 .bind(record.album) 819 - .bind(record.album_art.map(|x| { 820 - format!( 821 - "https://cdn.bsky.app/img/feed_thumbnail/plain/{}/{}@{}", 822 - did, 823 - x.r#ref.link, 824 - x.mime_type.split('/').last().unwrap_or("jpeg") 825 - ) 826 - })) 784 + .bind(record.album_art_url) 827 785 .bind(record.album_artist) 828 786 .bind(record.track_number) 829 787 .bind(record.duration)
+8
crates/jetstream/src/types.rs
··· 66 66 #[serde(skip_serializing_if = "Option::is_none")] 67 67 pub album_art: Option<ImageBlob>, 68 68 #[serde(skip_serializing_if = "Option::is_none")] 69 + pub album_art_url: Option<String>, 70 + #[serde(skip_serializing_if = "Option::is_none")] 69 71 pub youtube_link: Option<String>, 70 72 #[serde(skip_serializing_if = "Option::is_none")] 71 73 pub spotify_link: Option<String>, ··· 132 134 pub bio: Option<String>, 133 135 #[serde(skip_serializing_if = "Option::is_none")] 134 136 pub picture: Option<ImageBlob>, 137 + #[serde(skip_serializing_if = "Option::is_none")] 138 + pub picture_url: Option<String>, 135 139 #[serde(skip_serializing_if = "Option::is_none")] 136 140 pub tags: Option<Vec<String>>, 137 141 #[serde(skip_serializing_if = "Option::is_none")] ··· 159 163 #[serde(skip_serializing_if = "Option::is_none")] 160 164 pub album_art: Option<ImageBlob>, 161 165 #[serde(skip_serializing_if = "Option::is_none")] 166 + pub album_art_url: Option<String>, 167 + #[serde(skip_serializing_if = "Option::is_none")] 162 168 pub tags: Option<Vec<String>>, 163 169 #[serde(skip_serializing_if = "Option::is_none")] 164 170 pub youtube_link: Option<String>, ··· 202 208 pub wiki: Option<String>, 203 209 #[serde(skip_serializing_if = "Option::is_none")] 204 210 pub album_art: Option<ImageBlob>, 211 + #[serde(skip_serializing_if = "Option::is_none")] 212 + pub album_art_url: Option<String>, 205 213 #[serde(skip_serializing_if = "Option::is_none")] 206 214 pub youtube_link: Option<String>, 207 215 #[serde(skip_serializing_if = "Option::is_none")]