A Wrapped / Replay like for teal.fm and rocksky.app (currently on hiatus)
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

set FindMbzData fields to None if they're blank strings

Mia 42ee58e0 3b076610

+11 -3
+11 -3
src/ingest/scrobbles.rs
··· 30 30 .map(|v| v.artist_name.as_str()); 31 31 32 32 let find = FindMbzData { 33 - release_name: scrobble.release_name.as_deref(), 34 - release_mbid: scrobble.release_mb_id.as_deref(), 33 + release_name: null_if_empty(scrobble.release_name.as_deref()), 34 + release_mbid: null_if_empty(scrobble.release_mb_id.as_deref()), 35 35 release_discrim: scrobble.release_discriminant.as_deref(), 36 - recording_mbid: scrobble.recording_mb_id.as_deref(), 36 + recording_mbid: null_if_empty(scrobble.recording_mb_id.as_deref()), 37 37 artist_name: artist, 38 38 track_discrim: scrobble.track_discriminant.as_deref(), 39 39 }; ··· 138 138 139 139 Ok(rkey) 140 140 } 141 + 142 + fn null_if_empty(input: Option<&str>) -> Option<&str> { 143 + match input { 144 + Some("") => None, 145 + Some(v) => Some(v), 146 + None => None, 147 + } 148 + }