fix dynamic mode not sorting songs correctly

Previously when track information was loaded from the DB dates (such as
lastQueueDate) were read as strings since they were simply deserialized
with JSON.parse. Now type information is used to turn date properties
into actual dates so that sorting and date operations can work.
This commit is contained in:
Andrew Kelley 2014-04-18 12:16:28 -07:00
parent 656aab43ab
commit b861d4776c

View file

@ -1757,7 +1757,14 @@ function isFileIgnored(basename) {
}
function deserializeFileData(dataStr) {
return JSON.parse(dataStr);
var dbFile = JSON.parse(dataStr);
for (var propName in DB_PROPS) {
var propInfo = DB_PROPS[propName];
if (!propInfo) continue;
var parser = PROP_TYPE_PARSERS[propInfo.type];
dbFile[propName] = parser(dbFile[propName]);
}
return dbFile;
}
function serializePlaylistItem(item) {