pmtiles-swarm 0.15.1 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@
7
7
  ### 🐞 Bug fixes
8
8
  - _...Add new stuff here..._
9
9
 
10
+ ## 0.15.2
11
+ ### 🐞 Bug fixes
12
+ - **A mutable magnet is named after its category rather than a build.** `dn=` was taken from
13
+ whichever archive was newest when the string was generated, so a magnet whose whole purpose is to
14
+ resolve to *the current* build carried the name of one particular build — dated the moment the
15
+ next one landed. It now reads `dn=openmaptiles`.
16
+
17
+ Nothing depended on it: `dn` is a display hint, replaced by the real name as soon as metadata
18
+ arrives. It was simply describing the wrong thing.
19
+
10
20
  ## 0.15.1
11
21
  ### 🐞 Bug fixes
12
22
  - **The downloaded bar showed nothing on an archive that was plainly downloading.** A column on
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmtiles-swarm",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
4
4
  "description": "BitTorrent distribution for PMTiles map archives: create torrents, watch folders, publish and subscribe to RSS feeds, and seed through qBittorrent or an embedded client",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/api.js CHANGED
@@ -73,7 +73,8 @@ function styleUrlFor(category, newest, base) {
73
73
  const magnet = newest?.mutable?.publicKey
74
74
  ? mutableMagnet(newest.mutable.publicKey, {
75
75
  salt: newest.mutable.salt ?? category,
76
- name: newest.name,
76
+ // The category, since that is what this magnet resolves to.
77
+ name: newest.mutable.salt ?? category,
77
78
  webSeeds: newest.webSeeds,
78
79
  })
79
80
  : newest?.magnet;
package/src/publisher.js CHANGED
@@ -214,7 +214,12 @@ export class MutablePublisher {
214
214
  magnetFor(category, entry) {
215
215
  return mutableMagnet(this.#key.publicKey, {
216
216
  salt: category,
217
- name: entry?.name,
217
+ // The category rather than the build. This magnet resolves to whichever
218
+ // archive is current, so naming one of them dates the string the moment
219
+ // the next build lands. `dn` is only a label -- the real name arrives
220
+ // with the metadata and overrides it -- so nothing depends on this
221
+ // beyond being honest about what the magnet identifies.
222
+ name: category,
218
223
  webSeeds: entry?.webSeeds,
219
224
  });
220
225
  }
package/src/tilejson.js CHANGED
@@ -100,7 +100,9 @@ function buildTorrentBlock(entry, root) {
100
100
  // and buildable by any node, because it contains only the public half.
101
101
  magnet: mutableMagnet(entry.mutable.publicKey, {
102
102
  salt: entry.mutable.salt,
103
- name: entry.name,
103
+ // The category, not this build: the record resolves to whichever
104
+ // archive is current, and `dn` is a label the metadata replaces.
105
+ name: entry.mutable.salt,
104
106
  webSeeds: entry.webSeeds,
105
107
  }),
106
108
  };