fluncle 0.125.0 → 0.126.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 +33 -20
  2. package/package.json +1 -1
package/bin/fluncle.mjs CHANGED
@@ -557,7 +557,7 @@ function parseVersion(version) {
557
557
  var currentVersion;
558
558
  var init_version = __esm(() => {
559
559
  init_output();
560
- currentVersion = "0.125.0".trim() ? "0.125.0".trim() : "0.1.0";
560
+ currentVersion = "0.126.0".trim() ? "0.126.0".trim() : "0.1.0";
561
561
  });
562
562
 
563
563
  // src/update-notifier.ts
@@ -2185,7 +2185,7 @@ function parseVersion2(version) {
2185
2185
  var currentVersion2, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
2186
2186
  var init_version2 = __esm(() => {
2187
2187
  init_output();
2188
- currentVersion2 = "0.125.0".trim() ? "0.125.0".trim() : "0.1.0";
2188
+ currentVersion2 = "0.126.0".trim() ? "0.126.0".trim() : "0.1.0";
2189
2189
  });
2190
2190
 
2191
2191
  // ../../packages/registry/src/index.ts
@@ -8337,6 +8337,12 @@ async function runTrackNote(idOrLogId, options, trackNoteCommand2) {
8337
8337
  console.log(`Authored the note for ${result.logId}:`);
8338
8338
  console.log(` ${result.note}`);
8339
8339
  }
8340
+ function printSweepJson(payload, failedCount) {
8341
+ printJson({ ...payload, failedCount, ok: failedCount === 0 });
8342
+ if (failedCount > 0) {
8343
+ process.exitCode = 1;
8344
+ }
8345
+ }
8340
8346
  async function runMigratePreviewArchive(options, migratePreviewArchiveCommand2) {
8341
8347
  const limit = options.limit === undefined ? 50 : Number.parseInt(options.limit, 10);
8342
8348
  if (!Number.isInteger(limit) || limit < 1) {
@@ -8385,7 +8391,7 @@ async function runMigratePreviewArchive(options, migratePreviewArchiveCommand2)
8385
8391
  cursor = result.nextCursor;
8386
8392
  }
8387
8393
  if (options.json) {
8388
- printJson({
8394
+ printSweepJson({
8389
8395
  blocked,
8390
8396
  copied,
8391
8397
  copiedCount: copied.length,
@@ -8393,13 +8399,11 @@ async function runMigratePreviewArchive(options, migratePreviewArchiveCommand2)
8393
8399
  deletedCount: deleted.length,
8394
8400
  dryRun,
8395
8401
  failed,
8396
- failedCount: failed.length,
8397
8402
  mode,
8398
- ok: true,
8399
8403
  remaining,
8400
8404
  skipped,
8401
8405
  skippedCount: skipped.length
8402
- });
8406
+ }, failed.length);
8403
8407
  return;
8404
8408
  }
8405
8409
  if (blocked) {
@@ -8418,6 +8422,9 @@ async function runMigratePreviewArchive(options, migratePreviewArchiveCommand2)
8418
8422
  for (const item of failed) {
8419
8423
  console.log(` FAILED ${item.trackId}: ${item.error}`);
8420
8424
  }
8425
+ if (failed.length > 0) {
8426
+ process.exitCode = 1;
8427
+ }
8421
8428
  }
8422
8429
  async function runPreviewArchiveBackfill(options, previewArchiveBackfillCommand2) {
8423
8430
  const limit = options.limit === undefined ? undefined : Number.parseInt(options.limit, 10);
@@ -8429,7 +8436,7 @@ async function runPreviewArchiveBackfill(options, previewArchiveBackfillCommand2
8429
8436
  limit
8430
8437
  });
8431
8438
  if (options.json) {
8432
- printJson({ ok: true, ...result });
8439
+ printSweepJson({ ...result }, result.failed.length);
8433
8440
  return;
8434
8441
  }
8435
8442
  const verb = result.dryRun ? "Would archive" : "Archived";
@@ -8438,6 +8445,9 @@ async function runPreviewArchiveBackfill(options, previewArchiveBackfillCommand2
8438
8445
  for (const item of result.archived) {
8439
8446
  console.log(` ${item.logId}: ${item.source}`);
8440
8447
  }
8448
+ if (result.failed.length > 0) {
8449
+ process.exitCode = 1;
8450
+ }
8441
8451
  }
8442
8452
  async function runBackfillLastfm(options, backfillLastfmCommand2) {
8443
8453
  const limit = parseListLimit(options.limit);
@@ -8468,17 +8478,15 @@ async function runBackfillLastfm(options, backfillLastfmCommand2) {
8468
8478
  cursor = result.nextCursor;
8469
8479
  }
8470
8480
  if (options.json) {
8471
- printJson({
8481
+ printSweepJson({
8472
8482
  dryRun,
8473
8483
  failed,
8474
- failedCount: failed.length,
8475
8484
  loved,
8476
8485
  lovedCount: loved.length,
8477
- ok: true,
8478
8486
  rateLimited: throttled,
8479
8487
  skipped,
8480
8488
  skippedCount: skipped.length
8481
- });
8489
+ }, failed.length);
8482
8490
  return;
8483
8491
  }
8484
8492
  const verb = dryRun ? "Would love" : "Loved";
@@ -8489,6 +8497,9 @@ async function runBackfillLastfm(options, backfillLastfmCommand2) {
8489
8497
  for (const item of failed) {
8490
8498
  console.log(` ${item.logId}: ${item.error}`);
8491
8499
  }
8500
+ if (failed.length > 0) {
8501
+ process.exitCode = 1;
8502
+ }
8492
8503
  }
8493
8504
  async function runBackfillDiscogs(options, backfillDiscogsCommand2) {
8494
8505
  const limit = parseListLimit(options.limit);
@@ -8563,16 +8574,14 @@ async function runBackfillArtists(options, backfillArtistsCommand2) {
8563
8574
  cursor = result.nextCursor;
8564
8575
  }
8565
8576
  if (options.json) {
8566
- printJson({
8577
+ printSweepJson({
8567
8578
  dryRun,
8568
8579
  failed,
8569
- failedCount: failed.length,
8570
- ok: true,
8571
8580
  skipped,
8572
8581
  skippedCount: skipped.length,
8573
8582
  upserted,
8574
8583
  upsertedCount: upserted.length
8575
- });
8584
+ }, failed.length);
8576
8585
  return;
8577
8586
  }
8578
8587
  const verb = dryRun ? "Would upsert" : "Upserted";
@@ -8583,6 +8592,9 @@ async function runBackfillArtists(options, backfillArtistsCommand2) {
8583
8592
  for (const item of failed) {
8584
8593
  console.log(` ${item.logId}: ${item.error}`);
8585
8594
  }
8595
+ if (failed.length > 0) {
8596
+ process.exitCode = 1;
8597
+ }
8586
8598
  }
8587
8599
  async function runBackfillArtistImages(options, backfillArtistImagesCommand2) {
8588
8600
  const limit = parseListLimit(options.limit);
@@ -8608,16 +8620,14 @@ async function runBackfillArtistImages(options, backfillArtistImagesCommand2) {
8608
8620
  cursor = result.nextCursor;
8609
8621
  }
8610
8622
  if (options.json) {
8611
- printJson({
8623
+ printSweepJson({
8612
8624
  dryRun,
8613
8625
  failed,
8614
- failedCount: failed.length,
8615
8626
  filled,
8616
8627
  filledCount: filled.length,
8617
- ok: true,
8618
8628
  skipped,
8619
8629
  skippedCount: skipped.length
8620
- });
8630
+ }, failed.length);
8621
8631
  return;
8622
8632
  }
8623
8633
  const verb = dryRun ? "Would fill" : "Filled";
@@ -8628,6 +8638,9 @@ async function runBackfillArtistImages(options, backfillArtistImagesCommand2) {
8628
8638
  for (const item of failed) {
8629
8639
  console.log(` ${item.artistId}: ${item.error}`);
8630
8640
  }
8641
+ if (failed.length > 0) {
8642
+ process.exitCode = 1;
8643
+ }
8631
8644
  }
8632
8645
  async function runArtistResolveQueue(options, listArtistsCommand2) {
8633
8646
  const limit = parseListLimit(options.limit);
@@ -9553,7 +9566,7 @@ async function runAdminRequeueAnalysis(options, requeueAnalysisCommand2) {
9553
9566
  const max = parseRequeueAnalysisLimit(options.limit);
9554
9567
  const result = await requeueAnalysisCommand2({ apply: options.apply === true, max });
9555
9568
  if (options.json) {
9556
- printJson({ ok: true, ...result });
9569
+ printSweepJson({ ...result }, result.failed.length);
9557
9570
  return;
9558
9571
  }
9559
9572
  const { coordinate: coordinate3 } = await Promise.resolve().then(() => (init_format2(), exports_format));
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.125.0"
34
+ "version": "0.126.0"
35
35
  }