fluncle 0.212.0 → 0.213.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 +74 -2
  2. package/package.json +1 -1
package/bin/fluncle.mjs CHANGED
@@ -610,7 +610,7 @@ function parseVersion(version) {
610
610
  var currentVersion;
611
611
  var init_version = __esm(() => {
612
612
  init_output();
613
- currentVersion = "0.212.0".trim() ? "0.212.0".trim() : "0.1.0";
613
+ currentVersion = "0.213.0".trim() ? "0.213.0".trim() : "0.1.0";
614
614
  });
615
615
 
616
616
  // src/update-notifier.ts
@@ -2452,7 +2452,7 @@ function parseVersion2(version) {
2452
2452
  var currentVersion2, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
2453
2453
  var init_version2 = __esm(() => {
2454
2454
  init_output();
2455
- currentVersion2 = "0.212.0".trim() ? "0.212.0".trim() : "0.1.0";
2455
+ currentVersion2 = "0.213.0".trim() ? "0.213.0".trim() : "0.1.0";
2456
2456
  });
2457
2457
 
2458
2458
  // ../../packages/registry/src/index.ts
@@ -4664,6 +4664,7 @@ __export(exports_admin_tracks, {
4664
4664
  backfillRecordingMbidsCommand: () => backfillRecordingMbidsCommand,
4665
4665
  backfillLastfmCommand: () => backfillLastfmCommand,
4666
4666
  backfillDiscogsCommand: () => backfillDiscogsCommand,
4667
+ backfillBeatportCommand: () => backfillBeatportCommand,
4667
4668
  backfillArtistEdgesCommand: () => backfillArtistEdgesCommand,
4668
4669
  backfillArtistCreditsCommand: () => backfillArtistCreditsCommand,
4669
4670
  backfillAppleMusicCommand: () => backfillAppleMusicCommand,
@@ -4847,6 +4848,13 @@ async function backfillAppleMusicCommand(limit, dryRun, cursor) {
4847
4848
  }
4848
4849
  return adminApiPost(`/api/v1/admin/backfill/apple-music?${params.toString()}`);
4849
4850
  }
4851
+ async function backfillBeatportCommand(limit, dryRun, cursor) {
4852
+ const params = new URLSearchParams({ dryRun: String(dryRun), limit: String(limit) });
4853
+ if (cursor) {
4854
+ params.set("cursor", cursor);
4855
+ }
4856
+ return adminApiPost(`/api/v1/admin/backfill/beatport?${params.toString()}`);
4857
+ }
4850
4858
  async function backfillAppleCatalogueCommand(limit, dryRun) {
4851
4859
  const params = new URLSearchParams({ dryRun: String(dryRun), limit: String(limit) });
4852
4860
  return adminApiPost(`/api/v1/admin/backfill/apple-catalogue?${params.toString()}`);
@@ -10409,6 +10417,10 @@ function addAdminCommands(program2) {
10409
10417
  const { backfillAppleCatalogueCommand: backfillAppleCatalogueCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
10410
10418
  await runBackfillAppleCatalogue(options, backfillAppleCatalogueCommand2);
10411
10419
  });
10420
+ backfill.command("beatport").description("Resolve missing Beatport URLs for published findings (exact ISRC match)").option("--dry-run", "Report the eligible set without resolving or writing", false).option("--limit <limit>", "Max findings to resolve", "50").option("--json", "Print JSON", false).action(async (options) => {
10421
+ const { backfillBeatportCommand: backfillBeatportCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
10422
+ await runBackfillBeatport(options, backfillBeatportCommand2);
10423
+ });
10412
10424
  backfill.command("artists").description("Back-fill the artist entity (artists + track_artists) for existing findings").option("--dry-run", "Report which findings would be upserted without touching the DB", false).option("--limit <limit>", "Max findings to process", "50").option("--json", "Print JSON", false).action(async (options) => {
10413
10425
  const { backfillArtistsCommand: backfillArtistsCommand2 } = await Promise.resolve().then(() => (init_admin_artists(), exports_admin_artists));
10414
10426
  await runBackfillArtists(options, backfillArtistsCommand2);
@@ -11068,6 +11080,66 @@ async function runBackfillAppleMusic(options, backfillAppleMusicCommand2) {
11068
11080
  process.exitCode = 1;
11069
11081
  }
11070
11082
  }
11083
+ async function runBackfillBeatport(options, backfillBeatportCommand2) {
11084
+ const limit = parseListLimit(options.limit);
11085
+ const resolved = [];
11086
+ const unresolved = [];
11087
+ const failed = [];
11088
+ const skipped = [];
11089
+ let cursor;
11090
+ let dryRun = options.dryRun;
11091
+ let configured = true;
11092
+ while (resolved.length + unresolved.length + failed.length < limit) {
11093
+ const remaining = limit - (resolved.length + unresolved.length + failed.length);
11094
+ const result = await backfillBeatportCommand2(remaining, options.dryRun, cursor);
11095
+ dryRun = result.dryRun;
11096
+ configured = result.configured;
11097
+ resolved.push(...result.resolved);
11098
+ unresolved.push(...result.unresolved);
11099
+ failed.push(...result.failed);
11100
+ skipped.push(...result.skipped);
11101
+ if (!options.json) {
11102
+ const verb2 = result.dryRun ? "would resolve" : "resolved";
11103
+ console.log(` \u2026${verb2} ${result.resolvedCount}; ${result.unresolvedCount} unresolved; ${result.failedCount} failed; ${result.skippedCount} skipped`);
11104
+ }
11105
+ if (!result.configured) {
11106
+ break;
11107
+ }
11108
+ if (result.nextCursor === null) {
11109
+ break;
11110
+ }
11111
+ cursor = result.nextCursor;
11112
+ }
11113
+ if (options.json) {
11114
+ printSweepJson({
11115
+ configured,
11116
+ dryRun,
11117
+ failed,
11118
+ resolved,
11119
+ resolvedCount: resolved.length,
11120
+ skipped,
11121
+ skippedCount: skipped.length,
11122
+ unresolved,
11123
+ unresolvedCount: unresolved.length
11124
+ }, failed.length);
11125
+ return;
11126
+ }
11127
+ if (!configured) {
11128
+ console.log("Beatport backfill is not configured (the Worker's Firecrawl key is unset) \u2014 nothing resolved.");
11129
+ return;
11130
+ }
11131
+ const verb = dryRun ? "Would resolve" : "Resolved";
11132
+ console.log(`${verb} ${resolved.length} Beatport URL(s); ${unresolved.length} unresolved; ${failed.length} failed; ${skipped.length} skipped.`);
11133
+ for (const item of resolved) {
11134
+ console.log(` ${item.logId}: ${item.url}`);
11135
+ }
11136
+ for (const item of failed) {
11137
+ console.log(` ${item.logId}: ${item.error}`);
11138
+ }
11139
+ if (failed.length > 0) {
11140
+ process.exitCode = 1;
11141
+ }
11142
+ }
11071
11143
  async function runBackfillAppleCatalogue(options, backfillAppleCatalogueCommand2) {
11072
11144
  const limit = parseListLimit(options.limit);
11073
11145
  const resolved = [];
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.212.0"
34
+ "version": "0.213.0"
35
35
  }