fluncle 0.98.0 → 0.100.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 -11
  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.98.0".trim() ? "0.98.0".trim() : "0.1.0";
560
+ currentVersion = "0.100.0".trim() ? "0.100.0".trim() : "0.1.0";
561
561
  });
562
562
 
563
563
  // src/update-notifier.ts
@@ -2187,7 +2187,7 @@ function parseVersion2(version) {
2187
2187
  var currentVersion2, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
2188
2188
  var init_version2 = __esm(() => {
2189
2189
  init_output();
2190
- currentVersion2 = "0.98.0".trim() ? "0.98.0".trim() : "0.1.0";
2190
+ currentVersion2 = "0.100.0".trim() ? "0.100.0".trim() : "0.1.0";
2191
2191
  });
2192
2192
 
2193
2193
  // ../../packages/registry/src/index.ts
@@ -3957,14 +3957,10 @@ var init_mixtape_youtube2 = __esm(() => {
3957
3957
  init_output();
3958
3958
  });
3959
3959
 
3960
- // src/commands/mixtape-set-video.ts
3961
- import { randomUUID } from "node:crypto";
3962
- import { existsSync as existsSync2, rmSync as rmSync3, statSync as statSync3 } from "node:fs";
3963
- import { tmpdir } from "node:os";
3964
- import { join as join5 } from "node:path";
3960
+ // ../../packages/contracts/src/util/multipart.ts
3965
3961
  function planMultipart(contentLength, partSize = DEFAULT_PART_SIZE) {
3966
3962
  if (!Number.isInteger(contentLength) || contentLength <= 0) {
3967
- throw new CliError2("invalid_size", `The rendition size must be a positive integer (got ${contentLength})`);
3963
+ throw new Error(`multipart content length must be a positive integer (got ${contentLength})`);
3968
3964
  }
3969
3965
  let effective = Math.max(partSize, MIN_PART_SIZE);
3970
3966
  if (Math.ceil(contentLength / effective) > MAX_PARTS) {
@@ -3989,6 +3985,17 @@ function buildCompleteXml(parts) {
3989
3985
  const body = ordered.map((part) => `<Part><PartNumber>${part.partNumber}</PartNumber><ETag>${escapeXml(part.etag)}</ETag></Part>`).join("");
3990
3986
  return `<CompleteMultipartUpload>${body}</CompleteMultipartUpload>`;
3991
3987
  }
3988
+ var DEFAULT_PART_SIZE, MIN_PART_SIZE, MAX_PARTS = 1e4;
3989
+ var init_multipart = __esm(() => {
3990
+ DEFAULT_PART_SIZE = 16 * 1024 * 1024;
3991
+ MIN_PART_SIZE = 5 * 1024 * 1024;
3992
+ });
3993
+
3994
+ // src/commands/mixtape-set-video.ts
3995
+ import { randomUUID } from "node:crypto";
3996
+ import { existsSync as existsSync2, rmSync as rmSync3, statSync as statSync3 } from "node:fs";
3997
+ import { tmpdir } from "node:os";
3998
+ import { join as join5 } from "node:path";
3992
3999
  function renditionFfmpegArgs(inputPath, outputPath) {
3993
4000
  return [
3994
4001
  "-y",
@@ -4121,8 +4128,9 @@ async function deriveRendition(inputPath, outputPath) {
4121
4128
  throw new CliError2("ffmpeg_failed", `ffmpeg failed to derive the set-video rendition${detail ? `: ${detail}` : ""}`);
4122
4129
  }
4123
4130
  }
4124
- var FOUND_BASE2 = "https://found.fluncle.com", SET_VIDEO_RENDITION, DEFAULT_PART_SIZE, MIN_PART_SIZE, MAX_PARTS = 1e4, MAX_PART_ATTEMPTS = 5;
4131
+ var FOUND_BASE2 = "https://found.fluncle.com", SET_VIDEO_RENDITION, MAX_PART_ATTEMPTS = 5;
4125
4132
  var init_mixtape_set_video = __esm(() => {
4133
+ init_multipart();
4126
4134
  init_api();
4127
4135
  init_output();
4128
4136
  SET_VIDEO_RENDITION = {
@@ -4131,8 +4139,6 @@ var init_mixtape_set_video = __esm(() => {
4131
4139
  gopSeconds: 2,
4132
4140
  height: 1080
4133
4141
  };
4134
- DEFAULT_PART_SIZE = 16 * 1024 * 1024;
4135
- MIN_PART_SIZE = 5 * 1024 * 1024;
4136
4142
  });
4137
4143
 
4138
4144
  // src/commands/recordings.ts
@@ -5091,6 +5097,22 @@ var init_auth_lastfm = __esm(() => {
5091
5097
  init_api();
5092
5098
  });
5093
5099
 
5100
+ // src/commands/admin-artists.ts
5101
+ var exports_admin_artists = {};
5102
+ __export(exports_admin_artists, {
5103
+ backfillArtistsCommand: () => backfillArtistsCommand
5104
+ });
5105
+ async function backfillArtistsCommand(limit, dryRun, cursor) {
5106
+ const params = new URLSearchParams({ dryRun: String(dryRun), limit: String(limit) });
5107
+ if (cursor) {
5108
+ params.set("cursor", cursor);
5109
+ }
5110
+ return adminApiPost(`/api/admin/backfill/artists?${params.toString()}`);
5111
+ }
5112
+ var init_admin_artists = __esm(() => {
5113
+ init_api();
5114
+ });
5115
+
5094
5116
  // src/interactive.ts
5095
5117
  var exports_interactive = {};
5096
5118
  __export(exports_interactive, {
@@ -7908,6 +7930,10 @@ function addAdminCommands(program2) {
7908
7930
  const { backfillDiscogsCommand: backfillDiscogsCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
7909
7931
  await runBackfillDiscogs(options, backfillDiscogsCommand2);
7910
7932
  });
7933
+ 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) => {
7934
+ const { backfillArtistsCommand: backfillArtistsCommand2 } = await Promise.resolve().then(() => (init_admin_artists(), exports_admin_artists));
7935
+ await runBackfillArtists(options, backfillArtistsCommand2);
7936
+ });
7911
7937
  }
7912
7938
  async function runTrackPreviewArchive(idOrLogId, options, previewArchiveUploadCommand2) {
7913
7939
  if (!idOrLogId || !options.file || !options.source || !options.mime) {
@@ -8120,6 +8146,51 @@ async function runBackfillDiscogs(options, backfillDiscogsCommand2) {
8120
8146
  console.log(` ${item.logId}: release ${item.releaseId}${master}`);
8121
8147
  }
8122
8148
  }
8149
+ async function runBackfillArtists(options, backfillArtistsCommand2) {
8150
+ const limit = parseListLimit(options.limit);
8151
+ const upserted = [];
8152
+ const failed = [];
8153
+ const skipped = [];
8154
+ let cursor;
8155
+ let dryRun = options.dryRun;
8156
+ while (upserted.length + failed.length < limit) {
8157
+ const remaining = limit - (upserted.length + failed.length);
8158
+ const result = await backfillArtistsCommand2(remaining, options.dryRun, cursor);
8159
+ dryRun = result.dryRun;
8160
+ upserted.push(...result.upserted);
8161
+ failed.push(...result.failed);
8162
+ skipped.push(...result.skipped);
8163
+ if (!options.json) {
8164
+ const verb2 = result.dryRun ? "would upsert" : "upserted";
8165
+ console.log(` \u2026${verb2} ${result.upsertedCount}; ${result.failedCount} failed; ${result.skippedCount} skipped`);
8166
+ }
8167
+ if (result.nextCursor === null) {
8168
+ break;
8169
+ }
8170
+ cursor = result.nextCursor;
8171
+ }
8172
+ if (options.json) {
8173
+ printJson({
8174
+ dryRun,
8175
+ failed,
8176
+ failedCount: failed.length,
8177
+ ok: true,
8178
+ skipped,
8179
+ skippedCount: skipped.length,
8180
+ upserted,
8181
+ upsertedCount: upserted.length
8182
+ });
8183
+ return;
8184
+ }
8185
+ const verb = dryRun ? "Would upsert" : "Upserted";
8186
+ console.log(`${verb} ${upserted.length} artist entity row(s); ${failed.length} failed; ${skipped.length} skipped.`);
8187
+ for (const logId of upserted) {
8188
+ console.log(` ${logId}`);
8189
+ }
8190
+ for (const item of failed) {
8191
+ console.log(` ${item.logId}: ${item.error}`);
8192
+ }
8193
+ }
8123
8194
  async function runTrackVideo(idOrLogId, options, trackVideoCommand2) {
8124
8195
  if (!idOrLogId) {
8125
8196
  throw new Error("Missing id. Usage: fluncle admin tracks video <track_id|log_id> (--dir <dir> | --footage <file> [--footage-social <file>] [--footage-notext <file>] [--footage-landscape <file>] [--footage-landscape-social <file>] [--poster <file>] [--cover <file>] [--note <file>] [--composition <file>] [--props <file>] [--render <file>] [--intent <file>] [--metrics <file>] [--scene <file>] | --plate <file> [--plate-background <file>]) [--allow-partial]");
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.98.0"
34
+ "version": "0.100.0"
35
35
  }