Comparing version 0.9.5 to 0.9.6
@@ -377,3 +377,9 @@ var fs = require("fs"), | ||
client.hget(key, "metadata", function(err, metadata) { | ||
metadata = JSON.parse(metadata); | ||
try { | ||
metadata = JSON.parse(metadata) | ||
} | ||
catch (parseErr) { | ||
//if we can't understand it we don't want it | ||
metadata = {}; | ||
} | ||
if (typeof(metadata) !== "undefined" && metadata != null && Object.keys(metadata).length > 0) { | ||
@@ -402,3 +408,9 @@ if (typeof callback !== "undefined") | ||
if (typeof callback !== "undefined") { | ||
var metadata = JSON.parse(hash.metadata); | ||
var metadata = {}; | ||
try { | ||
metadata = JSON.parse(hash.metadata); | ||
} | ||
catch (parseErr) { | ||
//no good metadata - ignore | ||
} | ||
callback(null, metadata, hash.post); | ||
@@ -653,3 +665,9 @@ } | ||
if (typeof callback !== "undefined") { | ||
var metadata = JSON.parse(hash.metadata); | ||
var metadata = {}; | ||
try { | ||
metadata = JSON.parse(hash.metadata); | ||
} | ||
catch (parseErr) { | ||
//no good metadata - ignore | ||
} | ||
callback(null, metadata, hash.post); | ||
@@ -656,0 +674,0 @@ } |
@@ -7,3 +7,3 @@ { | ||
"tags": [ "redis", "blog" ], | ||
"version": "0.9.5", | ||
"version": "0.9.6", | ||
"homepage": "http://www.agnos.is/", | ||
@@ -10,0 +10,0 @@ "repository": { |
@@ -130,2 +130,5 @@ reed | ||
`metadata`, and `htmlContent`. | ||
* `all(callback)`: Retrieves all blog posts. The callback receives `error` and | ||
`posts`, which is a list of post objects, each containing `metadata` and | ||
`htmlContent` properties. | ||
* `getMetadata(id, callback)`: Retrieves only the metadata for a blog post. The | ||
@@ -132,0 +135,0 @@ callback receives `error` (if there was an error), and `metadata`, an object |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24934
595
209