fix(tracks): insert tracks breaks playlists
This commit is contained in:
@@ -219,7 +219,18 @@ pub async fn insert_tracks(
|
|||||||
});
|
});
|
||||||
|
|
||||||
let mut statement =
|
let mut statement =
|
||||||
tx.prepare("INSERT OR REPLACE INTO tracks (hash, library_path_id, name, artist_id, path, duration) VALUES (?1, ?2, ?3, ?4, ?5, ?6)")?;
|
tx.prepare("
|
||||||
|
INSERT INTO tracks
|
||||||
|
(hash, library_path_id, name, artist_id, path, duration)
|
||||||
|
VALUES
|
||||||
|
(?1, ?2, ?3, ?4, ?5, ?6)
|
||||||
|
ON CONFLICT(hash) DO UPDATE SET
|
||||||
|
library_path_id = ?2,
|
||||||
|
name = ?3,
|
||||||
|
artist_id = ?4,
|
||||||
|
path = ?5,
|
||||||
|
duration = ?6
|
||||||
|
")?;
|
||||||
|
|
||||||
for (hash, meta) in tracks.iter() {
|
for (hash, meta) in tracks.iter() {
|
||||||
statement.execute(params![
|
statement.execute(params![
|
||||||
|
|||||||
Reference in New Issue
Block a user