fluncle 0.208.0 → 0.210.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 +23 -13
  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.208.0".trim() ? "0.208.0".trim() : "0.1.0";
613
+ currentVersion = "0.210.0".trim() ? "0.210.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.208.0".trim() ? "0.208.0".trim() : "0.1.0";
2455
+ currentVersion2 = "0.210.0".trim() ? "0.210.0".trim() : "0.1.0";
2456
2456
  });
2457
2457
 
2458
2458
  // ../../packages/registry/src/index.ts
@@ -10845,6 +10845,7 @@ async function runBackfillDiscogs(options, backfillDiscogsCommand2) {
10845
10845
  let cursor;
10846
10846
  let dryRun = options.dryRun;
10847
10847
  let throttled = false;
10848
+ let rateLimitedBy = null;
10848
10849
  while (resolved.length + unresolved.length < limit) {
10849
10850
  const remaining = limit - (resolved.length + unresolved.length);
10850
10851
  const result = await backfillDiscogsCommand2(remaining, options.dryRun, cursor);
@@ -10858,6 +10859,7 @@ async function runBackfillDiscogs(options, backfillDiscogsCommand2) {
10858
10859
  }
10859
10860
  if (result.rateLimited) {
10860
10861
  throttled = true;
10862
+ rateLimitedBy = result.rateLimitedBy;
10861
10863
  break;
10862
10864
  }
10863
10865
  if (result.nextCursor === null) {
@@ -10870,6 +10872,7 @@ async function runBackfillDiscogs(options, backfillDiscogsCommand2) {
10870
10872
  dryRun,
10871
10873
  ok: true,
10872
10874
  rateLimited: throttled,
10875
+ rateLimitedBy,
10873
10876
  resolved,
10874
10877
  resolvedCount: resolved.length,
10875
10878
  skipped,
@@ -11079,36 +11082,48 @@ async function runBackfillArtistImages(options, backfillArtistImagesCommand2) {
11079
11082
  const failed = [];
11080
11083
  const skipped = [];
11081
11084
  let cursor;
11085
+ let budgetLimited = false;
11086
+ let checkedCount = 0;
11082
11087
  let dryRun = options.dryRun;
11083
- while (filled.length + failed.length + skipped.length < limit) {
11084
- const remaining = limit - (filled.length + failed.length + skipped.length);
11088
+ let queueDepth = 0;
11089
+ let rateLimited = false;
11090
+ while (filled.length < limit) {
11091
+ const remaining = limit - filled.length;
11085
11092
  const result = await backfillArtistImagesCommand2(remaining, options.dryRun, cursor);
11093
+ budgetLimited ||= result.budgetLimited;
11094
+ checkedCount += result.checkedCount;
11086
11095
  dryRun = result.dryRun;
11087
11096
  filled.push(...result.filled);
11088
11097
  failed.push(...result.failed);
11098
+ queueDepth = result.queueDepth;
11099
+ rateLimited ||= result.rateLimited;
11089
11100
  skipped.push(...result.skipped);
11090
11101
  if (!options.json) {
11091
11102
  const verb2 = result.dryRun ? "would fill" : "filled";
11092
11103
  console.log(` \u2026${verb2} ${result.filledCount}; ${result.failedCount} failed; ${result.skippedCount} without an image`);
11093
11104
  }
11094
- if (result.nextCursor === null) {
11105
+ if (result.nextCursor === null || result.rateLimited || result.budgetLimited) {
11095
11106
  break;
11096
11107
  }
11097
11108
  cursor = result.nextCursor;
11098
11109
  }
11099
11110
  if (options.json) {
11100
11111
  printSweepJson({
11112
+ budgetLimited,
11113
+ checkedCount,
11101
11114
  dryRun,
11102
11115
  failed,
11103
11116
  filled,
11104
11117
  filledCount: filled.length,
11118
+ queueDepth,
11119
+ rateLimited,
11105
11120
  skipped,
11106
11121
  skippedCount: skipped.length
11107
11122
  }, failed.length);
11108
11123
  return;
11109
11124
  }
11110
11125
  const verb = dryRun ? "Would fill" : "Filled";
11111
- console.log(`${verb} ${filled.length} artist avatar(s); ${failed.length} failed; ${skipped.length} without a Spotify image.`);
11126
+ console.log(`${verb} ${filled.length} artist avatar(s); checked ${checkedCount}; ${failed.length} failed; ${skipped.length} without a Spotify image; ${queueDepth} queued.`);
11112
11127
  for (const artistId of filled) {
11113
11128
  console.log(` ${artistId}`);
11114
11129
  }
@@ -11268,20 +11283,15 @@ async function runBackfillLabelImages(options, backfillLabelImagesCommand2) {
11268
11283
  cursor = result.nextCursor;
11269
11284
  }
11270
11285
  if (options.json) {
11271
- printJson({
11286
+ printSweepJson({
11272
11287
  dryRun,
11273
11288
  failed,
11274
- failedCount: failed.length,
11275
11289
  none,
11276
11290
  noneCount: none.length,
11277
- ok: true,
11278
11291
  rateLimited: throttled,
11279
11292
  resolved,
11280
11293
  resolvedCount: resolved.length
11281
- });
11282
- if (failed.length > 0) {
11283
- process.exitCode = 1;
11284
- }
11294
+ }, failed.length);
11285
11295
  return;
11286
11296
  }
11287
11297
  const verb = dryRun ? "Would resolve" : "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.208.0"
34
+ "version": "0.210.0"
35
35
  }