SQLite store: Fix playlist syncing
parent
c5b940680d
commit
1a7e7a4b70
|
@ -1293,6 +1293,19 @@ static SQLiteStore *g_sharedStore = NULL;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Now to replace the playlist entries
|
||||||
|
for (size_t i = 0; i < [databaseMirror count]; ++i)
|
||||||
|
{
|
||||||
|
PlaylistEntry *oldpe = [databaseMirror objectAtIndex:i];
|
||||||
|
if ([oldpe dbIndex] == trackId)
|
||||||
|
{
|
||||||
|
PlaylistEntry *newpe = [track mutableCopy];
|
||||||
|
[newpe setIndex:i];
|
||||||
|
[newpe setEntryId:[oldpe entryId]];
|
||||||
|
[databaseMirror replaceObjectAtIndex:i withObject:newpe];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1885,6 +1898,9 @@ static SQLiteStore *g_sharedStore = NULL;
|
||||||
callback(-1);
|
callback(-1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[databaseMirror replaceObjectAtIndex:i withObject:newpe];
|
||||||
|
|
||||||
callback(progress);
|
callback(progress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue