Commit 1a2e89c1945e9b2330e4834a9e544adbc12b171d
use blob_url plugin instead of hard coding the server
Dominic Tarr committed on 7/25/2016, 6:03:55 AMParent: ff26c80cfeeef42ea28f8dcf591948899991614e
Files changed
modules/music-release-cc.js | changed |
modules/music-release-cc.js | ||
---|---|---|
@@ -8,25 +8,26 @@ | ||
8 | 8 | var plugs = require('../plugs'); |
9 | 9 | var message_link = plugs.first(exports.message_link = []); |
10 | 10 | var message_confirm = plugs.first(exports.message_confirm = []); |
11 | 11 | var sbot_links = plugs.first(exports.sbot_links = []); |
12 | +var blob_url = plugs.first(exports.blob_url = []); | |
12 | 13 | |
13 | 14 | exports.message_content = function(msg, sbot) { |
14 | 15 | if (msg.value.content.type !== 'music-release-cc') |
15 | 16 | return; |
16 | 17 | |
17 | 18 | var tracks = msg.value.content.tracks; |
18 | 19 | return h('div', |
19 | - h('img', { "src" : "http://localhost:7777/" + encodeURIComponent(msg.value.content.cover) }), | |
20 | + h('img', { "src" : blob_url(msg.value.content.cover) }), | |
20 | 21 | h('h1', msg.value.content.title), |
21 | 22 | h('ol', |
22 | 23 | Object.keys(tracks).map(function(k) { |
23 | 24 | var t = tracks[k]; |
24 | 25 | return h('li', t.fname, |
25 | 26 | h("br"), |
26 | 27 | h('audio', { |
27 | 28 | "controls" : true, |
28 | - "src" : "http://localhost:7777/" + encodeURIComponent(t.link) | |
29 | + "src" : blob_url(t.link) | |
29 | 30 | })) |
30 | 31 | })), |
31 | 32 | h('p', |
32 | 33 | "More info:", h('a', { href : msg.value.content.archivedotorg }, "archive.org"), |
@@ -75,4 +76,5 @@ | ||
75 | 76 | // message_confirm(yup) |
76 | 77 | // }}, 'yup') |
77 | 78 | |
78 | 79 | // } |
80 | + |
Built with git-ssb-web