fluncle 0.37.0 → 0.39.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 +49 -3
  2. package/package.json +1 -1
package/bin/fluncle.mjs CHANGED
@@ -3602,7 +3602,7 @@ async function submitCommand(input) {
3602
3602
  spotifyUrl: selected.spotifyUrl,
3603
3603
  title: selected.title
3604
3604
  });
3605
- console.log("Logged. Fluncle will give it a listen.");
3605
+ console.log("Logged. I'll give it a listen.");
3606
3606
  }
3607
3607
  async function selectCandidate(candidates) {
3608
3608
  return await selectWithKeyboard(candidates, {
@@ -3789,7 +3789,7 @@ function parseVersion(version) {
3789
3789
  var currentVersion, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
3790
3790
  var init_version = __esm(() => {
3791
3791
  init_output();
3792
- currentVersion = "0.37.0".trim() ? "0.37.0".trim() : "0.1.0";
3792
+ currentVersion = "0.39.0".trim() ? "0.39.0".trim() : "0.1.0";
3793
3793
  });
3794
3794
 
3795
3795
  // src/commands/track.ts
@@ -3960,7 +3960,9 @@ __export(exports_admin_tracks, {
3960
3960
  vehiclesCommand: () => vehiclesCommand,
3961
3961
  queueCommand: () => queueCommand,
3962
3962
  enrichSweepCommand: () => enrichSweepCommand,
3963
- enrichQueueCommand: () => enrichQueueCommand
3963
+ enrichQueueCommand: () => enrichQueueCommand,
3964
+ backfillLastfmCommand: () => backfillLastfmCommand,
3965
+ backfillDiscogsCommand: () => backfillDiscogsCommand
3964
3966
  });
3965
3967
  async function fetchAdminTracks(options) {
3966
3968
  const { hasVideo, max, order, status } = options;
@@ -4001,6 +4003,12 @@ async function enrichQueueCommand(limit) {
4001
4003
  async function enrichSweepCommand(limit) {
4002
4004
  return adminApiPost(`/api/admin/enrich-sweep?limit=${limit}`);
4003
4005
  }
4006
+ async function backfillLastfmCommand(limit, dryRun) {
4007
+ return adminApiPost(`/api/admin/backfill/lastfm?limit=${limit}&dryRun=${dryRun}`);
4008
+ }
4009
+ async function backfillDiscogsCommand(limit, dryRun) {
4010
+ return adminApiPost(`/api/admin/backfill/discogs?limit=${limit}&dryRun=${dryRun}`);
4011
+ }
4004
4012
  async function vehiclesCommand(limit) {
4005
4013
  const tracks = await fetchAdminTracks({ hasVideo: true, max: limit, order: "desc" });
4006
4014
  return tracks.map((track) => ({
@@ -5289,6 +5297,14 @@ function addAdminCommands(program2) {
5289
5297
  const { previewArchiveBackfillCommand: previewArchiveBackfillCommand2 } = await Promise.resolve().then(() => (init_preview_archive(), exports_preview_archive));
5290
5298
  await runPreviewArchiveBackfill(options, previewArchiveBackfillCommand2);
5291
5299
  });
5300
+ backfill.command("lastfm").description("Love already-published findings on Last.fm (idempotent; a no-op until configured)").option("--dry-run", "Resolve the set but fire no loves; just report what would be loved", false).option("--limit <limit>", "Max findings to love", "50").option("--json", "Print JSON", false).action(async (options) => {
5301
+ const { backfillLastfmCommand: backfillLastfmCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
5302
+ await runBackfillLastfm(options, backfillLastfmCommand2);
5303
+ });
5304
+ backfill.command("discogs").description("Resolve missing Discogs release ids for published findings (high-confidence only)").option("--dry-run", "Resolve but write nothing; just report what would be resolved", false).option("--limit <limit>", "Max findings to resolve", "50").option("--json", "Print JSON", false).action(async (options) => {
5305
+ const { backfillDiscogsCommand: backfillDiscogsCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
5306
+ await runBackfillDiscogs(options, backfillDiscogsCommand2);
5307
+ });
5292
5308
  }
5293
5309
  async function runTrackPreviewArchive(idOrLogId, options, previewArchiveUploadCommand2) {
5294
5310
  if (!idOrLogId || !options.file || !options.source || !options.mime) {
@@ -5358,6 +5374,36 @@ async function runPreviewArchiveBackfill(options, previewArchiveBackfillCommand2
5358
5374
  console.log(` ${item.logId}: ${item.source}`);
5359
5375
  }
5360
5376
  }
5377
+ async function runBackfillLastfm(options, backfillLastfmCommand2) {
5378
+ const limit = parseListLimit(options.limit);
5379
+ const result = await backfillLastfmCommand2(limit, options.dryRun);
5380
+ if (options.json) {
5381
+ printJson(result);
5382
+ return;
5383
+ }
5384
+ const verb = result.dryRun ? "Would love" : "Loved";
5385
+ console.log(`${verb} ${result.lovedCount} finding(s) on Last.fm; ${result.failedCount} failed.`);
5386
+ for (const logId of result.loved) {
5387
+ console.log(` ${logId}`);
5388
+ }
5389
+ for (const item of result.failed) {
5390
+ console.log(` ${item.logId}: ${item.error}`);
5391
+ }
5392
+ }
5393
+ async function runBackfillDiscogs(options, backfillDiscogsCommand2) {
5394
+ const limit = parseListLimit(options.limit);
5395
+ const result = await backfillDiscogsCommand2(limit, options.dryRun);
5396
+ if (options.json) {
5397
+ printJson(result);
5398
+ return;
5399
+ }
5400
+ const verb = result.dryRun ? "Would resolve" : "Resolved";
5401
+ console.log(`${verb} ${result.resolvedCount} Discogs release id(s); ${result.unresolvedCount} unresolved.`);
5402
+ for (const item of result.resolved) {
5403
+ const master = item.masterId ? ` (master ${item.masterId})` : "";
5404
+ console.log(` ${item.logId}: release ${item.releaseId}${master}`);
5405
+ }
5406
+ }
5361
5407
  async function runTrackVideo(idOrLogId, options, trackVideoCommand2) {
5362
5408
  if (!idOrLogId) {
5363
5409
  throw new Error("Missing id. Usage: fluncle admin track video <track_id|log_id> (--dir <dir> | --footage <file> [--footage-silent <file>] [--poster <file>] [--cover <file>] [--note <file>] [--composition <file>] [--props <file>] [--render <file>])");
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.37.0"
34
+ "version": "0.39.0"
35
35
  }