tsarr 2.1.0 → 2.2.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.
package/dist/cli/index.js CHANGED
@@ -4540,6 +4540,52 @@ ${indent}`);
4540
4540
  consola = createConsola2();
4541
4541
  });
4542
4542
 
4543
+ // src/cli/prompt.ts
4544
+ async function promptIfMissing(value, message) {
4545
+ if (value)
4546
+ return value;
4547
+ if (!process.stdin.isTTY) {
4548
+ throw new Error(`Missing required argument. Use --help for usage info.`);
4549
+ }
4550
+ const result = await consola.prompt(message, { type: "text" });
4551
+ if (typeof result !== "string" || !result.trim()) {
4552
+ throw new Error("No input provided.");
4553
+ }
4554
+ return result.trim();
4555
+ }
4556
+ async function promptConfirm(message, skipPrompt = false) {
4557
+ if (skipPrompt)
4558
+ return true;
4559
+ if (!process.stdin.isTTY) {
4560
+ throw new Error("Destructive action requires confirmation. Use --yes to skip in non-interactive mode.");
4561
+ }
4562
+ const result = await consola.prompt(message, { type: "confirm" });
4563
+ return result === true;
4564
+ }
4565
+ async function promptSelect(message, options) {
4566
+ if (!process.stdin.isTTY) {
4567
+ throw new Error("Interactive selection requires a TTY.");
4568
+ }
4569
+ const result = await consola.prompt(message, {
4570
+ type: "select",
4571
+ options: options.map((o3) => ({ label: o3.label, value: o3.value }))
4572
+ });
4573
+ return result;
4574
+ }
4575
+ async function promptMultiSelect(message, options) {
4576
+ if (!process.stdin.isTTY) {
4577
+ throw new Error("Interactive selection requires a TTY.");
4578
+ }
4579
+ const result = await consola.prompt(message, {
4580
+ type: "multiselect",
4581
+ options: options.map((o3) => ({ label: o3.label, value: o3.value }))
4582
+ });
4583
+ return result;
4584
+ }
4585
+ var init_prompt2 = __esm(() => {
4586
+ init_dist2();
4587
+ });
4588
+
4543
4589
  // src/cli/config.ts
4544
4590
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
4545
4591
  import { homedir } from "os";
@@ -4812,52 +4858,6 @@ function formatCell(value) {
4812
4858
  return String(value);
4813
4859
  }
4814
4860
 
4815
- // src/cli/prompt.ts
4816
- async function promptIfMissing(value, message) {
4817
- if (value)
4818
- return value;
4819
- if (!process.stdin.isTTY) {
4820
- throw new Error(`Missing required argument. Use --help for usage info.`);
4821
- }
4822
- const result = await consola.prompt(message, { type: "text" });
4823
- if (typeof result !== "string" || !result.trim()) {
4824
- throw new Error("No input provided.");
4825
- }
4826
- return result.trim();
4827
- }
4828
- async function promptConfirm(message, skipPrompt = false) {
4829
- if (skipPrompt)
4830
- return true;
4831
- if (!process.stdin.isTTY) {
4832
- throw new Error("Destructive action requires confirmation. Use --yes to skip in non-interactive mode.");
4833
- }
4834
- const result = await consola.prompt(message, { type: "confirm" });
4835
- return result === true;
4836
- }
4837
- async function promptSelect(message, options) {
4838
- if (!process.stdin.isTTY) {
4839
- throw new Error("Interactive selection requires a TTY.");
4840
- }
4841
- const result = await consola.prompt(message, {
4842
- type: "select",
4843
- options: options.map((o3) => ({ label: o3.label, value: o3.value }))
4844
- });
4845
- return result;
4846
- }
4847
- async function promptMultiSelect(message, options) {
4848
- if (!process.stdin.isTTY) {
4849
- throw new Error("Interactive selection requires a TTY.");
4850
- }
4851
- const result = await consola.prompt(message, {
4852
- type: "multiselect",
4853
- options: options.map((o3) => ({ label: o3.label, value: o3.value }))
4854
- });
4855
- return result;
4856
- }
4857
- var init_prompt2 = __esm(() => {
4858
- init_dist2();
4859
- });
4860
-
4861
4861
  // src/cli/commands/service.ts
4862
4862
  function buildServiceCommand(serviceName, description, clientFactory, resources) {
4863
4863
  const subCommands = {};
@@ -4994,6 +4994,7 @@ __export(exports_radarr3, {
4994
4994
  var resources, radarr;
4995
4995
  var init_radarr3 = __esm(() => {
4996
4996
  init_radarr2();
4997
+ init_prompt2();
4997
4998
  init_service();
4998
4999
  resources = [
4999
5000
  {
@@ -5020,6 +5021,79 @@ var init_radarr3 = __esm(() => {
5020
5021
  idField: "tmdbId",
5021
5022
  run: (c3, a2) => c3.searchMovies(a2.term)
5022
5023
  },
5024
+ {
5025
+ name: "add",
5026
+ description: "Search and add a movie",
5027
+ args: [{ name: "term", description: "Search term", required: true }],
5028
+ run: async (c3, a2) => {
5029
+ const searchResult = await c3.searchMovies(a2.term);
5030
+ const results = searchResult?.data ?? searchResult;
5031
+ if (!Array.isArray(results) || results.length === 0) {
5032
+ throw new Error("No movies found.");
5033
+ }
5034
+ const movieId = await promptSelect("Select a movie:", results.map((m2) => ({ label: `${m2.title} (${m2.year})`, value: String(m2.tmdbId) })));
5035
+ const movie = results.find((m2) => String(m2.tmdbId) === movieId);
5036
+ if (!movie) {
5037
+ throw new Error("Selected movie was not found in the search results.");
5038
+ }
5039
+ const profilesResult = await c3.getQualityProfiles();
5040
+ const profiles = profilesResult?.data ?? profilesResult;
5041
+ if (!Array.isArray(profiles) || profiles.length === 0) {
5042
+ throw new Error("No quality profiles found. Configure one in Radarr first.");
5043
+ }
5044
+ const profileId = await promptSelect("Select quality profile:", profiles.map((p) => ({ label: p.name, value: String(p.id) })));
5045
+ const foldersResult = await c3.getRootFolders();
5046
+ const folders = foldersResult?.data ?? foldersResult;
5047
+ if (!Array.isArray(folders) || folders.length === 0) {
5048
+ throw new Error("No root folders found. Configure one in Radarr first.");
5049
+ }
5050
+ const rootFolderPath = await promptSelect("Select root folder:", folders.map((f3) => ({ label: f3.path, value: f3.path })));
5051
+ const confirmed = await promptConfirm(`Add "${movie.title} (${movie.year})"?`, !!a2.yes);
5052
+ if (!confirmed)
5053
+ throw new Error("Cancelled.");
5054
+ return c3.addMovie({
5055
+ ...movie,
5056
+ qualityProfileId: Number(profileId),
5057
+ rootFolderPath,
5058
+ monitored: true,
5059
+ addOptions: { searchForMovie: true }
5060
+ });
5061
+ }
5062
+ },
5063
+ {
5064
+ name: "edit",
5065
+ description: "Edit a movie",
5066
+ args: [
5067
+ { name: "id", description: "Movie ID", required: true, type: "number" },
5068
+ { name: "monitored", description: "Set monitored (true/false)" },
5069
+ { name: "quality-profile-id", description: "Quality profile ID", type: "number" },
5070
+ { name: "tags", description: "Comma-separated tag IDs" }
5071
+ ],
5072
+ run: async (c3, a2) => {
5073
+ const result = await c3.getMovie(a2.id);
5074
+ const movie = result?.data ?? result;
5075
+ const updates = { ...movie };
5076
+ if (a2.monitored !== undefined)
5077
+ updates.monitored = a2.monitored === "true";
5078
+ if (a2["quality-profile-id"] !== undefined)
5079
+ updates.qualityProfileId = Number(a2["quality-profile-id"]);
5080
+ if (a2.tags !== undefined)
5081
+ updates.tags = a2.tags.split(",").map((t2) => Number(t2.trim()));
5082
+ return c3.updateMovie(a2.id, updates);
5083
+ }
5084
+ },
5085
+ {
5086
+ name: "refresh",
5087
+ description: "Refresh movie metadata",
5088
+ args: [{ name: "id", description: "Movie ID", required: true, type: "number" }],
5089
+ run: (c3, a2) => c3.runCommand({ name: "RefreshMovie", movieIds: [a2.id] })
5090
+ },
5091
+ {
5092
+ name: "manual-search",
5093
+ description: "Trigger a manual search for releases",
5094
+ args: [{ name: "id", description: "Movie ID", required: true, type: "number" }],
5095
+ run: (c3, a2) => c3.runCommand({ name: "MoviesSearch", movieIds: [a2.id] })
5096
+ },
5023
5097
  {
5024
5098
  name: "delete",
5025
5099
  description: "Delete a movie",
@@ -7520,6 +7594,7 @@ __export(exports_sonarr3, {
7520
7594
  var resources2, sonarr;
7521
7595
  var init_sonarr3 = __esm(() => {
7522
7596
  init_sonarr2();
7597
+ init_prompt2();
7523
7598
  init_service();
7524
7599
  resources2 = [
7525
7600
  {
@@ -7545,6 +7620,79 @@ var init_sonarr3 = __esm(() => {
7545
7620
  columns: ["tvdbId", "title", "year", "overview"],
7546
7621
  run: (c3, a2) => c3.searchSeries(a2.term)
7547
7622
  },
7623
+ {
7624
+ name: "add",
7625
+ description: "Search and add a series",
7626
+ args: [{ name: "term", description: "Search term", required: true }],
7627
+ run: async (c3, a2) => {
7628
+ const searchResult = await c3.searchSeries(a2.term);
7629
+ const results = searchResult?.data ?? searchResult;
7630
+ if (!Array.isArray(results) || results.length === 0) {
7631
+ throw new Error("No series found.");
7632
+ }
7633
+ const seriesId = await promptSelect("Select a series:", results.map((s2) => ({ label: `${s2.title} (${s2.year})`, value: String(s2.tvdbId) })));
7634
+ const series = results.find((s2) => String(s2.tvdbId) === seriesId);
7635
+ if (!series) {
7636
+ throw new Error("Selected series was not found in the search results.");
7637
+ }
7638
+ const profilesResult = await c3.getQualityProfiles();
7639
+ const profiles = profilesResult?.data ?? profilesResult;
7640
+ if (!Array.isArray(profiles) || profiles.length === 0) {
7641
+ throw new Error("No quality profiles found. Configure one in Sonarr first.");
7642
+ }
7643
+ const profileId = await promptSelect("Select quality profile:", profiles.map((p) => ({ label: p.name, value: String(p.id) })));
7644
+ const foldersResult = await c3.getRootFolders();
7645
+ const folders = foldersResult?.data ?? foldersResult;
7646
+ if (!Array.isArray(folders) || folders.length === 0) {
7647
+ throw new Error("No root folders found. Configure one in Sonarr first.");
7648
+ }
7649
+ const rootFolderPath = await promptSelect("Select root folder:", folders.map((f3) => ({ label: f3.path, value: f3.path })));
7650
+ const confirmed = await promptConfirm(`Add "${series.title} (${series.year})"?`, !!a2.yes);
7651
+ if (!confirmed)
7652
+ throw new Error("Cancelled.");
7653
+ return c3.addSeries({
7654
+ ...series,
7655
+ qualityProfileId: Number(profileId),
7656
+ rootFolderPath,
7657
+ monitored: true,
7658
+ addOptions: { searchForMissingEpisodes: true }
7659
+ });
7660
+ }
7661
+ },
7662
+ {
7663
+ name: "edit",
7664
+ description: "Edit a series",
7665
+ args: [
7666
+ { name: "id", description: "Series ID", required: true, type: "number" },
7667
+ { name: "monitored", description: "Set monitored (true/false)" },
7668
+ { name: "quality-profile-id", description: "Quality profile ID", type: "number" },
7669
+ { name: "tags", description: "Comma-separated tag IDs" }
7670
+ ],
7671
+ run: async (c3, a2) => {
7672
+ const result = await c3.getSeriesById(a2.id);
7673
+ const series = result?.data ?? result;
7674
+ const updates = { ...series };
7675
+ if (a2.monitored !== undefined)
7676
+ updates.monitored = a2.monitored === "true";
7677
+ if (a2["quality-profile-id"] !== undefined)
7678
+ updates.qualityProfileId = Number(a2["quality-profile-id"]);
7679
+ if (a2.tags !== undefined)
7680
+ updates.tags = a2.tags.split(",").map((t2) => Number(t2.trim()));
7681
+ return c3.updateSeries(String(a2.id), updates);
7682
+ }
7683
+ },
7684
+ {
7685
+ name: "refresh",
7686
+ description: "Refresh series metadata",
7687
+ args: [{ name: "id", description: "Series ID", required: true, type: "number" }],
7688
+ run: (c3, a2) => c3.runCommand({ name: "RefreshSeries", seriesId: a2.id })
7689
+ },
7690
+ {
7691
+ name: "manual-search",
7692
+ description: "Trigger a manual search for releases",
7693
+ args: [{ name: "id", description: "Series ID", required: true, type: "number" }],
7694
+ run: (c3, a2) => c3.runCommand({ name: "SeriesSearch", seriesId: a2.id })
7695
+ },
7548
7696
  {
7549
7697
  name: "delete",
7550
7698
  description: "Delete a series",
@@ -9960,6 +10108,7 @@ __export(exports_lidarr3, {
9960
10108
  var resources3, lidarr;
9961
10109
  var init_lidarr3 = __esm(() => {
9962
10110
  init_lidarr2();
10111
+ init_prompt2();
9963
10112
  init_service();
9964
10113
  resources3 = [
9965
10114
  {
@@ -9985,6 +10134,82 @@ var init_lidarr3 = __esm(() => {
9985
10134
  columns: ["foreignArtistId", "artistName", "overview"],
9986
10135
  run: (c3, a2) => c3.searchArtists(a2.term)
9987
10136
  },
10137
+ {
10138
+ name: "add",
10139
+ description: "Search and add an artist",
10140
+ args: [{ name: "term", description: "Search term", required: true }],
10141
+ run: async (c3, a2) => {
10142
+ const searchResult = await c3.searchArtists(a2.term);
10143
+ const results = searchResult?.data ?? searchResult;
10144
+ if (!Array.isArray(results) || results.length === 0) {
10145
+ throw new Error("No artists found.");
10146
+ }
10147
+ const artistId = await promptSelect("Select an artist:", results.map((ar) => ({
10148
+ label: ar.artistName,
10149
+ value: String(ar.foreignArtistId)
10150
+ })));
10151
+ const artist = results.find((ar) => String(ar.foreignArtistId) === artistId);
10152
+ if (!artist) {
10153
+ throw new Error("Selected artist was not found in the search results.");
10154
+ }
10155
+ const profilesResult = await c3.getQualityProfiles();
10156
+ const profiles = profilesResult?.data ?? profilesResult;
10157
+ if (!Array.isArray(profiles) || profiles.length === 0) {
10158
+ throw new Error("No quality profiles found. Configure one in Lidarr first.");
10159
+ }
10160
+ const profileId = await promptSelect("Select quality profile:", profiles.map((p) => ({ label: p.name, value: String(p.id) })));
10161
+ const foldersResult = await c3.getRootFolders();
10162
+ const folders = foldersResult?.data ?? foldersResult;
10163
+ if (!Array.isArray(folders) || folders.length === 0) {
10164
+ throw new Error("No root folders found. Configure one in Lidarr first.");
10165
+ }
10166
+ const rootFolderPath = await promptSelect("Select root folder:", folders.map((f3) => ({ label: f3.path, value: f3.path })));
10167
+ const confirmed = await promptConfirm(`Add "${artist.artistName}"?`, !!a2.yes);
10168
+ if (!confirmed)
10169
+ throw new Error("Cancelled.");
10170
+ return c3.addArtist({
10171
+ ...artist,
10172
+ qualityProfileId: Number(profileId),
10173
+ rootFolderPath,
10174
+ monitored: true,
10175
+ addOptions: { searchForMissingAlbums: true }
10176
+ });
10177
+ }
10178
+ },
10179
+ {
10180
+ name: "edit",
10181
+ description: "Edit an artist",
10182
+ args: [
10183
+ { name: "id", description: "Artist ID", required: true, type: "number" },
10184
+ { name: "monitored", description: "Set monitored (true/false)" },
10185
+ { name: "quality-profile-id", description: "Quality profile ID", type: "number" },
10186
+ { name: "tags", description: "Comma-separated tag IDs" }
10187
+ ],
10188
+ run: async (c3, a2) => {
10189
+ const result = await c3.getArtist(a2.id);
10190
+ const artist = result?.data ?? result;
10191
+ const updates = { ...artist };
10192
+ if (a2.monitored !== undefined)
10193
+ updates.monitored = a2.monitored === "true";
10194
+ if (a2["quality-profile-id"] !== undefined)
10195
+ updates.qualityProfileId = Number(a2["quality-profile-id"]);
10196
+ if (a2.tags !== undefined)
10197
+ updates.tags = a2.tags.split(",").map((t2) => Number(t2.trim()));
10198
+ return c3.updateArtist(a2.id, updates);
10199
+ }
10200
+ },
10201
+ {
10202
+ name: "refresh",
10203
+ description: "Refresh artist metadata",
10204
+ args: [{ name: "id", description: "Artist ID", required: true, type: "number" }],
10205
+ run: (c3, a2) => c3.runCommand({ name: "RefreshArtist", artistId: a2.id })
10206
+ },
10207
+ {
10208
+ name: "manual-search",
10209
+ description: "Trigger a manual search for releases",
10210
+ args: [{ name: "id", description: "Artist ID", required: true, type: "number" }],
10211
+ run: (c3, a2) => c3.runCommand({ name: "ArtistSearch", artistId: a2.id })
10212
+ },
9988
10213
  {
9989
10214
  name: "delete",
9990
10215
  description: "Delete an artist",
@@ -12353,6 +12578,7 @@ __export(exports_readarr3, {
12353
12578
  var resources4, readarr;
12354
12579
  var init_readarr3 = __esm(() => {
12355
12580
  init_readarr2();
12581
+ init_prompt2();
12356
12582
  init_service();
12357
12583
  resources4 = [
12358
12584
  {
@@ -12378,6 +12604,79 @@ var init_readarr3 = __esm(() => {
12378
12604
  columns: ["foreignAuthorId", "authorName", "overview"],
12379
12605
  run: (c3, a2) => c3.searchAuthors(a2.term)
12380
12606
  },
12607
+ {
12608
+ name: "add",
12609
+ description: "Search and add an author",
12610
+ args: [{ name: "term", description: "Search term", required: true }],
12611
+ run: async (c3, a2) => {
12612
+ const searchResult = await c3.searchAuthors(a2.term);
12613
+ const results = searchResult?.data ?? searchResult;
12614
+ if (!Array.isArray(results) || results.length === 0) {
12615
+ throw new Error("No authors found.");
12616
+ }
12617
+ const authorId = await promptSelect("Select an author:", results.map((au) => ({
12618
+ label: au.authorName,
12619
+ value: String(au.foreignAuthorId)
12620
+ })));
12621
+ const author = results.find((au) => String(au.foreignAuthorId) === authorId);
12622
+ const profilesResult = await c3.getQualityProfiles();
12623
+ const profiles = profilesResult?.data ?? profilesResult;
12624
+ if (!Array.isArray(profiles) || profiles.length === 0) {
12625
+ throw new Error("No quality profiles found. Configure one in Readarr first.");
12626
+ }
12627
+ const profileId = await promptSelect("Select quality profile:", profiles.map((p) => ({ label: p.name, value: String(p.id) })));
12628
+ const foldersResult = await c3.getRootFolders();
12629
+ const folders = foldersResult?.data ?? foldersResult;
12630
+ if (!Array.isArray(folders) || folders.length === 0) {
12631
+ throw new Error("No root folders found. Configure one in Readarr first.");
12632
+ }
12633
+ const rootFolderPath = await promptSelect("Select root folder:", folders.map((f3) => ({ label: f3.path, value: f3.path })));
12634
+ const confirmed = await promptConfirm(`Add "${author.authorName}"?`, !!a2.yes);
12635
+ if (!confirmed)
12636
+ throw new Error("Cancelled.");
12637
+ return c3.addAuthor({
12638
+ ...author,
12639
+ qualityProfileId: Number(profileId),
12640
+ rootFolderPath,
12641
+ monitored: true,
12642
+ addOptions: { searchForMissingBooks: true }
12643
+ });
12644
+ }
12645
+ },
12646
+ {
12647
+ name: "edit",
12648
+ description: "Edit an author",
12649
+ args: [
12650
+ { name: "id", description: "Author ID", required: true, type: "number" },
12651
+ { name: "monitored", description: "Set monitored (true/false)" },
12652
+ { name: "quality-profile-id", description: "Quality profile ID", type: "number" },
12653
+ { name: "tags", description: "Comma-separated tag IDs" }
12654
+ ],
12655
+ run: async (c3, a2) => {
12656
+ const result = await c3.getAuthor(a2.id);
12657
+ const author = result?.data ?? result;
12658
+ const updates = { ...author };
12659
+ if (a2.monitored !== undefined)
12660
+ updates.monitored = a2.monitored === "true";
12661
+ if (a2["quality-profile-id"] !== undefined)
12662
+ updates.qualityProfileId = Number(a2["quality-profile-id"]);
12663
+ if (a2.tags !== undefined)
12664
+ updates.tags = a2.tags.split(",").map((t2) => Number(t2.trim()));
12665
+ return c3.updateAuthor(a2.id, updates);
12666
+ }
12667
+ },
12668
+ {
12669
+ name: "refresh",
12670
+ description: "Refresh author metadata",
12671
+ args: [{ name: "id", description: "Author ID", required: true, type: "number" }],
12672
+ run: (c3, a2) => c3.runCommand({ name: "RefreshAuthor", authorId: a2.id })
12673
+ },
12674
+ {
12675
+ name: "manual-search",
12676
+ description: "Trigger a manual search for releases",
12677
+ args: [{ name: "id", description: "Author ID", required: true, type: "number" }],
12678
+ run: (c3, a2) => c3.runCommand({ name: "AuthorSearch", authorId: a2.id })
12679
+ },
12381
12680
  {
12382
12681
  name: "delete",
12383
12682
  description: "Delete an author",
@@ -14990,46 +15289,46 @@ var init_client7 = __esm(() => {
14990
15289
  var client6;
14991
15290
  var init_client_gen12 = __esm(() => {
14992
15291
  init_client7();
14993
- client6 = createClient6(createConfig6({ baseUrl: "/api" }));
15292
+ client6 = createClient6(createConfig6());
14994
15293
  });
14995
15294
 
14996
15295
  // src/generated/bazarr/sdk.gen.ts
14997
15296
  var getBadges = (options) => (options?.client ?? client6).get({
14998
15297
  security: [{ name: "X-API-KEY", type: "apiKey" }],
14999
- url: "/badges",
15298
+ url: "/api/badges",
15000
15299
  ...options
15001
15300
  }), getEpisodes = (options) => (options?.client ?? client6).get({
15002
15301
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15003
- url: "/episodes",
15302
+ url: "/api/episodes",
15004
15303
  ...options
15005
15304
  }), deleteEpisodesBlacklist = (options) => (options?.client ?? client6).delete({
15006
15305
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15007
- url: "/episodes/blacklist",
15306
+ url: "/api/episodes/blacklist",
15008
15307
  ...options
15009
15308
  }), getEpisodesBlacklist = (options) => (options?.client ?? client6).get({
15010
15309
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15011
- url: "/episodes/blacklist",
15310
+ url: "/api/episodes/blacklist",
15012
15311
  ...options
15013
15312
  }), postEpisodesBlacklist = (options) => (options.client ?? client6).post({
15014
15313
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15015
- url: "/episodes/blacklist",
15314
+ url: "/api/episodes/blacklist",
15016
15315
  ...options
15017
15316
  }), getEpisodesHistory = (options) => (options?.client ?? client6).get({
15018
15317
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15019
- url: "/episodes/history",
15318
+ url: "/api/episodes/history",
15020
15319
  ...options
15021
15320
  }), deleteEpisodesSubtitles = (options) => (options.client ?? client6).delete({
15022
15321
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15023
- url: "/episodes/subtitles",
15322
+ url: "/api/episodes/subtitles",
15024
15323
  ...options
15025
15324
  }), patchEpisodesSubtitles = (options) => (options.client ?? client6).patch({
15026
15325
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15027
- url: "/episodes/subtitles",
15326
+ url: "/api/episodes/subtitles",
15028
15327
  ...options
15029
15328
  }), postEpisodesSubtitles = (options) => (options.client ?? client6).post({
15030
15329
  ...formDataBodySerializer,
15031
15330
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15032
- url: "/episodes/subtitles",
15331
+ url: "/api/episodes/subtitles",
15033
15332
  ...options,
15034
15333
  headers: {
15035
15334
  "Content-Type": null,
@@ -15037,64 +15336,64 @@ var getBadges = (options) => (options?.client ?? client6).get({
15037
15336
  }
15038
15337
  }), getEpisodesWanted = (options) => (options?.client ?? client6).get({
15039
15338
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15040
- url: "/episodes/wanted",
15339
+ url: "/api/episodes/wanted",
15041
15340
  ...options
15042
15341
  }), getBrowseBazarrFs = (options) => (options?.client ?? client6).get({
15043
15342
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15044
- url: "/files",
15343
+ url: "/api/files",
15045
15344
  ...options
15046
15345
  }), getBrowseRadarrFs = (options) => (options?.client ?? client6).get({
15047
15346
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15048
- url: "/files/radarr",
15347
+ url: "/api/files/radarr",
15049
15348
  ...options
15050
15349
  }), getBrowseSonarrFs = (options) => (options?.client ?? client6).get({
15051
15350
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15052
- url: "/files/sonarr",
15351
+ url: "/api/files/sonarr",
15053
15352
  ...options
15054
15353
  }), getHistoryStats = (options) => (options?.client ?? client6).get({
15055
15354
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15056
- url: "/history/stats",
15355
+ url: "/api/history/stats",
15057
15356
  ...options
15058
15357
  }), getMovies = (options) => (options?.client ?? client6).get({
15059
15358
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15060
- url: "/movies",
15359
+ url: "/api/movies",
15061
15360
  ...options
15062
15361
  }), patchMovies = (options) => (options?.client ?? client6).patch({
15063
15362
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15064
- url: "/movies",
15363
+ url: "/api/movies",
15065
15364
  ...options
15066
15365
  }), postMovies = (options) => (options?.client ?? client6).post({
15067
15366
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15068
- url: "/movies",
15367
+ url: "/api/movies",
15069
15368
  ...options
15070
15369
  }), deleteMoviesBlacklist = (options) => (options?.client ?? client6).delete({
15071
15370
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15072
- url: "/movies/blacklist",
15371
+ url: "/api/movies/blacklist",
15073
15372
  ...options
15074
15373
  }), getMoviesBlacklist = (options) => (options?.client ?? client6).get({
15075
15374
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15076
- url: "/movies/blacklist",
15375
+ url: "/api/movies/blacklist",
15077
15376
  ...options
15078
15377
  }), postMoviesBlacklist = (options) => (options.client ?? client6).post({
15079
15378
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15080
- url: "/movies/blacklist",
15379
+ url: "/api/movies/blacklist",
15081
15380
  ...options
15082
15381
  }), getMoviesHistory = (options) => (options?.client ?? client6).get({
15083
15382
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15084
- url: "/movies/history",
15383
+ url: "/api/movies/history",
15085
15384
  ...options
15086
15385
  }), deleteMoviesSubtitles = (options) => (options.client ?? client6).delete({
15087
15386
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15088
- url: "/movies/subtitles",
15387
+ url: "/api/movies/subtitles",
15089
15388
  ...options
15090
15389
  }), patchMoviesSubtitles = (options) => (options.client ?? client6).patch({
15091
15390
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15092
- url: "/movies/subtitles",
15391
+ url: "/api/movies/subtitles",
15093
15392
  ...options
15094
15393
  }), postMoviesSubtitles = (options) => (options.client ?? client6).post({
15095
15394
  ...formDataBodySerializer,
15096
15395
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15097
- url: "/movies/subtitles",
15396
+ url: "/api/movies/subtitles",
15098
15397
  ...options,
15099
15398
  headers: {
15100
15399
  "Content-Type": null,
@@ -15102,151 +15401,151 @@ var getBadges = (options) => (options?.client ?? client6).get({
15102
15401
  }
15103
15402
  }), getMoviesWanted = (options) => (options?.client ?? client6).get({
15104
15403
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15105
- url: "/movies/wanted",
15404
+ url: "/api/movies/wanted",
15106
15405
  ...options
15107
15406
  }), getProviders = (options) => (options?.client ?? client6).get({
15108
15407
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15109
- url: "/providers",
15408
+ url: "/api/providers",
15110
15409
  ...options
15111
15410
  }), postProviders = (options) => (options.client ?? client6).post({
15112
15411
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15113
- url: "/providers",
15412
+ url: "/api/providers",
15114
15413
  ...options
15115
15414
  }), getProviderEpisodes = (options) => (options.client ?? client6).get({
15116
15415
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15117
- url: "/providers/episodes",
15416
+ url: "/api/providers/episodes",
15118
15417
  ...options
15119
15418
  }), postProviderEpisodes = (options) => (options.client ?? client6).post({
15120
15419
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15121
- url: "/providers/episodes",
15420
+ url: "/api/providers/episodes",
15122
15421
  ...options
15123
15422
  }), getProviderMovies = (options) => (options.client ?? client6).get({
15124
15423
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15125
- url: "/providers/movies",
15424
+ url: "/api/providers/movies",
15126
15425
  ...options
15127
15426
  }), postProviderMovies = (options) => (options.client ?? client6).post({
15128
15427
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15129
- url: "/providers/movies",
15428
+ url: "/api/providers/movies",
15130
15429
  ...options
15131
15430
  }), getSeries = (options) => (options?.client ?? client6).get({
15132
15431
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15133
- url: "/series",
15432
+ url: "/api/series",
15134
15433
  ...options
15135
15434
  }), patchSeries = (options) => (options?.client ?? client6).patch({
15136
15435
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15137
- url: "/series",
15436
+ url: "/api/series",
15138
15437
  ...options
15139
15438
  }), postSeries = (options) => (options?.client ?? client6).post({
15140
15439
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15141
- url: "/series",
15440
+ url: "/api/series",
15142
15441
  ...options
15143
15442
  }), getSubtitles = (options) => (options.client ?? client6).get({
15144
15443
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15145
- url: "/subtitles",
15444
+ url: "/api/subtitles",
15146
15445
  ...options
15147
15446
  }), patchSubtitles = (options) => (options.client ?? client6).patch({
15148
15447
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15149
- url: "/subtitles",
15448
+ url: "/api/subtitles",
15150
15449
  ...options
15151
15450
  }), getSubtitleNameInfo = (options) => (options.client ?? client6).get({
15152
15451
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15153
- url: "/subtitles/info",
15452
+ url: "/api/subtitles/info",
15154
15453
  ...options
15155
15454
  }), getSystemAnnouncements = (options) => (options?.client ?? client6).get({
15156
15455
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15157
- url: "/system/announcements",
15456
+ url: "/api/system/announcements",
15158
15457
  ...options
15159
15458
  }), postSystemAnnouncements = (options) => (options.client ?? client6).post({
15160
15459
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15161
- url: "/system/announcements",
15460
+ url: "/api/system/announcements",
15162
15461
  ...options
15163
15462
  }), deleteSystemBackups = (options) => (options.client ?? client6).delete({
15164
15463
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15165
- url: "/system/backups",
15464
+ url: "/api/system/backups",
15166
15465
  ...options
15167
15466
  }), getSystemBackups = (options) => (options?.client ?? client6).get({
15168
15467
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15169
- url: "/system/backups",
15468
+ url: "/api/system/backups",
15170
15469
  ...options
15171
15470
  }), patchSystemBackups = (options) => (options.client ?? client6).patch({
15172
15471
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15173
- url: "/system/backups",
15472
+ url: "/api/system/backups",
15174
15473
  ...options
15175
15474
  }), postSystemBackups = (options) => (options?.client ?? client6).post({
15176
15475
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15177
- url: "/system/backups",
15476
+ url: "/api/system/backups",
15178
15477
  ...options
15179
15478
  }), getSystemHealth = (options) => (options?.client ?? client6).get({
15180
15479
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15181
- url: "/system/health",
15480
+ url: "/api/system/health",
15182
15481
  ...options
15183
15482
  }), deleteSystemJobs = (options) => (options.client ?? client6).delete({
15184
15483
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15185
- url: "/system/jobs",
15484
+ url: "/api/system/jobs",
15186
15485
  ...options
15187
15486
  }), getSystemJobs = (options) => (options?.client ?? client6).get({
15188
15487
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15189
- url: "/system/jobs",
15488
+ url: "/api/system/jobs",
15190
15489
  ...options
15191
15490
  }), patchSystemJobs = (options) => (options.client ?? client6).patch({
15192
15491
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15193
- url: "/system/jobs",
15492
+ url: "/api/system/jobs",
15194
15493
  ...options
15195
15494
  }), postSystemJobs = (options) => (options.client ?? client6).post({
15196
15495
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15197
- url: "/system/jobs",
15496
+ url: "/api/system/jobs",
15198
15497
  ...options
15199
15498
  }), getLanguages = (options) => (options?.client ?? client6).get({
15200
15499
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15201
- url: "/system/languages",
15500
+ url: "/api/system/languages",
15202
15501
  ...options
15203
15502
  }), getLanguagesProfiles = (options) => (options?.client ?? client6).get({
15204
15503
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15205
- url: "/system/languages/profiles",
15504
+ url: "/api/system/languages/profiles",
15206
15505
  ...options
15207
15506
  }), deleteSystemLogs = (options) => (options?.client ?? client6).delete({
15208
15507
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15209
- url: "/system/logs",
15508
+ url: "/api/system/logs",
15210
15509
  ...options
15211
15510
  }), getSystemLogs = (options) => (options?.client ?? client6).get({
15212
15511
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15213
- url: "/system/logs",
15512
+ url: "/api/system/logs",
15214
15513
  ...options
15215
15514
  }), getSystemPing = (options) => (options?.client ?? client6).get({
15216
15515
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15217
- url: "/system/ping",
15516
+ url: "/api/system/ping",
15218
15517
  ...options
15219
15518
  }), getSystemReleases = (options) => (options?.client ?? client6).get({
15220
15519
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15221
- url: "/system/releases",
15520
+ url: "/api/system/releases",
15222
15521
  ...options
15223
15522
  }), getSearches = (options) => (options.client ?? client6).get({
15224
15523
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15225
- url: "/system/searches",
15524
+ url: "/api/system/searches",
15226
15525
  ...options
15227
15526
  }), getSystemStatus = (options) => (options?.client ?? client6).get({
15228
15527
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15229
- url: "/system/status",
15528
+ url: "/api/system/status",
15230
15529
  ...options
15231
15530
  }), getSystemTasks = (options) => (options?.client ?? client6).get({
15232
15531
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15233
- url: "/system/tasks",
15532
+ url: "/api/system/tasks",
15234
15533
  ...options
15235
15534
  }), postSystemTasks = (options) => (options.client ?? client6).post({
15236
15535
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15237
- url: "/system/tasks",
15536
+ url: "/api/system/tasks",
15238
15537
  ...options
15239
15538
  }), postSystemWebhookTest = (options) => (options?.client ?? client6).post({
15240
15539
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15241
- url: "/system/webhooks/test",
15540
+ url: "/api/system/webhooks/test",
15242
15541
  ...options
15243
15542
  }), postWebHooksPlex = (options) => (options.client ?? client6).post({
15244
15543
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15245
- url: "/webhooks/plex",
15544
+ url: "/api/webhooks/plex",
15246
15545
  ...options
15247
15546
  }), postWebHooksRadarr = (options) => (options.client ?? client6).post({
15248
15547
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15249
- url: "/webhooks/radarr",
15548
+ url: "/api/webhooks/radarr",
15250
15549
  ...options,
15251
15550
  headers: {
15252
15551
  "Content-Type": "application/json",
@@ -15254,7 +15553,7 @@ var getBadges = (options) => (options?.client ?? client6).get({
15254
15553
  }
15255
15554
  }), postWebHooksSonarr = (options) => (options.client ?? client6).post({
15256
15555
  security: [{ name: "X-API-KEY", type: "apiKey" }],
15257
- url: "/webhooks/sonarr",
15556
+ url: "/api/webhooks/sonarr",
15258
15557
  ...options,
15259
15558
  headers: {
15260
15559
  "Content-Type": "application/json",
@@ -15743,8 +16042,15 @@ var exports_doctor = {};
15743
16042
  __export(exports_doctor, {
15744
16043
  doctor: () => doctor
15745
16044
  });
15746
- function getDoctorVersion(status) {
15747
- return status?.data?.data?.version ?? status?.data?.data?.bazarr_version ?? status?.data?.version ?? status?.version ?? status?.data?.bazarr_version ?? status?.bazarr_version ?? undefined;
16045
+ function extractVersion(service, status) {
16046
+ const data = status?.data ?? status;
16047
+ if (typeof data === "string") {
16048
+ return null;
16049
+ }
16050
+ if (service === "bazarr") {
16051
+ return data?.data?.bazarr_version ?? data?.bazarr_version ?? null;
16052
+ }
16053
+ return data?.version ?? status?.version ?? null;
15748
16054
  }
15749
16055
  var clientFactories, doctor;
15750
16056
  var init_doctor = __esm(() => {
@@ -15808,7 +16114,10 @@ var init_doctor = __esm(() => {
15808
16114
  }
15809
16115
  const client7 = factory(svcConfig);
15810
16116
  const status = await client7.getSystemStatus();
15811
- const version = getDoctorVersion(status) ?? "?";
16117
+ const version = extractVersion(service, status) ?? "?";
16118
+ if (version === "?") {
16119
+ throw new Error("Unexpected response payload");
16120
+ }
15812
16121
  results.push({
15813
16122
  service,
15814
16123
  configured: true,
@@ -16125,7 +16434,7 @@ var init_completions = __esm(() => {
16125
16434
  init_dist2();
16126
16435
  SERVICE_COMMANDS = {
16127
16436
  radarr: {
16128
- movie: ["list", "get", "search", "delete"],
16437
+ movie: ["list", "get", "search", "add", "edit", "refresh", "manual-search", "delete"],
16129
16438
  profile: ["list", "get"],
16130
16439
  tag: ["list"],
16131
16440
  queue: ["list", "status"],
@@ -16135,7 +16444,7 @@ var init_completions = __esm(() => {
16135
16444
  customformat: ["list"]
16136
16445
  },
16137
16446
  sonarr: {
16138
- series: ["list", "get", "search", "delete"],
16447
+ series: ["list", "get", "search", "add", "edit", "refresh", "manual-search", "delete"],
16139
16448
  episode: ["list", "get"],
16140
16449
  profile: ["list"],
16141
16450
  tag: ["list"],
@@ -16143,7 +16452,7 @@ var init_completions = __esm(() => {
16143
16452
  system: ["status", "health"]
16144
16453
  },
16145
16454
  lidarr: {
16146
- artist: ["list", "get", "search", "delete"],
16455
+ artist: ["list", "get", "search", "add", "edit", "refresh", "manual-search", "delete"],
16147
16456
  album: ["list", "get", "search"],
16148
16457
  profile: ["list"],
16149
16458
  tag: ["list"],
@@ -16151,7 +16460,7 @@ var init_completions = __esm(() => {
16151
16460
  system: ["status", "health"]
16152
16461
  },
16153
16462
  readarr: {
16154
- author: ["list", "get", "search", "delete"],
16463
+ author: ["list", "get", "search", "add", "edit", "refresh", "manual-search", "delete"],
16155
16464
  book: ["list", "get", "search"],
16156
16465
  profile: ["list"],
16157
16466
  tag: ["list"],