beatbox duplicates my songs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
BeatBox |
Fix Released
|
High
|
Scott Ringwelski |
Bug Description
BeatBox duplicates songs sometimes.
1. Import new music
2. Force beatbox to save that song (edit metadata)
3. The rowid of the internal song in code is 1 less than the rowid on the db, and so beatbox updates the wrong song thereby replacing it with a duplicate of the song 1 lower. Therefore, beatbox duplicates one song and removes another from the db.
My own notes:
Look into true updating of songs rather than fresh saves everytime.
Look into doing update if song in db, otherwise adding it.
Look into reloading db after adding songs to the db. this is not optimal
Why is it off in the first place? foreach loop. what is the difference between songs that were added dynamically and songs that were added through loading the db?
foreach loop is inconsistent, is there a way to consistently loop through a hashmap? yes a for loop. as long as entries are consolidated. pass hashmap instead of collection through to dbm and do for loop. downsides? could be slower since we have to check if songs.has_
looking into true update: will have to be more distinction between adding, updating, and removing songs. no more calling save_songs to easily save the db. could cause a lot of internal problems/bugs to fix. could be a lot of work for 1 small problem. does allow for consistency of rowid's in songs. potentially allow for playlists based on rowid list rather than list of song names. makes it faster. also could be good for device sync as a consistent rowid could be very helpful. all in all definitely something i should look into first, potentially waste my time on yet potentially make beatbox that much better.
Changed in beat-box: | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → Scott Ringwelski (sgringwe) |
milestone: | none → 0.1 |
db now is consistent through runs, each song has a consistent unique id, duplicate problem fixed.
testing very welcome.