A decentralized music tracking and discovery platform built on AT Protocol 🎵
0
fork

Configure Feed

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

fix: update SQL queries in save_album, save_artist, and save_track to use title, artist, and album for URI updates

+6 -6
+2 -2
crates/feed/src/repo/duckdb/album.rs
··· 15 15 let album_hash = sha256::digest(format!("{} - {}", record.title, record.artist).to_lowercase()); 16 16 17 17 match conn.execute( 18 - "UPDATE albums SET uri = ? WHERE sha256 = ? AND uri IS NULL;", 19 - params![uri, album_hash], 18 + "UPDATE albums SET uri = ? WHERE title = ? AND artist = ? AND uri IS NULL;", 19 + params![uri, record.title, record.artist], 20 20 ) { 21 21 Ok(x) => { 22 22 tracing::info!("Album URI updated successfully: {}", x);
+2 -2
crates/feed/src/repo/duckdb/artist.rs
··· 15 15 let artist_hash = sha256::digest(record.name.to_lowercase()); 16 16 17 17 match conn.execute( 18 - "UPDATE artists SET uri = ?, picture = ? WHERE sha256 = ? AND URI IS NULL;", 19 - params![uri, record.picture_url, artist_hash], 18 + "UPDATE artists SET uri = ?, picture = ? WHERE name = ? AND uri IS NULL;", 19 + params![uri, record.picture_url, record.name], 20 20 ) { 21 21 Ok(x) => { 22 22 tracing::info!("Artist URI updated successfully: {}", x);
+2 -2
crates/feed/src/repo/duckdb/track.rs
··· 16 16 ); 17 17 18 18 match conn.execute( 19 - "UPDATE tracks SET uri = ? WHERE sha256 = ? AND uri IS NULL;", 20 - params![uri, track_hash], 19 + "UPDATE tracks SET uri = ? WHERE title = ? AND artist = ? AND album = ? AND uri IS NULL;", 20 + params![uri, record.title, record.artist, record.album], 21 21 ) { 22 22 Ok(x) => { 23 23 tracing::info!("Track URI updated successfully: {}", x);