fluncle 0.192.0 → 0.194.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.
Files changed (2) hide show
  1. package/bin/fluncle.mjs +36 -5
  2. 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.192.0".trim() ? "0.192.0".trim() : "0.1.0";
564
+ currentVersion = "0.194.0".trim() ? "0.194.0".trim() : "0.1.0";
565
565
  });
566
566
 
567
567
  // src/update-notifier.ts
@@ -2443,7 +2443,7 @@ function parseVersion2(version) {
2443
2443
  var currentVersion2, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
2444
2444
  var init_version2 = __esm(() => {
2445
2445
  init_output();
2446
- currentVersion2 = "0.192.0".trim() ? "0.192.0".trim() : "0.1.0";
2446
+ currentVersion2 = "0.194.0".trim() ? "0.194.0".trim() : "0.1.0";
2447
2447
  });
2448
2448
 
2449
2449
  // ../../packages/registry/src/index.ts
@@ -6559,7 +6559,10 @@ __export(exports_admin_catalogue, {
6559
6559
  });
6560
6560
  async function catalogueRankCommand(options) {
6561
6561
  const limit = options.limit ? Number.parseInt(options.limit, 10) : undefined;
6562
- const response = await adminApiPost("/api/v1/admin/catalogue/rank", limit ? { limit } : {});
6562
+ const response = await adminApiPost("/api/v1/admin/catalogue/rank", {
6563
+ ...limit ? { limit } : {},
6564
+ ...options.countRemaining ? { countRemaining: true } : {}
6565
+ });
6563
6566
  return { summary: response.summary, telescope: response.telescope };
6564
6567
  }
6565
6568
  async function catalogueDemandCommand() {
@@ -6729,6 +6732,7 @@ var init_admin_artists2 = __esm(() => {
6729
6732
  // src/commands/admin-labels.ts
6730
6733
  var exports_admin_labels = {};
6731
6734
  __export(exports_admin_labels, {
6735
+ updateLabelCommand: () => updateLabelCommand,
6732
6736
  mergeLabelCommand: () => mergeLabelCommand,
6733
6737
  labelsBioQueueCommand: () => labelsBioQueueCommand,
6734
6738
  draftLabelBioCommand: () => draftLabelBioCommand,
@@ -6740,6 +6744,15 @@ async function mergeLabelCommand(losingSlug, canonicalSlug) {
6740
6744
  const response = await adminApiPost(`/api/v1/admin/labels/${encodeURIComponent(losingSlug)}/merge`, { canonicalSlug });
6741
6745
  return response.result;
6742
6746
  }
6747
+ async function updateLabelCommand(slugOrId, seedState) {
6748
+ const { labels } = await adminApiGet("/api/v1/admin/labels");
6749
+ const match = labels.find((label) => label.slug === slugOrId || label.id === slugOrId);
6750
+ if (!match) {
6751
+ throw new Error(`No label with slug or id '${slugOrId}' — check \`fluncle labels\``);
6752
+ }
6753
+ const response = await adminApiPatch(`/api/v1/admin/labels/${encodeURIComponent(match.id)}`, { seedState });
6754
+ return response.label;
6755
+ }
6743
6756
  async function describeLabelCommand(slug, options) {
6744
6757
  return adminApiPost(`/api/v1/admin/labels/${encodeURIComponent(slug)}/bio`, buildBioBody2(options));
6745
6758
  }
@@ -10091,7 +10104,7 @@ function addAdminCommands(program2) {
10091
10104
  const { draftArtistBioCommand: draftArtistBioCommand2 } = await Promise.resolve().then(() => (init_admin_artists(), exports_admin_artists));
10092
10105
  await runEntityBioDraft("artist", slug, options, draftArtistBioCommand2);
10093
10106
  });
10094
- const labels = configureCommand(admin.command("labels").description("Label entity commands (voiced bio + slug-split merge)"));
10107
+ const labels = configureCommand(admin.command("labels").description("Label entity commands (crawl-seed ruling + voiced bio + slug-split merge)"));
10095
10108
  labels.action(() => {
10096
10109
  labels.outputHelp();
10097
10110
  });
@@ -10108,6 +10121,20 @@ function addAdminCommands(program2) {
10108
10121
  const { draftLabelBioCommand: draftLabelBioCommand2 } = await Promise.resolve().then(() => (init_admin_labels(), exports_admin_labels));
10109
10122
  await runEntityBioDraft("label", slug, options, draftLabelBioCommand2);
10110
10123
  });
10124
+ labels.command("update").description("Rule on a label's crawl-seed state (operator; next crawl only, never storage)").argument("<slug>", "The label's slug (an exact lbl_\u2026 id also works)").option("--seed-state <state>", "The ruling: enabled, disabled, or undecided").option("--json", "Print JSON", false).action(async (slug, options) => {
10125
+ const seedState = options.seedState;
10126
+ if (seedState !== "enabled" && seedState !== "disabled" && seedState !== "undecided") {
10127
+ throw new Error("Pass --seed-state enabled|disabled|undecided");
10128
+ }
10129
+ const { updateLabelCommand: updateLabelCommand2 } = await Promise.resolve().then(() => (init_admin_labels(), exports_admin_labels));
10130
+ const label = await updateLabelCommand2(slug, seedState);
10131
+ if (options.json) {
10132
+ printJson({ label, ok: true });
10133
+ return;
10134
+ }
10135
+ console.log(`${label.name} (${label.slug}) \u2192 ${label.seedState}.`);
10136
+ console.log(label.seedState === "enabled" ? " The next crawl seeds from it and stores its releases." : " The next crawl will not seed from it; nothing already stored is touched.");
10137
+ });
10111
10138
  labels.command("merge").description("Merge a slug-split label into its canonical row (operator; re-points + redirects)").argument("<losingSlug>", "The duplicate label to fold away").argument("<canonicalSlug>", "The label to keep \u2014 everything re-points onto it").option("--json", "Print JSON", false).action(async (losingSlug, canonicalSlug, options) => {
10112
10139
  const { mergeLabelCommand: mergeLabelCommand2 } = await Promise.resolve().then(() => (init_admin_labels(), exports_admin_labels));
10113
10140
  const result = await mergeLabelCommand2(losingSlug, canonicalSlug);
@@ -11998,7 +12025,10 @@ async function runArtistsRank(options, rankArtistsCommand2) {
11998
12025
  console.log(`Ranked ${summary.centroidsComputed} artist(s); wrote ${summary.edgesWritten} edges.${removed} ${summary.remaining} still stale.`);
11999
12026
  }
12000
12027
  async function runCatalogueRank(options, catalogueRankCommand2) {
12001
- const { summary, telescope } = await catalogueRankCommand2({ limit: options.limit });
12028
+ const { summary, telescope } = await catalogueRankCommand2({
12029
+ countRemaining: !options.json,
12030
+ limit: options.limit
12031
+ });
12002
12032
  if (options.json) {
12003
12033
  printJson({ ok: true, summary, telescope });
12004
12034
  return;
@@ -12781,6 +12811,7 @@ var stringOptions = new Set([
12781
12811
  "--script",
12782
12812
  "--script-file",
12783
12813
  "--seed",
12814
+ "--seed-state",
12784
12815
  "--soundcloud-url",
12785
12816
  "--source",
12786
12817
  "--status",
package/package.json CHANGED
@@ -31,5 +31,5 @@
31
31
  "url": "git+https://github.com/mauricekleine/fluncle.git"
32
32
  },
33
33
  "type": "module",
34
- "version": "0.192.0"
34
+ "version": "0.194.0"
35
35
  }