Fixes for the "Doesn't actually delete stuff on rescan" bug. Thanks to Roger Mundt for the logs and documentation to track this down.
This commit is contained in:
parent
f7bec2c5f6
commit
133e971edc
4
CREDITS
4
CREDITS
|
@ -62,3 +62,7 @@ Stephen Rubner
|
||||||
Ciamac Moallemi
|
Ciamac Moallemi
|
||||||
* gzip content-encoding
|
* gzip content-encoding
|
||||||
|
|
||||||
|
Roger Mundt
|
||||||
|
* troubleshooting and debugging help
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -498,13 +498,23 @@ int db_start_initial_update(void) {
|
||||||
*/
|
*/
|
||||||
int db_end_initial_update(void) {
|
int db_end_initial_update(void) {
|
||||||
const void *val;
|
const void *val;
|
||||||
|
unsigned long int oldval;
|
||||||
|
unsigned long int *oldptr;
|
||||||
|
|
||||||
DB_PLAYLIST *current,*last;
|
DB_PLAYLIST *current,*last;
|
||||||
DB_PLAYLISTENTRY *pple;
|
DB_PLAYLISTENTRY *pple;
|
||||||
|
|
||||||
DPRINTF(E_DBG,L_DB|L_SCAN,"Initial update over. Removing stale items\n");
|
DPRINTF(E_DBG,L_DB|L_SCAN,"Initial update over. Removing stale items\n");
|
||||||
for(val=rblookup(RB_LUFIRST,NULL,db_removed); val != NULL;
|
val=rblookup(RB_LUFIRST,NULL,db_removed);
|
||||||
val=rblookup(RB_LUNEXT,val,db_removed)) {
|
|
||||||
db_delete(*((int*)val));
|
while(val) {
|
||||||
|
oldval=(*((int*)val));
|
||||||
|
oldptr=(unsigned long int*)rbdelete((void*)&oldval,db_removed);
|
||||||
|
if(oldptr)
|
||||||
|
free(oldptr);
|
||||||
|
db_delete(oldval);
|
||||||
|
|
||||||
|
val=rblookup(RB_LUFIRST,NULL,db_removed);
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINTF(E_DBG,L_DB|L_SCAN,"Done removing stale items\n");
|
DPRINTF(E_DBG,L_DB|L_SCAN,"Done removing stale items\n");
|
||||||
|
|
Loading…
Reference in New Issue