fluncle 0.126.0 → 0.128.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 +82 -3
  2. package/package.json +1 -1
package/bin/fluncle.mjs CHANGED
@@ -462,6 +462,10 @@ function versionMatches(findingTitle, candidateTitle) {
462
462
  }
463
463
  return !candidateIsRemix;
464
464
  }
465
+ function r2PublicUrl(base, key) {
466
+ const path2 = key.split("/").map(encodeURIComponent).join("/");
467
+ return `${base}/${path2}`;
468
+ }
465
469
  function mixcloudSections(members) {
466
470
  return members.filter((member) => member.startMs != null).sort((a, b) => a.startMs - b.startMs).map((member) => ({
467
471
  artist: member.artists.join(", "),
@@ -557,7 +561,7 @@ function parseVersion(version) {
557
561
  var currentVersion;
558
562
  var init_version = __esm(() => {
559
563
  init_output();
560
- currentVersion = "0.126.0".trim() ? "0.126.0".trim() : "0.1.0";
564
+ currentVersion = "0.128.0".trim() ? "0.128.0".trim() : "0.1.0";
561
565
  });
562
566
 
563
567
  // src/update-notifier.ts
@@ -2185,7 +2189,7 @@ function parseVersion2(version) {
2185
2189
  var currentVersion2, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
2186
2190
  var init_version2 = __esm(() => {
2187
2191
  init_output();
2188
- currentVersion2 = "0.126.0".trim() ? "0.126.0".trim() : "0.1.0";
2192
+ currentVersion2 = "0.128.0".trim() ? "0.128.0".trim() : "0.1.0";
2189
2193
  });
2190
2194
 
2191
2195
  // ../../packages/registry/src/index.ts
@@ -3753,6 +3757,9 @@ async function previewArchiveBackfillCommand(options) {
3753
3757
  if (result.archived.length >= (options.limit ?? Number.POSITIVE_INFINITY)) {
3754
3758
  break;
3755
3759
  }
3760
+ if (track.type === "mixtape") {
3761
+ continue;
3762
+ }
3756
3763
  if (!track.logId) {
3757
3764
  result.skipped.push({ reason: "no_log_id", trackId: track.trackId });
3758
3765
  continue;
@@ -4571,7 +4578,7 @@ async function resolveClipSource(clip) {
4571
4578
  throw new CliError2("recording_not_staged", `Recording ${clip.recordingId} has no staged set video`);
4572
4579
  }
4573
4580
  return {
4574
- setUrl: `${FOUND_BASE3}/${recording.r2Key.split("/").map(encodeURIComponent).join("/")}`
4581
+ setUrl: r2PublicUrl(FOUND_BASE3, recording.r2Key)
4575
4582
  };
4576
4583
  }
4577
4584
  async function clipCutCommand(clipId, onProgress = () => {}) {
@@ -4649,6 +4656,7 @@ async function runClipCut(options) {
4649
4656
  }
4650
4657
  var FOUND_BASE3 = "https://found.fluncle.com", CLIP_WIDTH = 1080, CLIP_HEIGHT = 1920, CLIP_CRF = 21, CLIP_MAXRATE = "10M", CLIP_BUFSIZE = "20M", CLIP_AUDIO_BITRATE = "192k", MAX_CLIP_BYTES;
4651
4658
  var init_clips = __esm(() => {
4659
+ init_util();
4652
4660
  init_api();
4653
4661
  init_output();
4654
4662
  MAX_CLIP_BYTES = 100 * 1024 * 1024;
@@ -5287,6 +5295,29 @@ var init_auth_lastfm = __esm(() => {
5287
5295
  init_api();
5288
5296
  });
5289
5297
 
5298
+ // src/commands/admin-catalogue.ts
5299
+ var exports_admin_catalogue = {};
5300
+ __export(exports_admin_catalogue, {
5301
+ catalogueRankCommand: () => catalogueRankCommand,
5302
+ catalogueListCommand: () => catalogueListCommand
5303
+ });
5304
+ async function catalogueRankCommand(options) {
5305
+ const limit = options.limit ? Number.parseInt(options.limit, 10) : undefined;
5306
+ const response = await adminApiPost("/api/admin/catalogue/rank", limit ? { limit } : {});
5307
+ return response.summary;
5308
+ }
5309
+ async function catalogueListCommand(options) {
5310
+ const params = new URLSearchParams;
5311
+ params.set("lens", options.lens === "capture" ? "capture" : "ear");
5312
+ if (options.limit) {
5313
+ params.set("limit", options.limit);
5314
+ }
5315
+ return adminApiGet(`/api/admin/catalogue?${params.toString()}`);
5316
+ }
5317
+ var init_admin_catalogue = __esm(() => {
5318
+ init_api();
5319
+ });
5320
+
5290
5321
  // src/commands/admin-artists.ts
5291
5322
  var exports_admin_artists = {};
5292
5323
  __export(exports_admin_artists, {
@@ -8204,6 +8235,18 @@ function addAdminCommands(program2) {
8204
8235
  const { galaxyMapWriteCommand: galaxyMapWriteCommand2 } = await Promise.resolve().then(() => (init_galaxies(), exports_galaxies));
8205
8236
  await runGalaxyMapWrite(options, galaxyMapWriteCommand2);
8206
8237
  });
8238
+ const catalogue = configureCommand(admin.command("catalogue").description("The catalogue (uncertified tracks) + its ranking"));
8239
+ catalogue.action(() => {
8240
+ catalogue.outputHelp();
8241
+ });
8242
+ catalogue.command("rank").description("Run one tick of the ranking sweep (nearest finding + capture priority)").option("--limit <limit>", "Candidates per tick (default 250)").option("--json", "Print JSON", false).action(async (options) => {
8243
+ const { catalogueRankCommand: catalogueRankCommand2 } = await Promise.resolve().then(() => (init_admin_catalogue(), exports_admin_catalogue));
8244
+ await runCatalogueRank(options, catalogueRankCommand2);
8245
+ });
8246
+ catalogue.command("list").description("The ranked catalogue: closest to a finding (ear), or next to capture").option("--lens <lens>", "ear (default) or capture", "ear").option("--limit <limit>", "Rows (default 50, max 200)").option("--json", "Print JSON", false).action(async (options) => {
8247
+ const { catalogueListCommand: catalogueListCommand2 } = await Promise.resolve().then(() => (init_admin_catalogue(), exports_admin_catalogue));
8248
+ await runCatalogueList(options, catalogueListCommand2);
8249
+ });
8207
8250
  const backfill = configureCommand(admin.command("backfills").description("Backfill operator-only archives"));
8208
8251
  backfill.action(() => {
8209
8252
  backfill.outputHelp();
@@ -9306,6 +9349,41 @@ async function runGalaxies(slug, options, commands) {
9306
9349
  console.log(`${galaxy.name.padEnd(40)} ${String(galaxy.memberCount).padStart(3)} finding${galaxy.memberCount === 1 ? "" : "s"}`);
9307
9350
  }
9308
9351
  }
9352
+ async function runCatalogueRank(options, catalogueRankCommand2) {
9353
+ const summary = await catalogueRankCommand2({ limit: options.limit });
9354
+ if (options.json) {
9355
+ printJson({ ok: true, summary });
9356
+ return;
9357
+ }
9358
+ console.log(`Ranked ${summary.scored} against ${summary.embeddedFindings} embedded findings; prioritized ${summary.prioritized} for capture. ${summary.remaining} still stale.`);
9359
+ }
9360
+ async function runCatalogueList(options, catalogueListCommand2) {
9361
+ const { summary, tracks } = await catalogueListCommand2({
9362
+ lens: options.lens,
9363
+ limit: options.limit
9364
+ });
9365
+ if (options.json) {
9366
+ printJson({ ok: true, summary, tracks });
9367
+ return;
9368
+ }
9369
+ if (tracks.length === 0) {
9370
+ console.log("Nothing out there yet.");
9371
+ return;
9372
+ }
9373
+ for (const track of tracks) {
9374
+ const identity = `${track.artists.join(", ")} \u2014 ${track.title}`;
9375
+ if (options.lens === "capture") {
9376
+ const reason = track.captureReason;
9377
+ const why2 = reason?.kind === "artist" ? `${reason.name} is already in the archive` : reason?.kind === "label" ? `${reason.name} already carries a finding` : reason?.kind === "seed-label" ? `${reason.name} is a label the crawler digs from` : reason?.kind === "skipped-label" ? `${reason.name} is not your lane \u2014 ranked last, kept anyway` : "nothing ties it to the archive yet";
9378
+ console.log(`${String(track.capturePriority ?? 0)} ${identity.padEnd(52)} ${why2}`);
9379
+ continue;
9380
+ }
9381
+ const match = track.nearestFinding;
9382
+ const score = track.nearestFindingScore?.toFixed(2) ?? "\u2014";
9383
+ const why = match ? `closest to ${match.logId ? `${match.logId} ` : ""}${match.artists.join(", ")} \u2014 ${match.title}` : "nothing to compare it to yet";
9384
+ console.log(`${score} ${identity.padEnd(52)} ${why}`);
9385
+ }
9386
+ }
9309
9387
  async function runGalaxyMapRead(options, galaxyMapReadCommand2) {
9310
9388
  const galaxies = await galaxyMapReadCommand2();
9311
9389
  if (options.json) {
@@ -9870,6 +9948,7 @@ var stringOptions = new Set([
9870
9948
  "--key-confidence",
9871
9949
  "--key-source",
9872
9950
  "--kind",
9951
+ "--lens",
9873
9952
  "--limit",
9874
9953
  "--metrics",
9875
9954
  "--mime",
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.126.0"
34
+ "version": "0.128.0"
35
35
  }