fluncle 0.164.0 → 0.166.0
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/bin/fluncle.mjs +71 -26
- package/package.json +1 -1
package/bin/fluncle.mjs
CHANGED
|
@@ -561,7 +561,7 @@ function parseVersion(version) {
|
|
|
561
561
|
var currentVersion;
|
|
562
562
|
var init_version = __esm(() => {
|
|
563
563
|
init_output();
|
|
564
|
-
currentVersion = "0.
|
|
564
|
+
currentVersion = "0.166.0".trim() ? "0.166.0".trim() : "0.1.0";
|
|
565
565
|
});
|
|
566
566
|
|
|
567
567
|
// src/update-notifier.ts
|
|
@@ -995,6 +995,46 @@ var init_recent = __esm(() => {
|
|
|
995
995
|
init_api();
|
|
996
996
|
});
|
|
997
997
|
|
|
998
|
+
// src/commands/fresh.ts
|
|
999
|
+
var exports_fresh = {};
|
|
1000
|
+
__export(exports_fresh, {
|
|
1001
|
+
freshCommand: () => freshCommand
|
|
1002
|
+
});
|
|
1003
|
+
function coordinate(track) {
|
|
1004
|
+
return track.logId ?? COORD_FALLBACK;
|
|
1005
|
+
}
|
|
1006
|
+
function freshRows(tracks) {
|
|
1007
|
+
const coordWidth = tracks.reduce((width, track) => {
|
|
1008
|
+
return Math.max(width, coordinate(track).length);
|
|
1009
|
+
}, 0);
|
|
1010
|
+
return tracks.map((track) => {
|
|
1011
|
+
const released = track.releaseDate.slice(0, 10);
|
|
1012
|
+
const label = `${track.artists.join(", ")} — ${track.title}`;
|
|
1013
|
+
return `${coordinate(track).padEnd(coordWidth)} ${released} ${label}`;
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
1016
|
+
async function freshCommand({
|
|
1017
|
+
json,
|
|
1018
|
+
limit
|
|
1019
|
+
}) {
|
|
1020
|
+
const response = await publicApiGet(`/api/v1/tracks/fresh?limit=${limit}`);
|
|
1021
|
+
if (json) {
|
|
1022
|
+
printJson2({ ok: true, ...response });
|
|
1023
|
+
return;
|
|
1024
|
+
}
|
|
1025
|
+
if (response.tracks.length === 0) {
|
|
1026
|
+
console.log(`Nothing new out in the last ${response.windowDays} days.`);
|
|
1027
|
+
return;
|
|
1028
|
+
}
|
|
1029
|
+
console.log(freshRows(response.tracks).join(`
|
|
1030
|
+
`));
|
|
1031
|
+
}
|
|
1032
|
+
var COORD_FALLBACK = "—";
|
|
1033
|
+
var init_fresh = __esm(() => {
|
|
1034
|
+
init_api();
|
|
1035
|
+
init_output();
|
|
1036
|
+
});
|
|
1037
|
+
|
|
998
1038
|
// src/commands/artists.ts
|
|
999
1039
|
var exports_artists = {};
|
|
1000
1040
|
__export(exports_artists, {
|
|
@@ -1531,13 +1571,13 @@ var init_mixtapes = __esm(() => {
|
|
|
1531
1571
|
});
|
|
1532
1572
|
|
|
1533
1573
|
// src/format.ts
|
|
1534
|
-
function
|
|
1535
|
-
return track.logId ??
|
|
1574
|
+
function coordinate2(track) {
|
|
1575
|
+
return track.logId ?? COORD_FALLBACK2;
|
|
1536
1576
|
}
|
|
1537
1577
|
function artistTitle(track) {
|
|
1538
1578
|
return `${track.artists.join(", ")} — ${track.title}`;
|
|
1539
1579
|
}
|
|
1540
|
-
var
|
|
1580
|
+
var COORD_FALLBACK2 = "—";
|
|
1541
1581
|
var init_format = __esm(() => {
|
|
1542
1582
|
init_util();
|
|
1543
1583
|
});
|
|
@@ -1748,13 +1788,13 @@ async function selectRecentTrack(tracks) {
|
|
|
1748
1788
|
}
|
|
1749
1789
|
function buildSelectorLines(tracks, selectedIndex, columns) {
|
|
1750
1790
|
const coordWidth = tracks.reduce((width, track) => {
|
|
1751
|
-
return Math.max(width,
|
|
1791
|
+
return Math.max(width, coordinate2(track).length);
|
|
1752
1792
|
}, 0);
|
|
1753
1793
|
return [
|
|
1754
1794
|
"Select a track to open in Spotify",
|
|
1755
1795
|
...tracks.map((track, index) => {
|
|
1756
1796
|
const prefix = index === selectedIndex ? "> " : " ";
|
|
1757
|
-
const label = `${
|
|
1797
|
+
const label = `${coordinate2(track).padEnd(coordWidth)} ${artistTitle(track)}`;
|
|
1758
1798
|
const line = truncateTerminalLine(`${prefix}${label}`, Math.max(columns, 20));
|
|
1759
1799
|
return index === selectedIndex ? `\x1B[7m${line}\x1B[0m` : line;
|
|
1760
1800
|
}),
|
|
@@ -2189,7 +2229,7 @@ function parseVersion2(version) {
|
|
|
2189
2229
|
var currentVersion2, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
|
|
2190
2230
|
var init_version2 = __esm(() => {
|
|
2191
2231
|
init_output();
|
|
2192
|
-
currentVersion2 = "0.
|
|
2232
|
+
currentVersion2 = "0.166.0".trim() ? "0.166.0".trim() : "0.1.0";
|
|
2193
2233
|
});
|
|
2194
2234
|
|
|
2195
2235
|
// ../../packages/registry/src/index.ts
|
|
@@ -6481,11 +6521,11 @@ __export(exports_format, {
|
|
|
6481
6521
|
trackDetailLines: () => trackDetailLines,
|
|
6482
6522
|
rowLabel: () => rowLabel,
|
|
6483
6523
|
foundDate: () => foundDate,
|
|
6484
|
-
coordinate: () =>
|
|
6524
|
+
coordinate: () => coordinate3,
|
|
6485
6525
|
artistTitle: () => artistTitle2
|
|
6486
6526
|
});
|
|
6487
|
-
function
|
|
6488
|
-
return track.logId ??
|
|
6527
|
+
function coordinate3(track) {
|
|
6528
|
+
return track.logId ?? COORD_FALLBACK3;
|
|
6489
6529
|
}
|
|
6490
6530
|
function artistTitle2(track) {
|
|
6491
6531
|
return `${track.artists.join(", ")} — ${track.title}`;
|
|
@@ -6502,10 +6542,10 @@ function stripCoordinateSuffix(title, logId) {
|
|
|
6502
6542
|
}
|
|
6503
6543
|
function trackRows(tracks) {
|
|
6504
6544
|
const coordWidth = tracks.reduce((width, track) => {
|
|
6505
|
-
return Math.max(width,
|
|
6545
|
+
return Math.max(width, coordinate3(track).length);
|
|
6506
6546
|
}, 0);
|
|
6507
6547
|
return tracks.map((track) => {
|
|
6508
|
-
return `${
|
|
6548
|
+
return `${coordinate3(track).padEnd(coordWidth)} ${rowLabel(track)}`;
|
|
6509
6549
|
});
|
|
6510
6550
|
}
|
|
6511
6551
|
function foundDate(addedAt) {
|
|
@@ -6513,14 +6553,14 @@ function foundDate(addedAt) {
|
|
|
6513
6553
|
}
|
|
6514
6554
|
function vehicleRows(rows) {
|
|
6515
6555
|
const coordWidth = rows.reduce((width, row) => {
|
|
6516
|
-
return Math.max(width,
|
|
6556
|
+
return Math.max(width, coordinate3(row).length);
|
|
6517
6557
|
}, 0);
|
|
6518
6558
|
return rows.map((row) => {
|
|
6519
|
-
return `${
|
|
6559
|
+
return `${coordinate3(row).padEnd(coordWidth)} ${foundDate(row.addedAt)} ${row.vehicle ?? COORD_FALLBACK3} · ${row.register ?? COORD_FALLBACK3}`;
|
|
6520
6560
|
});
|
|
6521
6561
|
}
|
|
6522
6562
|
function trackDetailLines(track) {
|
|
6523
|
-
const lines = [`${
|
|
6563
|
+
const lines = [`${coordinate3(track)} ${artistTitle2(track)}`];
|
|
6524
6564
|
const meta = [];
|
|
6525
6565
|
if (typeof track.durationMs === "number") {
|
|
6526
6566
|
meta.push(formatDuration(track.durationMs));
|
|
@@ -6533,7 +6573,7 @@ function trackDetailLines(track) {
|
|
|
6533
6573
|
}
|
|
6534
6574
|
return lines;
|
|
6535
6575
|
}
|
|
6536
|
-
var
|
|
6576
|
+
var COORD_FALLBACK3 = "—";
|
|
6537
6577
|
var init_format2 = __esm(() => {
|
|
6538
6578
|
init_util();
|
|
6539
6579
|
});
|
|
@@ -8722,6 +8762,10 @@ function addListenCommands(program2) {
|
|
|
8722
8762
|
const { recentCommand: recentCommand3 } = await Promise.resolve().then(() => (init_recent(), exports_recent));
|
|
8723
8763
|
await runRecent(options, recentCommand3);
|
|
8724
8764
|
});
|
|
8765
|
+
program2.command("fresh").description("What just came out, newest release first").option("--limit <limit>", "Number of releases to fetch").option("--json", "Print JSON", false).action(async (options) => {
|
|
8766
|
+
const { freshCommand: freshCommand2 } = await Promise.resolve().then(() => (init_fresh(), exports_fresh));
|
|
8767
|
+
await freshCommand2({ json: options.json, limit: parseListLimit(options.limit) });
|
|
8768
|
+
});
|
|
8725
8769
|
program2.command("artists").description("Browse artists in Fluncle's archive").argument("[slug]", "Artist slug (omit for the full list)").option("--json", "Print JSON", false).action(async (slug, options) => {
|
|
8726
8770
|
const { artistsListCommand: artistsListCommand2, artistsGetCommand: artistsGetCommand2 } = await Promise.resolve().then(() => (init_artists(), exports_artists));
|
|
8727
8771
|
await runArtists(slug, options, { artistsGetCommand: artistsGetCommand2, artistsListCommand: artistsListCommand2 });
|
|
@@ -9235,11 +9279,12 @@ function addAdminCommands(program2) {
|
|
|
9235
9279
|
printJson(summary);
|
|
9236
9280
|
return;
|
|
9237
9281
|
}
|
|
9282
|
+
const counts = `${summary.refreshed} refreshed, ${summary.minted} minted, ${summary.editionOnly} edition-only, ${summary.unchanged} unchanged, ${summary.failed} failed`;
|
|
9238
9283
|
if (summary.switchOff) {
|
|
9239
|
-
console.log(
|
|
9284
|
+
console.log(`Frontier minting is paused (the kill switch is closed) \u2014 editions written, Spotify skipped. Walked ${summary.total} user(s): ${counts}.`);
|
|
9240
9285
|
return;
|
|
9241
9286
|
}
|
|
9242
|
-
console.log(`Walked ${summary.total}
|
|
9287
|
+
console.log(`Walked ${summary.total} user(s): ${counts}.`);
|
|
9243
9288
|
});
|
|
9244
9289
|
frontier.command("status").description("Whether Frontier minting is open (the kill switch's state)").option("--json", "Print JSON", false).action(async (options) => {
|
|
9245
9290
|
const { frontierStatusCommand: frontierStatusCommand2 } = await Promise.resolve().then(() => (init_admin_frontier(), exports_admin_frontier));
|
|
@@ -10717,8 +10762,8 @@ async function runMixtapeList(options, mixtapeListCommand2) {
|
|
|
10717
10762
|
}
|
|
10718
10763
|
for (const mixtape of mixtapes) {
|
|
10719
10764
|
const status = mixtape.status ?? "distributing";
|
|
10720
|
-
const
|
|
10721
|
-
console.log(`${
|
|
10765
|
+
const coordinate4 = mixtape.logId ?? "unminted";
|
|
10766
|
+
console.log(`${coordinate4} ${status} ${mixtape.memberCount} bangers ${mixtape.title}`);
|
|
10722
10767
|
}
|
|
10723
10768
|
}
|
|
10724
10769
|
async function runClipsList(options, clipsListCommand2, clipPostsListCommand2) {
|
|
@@ -10872,10 +10917,10 @@ async function runMixtapeGet(idOrLogId, options, mixtapeGetCommand2) {
|
|
|
10872
10917
|
printJson(mixtape);
|
|
10873
10918
|
return;
|
|
10874
10919
|
}
|
|
10875
|
-
const
|
|
10920
|
+
const coordinate4 = mixtape.logId ?? "unminted";
|
|
10876
10921
|
const status = mixtape.status ?? "distributing";
|
|
10877
10922
|
console.log(`${mixtape.title}`);
|
|
10878
|
-
console.log(` ${
|
|
10923
|
+
console.log(` ${coordinate4} \xB7 ${status} \xB7 ${mixtape.memberCount} bangers`);
|
|
10879
10924
|
if (mixtape.note) {
|
|
10880
10925
|
console.log(` ${mixtape.note}`);
|
|
10881
10926
|
}
|
|
@@ -11182,8 +11227,8 @@ async function runGalaxies(slug, options, commands) {
|
|
|
11182
11227
|
console.log(`${galaxy.name} (${galaxy.slug})`);
|
|
11183
11228
|
console.log(`${galaxy.memberCount} finding${galaxy.memberCount === 1 ? "" : "s"}`);
|
|
11184
11229
|
for (const finding of findings) {
|
|
11185
|
-
const
|
|
11186
|
-
console.log(` ${
|
|
11230
|
+
const coordinate4 = finding.logId ? `${finding.logId} ` : "";
|
|
11231
|
+
console.log(` ${coordinate4}${finding.artists.join(", ")} \u2014 ${finding.title}`);
|
|
11187
11232
|
}
|
|
11188
11233
|
return;
|
|
11189
11234
|
}
|
|
@@ -11625,14 +11670,14 @@ async function runAdminRequeueAnalysis(options, requeueAnalysisCommand2) {
|
|
|
11625
11670
|
printSweepJson({ ...result }, result.failed.length);
|
|
11626
11671
|
return;
|
|
11627
11672
|
}
|
|
11628
|
-
const { coordinate:
|
|
11673
|
+
const { coordinate: coordinate4 } = await Promise.resolve().then(() => (init_format2(), exports_format));
|
|
11629
11674
|
const staleCount = result.withSourceAudio.length + result.withoutSourceAudio.length;
|
|
11630
11675
|
if (staleCount === 0) {
|
|
11631
11676
|
console.log("Nothing to re-queue. Every finding's BPM/key was analyzed from full audio.");
|
|
11632
11677
|
return;
|
|
11633
11678
|
}
|
|
11634
11679
|
const describe = (row) => {
|
|
11635
|
-
const coord =
|
|
11680
|
+
const coord = coordinate4({ logId: row.logId });
|
|
11636
11681
|
const bpm = row.bpm ? `${row.bpm} bpm` : "no bpm";
|
|
11637
11682
|
const key = row.key ?? "no key";
|
|
11638
11683
|
const from = row.analyzedFrom ?? "legacy/null";
|
package/package.json
CHANGED