Commit 2dc0f2000ea26763376b01729bf194b42f37f963
Don't double images on some books, requires a patchfor for mutant
Anders Rune Jensen committed on 11/4/2017, 2:39:11 PMParent: 5536690d426af0f924c488a430680757ed70c82d
Files changed
book/obs/book.js | changed |
book/obs/struct.js | changed |
package.json | changed |
book/obs/book.js | ||
---|---|---|
@@ -21,9 +21,9 @@ | ||
21 | 21 … | book.authors.set(dbBook.common.authors) |
22 | 22 … | book.description.set(dbBook.common.description) |
23 | 23 … | |
24 | 24 … | if (dbBook.common.image) |
25 | - book.images.add(dbBook.common.image) // https://github.com/mmckegg/mutant/issues/20 | |
25 … | + book.images.add(dbBook.common.image) | |
26 | 26 … | |
27 | 27 … | Object.keys(dbBook.subjective).forEach((k) => { |
28 | 28 … | if (book.subjective.has(k)) |
29 | 29 … | { |
book/obs/struct.js | ||
---|---|---|
@@ -1,6 +1,7 @@ | ||
1 | 1 … | const nest = require('depnest') |
2 | 2 … | const { Value, Set, Dict, Struct, forEachPair } = require('mutant') |
3 … | +const eq = require('deep-equal') | |
3 | 4 … | |
4 | 5 … | exports.needs = nest({ |
5 | 6 … | 'sbot.async.publish': 'first' |
6 | 7 … | }) |
@@ -13,9 +14,9 @@ | ||
13 | 14 … | key: Value(''), |
14 | 15 … | title: Value(''), |
15 | 16 … | authors: Value(''), |
16 | 17 … | description: Value(''), |
17 | - images: Set([]), | |
18 … | + images: Set([], { comparer: eq }), | |
18 | 19 … | subjective: Dict() |
19 | 20 … | }) |
20 | 21 … | |
21 | 22 … | struct.create = function(cb) |
Built with git-ssb-web