alphatheta-connect 0.28.4 → 0.28.5
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/lib/cli.js +26 -17
- package/lib/cli.js.map +1 -1
- package/lib/index.js +26 -17
- package/lib/index.js.map +1 -1
- package/lib/remotedb/fields.d.ts +6 -6
- package/lib/remotedb/message/item.d.ts +5 -0
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -9406,6 +9406,10 @@ var ItemType;
|
|
|
9406
9406
|
ItemType[ItemType["MenuBit"] = 147] = "MenuBit";
|
|
9407
9407
|
ItemType[ItemType["MenuFilename"] = 148] = "MenuFilename";
|
|
9408
9408
|
ItemType[ItemType["MenuHistory"] = 149] = "MenuHistory";
|
|
9409
|
+
// Native streaming players return the track title and artist together in
|
|
9410
|
+
// this otherwise undocumented item instead of the normal 0x0004/0x0007
|
|
9411
|
+
// pair. Observed from direct Beatport streaming (NP3-591).
|
|
9412
|
+
ItemType[ItemType["StreamingTrackMetadata"] = 153] = "StreamingTrackMetadata";
|
|
9409
9413
|
ItemType[ItemType["MenuAll"] = 160] = "MenuAll";
|
|
9410
9414
|
ItemType[ItemType["TrackTitleAlbum"] = 516] = "TrackTitleAlbum";
|
|
9411
9415
|
ItemType[ItemType["TrackTitleGenre"] = 1540] = "TrackTitleGenre";
|
|
@@ -9452,6 +9456,10 @@ const transformItem = {
|
|
|
9452
9456
|
title: a.label1,
|
|
9453
9457
|
artworkId: a.artworkId,
|
|
9454
9458
|
}),
|
|
9459
|
+
[ItemType.StreamingTrackMetadata]: (a) => ({
|
|
9460
|
+
title: a.label1,
|
|
9461
|
+
artist: a.label2,
|
|
9462
|
+
}),
|
|
9455
9463
|
[ItemType.AlbumTitle]: mapIdName,
|
|
9456
9464
|
[ItemType.Artist]: mapIdName,
|
|
9457
9465
|
[ItemType.Genre]: mapIdName,
|
|
@@ -9850,7 +9858,7 @@ const utils_1 = __webpack_require__(/*! ./utils */ "./src/remotedb/utils.ts");
|
|
|
9850
9858
|
* Lookup track metadata from rekordbox and coerce it into a Track entity
|
|
9851
9859
|
*/
|
|
9852
9860
|
async function getMetadata(opts) {
|
|
9853
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
9861
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
9854
9862
|
const { conn, lookupDescriptor, span, args } = opts;
|
|
9855
9863
|
const { trackId, onResponse } = args;
|
|
9856
9864
|
const request = new message_1.Message({
|
|
@@ -9871,24 +9879,25 @@ async function getMetadata(opts) {
|
|
|
9871
9879
|
onResponse === null || onResponse === void 0 ? void 0 : onResponse({ itemsAvailable: resp.data.itemsAvailable, items: received });
|
|
9872
9880
|
// Translate our trackItems into a (partial) Track entity.
|
|
9873
9881
|
// Use optional chaining for all fields since streaming tracks may omit some.
|
|
9882
|
+
const streamingMetadata = trackItems[item_1.ItemType.StreamingTrackMetadata];
|
|
9874
9883
|
const track = {
|
|
9875
9884
|
id: (_b = (_a = trackItems[item_1.ItemType.TrackTitle]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : 0,
|
|
9876
|
-
title: (_d = (_c = trackItems[item_1.ItemType.TrackTitle]) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : '',
|
|
9877
|
-
duration: (
|
|
9878
|
-
tempo: (
|
|
9879
|
-
comment: (
|
|
9880
|
-
rating: (
|
|
9881
|
-
year: (
|
|
9882
|
-
bitrate: (
|
|
9883
|
-
artwork: { id: (
|
|
9884
|
-
album: (
|
|
9885
|
-
artist: (
|
|
9886
|
-
genre: (
|
|
9887
|
-
key: (
|
|
9888
|
-
color: (
|
|
9889
|
-
label: (
|
|
9890
|
-
remixer: (
|
|
9891
|
-
originalArtist: (
|
|
9885
|
+
title: (_e = (_d = (_c = trackItems[item_1.ItemType.TrackTitle]) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : streamingMetadata === null || streamingMetadata === void 0 ? void 0 : streamingMetadata.title) !== null && _e !== void 0 ? _e : '',
|
|
9886
|
+
duration: (_g = (_f = trackItems[item_1.ItemType.Duration]) === null || _f === void 0 ? void 0 : _f.duration) !== null && _g !== void 0 ? _g : 0,
|
|
9887
|
+
tempo: (_j = (_h = trackItems[item_1.ItemType.Tempo]) === null || _h === void 0 ? void 0 : _h.bpm) !== null && _j !== void 0 ? _j : 0,
|
|
9888
|
+
comment: (_l = (_k = trackItems[item_1.ItemType.Comment]) === null || _k === void 0 ? void 0 : _k.comment) !== null && _l !== void 0 ? _l : '',
|
|
9889
|
+
rating: (_o = (_m = trackItems[item_1.ItemType.Rating]) === null || _m === void 0 ? void 0 : _m.rating) !== null && _o !== void 0 ? _o : 0,
|
|
9890
|
+
year: (_p = trackItems === null || trackItems === void 0 ? void 0 : trackItems[item_1.ItemType.Year]) === null || _p === void 0 ? void 0 : _p.year,
|
|
9891
|
+
bitrate: (_q = trackItems === null || trackItems === void 0 ? void 0 : trackItems[item_1.ItemType.BitRate]) === null || _q === void 0 ? void 0 : _q.bitrate,
|
|
9892
|
+
artwork: { id: (_s = (_r = trackItems[item_1.ItemType.TrackTitle]) === null || _r === void 0 ? void 0 : _r.artworkId) !== null && _s !== void 0 ? _s : 0 },
|
|
9893
|
+
album: (_t = trackItems[item_1.ItemType.AlbumTitle]) !== null && _t !== void 0 ? _t : null,
|
|
9894
|
+
artist: (_u = trackItems[item_1.ItemType.Artist]) !== null && _u !== void 0 ? _u : ((streamingMetadata === null || streamingMetadata === void 0 ? void 0 : streamingMetadata.artist) ? { id: 0, name: streamingMetadata.artist } : null),
|
|
9895
|
+
genre: (_v = trackItems[item_1.ItemType.Genre]) !== null && _v !== void 0 ? _v : null,
|
|
9896
|
+
key: (_w = trackItems[item_1.ItemType.Key]) !== null && _w !== void 0 ? _w : null,
|
|
9897
|
+
color: (_x = (0, utils_1.findColor)(Object.values(trackItems))) !== null && _x !== void 0 ? _x : null,
|
|
9898
|
+
label: (_y = trackItems[item_1.ItemType.Label]) !== null && _y !== void 0 ? _y : null,
|
|
9899
|
+
remixer: (_z = trackItems === null || trackItems === void 0 ? void 0 : trackItems[item_1.ItemType.Remixer]) !== null && _z !== void 0 ? _z : null,
|
|
9900
|
+
originalArtist: (_0 = trackItems === null || trackItems === void 0 ? void 0 : trackItems[item_1.ItemType.OriginalArtist]) !== null && _0 !== void 0 ? _0 : null,
|
|
9892
9901
|
composer: null,
|
|
9893
9902
|
fileName: '',
|
|
9894
9903
|
filePath: '',
|