tsarr 2.7.5 → 2.7.6
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/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/lidarr.d.ts.map +1 -1
- package/dist/cli/commands/prowlarr.d.ts.map +1 -1
- package/dist/cli/commands/qbit.d.ts +1 -1
- package/dist/cli/commands/qbit.d.ts.map +1 -1
- package/dist/cli/commands/radarr.d.ts +1 -1
- package/dist/cli/commands/radarr.d.ts.map +1 -1
- package/dist/cli/commands/readarr.d.ts.map +1 -1
- package/dist/cli/commands/seerr.d.ts +1 -1
- package/dist/cli/commands/seerr.d.ts.map +1 -1
- package/dist/cli/commands/service.d.ts +6 -0
- package/dist/cli/commands/service.d.ts.map +1 -1
- package/dist/cli/commands/sonarr.d.ts +1 -1
- package/dist/cli/commands/sonarr.d.ts.map +1 -1
- package/dist/cli/config.d.ts +1 -1
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/index.js +154 -280
- package/dist/clients/bazarr.d.ts +3 -2
- package/dist/clients/bazarr.d.ts.map +1 -1
- package/dist/clients/lidarr.d.ts +4 -3
- package/dist/clients/lidarr.d.ts.map +1 -1
- package/dist/clients/prowlarr.d.ts +4 -3
- package/dist/clients/prowlarr.d.ts.map +1 -1
- package/dist/clients/qbittorrent.d.ts +3 -2
- package/dist/clients/qbittorrent.d.ts.map +1 -1
- package/dist/clients/radarr.d.ts +4 -3
- package/dist/clients/radarr.d.ts.map +1 -1
- package/dist/clients/readarr.d.ts +4 -3
- package/dist/clients/readarr.d.ts.map +1 -1
- package/dist/clients/seerr.d.ts +4 -3
- package/dist/clients/seerr.d.ts.map +1 -1
- package/dist/clients/sonarr.d.ts +4 -3
- package/dist/clients/sonarr.d.ts.map +1 -1
- package/dist/core/client.d.ts +1 -1
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/index.d.ts +3 -4
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/types.d.ts +0 -5
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.d.ts +17 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -41
- package/dist/tsarr-2.7.6.tgz +0 -0
- package/package.json +1 -1
- package/dist/core/response.d.ts +0 -13
- package/dist/core/response.d.ts.map +0 -1
- package/dist/tsarr-2.7.5.tgz +0 -0
package/dist/cli/index.js
CHANGED
|
@@ -564,7 +564,7 @@ var init_dist = __esm(() => {
|
|
|
564
564
|
});
|
|
565
565
|
|
|
566
566
|
// src/core/errors.ts
|
|
567
|
-
var TsarrError, ApiKeyError, ConnectionError
|
|
567
|
+
var TsarrError, ApiKeyError, ConnectionError;
|
|
568
568
|
var init_errors = __esm(() => {
|
|
569
569
|
TsarrError = class TsarrError extends Error {
|
|
570
570
|
code;
|
|
@@ -590,12 +590,6 @@ var init_errors = __esm(() => {
|
|
|
590
590
|
this.name = "ConnectionError";
|
|
591
591
|
}
|
|
592
592
|
};
|
|
593
|
-
NotFoundError = class NotFoundError extends TsarrError {
|
|
594
|
-
constructor(resource) {
|
|
595
|
-
super(`Resource not found: ${resource}`, "NOT_FOUND", 404);
|
|
596
|
-
this.name = "NotFoundError";
|
|
597
|
-
}
|
|
598
|
-
};
|
|
599
593
|
});
|
|
600
594
|
|
|
601
595
|
// src/core/client.ts
|
|
@@ -4882,11 +4876,7 @@ function normalizeConfig(config) {
|
|
|
4882
4876
|
function readJsonFile(path) {
|
|
4883
4877
|
if (!existsSync(path))
|
|
4884
4878
|
return {};
|
|
4885
|
-
|
|
4886
|
-
return normalizeConfig(JSON.parse(readFileSync(path, "utf-8")));
|
|
4887
|
-
} catch {
|
|
4888
|
-
return {};
|
|
4889
|
-
}
|
|
4879
|
+
return normalizeConfig(JSON.parse(readFileSync(path, "utf-8")));
|
|
4890
4880
|
}
|
|
4891
4881
|
function getEnvConfig() {
|
|
4892
4882
|
const services = {};
|
|
@@ -5293,14 +5283,10 @@ function formatBytes(bytes) {
|
|
|
5293
5283
|
function formatDate(value) {
|
|
5294
5284
|
if (typeof value !== "string" && !(value instanceof Date))
|
|
5295
5285
|
return String(value);
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
if (Number.isNaN(d2.getTime()))
|
|
5299
|
-
return String(value);
|
|
5300
|
-
return d2.toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric" });
|
|
5301
|
-
} catch {
|
|
5286
|
+
const d2 = new Date(value);
|
|
5287
|
+
if (Number.isNaN(d2.getTime()))
|
|
5302
5288
|
return String(value);
|
|
5303
|
-
}
|
|
5289
|
+
return d2.toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric" });
|
|
5304
5290
|
}
|
|
5305
5291
|
function stripAnsi3(str) {
|
|
5306
5292
|
return str.replace(ANSI_PATTERN, "");
|
|
@@ -5322,6 +5308,7 @@ var init_output = __esm(() => {
|
|
|
5322
5308
|
});
|
|
5323
5309
|
|
|
5324
5310
|
// src/cli/commands/service.ts
|
|
5311
|
+
import { readFileSync as readFileSync2 } from "node:fs";
|
|
5325
5312
|
function limitResults(results, limit) {
|
|
5326
5313
|
if (limit === undefined)
|
|
5327
5314
|
return results;
|
|
@@ -5474,6 +5461,44 @@ Run \`tsarr config init\` or set TSARR_${serviceName.toUpperCase()}_API_KEY`;
|
|
|
5474
5461
|
subCommands
|
|
5475
5462
|
});
|
|
5476
5463
|
}
|
|
5464
|
+
function unwrapData(result) {
|
|
5465
|
+
return result?.data ?? result;
|
|
5466
|
+
}
|
|
5467
|
+
function readJsonInput(filePath) {
|
|
5468
|
+
const raw = filePath === "-" ? readFileSync2(0, "utf-8") : readFileSync2(filePath, "utf-8");
|
|
5469
|
+
return JSON.parse(raw);
|
|
5470
|
+
}
|
|
5471
|
+
function parseBooleanArg(value, fallback) {
|
|
5472
|
+
if (value === undefined)
|
|
5473
|
+
return fallback;
|
|
5474
|
+
if (typeof value === "boolean")
|
|
5475
|
+
return value;
|
|
5476
|
+
if (typeof value === "string") {
|
|
5477
|
+
const normalized = value.trim().toLowerCase();
|
|
5478
|
+
if (normalized === "true")
|
|
5479
|
+
return true;
|
|
5480
|
+
if (normalized === "false")
|
|
5481
|
+
return false;
|
|
5482
|
+
}
|
|
5483
|
+
return Boolean(value);
|
|
5484
|
+
}
|
|
5485
|
+
function resolveQualityProfileId(profiles, profileId) {
|
|
5486
|
+
const profile = profiles.find((item) => item?.id === profileId);
|
|
5487
|
+
if (!profile) {
|
|
5488
|
+
throw new Error(`Quality profile ${profileId} was not found.`);
|
|
5489
|
+
}
|
|
5490
|
+
return profileId;
|
|
5491
|
+
}
|
|
5492
|
+
function resolveRootFolderPath(folders, rootFolderPath) {
|
|
5493
|
+
const folder = folders.find((item) => item?.path === rootFolderPath);
|
|
5494
|
+
if (!folder) {
|
|
5495
|
+
throw new Error(`Root folder "${rootFolderPath}" was not found.`);
|
|
5496
|
+
}
|
|
5497
|
+
return rootFolderPath;
|
|
5498
|
+
}
|
|
5499
|
+
function getApiStatus(result) {
|
|
5500
|
+
return result?.error?.status ?? result?.response?.status;
|
|
5501
|
+
}
|
|
5477
5502
|
function coerceBooleanArg(value) {
|
|
5478
5503
|
if (typeof value === "boolean")
|
|
5479
5504
|
return value;
|
|
@@ -5514,8 +5539,6 @@ Run \`tsarr config init\` or set TSARR_${serviceName.toUpperCase()}_API_KEY`);
|
|
|
5514
5539
|
} else if (error instanceof ConnectionError) {
|
|
5515
5540
|
consola.error(`Connection error: ${error.message}
|
|
5516
5541
|
Run \`tsarr doctor\` to diagnose.`);
|
|
5517
|
-
} else if (error instanceof NotFoundError) {
|
|
5518
|
-
consola.error(error.message);
|
|
5519
5542
|
} else if (error instanceof TsarrError) {
|
|
5520
5543
|
consola.error(`Error: ${error.message}`);
|
|
5521
5544
|
} else if (error instanceof Error) {
|
|
@@ -5572,51 +5595,12 @@ __export(exports_radarr3, {
|
|
|
5572
5595
|
resources: () => resources,
|
|
5573
5596
|
radarr: () => radarr
|
|
5574
5597
|
});
|
|
5575
|
-
import { readFileSync as readFileSync2 } from "node:fs";
|
|
5576
|
-
function unwrapData(result) {
|
|
5577
|
-
return result?.data ?? result;
|
|
5578
|
-
}
|
|
5579
|
-
function parseBooleanArg(value, fallback) {
|
|
5580
|
-
if (value === undefined)
|
|
5581
|
-
return fallback;
|
|
5582
|
-
if (typeof value === "boolean")
|
|
5583
|
-
return value;
|
|
5584
|
-
if (typeof value === "string") {
|
|
5585
|
-
const normalized = value.trim().toLowerCase();
|
|
5586
|
-
if (normalized === "true")
|
|
5587
|
-
return true;
|
|
5588
|
-
if (normalized === "false")
|
|
5589
|
-
return false;
|
|
5590
|
-
}
|
|
5591
|
-
return Boolean(value);
|
|
5592
|
-
}
|
|
5593
|
-
function resolveQualityProfileId(profiles, profileId) {
|
|
5594
|
-
const profile = profiles.find((item) => item?.id === profileId);
|
|
5595
|
-
if (!profile) {
|
|
5596
|
-
throw new Error(`Quality profile ${profileId} was not found.`);
|
|
5597
|
-
}
|
|
5598
|
-
return profileId;
|
|
5599
|
-
}
|
|
5600
|
-
function resolveRootFolderPath(folders, rootFolderPath) {
|
|
5601
|
-
const folder = folders.find((item) => item?.path === rootFolderPath);
|
|
5602
|
-
if (!folder) {
|
|
5603
|
-
throw new Error(`Root folder "${rootFolderPath}" was not found.`);
|
|
5604
|
-
}
|
|
5605
|
-
return rootFolderPath;
|
|
5606
|
-
}
|
|
5607
5598
|
async function findMovieByTmdbId(client2, tmdbId) {
|
|
5608
5599
|
if (tmdbId === undefined)
|
|
5609
5600
|
return;
|
|
5610
5601
|
const movies = unwrapData(await client2.getMovies());
|
|
5611
5602
|
return movies.find((movie) => movie?.tmdbId === tmdbId);
|
|
5612
5603
|
}
|
|
5613
|
-
function getApiStatus(result) {
|
|
5614
|
-
return result?.error?.status ?? result?.response?.status;
|
|
5615
|
-
}
|
|
5616
|
-
function readJsonInput(filePath) {
|
|
5617
|
-
const raw = filePath === "-" ? readFileSync2(0, "utf-8") : readFileSync2(filePath, "utf-8");
|
|
5618
|
-
return JSON.parse(raw);
|
|
5619
|
-
}
|
|
5620
5604
|
var resources, radarr;
|
|
5621
5605
|
var init_radarr3 = __esm(() => {
|
|
5622
5606
|
init_radarr2();
|
|
@@ -8684,38 +8668,6 @@ __export(exports_sonarr3, {
|
|
|
8684
8668
|
sonarr: () => sonarr,
|
|
8685
8669
|
resources: () => resources2
|
|
8686
8670
|
});
|
|
8687
|
-
import { readFileSync as readFileSync3 } from "node:fs";
|
|
8688
|
-
function unwrapData2(result) {
|
|
8689
|
-
return result?.data ?? result;
|
|
8690
|
-
}
|
|
8691
|
-
function parseBooleanArg2(value, fallback) {
|
|
8692
|
-
if (value === undefined)
|
|
8693
|
-
return fallback;
|
|
8694
|
-
if (typeof value === "boolean")
|
|
8695
|
-
return value;
|
|
8696
|
-
if (typeof value === "string") {
|
|
8697
|
-
const normalized = value.trim().toLowerCase();
|
|
8698
|
-
if (normalized === "true")
|
|
8699
|
-
return true;
|
|
8700
|
-
if (normalized === "false")
|
|
8701
|
-
return false;
|
|
8702
|
-
}
|
|
8703
|
-
return Boolean(value);
|
|
8704
|
-
}
|
|
8705
|
-
function resolveQualityProfileId2(profiles, profileId) {
|
|
8706
|
-
const profile = profiles.find((item) => item?.id === profileId);
|
|
8707
|
-
if (!profile) {
|
|
8708
|
-
throw new Error(`Quality profile ${profileId} was not found.`);
|
|
8709
|
-
}
|
|
8710
|
-
return profileId;
|
|
8711
|
-
}
|
|
8712
|
-
function resolveRootFolderPath2(folders, rootFolderPath) {
|
|
8713
|
-
const folder = folders.find((item) => item?.path === rootFolderPath);
|
|
8714
|
-
if (!folder) {
|
|
8715
|
-
throw new Error(`Root folder "${rootFolderPath}" was not found.`);
|
|
8716
|
-
}
|
|
8717
|
-
return rootFolderPath;
|
|
8718
|
-
}
|
|
8719
8671
|
function formatSeriesListItem(series) {
|
|
8720
8672
|
const seasons = Array.isArray(series?.seasons) ? series.seasons.filter((season) => season?.seasonNumber !== 0) : [];
|
|
8721
8673
|
const statistics = series?.statistics ?? {};
|
|
@@ -8728,26 +8680,19 @@ function formatSeriesListItem(series) {
|
|
|
8728
8680
|
};
|
|
8729
8681
|
}
|
|
8730
8682
|
async function lookupSeriesByTvdbId(client3, tvdbId) {
|
|
8731
|
-
const tvdbSearch =
|
|
8683
|
+
const tvdbSearch = unwrapData(await client3.searchSeries(`tvdb:${tvdbId}`));
|
|
8732
8684
|
const exactTvdbMatch = tvdbSearch.find((series) => series?.tvdbId === tvdbId);
|
|
8733
8685
|
if (exactTvdbMatch)
|
|
8734
8686
|
return exactTvdbMatch;
|
|
8735
|
-
const fallbackSearch =
|
|
8687
|
+
const fallbackSearch = unwrapData(await client3.searchSeries(String(tvdbId)));
|
|
8736
8688
|
return fallbackSearch.find((series) => series?.tvdbId === tvdbId);
|
|
8737
8689
|
}
|
|
8738
8690
|
async function findSeriesByTvdbId(client3, tvdbId) {
|
|
8739
8691
|
if (tvdbId === undefined)
|
|
8740
8692
|
return;
|
|
8741
|
-
const series =
|
|
8693
|
+
const series = unwrapData(await client3.getSeries());
|
|
8742
8694
|
return series.find((item) => item?.tvdbId === tvdbId);
|
|
8743
8695
|
}
|
|
8744
|
-
function getApiStatus2(result) {
|
|
8745
|
-
return result?.error?.status ?? result?.response?.status;
|
|
8746
|
-
}
|
|
8747
|
-
function readJsonInput2(filePath) {
|
|
8748
|
-
const raw = filePath === "-" ? readFileSync3(0, "utf-8") : readFileSync3(filePath, "utf-8");
|
|
8749
|
-
return JSON.parse(raw);
|
|
8750
|
-
}
|
|
8751
8696
|
var resources2, sonarr;
|
|
8752
8697
|
var init_sonarr3 = __esm(() => {
|
|
8753
8698
|
init_sonarr2();
|
|
@@ -8772,7 +8717,7 @@ var init_sonarr3 = __esm(() => {
|
|
|
8772
8717
|
"status"
|
|
8773
8718
|
],
|
|
8774
8719
|
run: async (c3) => {
|
|
8775
|
-
const series =
|
|
8720
|
+
const series = unwrapData(await c3.getSeries());
|
|
8776
8721
|
return series.map(formatSeriesListItem);
|
|
8777
8722
|
}
|
|
8778
8723
|
},
|
|
@@ -8792,7 +8737,7 @@ var init_sonarr3 = __esm(() => {
|
|
|
8792
8737
|
],
|
|
8793
8738
|
run: async (c3, a2) => {
|
|
8794
8739
|
const result = await c3.getSeriesById(a2.id);
|
|
8795
|
-
const series =
|
|
8740
|
+
const series = unwrapData(result);
|
|
8796
8741
|
return formatSeriesListItem(series);
|
|
8797
8742
|
}
|
|
8798
8743
|
},
|
|
@@ -8805,7 +8750,7 @@ var init_sonarr3 = __esm(() => {
|
|
|
8805
8750
|
],
|
|
8806
8751
|
columns: ["tvdbId", "title", "year", "overview"],
|
|
8807
8752
|
run: async (c3, a2) => {
|
|
8808
|
-
const results =
|
|
8753
|
+
const results = unwrapData(await c3.searchSeries(a2.term));
|
|
8809
8754
|
return limitResults(results, a2.limit);
|
|
8810
8755
|
}
|
|
8811
8756
|
},
|
|
@@ -8829,7 +8774,7 @@ var init_sonarr3 = __esm(() => {
|
|
|
8829
8774
|
} else {
|
|
8830
8775
|
const term = await promptIfMissing(a2.term, "Search term:");
|
|
8831
8776
|
const searchResult = await c3.searchSeries(term);
|
|
8832
|
-
const results =
|
|
8777
|
+
const results = unwrapData(searchResult);
|
|
8833
8778
|
if (!Array.isArray(results) || results.length === 0) {
|
|
8834
8779
|
throw new Error("No series found.");
|
|
8835
8780
|
}
|
|
@@ -8843,17 +8788,17 @@ var init_sonarr3 = __esm(() => {
|
|
|
8843
8788
|
}
|
|
8844
8789
|
}
|
|
8845
8790
|
const profilesResult = await c3.getQualityProfiles();
|
|
8846
|
-
const profiles =
|
|
8791
|
+
const profiles = unwrapData(profilesResult);
|
|
8847
8792
|
if (!Array.isArray(profiles) || profiles.length === 0) {
|
|
8848
8793
|
throw new Error("No quality profiles found. Configure one in Sonarr first.");
|
|
8849
8794
|
}
|
|
8850
|
-
const profileId = a2["quality-profile-id"] !== undefined ?
|
|
8795
|
+
const profileId = a2["quality-profile-id"] !== undefined ? resolveQualityProfileId(profiles, a2["quality-profile-id"]) : Number(await promptSelect("Select quality profile:", profiles.map((p) => ({ label: p.name, value: String(p.id) }))));
|
|
8851
8796
|
const foldersResult = await c3.getRootFolders();
|
|
8852
|
-
const folders =
|
|
8797
|
+
const folders = unwrapData(foldersResult);
|
|
8853
8798
|
if (!Array.isArray(folders) || folders.length === 0) {
|
|
8854
8799
|
throw new Error("No root folders found. Configure one in Sonarr first.");
|
|
8855
8800
|
}
|
|
8856
|
-
const rootFolderPath = a2["root-folder"] !== undefined ?
|
|
8801
|
+
const rootFolderPath = a2["root-folder"] !== undefined ? resolveRootFolderPath(folders, a2["root-folder"]) : await promptSelect("Select root folder:", folders.map((f3) => ({ label: f3.path, value: f3.path })));
|
|
8857
8802
|
const confirmed = await promptConfirm(`Add "${series.title} (${series.year})"?`, !!a2.yes);
|
|
8858
8803
|
if (!confirmed)
|
|
8859
8804
|
throw new Error("Cancelled.");
|
|
@@ -8861,10 +8806,10 @@ var init_sonarr3 = __esm(() => {
|
|
|
8861
8806
|
...series,
|
|
8862
8807
|
qualityProfileId: profileId,
|
|
8863
8808
|
rootFolderPath,
|
|
8864
|
-
monitored:
|
|
8809
|
+
monitored: parseBooleanArg(a2.monitored, true),
|
|
8865
8810
|
addOptions: { searchForMissingEpisodes: true }
|
|
8866
8811
|
});
|
|
8867
|
-
if (addResult?.error &&
|
|
8812
|
+
if (addResult?.error && getApiStatus(addResult) === 400) {
|
|
8868
8813
|
const existingSeries = await findSeriesByTvdbId(c3, series.tvdbId);
|
|
8869
8814
|
if (existingSeries) {
|
|
8870
8815
|
throw new Error(`${existingSeries.title} is already in your library (ID: ${existingSeries.id})`);
|
|
@@ -8926,7 +8871,7 @@ var init_sonarr3 = __esm(() => {
|
|
|
8926
8871
|
const seriesResult = await c3.getSeriesById(a2.id);
|
|
8927
8872
|
if (seriesResult?.error)
|
|
8928
8873
|
return seriesResult;
|
|
8929
|
-
const series =
|
|
8874
|
+
const series = unwrapData(seriesResult);
|
|
8930
8875
|
const deleteResult = await c3.deleteSeries(a2.id, {
|
|
8931
8876
|
deleteFiles: a2["delete-files"],
|
|
8932
8877
|
addImportListExclusion: a2["add-import-list-exclusion"]
|
|
@@ -9027,7 +8972,7 @@ var init_sonarr3 = __esm(() => {
|
|
|
9027
8972
|
const tagResult = await c3.getTag(a2.id);
|
|
9028
8973
|
if (tagResult?.error)
|
|
9029
8974
|
return tagResult;
|
|
9030
|
-
const tag =
|
|
8975
|
+
const tag = unwrapData(tagResult);
|
|
9031
8976
|
const deleteResult = await c3.deleteTag(a2.id);
|
|
9032
8977
|
if (deleteResult?.error)
|
|
9033
8978
|
return deleteResult;
|
|
@@ -9097,7 +9042,7 @@ var init_sonarr3 = __esm(() => {
|
|
|
9097
9042
|
run: async (c3, a2) => {
|
|
9098
9043
|
if (a2.since) {
|
|
9099
9044
|
const result2 = await c3.getHistorySince(a2.since, a2["series-id"]);
|
|
9100
|
-
const items2 =
|
|
9045
|
+
const items2 = unwrapData(result2);
|
|
9101
9046
|
if (a2.until) {
|
|
9102
9047
|
const untilDate = new Date(a2.until);
|
|
9103
9048
|
return items2.filter((item) => new Date(item.date) <= untilDate);
|
|
@@ -9105,7 +9050,7 @@ var init_sonarr3 = __esm(() => {
|
|
|
9105
9050
|
return items2;
|
|
9106
9051
|
}
|
|
9107
9052
|
const result = await c3.getHistory(undefined, undefined, undefined, undefined, a2["series-id"]);
|
|
9108
|
-
const items =
|
|
9053
|
+
const items = unwrapData(result);
|
|
9109
9054
|
if (a2.until) {
|
|
9110
9055
|
const untilDate = new Date(a2.until);
|
|
9111
9056
|
return items.filter((item) => new Date(item.date) <= untilDate);
|
|
@@ -9155,7 +9100,7 @@ var init_sonarr3 = __esm(() => {
|
|
|
9155
9100
|
columns: ["id", "seriesTitle", "title", "seasonNumber", "episodeNumber", "airDateUtc"],
|
|
9156
9101
|
run: async (c3, a2) => {
|
|
9157
9102
|
const result = await c3.getCalendar(a2.start, a2.end, a2.unmonitored);
|
|
9158
|
-
const episodes =
|
|
9103
|
+
const episodes = unwrapData(result);
|
|
9159
9104
|
return episodes.map((ep) => ({
|
|
9160
9105
|
...ep,
|
|
9161
9106
|
seriesTitle: ep.seriesTitle || ep.series?.title || "—"
|
|
@@ -9184,7 +9129,7 @@ var init_sonarr3 = __esm(() => {
|
|
|
9184
9129
|
name: "add",
|
|
9185
9130
|
description: "Add a notification from JSON file or stdin",
|
|
9186
9131
|
args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
|
|
9187
|
-
run: async (c3, a2) => c3.addNotification(
|
|
9132
|
+
run: async (c3, a2) => c3.addNotification(readJsonInput(a2.file))
|
|
9188
9133
|
},
|
|
9189
9134
|
{
|
|
9190
9135
|
name: "edit",
|
|
@@ -9194,8 +9139,8 @@ var init_sonarr3 = __esm(() => {
|
|
|
9194
9139
|
{ name: "file", description: "JSON file with fields to update", required: true }
|
|
9195
9140
|
],
|
|
9196
9141
|
run: async (c3, a2) => {
|
|
9197
|
-
const existing =
|
|
9198
|
-
return c3.updateNotification(a2.id, { ...existing, ...
|
|
9142
|
+
const existing = unwrapData(await c3.getNotification(a2.id));
|
|
9143
|
+
return c3.updateNotification(a2.id, { ...existing, ...readJsonInput(a2.file) });
|
|
9199
9144
|
}
|
|
9200
9145
|
},
|
|
9201
9146
|
{
|
|
@@ -9232,7 +9177,7 @@ var init_sonarr3 = __esm(() => {
|
|
|
9232
9177
|
name: "add",
|
|
9233
9178
|
description: "Add a download client from JSON file or stdin",
|
|
9234
9179
|
args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
|
|
9235
|
-
run: async (c3, a2) => c3.addDownloadClient(
|
|
9180
|
+
run: async (c3, a2) => c3.addDownloadClient(readJsonInput(a2.file))
|
|
9236
9181
|
},
|
|
9237
9182
|
{
|
|
9238
9183
|
name: "edit",
|
|
@@ -9242,8 +9187,8 @@ var init_sonarr3 = __esm(() => {
|
|
|
9242
9187
|
{ name: "file", description: "JSON file with fields to update", required: true }
|
|
9243
9188
|
],
|
|
9244
9189
|
run: async (c3, a2) => {
|
|
9245
|
-
const existing =
|
|
9246
|
-
return c3.updateDownloadClient(a2.id, { ...existing, ...
|
|
9190
|
+
const existing = unwrapData(await c3.getDownloadClient(a2.id));
|
|
9191
|
+
return c3.updateDownloadClient(a2.id, { ...existing, ...readJsonInput(a2.file) });
|
|
9247
9192
|
}
|
|
9248
9193
|
},
|
|
9249
9194
|
{
|
|
@@ -9317,7 +9262,7 @@ var init_sonarr3 = __esm(() => {
|
|
|
9317
9262
|
name: "add",
|
|
9318
9263
|
description: "Add an import list from JSON file or stdin",
|
|
9319
9264
|
args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
|
|
9320
|
-
run: async (c3, a2) => c3.addImportList(
|
|
9265
|
+
run: async (c3, a2) => c3.addImportList(readJsonInput(a2.file))
|
|
9321
9266
|
},
|
|
9322
9267
|
{
|
|
9323
9268
|
name: "edit",
|
|
@@ -9327,8 +9272,8 @@ var init_sonarr3 = __esm(() => {
|
|
|
9327
9272
|
{ name: "file", description: "JSON file with fields to update", required: true }
|
|
9328
9273
|
],
|
|
9329
9274
|
run: async (c3, a2) => {
|
|
9330
|
-
const existing =
|
|
9331
|
-
return c3.updateImportList(a2.id, { ...existing, ...
|
|
9275
|
+
const existing = unwrapData(await c3.getImportList(a2.id));
|
|
9276
|
+
return c3.updateImportList(a2.id, { ...existing, ...readJsonInput(a2.file) });
|
|
9332
9277
|
}
|
|
9333
9278
|
},
|
|
9334
9279
|
{
|
|
@@ -11836,38 +11781,12 @@ var exports_lidarr3 = {};
|
|
|
11836
11781
|
__export(exports_lidarr3, {
|
|
11837
11782
|
lidarr: () => lidarr
|
|
11838
11783
|
});
|
|
11839
|
-
|
|
11840
|
-
function unwrapData3(result) {
|
|
11841
|
-
return result?.data ?? result;
|
|
11842
|
-
}
|
|
11843
|
-
function formatAlbumListItem(album) {
|
|
11844
|
-
return {
|
|
11845
|
-
...album,
|
|
11846
|
-
artistName: album?.artistName ?? album?.artist?.artistName ?? "—"
|
|
11847
|
-
};
|
|
11848
|
-
}
|
|
11849
|
-
function formatQueueListItem(item) {
|
|
11850
|
-
return {
|
|
11851
|
-
...item,
|
|
11852
|
-
artistName: item?.artistName ?? item?.artist?.artistName ?? "—"
|
|
11853
|
-
};
|
|
11854
|
-
}
|
|
11855
|
-
function formatHistoryListItem(item) {
|
|
11856
|
-
return {
|
|
11857
|
-
...item,
|
|
11858
|
-
artistName: item?.artistName ?? item?.artist?.artistName ?? "—"
|
|
11859
|
-
};
|
|
11860
|
-
}
|
|
11861
|
-
function formatBlocklistItem(item) {
|
|
11784
|
+
function withArtistName(item) {
|
|
11862
11785
|
return {
|
|
11863
11786
|
...item,
|
|
11864
11787
|
artistName: item?.artistName ?? item?.artist?.artistName ?? "—"
|
|
11865
11788
|
};
|
|
11866
11789
|
}
|
|
11867
|
-
function readJsonInput3(filePath) {
|
|
11868
|
-
const raw = filePath === "-" ? readFileSync4(0, "utf-8") : readFileSync4(filePath, "utf-8");
|
|
11869
|
-
return JSON.parse(raw);
|
|
11870
|
-
}
|
|
11871
11790
|
var resources3, lidarr;
|
|
11872
11791
|
var init_lidarr3 = __esm(() => {
|
|
11873
11792
|
init_lidarr2();
|
|
@@ -11903,7 +11822,7 @@ var init_lidarr3 = __esm(() => {
|
|
|
11903
11822
|
description: "Search and add an artist",
|
|
11904
11823
|
args: [{ name: "term", description: "Search term", required: true }],
|
|
11905
11824
|
run: async (c3, a2) => {
|
|
11906
|
-
const results =
|
|
11825
|
+
const results = unwrapData(await c3.searchArtists(a2.term));
|
|
11907
11826
|
if (!Array.isArray(results) || results.length === 0) {
|
|
11908
11827
|
throw new Error("No artists found.");
|
|
11909
11828
|
}
|
|
@@ -11915,12 +11834,12 @@ var init_lidarr3 = __esm(() => {
|
|
|
11915
11834
|
if (!artist) {
|
|
11916
11835
|
throw new Error("Selected artist was not found in the search results.");
|
|
11917
11836
|
}
|
|
11918
|
-
const profiles =
|
|
11837
|
+
const profiles = unwrapData(await c3.getQualityProfiles());
|
|
11919
11838
|
if (!Array.isArray(profiles) || profiles.length === 0) {
|
|
11920
11839
|
throw new Error("No quality profiles found. Configure one in Lidarr first.");
|
|
11921
11840
|
}
|
|
11922
11841
|
const profileId = await promptSelect("Select quality profile:", profiles.map((profile) => ({ label: profile.name, value: String(profile.id) })));
|
|
11923
|
-
const folders =
|
|
11842
|
+
const folders = unwrapData(await c3.getRootFolders());
|
|
11924
11843
|
if (!Array.isArray(folders) || folders.length === 0) {
|
|
11925
11844
|
throw new Error("No root folders found. Configure one in Lidarr first.");
|
|
11926
11845
|
}
|
|
@@ -11947,7 +11866,7 @@ var init_lidarr3 = __esm(() => {
|
|
|
11947
11866
|
{ name: "tags", description: "Comma-separated tag IDs" }
|
|
11948
11867
|
],
|
|
11949
11868
|
run: async (c3, a2) => {
|
|
11950
|
-
const artist =
|
|
11869
|
+
const artist = unwrapData(await c3.getArtist(a2.id));
|
|
11951
11870
|
const updates = { ...artist };
|
|
11952
11871
|
if (a2.monitored !== undefined)
|
|
11953
11872
|
updates.monitored = a2.monitored === "true";
|
|
@@ -11992,8 +11911,8 @@ var init_lidarr3 = __esm(() => {
|
|
|
11992
11911
|
description: "List all albums",
|
|
11993
11912
|
columns: ["id", "artistName", "title", "monitored"],
|
|
11994
11913
|
run: async (c3) => {
|
|
11995
|
-
const albums =
|
|
11996
|
-
return albums.map(
|
|
11914
|
+
const albums = unwrapData(await c3.getAlbums());
|
|
11915
|
+
return albums.map(withArtistName);
|
|
11997
11916
|
}
|
|
11998
11917
|
},
|
|
11999
11918
|
{
|
|
@@ -12001,8 +11920,8 @@ var init_lidarr3 = __esm(() => {
|
|
|
12001
11920
|
description: "Get an album by ID",
|
|
12002
11921
|
args: [{ name: "id", description: "Album ID", required: true, type: "number" }],
|
|
12003
11922
|
run: async (c3, a2) => {
|
|
12004
|
-
const album =
|
|
12005
|
-
return
|
|
11923
|
+
const album = unwrapData(await c3.getAlbum(a2.id));
|
|
11924
|
+
return withArtistName(album);
|
|
12006
11925
|
}
|
|
12007
11926
|
},
|
|
12008
11927
|
{
|
|
@@ -12012,15 +11931,15 @@ var init_lidarr3 = __esm(() => {
|
|
|
12012
11931
|
columns: ["foreignAlbumId", "artistName", "title", "monitored"],
|
|
12013
11932
|
idField: "foreignAlbumId",
|
|
12014
11933
|
run: async (c3, a2) => {
|
|
12015
|
-
const albums =
|
|
12016
|
-
return albums.map(
|
|
11934
|
+
const albums = unwrapData(await c3.searchAlbums(a2.term));
|
|
11935
|
+
return albums.map(withArtistName);
|
|
12017
11936
|
}
|
|
12018
11937
|
},
|
|
12019
11938
|
{
|
|
12020
11939
|
name: "add",
|
|
12021
11940
|
description: "Add an album from JSON file or stdin",
|
|
12022
11941
|
args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
|
|
12023
|
-
run: async (c3, a2) => c3.addAlbum(
|
|
11942
|
+
run: async (c3, a2) => c3.addAlbum(readJsonInput(a2.file))
|
|
12024
11943
|
},
|
|
12025
11944
|
{
|
|
12026
11945
|
name: "edit",
|
|
@@ -12030,8 +11949,8 @@ var init_lidarr3 = __esm(() => {
|
|
|
12030
11949
|
{ name: "file", description: "JSON file with fields to update", required: true }
|
|
12031
11950
|
],
|
|
12032
11951
|
run: async (c3, a2) => {
|
|
12033
|
-
const existing =
|
|
12034
|
-
return c3.updateAlbum(a2.id, { ...existing, ...
|
|
11952
|
+
const existing = unwrapData(await c3.getAlbum(a2.id));
|
|
11953
|
+
return c3.updateAlbum(a2.id, { ...existing, ...readJsonInput(a2.file) });
|
|
12035
11954
|
}
|
|
12036
11955
|
},
|
|
12037
11956
|
{
|
|
@@ -12106,7 +12025,7 @@ var init_lidarr3 = __esm(() => {
|
|
|
12106
12025
|
const tagResult = await c3.getTag(a2.id);
|
|
12107
12026
|
if (tagResult?.error)
|
|
12108
12027
|
return tagResult;
|
|
12109
|
-
const tag =
|
|
12028
|
+
const tag = unwrapData(tagResult);
|
|
12110
12029
|
const deleteResult = await c3.deleteTag(a2.id);
|
|
12111
12030
|
if (deleteResult?.error)
|
|
12112
12031
|
return deleteResult;
|
|
@@ -12130,8 +12049,8 @@ var init_lidarr3 = __esm(() => {
|
|
|
12130
12049
|
description: "List queue items",
|
|
12131
12050
|
columns: ["id", "artistName", "title", "status", "sizeleft", "timeleft"],
|
|
12132
12051
|
run: async (c3) => {
|
|
12133
|
-
const items =
|
|
12134
|
-
return items.map(
|
|
12052
|
+
const items = unwrapData(await c3.getQueue());
|
|
12053
|
+
return items.map(withArtistName);
|
|
12135
12054
|
}
|
|
12136
12055
|
},
|
|
12137
12056
|
{
|
|
@@ -12175,9 +12094,9 @@ var init_lidarr3 = __esm(() => {
|
|
|
12175
12094
|
],
|
|
12176
12095
|
columns: ["id", "artistName", "sourceTitle", "eventType", "date"],
|
|
12177
12096
|
run: async (c3, a2) => {
|
|
12178
|
-
const items = a2.since ?
|
|
12097
|
+
const items = a2.since ? unwrapData(await c3.getHistorySince(a2.since)) : unwrapData(await c3.getHistory());
|
|
12179
12098
|
const filtered = a2.until ? items.filter((item) => new Date(item.date) <= new Date(a2.until)) : items;
|
|
12180
|
-
return filtered.map(
|
|
12099
|
+
return filtered.map(withArtistName);
|
|
12181
12100
|
}
|
|
12182
12101
|
}
|
|
12183
12102
|
]
|
|
@@ -12196,8 +12115,8 @@ var init_lidarr3 = __esm(() => {
|
|
|
12196
12115
|
],
|
|
12197
12116
|
columns: ["id", "artistName", "title", "releaseDate"],
|
|
12198
12117
|
run: async (c3, a2) => {
|
|
12199
|
-
const albums =
|
|
12200
|
-
return albums.map(
|
|
12118
|
+
const albums = unwrapData(await c3.getCalendar(a2.start, a2.end, a2.unmonitored));
|
|
12119
|
+
return albums.map(withArtistName);
|
|
12201
12120
|
}
|
|
12202
12121
|
}
|
|
12203
12122
|
]
|
|
@@ -12222,7 +12141,7 @@ var init_lidarr3 = __esm(() => {
|
|
|
12222
12141
|
name: "add",
|
|
12223
12142
|
description: "Add a notification from JSON file or stdin",
|
|
12224
12143
|
args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
|
|
12225
|
-
run: async (c3, a2) => c3.addNotification(
|
|
12144
|
+
run: async (c3, a2) => c3.addNotification(readJsonInput(a2.file))
|
|
12226
12145
|
},
|
|
12227
12146
|
{
|
|
12228
12147
|
name: "edit",
|
|
@@ -12232,8 +12151,8 @@ var init_lidarr3 = __esm(() => {
|
|
|
12232
12151
|
{ name: "file", description: "JSON file with fields to update", required: true }
|
|
12233
12152
|
],
|
|
12234
12153
|
run: async (c3, a2) => {
|
|
12235
|
-
const existing =
|
|
12236
|
-
return c3.updateNotification(a2.id, { ...existing, ...
|
|
12154
|
+
const existing = unwrapData(await c3.getNotification(a2.id));
|
|
12155
|
+
return c3.updateNotification(a2.id, { ...existing, ...readJsonInput(a2.file) });
|
|
12237
12156
|
}
|
|
12238
12157
|
},
|
|
12239
12158
|
{
|
|
@@ -12270,7 +12189,7 @@ var init_lidarr3 = __esm(() => {
|
|
|
12270
12189
|
name: "add",
|
|
12271
12190
|
description: "Add a download client from JSON file or stdin",
|
|
12272
12191
|
args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
|
|
12273
|
-
run: async (c3, a2) => c3.addDownloadClient(
|
|
12192
|
+
run: async (c3, a2) => c3.addDownloadClient(readJsonInput(a2.file))
|
|
12274
12193
|
},
|
|
12275
12194
|
{
|
|
12276
12195
|
name: "edit",
|
|
@@ -12280,8 +12199,8 @@ var init_lidarr3 = __esm(() => {
|
|
|
12280
12199
|
{ name: "file", description: "JSON file with fields to update", required: true }
|
|
12281
12200
|
],
|
|
12282
12201
|
run: async (c3, a2) => {
|
|
12283
|
-
const existing =
|
|
12284
|
-
return c3.updateDownloadClient(a2.id, { ...existing, ...
|
|
12202
|
+
const existing = unwrapData(await c3.getDownloadClient(a2.id));
|
|
12203
|
+
return c3.updateDownloadClient(a2.id, { ...existing, ...readJsonInput(a2.file) });
|
|
12285
12204
|
}
|
|
12286
12205
|
},
|
|
12287
12206
|
{
|
|
@@ -12307,8 +12226,8 @@ var init_lidarr3 = __esm(() => {
|
|
|
12307
12226
|
description: "List blocked releases",
|
|
12308
12227
|
columns: ["id", "artistName", "sourceTitle", "date"],
|
|
12309
12228
|
run: async (c3) => {
|
|
12310
|
-
const items =
|
|
12311
|
-
return items.map(
|
|
12229
|
+
const items = unwrapData(await c3.getBlocklist());
|
|
12230
|
+
return items.map(withArtistName);
|
|
12312
12231
|
}
|
|
12313
12232
|
},
|
|
12314
12233
|
{
|
|
@@ -12329,8 +12248,8 @@ var init_lidarr3 = __esm(() => {
|
|
|
12329
12248
|
description: "List albums with missing tracks",
|
|
12330
12249
|
columns: ["id", "artistName", "title", "releaseDate"],
|
|
12331
12250
|
run: async (c3) => {
|
|
12332
|
-
const albums =
|
|
12333
|
-
return albums.map(
|
|
12251
|
+
const albums = unwrapData(await c3.getWantedMissing());
|
|
12252
|
+
return albums.map(withArtistName);
|
|
12334
12253
|
}
|
|
12335
12254
|
},
|
|
12336
12255
|
{
|
|
@@ -12338,8 +12257,8 @@ var init_lidarr3 = __esm(() => {
|
|
|
12338
12257
|
description: "List albums below quality cutoff",
|
|
12339
12258
|
columns: ["id", "artistName", "title", "releaseDate"],
|
|
12340
12259
|
run: async (c3) => {
|
|
12341
|
-
const albums =
|
|
12342
|
-
return albums.map(
|
|
12260
|
+
const albums = unwrapData(await c3.getWantedCutoff());
|
|
12261
|
+
return albums.map(withArtistName);
|
|
12343
12262
|
}
|
|
12344
12263
|
}
|
|
12345
12264
|
]
|
|
@@ -14871,38 +14790,12 @@ var exports_readarr3 = {};
|
|
|
14871
14790
|
__export(exports_readarr3, {
|
|
14872
14791
|
readarr: () => readarr
|
|
14873
14792
|
});
|
|
14874
|
-
|
|
14875
|
-
function unwrapData4(result) {
|
|
14876
|
-
return result?.data ?? result;
|
|
14877
|
-
}
|
|
14878
|
-
function formatBookListItem(book) {
|
|
14879
|
-
return {
|
|
14880
|
-
...book,
|
|
14881
|
-
authorName: book?.authorName ?? book?.authorTitle ?? book?.author?.authorName ?? "—"
|
|
14882
|
-
};
|
|
14883
|
-
}
|
|
14884
|
-
function formatQueueListItem2(item) {
|
|
14885
|
-
return {
|
|
14886
|
-
...item,
|
|
14887
|
-
authorName: item?.authorName ?? item?.authorTitle ?? item?.author?.authorName ?? "—"
|
|
14888
|
-
};
|
|
14889
|
-
}
|
|
14890
|
-
function formatHistoryListItem2(item) {
|
|
14793
|
+
function withAuthorName(item) {
|
|
14891
14794
|
return {
|
|
14892
14795
|
...item,
|
|
14893
14796
|
authorName: item?.authorName ?? item?.authorTitle ?? item?.author?.authorName ?? "—"
|
|
14894
14797
|
};
|
|
14895
14798
|
}
|
|
14896
|
-
function formatBlocklistItem2(item) {
|
|
14897
|
-
return {
|
|
14898
|
-
...item,
|
|
14899
|
-
authorName: item?.authorName ?? item?.authorTitle ?? item?.author?.authorName ?? "—"
|
|
14900
|
-
};
|
|
14901
|
-
}
|
|
14902
|
-
function readJsonInput4(filePath) {
|
|
14903
|
-
const raw = filePath === "-" ? readFileSync5(0, "utf-8") : readFileSync5(filePath, "utf-8");
|
|
14904
|
-
return JSON.parse(raw);
|
|
14905
|
-
}
|
|
14906
14799
|
var resources4, readarr;
|
|
14907
14800
|
var init_readarr3 = __esm(() => {
|
|
14908
14801
|
init_readarr2();
|
|
@@ -14938,7 +14831,7 @@ var init_readarr3 = __esm(() => {
|
|
|
14938
14831
|
description: "Search and add an author",
|
|
14939
14832
|
args: [{ name: "term", description: "Search term", required: true }],
|
|
14940
14833
|
run: async (c3, a2) => {
|
|
14941
|
-
const results =
|
|
14834
|
+
const results = unwrapData(await c3.searchAuthors(a2.term));
|
|
14942
14835
|
if (!Array.isArray(results) || results.length === 0) {
|
|
14943
14836
|
throw new Error("No authors found.");
|
|
14944
14837
|
}
|
|
@@ -14950,12 +14843,12 @@ var init_readarr3 = __esm(() => {
|
|
|
14950
14843
|
if (!author) {
|
|
14951
14844
|
throw new Error("Selected author was not found in the search results.");
|
|
14952
14845
|
}
|
|
14953
|
-
const profiles =
|
|
14846
|
+
const profiles = unwrapData(await c3.getQualityProfiles());
|
|
14954
14847
|
if (!Array.isArray(profiles) || profiles.length === 0) {
|
|
14955
14848
|
throw new Error("No quality profiles found. Configure one in Readarr first.");
|
|
14956
14849
|
}
|
|
14957
14850
|
const profileId = await promptSelect("Select quality profile:", profiles.map((profile) => ({ label: profile.name, value: String(profile.id) })));
|
|
14958
|
-
const folders =
|
|
14851
|
+
const folders = unwrapData(await c3.getRootFolders());
|
|
14959
14852
|
if (!Array.isArray(folders) || folders.length === 0) {
|
|
14960
14853
|
throw new Error("No root folders found. Configure one in Readarr first.");
|
|
14961
14854
|
}
|
|
@@ -14982,7 +14875,7 @@ var init_readarr3 = __esm(() => {
|
|
|
14982
14875
|
{ name: "tags", description: "Comma-separated tag IDs" }
|
|
14983
14876
|
],
|
|
14984
14877
|
run: async (c3, a2) => {
|
|
14985
|
-
const author =
|
|
14878
|
+
const author = unwrapData(await c3.getAuthor(a2.id));
|
|
14986
14879
|
const updates = { ...author };
|
|
14987
14880
|
if (a2.monitored !== undefined)
|
|
14988
14881
|
updates.monitored = a2.monitored === "true";
|
|
@@ -15027,8 +14920,8 @@ var init_readarr3 = __esm(() => {
|
|
|
15027
14920
|
description: "List all books",
|
|
15028
14921
|
columns: ["id", "authorName", "title", "monitored"],
|
|
15029
14922
|
run: async (c3) => {
|
|
15030
|
-
const books =
|
|
15031
|
-
return books.map(
|
|
14923
|
+
const books = unwrapData(await c3.getBooks());
|
|
14924
|
+
return books.map(withAuthorName);
|
|
15032
14925
|
}
|
|
15033
14926
|
},
|
|
15034
14927
|
{
|
|
@@ -15036,8 +14929,8 @@ var init_readarr3 = __esm(() => {
|
|
|
15036
14929
|
description: "Get a book by ID",
|
|
15037
14930
|
args: [{ name: "id", description: "Book ID", required: true, type: "number" }],
|
|
15038
14931
|
run: async (c3, a2) => {
|
|
15039
|
-
const book =
|
|
15040
|
-
return
|
|
14932
|
+
const book = unwrapData(await c3.getBook(a2.id));
|
|
14933
|
+
return withAuthorName(book);
|
|
15041
14934
|
}
|
|
15042
14935
|
},
|
|
15043
14936
|
{
|
|
@@ -15047,15 +14940,15 @@ var init_readarr3 = __esm(() => {
|
|
|
15047
14940
|
columns: ["foreignBookId", "authorName", "title", "monitored"],
|
|
15048
14941
|
idField: "foreignBookId",
|
|
15049
14942
|
run: async (c3, a2) => {
|
|
15050
|
-
const books =
|
|
15051
|
-
return books.map(
|
|
14943
|
+
const books = unwrapData(await c3.searchBooks(a2.term));
|
|
14944
|
+
return books.map(withAuthorName);
|
|
15052
14945
|
}
|
|
15053
14946
|
},
|
|
15054
14947
|
{
|
|
15055
14948
|
name: "add",
|
|
15056
14949
|
description: "Add a book from JSON file or stdin",
|
|
15057
14950
|
args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
|
|
15058
|
-
run: async (c3, a2) => c3.addBook(
|
|
14951
|
+
run: async (c3, a2) => c3.addBook(readJsonInput(a2.file))
|
|
15059
14952
|
},
|
|
15060
14953
|
{
|
|
15061
14954
|
name: "edit",
|
|
@@ -15065,8 +14958,8 @@ var init_readarr3 = __esm(() => {
|
|
|
15065
14958
|
{ name: "file", description: "JSON file with fields to update", required: true }
|
|
15066
14959
|
],
|
|
15067
14960
|
run: async (c3, a2) => {
|
|
15068
|
-
const existing =
|
|
15069
|
-
return c3.updateBook(a2.id, { ...existing, ...
|
|
14961
|
+
const existing = unwrapData(await c3.getBook(a2.id));
|
|
14962
|
+
return c3.updateBook(a2.id, { ...existing, ...readJsonInput(a2.file) });
|
|
15070
14963
|
}
|
|
15071
14964
|
},
|
|
15072
14965
|
{
|
|
@@ -15141,7 +15034,7 @@ var init_readarr3 = __esm(() => {
|
|
|
15141
15034
|
const tagResult = await c3.getTag(a2.id);
|
|
15142
15035
|
if (tagResult?.error)
|
|
15143
15036
|
return tagResult;
|
|
15144
|
-
const tag =
|
|
15037
|
+
const tag = unwrapData(tagResult);
|
|
15145
15038
|
const deleteResult = await c3.deleteTag(a2.id);
|
|
15146
15039
|
if (deleteResult?.error)
|
|
15147
15040
|
return deleteResult;
|
|
@@ -15165,8 +15058,8 @@ var init_readarr3 = __esm(() => {
|
|
|
15165
15058
|
description: "List queue items",
|
|
15166
15059
|
columns: ["id", "authorName", "title", "status", "sizeleft", "timeleft"],
|
|
15167
15060
|
run: async (c3) => {
|
|
15168
|
-
const items =
|
|
15169
|
-
return items.map(
|
|
15061
|
+
const items = unwrapData(await c3.getQueue());
|
|
15062
|
+
return items.map(withAuthorName);
|
|
15170
15063
|
}
|
|
15171
15064
|
},
|
|
15172
15065
|
{
|
|
@@ -15210,9 +15103,9 @@ var init_readarr3 = __esm(() => {
|
|
|
15210
15103
|
],
|
|
15211
15104
|
columns: ["id", "authorName", "sourceTitle", "eventType", "date"],
|
|
15212
15105
|
run: async (c3, a2) => {
|
|
15213
|
-
const items = a2.since ?
|
|
15106
|
+
const items = a2.since ? unwrapData(await c3.getHistorySince(a2.since)) : unwrapData(await c3.getHistory());
|
|
15214
15107
|
const filtered = a2.until ? items.filter((item) => new Date(item.date) <= new Date(a2.until)) : items;
|
|
15215
|
-
return filtered.map(
|
|
15108
|
+
return filtered.map(withAuthorName);
|
|
15216
15109
|
}
|
|
15217
15110
|
}
|
|
15218
15111
|
]
|
|
@@ -15231,8 +15124,8 @@ var init_readarr3 = __esm(() => {
|
|
|
15231
15124
|
],
|
|
15232
15125
|
columns: ["id", "authorName", "title", "releaseDate"],
|
|
15233
15126
|
run: async (c3, a2) => {
|
|
15234
|
-
const books =
|
|
15235
|
-
return books.map(
|
|
15127
|
+
const books = unwrapData(await c3.getCalendar(a2.start, a2.end, a2.unmonitored));
|
|
15128
|
+
return books.map(withAuthorName);
|
|
15236
15129
|
}
|
|
15237
15130
|
}
|
|
15238
15131
|
]
|
|
@@ -15257,7 +15150,7 @@ var init_readarr3 = __esm(() => {
|
|
|
15257
15150
|
name: "add",
|
|
15258
15151
|
description: "Add a notification from JSON file or stdin",
|
|
15259
15152
|
args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
|
|
15260
|
-
run: async (c3, a2) => c3.addNotification(
|
|
15153
|
+
run: async (c3, a2) => c3.addNotification(readJsonInput(a2.file))
|
|
15261
15154
|
},
|
|
15262
15155
|
{
|
|
15263
15156
|
name: "edit",
|
|
@@ -15267,8 +15160,8 @@ var init_readarr3 = __esm(() => {
|
|
|
15267
15160
|
{ name: "file", description: "JSON file with fields to update", required: true }
|
|
15268
15161
|
],
|
|
15269
15162
|
run: async (c3, a2) => {
|
|
15270
|
-
const existing =
|
|
15271
|
-
return c3.updateNotification(a2.id, { ...existing, ...
|
|
15163
|
+
const existing = unwrapData(await c3.getNotification(a2.id));
|
|
15164
|
+
return c3.updateNotification(a2.id, { ...existing, ...readJsonInput(a2.file) });
|
|
15272
15165
|
}
|
|
15273
15166
|
},
|
|
15274
15167
|
{
|
|
@@ -15305,7 +15198,7 @@ var init_readarr3 = __esm(() => {
|
|
|
15305
15198
|
name: "add",
|
|
15306
15199
|
description: "Add a download client from JSON file or stdin",
|
|
15307
15200
|
args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
|
|
15308
|
-
run: async (c3, a2) => c3.addDownloadClient(
|
|
15201
|
+
run: async (c3, a2) => c3.addDownloadClient(readJsonInput(a2.file))
|
|
15309
15202
|
},
|
|
15310
15203
|
{
|
|
15311
15204
|
name: "edit",
|
|
@@ -15315,8 +15208,8 @@ var init_readarr3 = __esm(() => {
|
|
|
15315
15208
|
{ name: "file", description: "JSON file with fields to update", required: true }
|
|
15316
15209
|
],
|
|
15317
15210
|
run: async (c3, a2) => {
|
|
15318
|
-
const existing =
|
|
15319
|
-
return c3.updateDownloadClient(a2.id, { ...existing, ...
|
|
15211
|
+
const existing = unwrapData(await c3.getDownloadClient(a2.id));
|
|
15212
|
+
return c3.updateDownloadClient(a2.id, { ...existing, ...readJsonInput(a2.file) });
|
|
15320
15213
|
}
|
|
15321
15214
|
},
|
|
15322
15215
|
{
|
|
@@ -15342,8 +15235,8 @@ var init_readarr3 = __esm(() => {
|
|
|
15342
15235
|
description: "List blocked releases",
|
|
15343
15236
|
columns: ["id", "authorName", "sourceTitle", "date"],
|
|
15344
15237
|
run: async (c3) => {
|
|
15345
|
-
const items =
|
|
15346
|
-
return items.map(
|
|
15238
|
+
const items = unwrapData(await c3.getBlocklist());
|
|
15239
|
+
return items.map(withAuthorName);
|
|
15347
15240
|
}
|
|
15348
15241
|
},
|
|
15349
15242
|
{
|
|
@@ -15364,8 +15257,8 @@ var init_readarr3 = __esm(() => {
|
|
|
15364
15257
|
description: "List books with missing files",
|
|
15365
15258
|
columns: ["id", "authorName", "title", "releaseDate"],
|
|
15366
15259
|
run: async (c3) => {
|
|
15367
|
-
const books =
|
|
15368
|
-
return books.map(
|
|
15260
|
+
const books = unwrapData(await c3.getWantedMissing());
|
|
15261
|
+
return books.map(withAuthorName);
|
|
15369
15262
|
}
|
|
15370
15263
|
},
|
|
15371
15264
|
{
|
|
@@ -15373,8 +15266,8 @@ var init_readarr3 = __esm(() => {
|
|
|
15373
15266
|
description: "List books below quality cutoff",
|
|
15374
15267
|
columns: ["id", "authorName", "title", "releaseDate"],
|
|
15375
15268
|
run: async (c3) => {
|
|
15376
|
-
const books =
|
|
15377
|
-
return books.map(
|
|
15269
|
+
const books = unwrapData(await c3.getWantedCutoff());
|
|
15270
|
+
return books.map(withAuthorName);
|
|
15378
15271
|
}
|
|
15379
15272
|
}
|
|
15380
15273
|
]
|
|
@@ -17070,14 +16963,6 @@ var exports_prowlarr3 = {};
|
|
|
17070
16963
|
__export(exports_prowlarr3, {
|
|
17071
16964
|
prowlarr: () => prowlarr
|
|
17072
16965
|
});
|
|
17073
|
-
import { readFileSync as readFileSync6 } from "node:fs";
|
|
17074
|
-
function unwrapData5(result) {
|
|
17075
|
-
return result?.data ?? result;
|
|
17076
|
-
}
|
|
17077
|
-
function readJsonInput5(filePath) {
|
|
17078
|
-
const raw = filePath === "-" ? readFileSync6(0, "utf-8") : readFileSync6(filePath, "utf-8");
|
|
17079
|
-
return JSON.parse(raw);
|
|
17080
|
-
}
|
|
17081
16966
|
async function runIndexerTest(client6, indexer) {
|
|
17082
16967
|
const result = await client6.testIndexer(indexer);
|
|
17083
16968
|
if (result?.error) {
|
|
@@ -17091,7 +16976,7 @@ async function runIndexerTest(client6, indexer) {
|
|
|
17091
16976
|
message: error?.title ?? error?.message ?? `API error (${status ?? "unknown"})`
|
|
17092
16977
|
};
|
|
17093
16978
|
}
|
|
17094
|
-
const data =
|
|
16979
|
+
const data = unwrapData(result);
|
|
17095
16980
|
return {
|
|
17096
16981
|
id: indexer?.id,
|
|
17097
16982
|
name: indexer?.name ?? "Unknown indexer",
|
|
@@ -17144,7 +17029,7 @@ var init_prowlarr3 = __esm(() => {
|
|
|
17144
17029
|
description: "Add an indexer from JSON file or stdin",
|
|
17145
17030
|
args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
|
|
17146
17031
|
run: async (c3, a2) => {
|
|
17147
|
-
const body =
|
|
17032
|
+
const body = readJsonInput(a2.file);
|
|
17148
17033
|
return c3.addIndexer(body);
|
|
17149
17034
|
}
|
|
17150
17035
|
},
|
|
@@ -17156,8 +17041,8 @@ var init_prowlarr3 = __esm(() => {
|
|
|
17156
17041
|
{ name: "file", description: "JSON file with fields to update", required: true }
|
|
17157
17042
|
],
|
|
17158
17043
|
run: async (c3, a2) => {
|
|
17159
|
-
const existing =
|
|
17160
|
-
const updates =
|
|
17044
|
+
const existing = unwrapData(await c3.getIndexer(a2.id));
|
|
17045
|
+
const updates = readJsonInput(a2.file);
|
|
17161
17046
|
return c3.updateIndexer(a2.id, { ...existing, ...updates });
|
|
17162
17047
|
}
|
|
17163
17048
|
},
|
|
@@ -17174,7 +17059,7 @@ var init_prowlarr3 = __esm(() => {
|
|
|
17174
17059
|
args: [{ name: "id", description: "Indexer ID", type: "number" }],
|
|
17175
17060
|
columns: ["id", "name", "status", "message"],
|
|
17176
17061
|
run: async (c3, a2) => {
|
|
17177
|
-
const indexers = a2.id ? [
|
|
17062
|
+
const indexers = a2.id ? [unwrapData(await c3.getIndexer(a2.id))] : unwrapData(await c3.getIndexers());
|
|
17178
17063
|
const results = [];
|
|
17179
17064
|
for (const indexer of indexers) {
|
|
17180
17065
|
results.push(await runIndexerTest(c3, indexer));
|
|
@@ -17221,7 +17106,7 @@ var init_prowlarr3 = __esm(() => {
|
|
|
17221
17106
|
description: "Add an application from JSON file or stdin",
|
|
17222
17107
|
args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
|
|
17223
17108
|
run: async (c3, a2) => {
|
|
17224
|
-
const body =
|
|
17109
|
+
const body = readJsonInput(a2.file);
|
|
17225
17110
|
return c3.addApplication(body);
|
|
17226
17111
|
}
|
|
17227
17112
|
},
|
|
@@ -17233,8 +17118,8 @@ var init_prowlarr3 = __esm(() => {
|
|
|
17233
17118
|
{ name: "file", description: "JSON file with fields to update", required: true }
|
|
17234
17119
|
],
|
|
17235
17120
|
run: async (c3, a2) => {
|
|
17236
|
-
const existing =
|
|
17237
|
-
const updates =
|
|
17121
|
+
const existing = unwrapData(await c3.getApplication(a2.id));
|
|
17122
|
+
const updates = readJsonInput(a2.file);
|
|
17238
17123
|
return c3.updateApplication(a2.id, { ...existing, ...updates });
|
|
17239
17124
|
}
|
|
17240
17125
|
},
|
|
@@ -17302,7 +17187,7 @@ var init_prowlarr3 = __esm(() => {
|
|
|
17302
17187
|
"averageResponseTime"
|
|
17303
17188
|
],
|
|
17304
17189
|
run: async (c3) => {
|
|
17305
|
-
const result =
|
|
17190
|
+
const result = unwrapData(await c3.getIndexerStats());
|
|
17306
17191
|
return result?.indexers ?? result;
|
|
17307
17192
|
}
|
|
17308
17193
|
}
|
|
@@ -17328,7 +17213,7 @@ var init_prowlarr3 = __esm(() => {
|
|
|
17328
17213
|
name: "add",
|
|
17329
17214
|
description: "Add a notification from JSON file or stdin",
|
|
17330
17215
|
args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
|
|
17331
|
-
run: async (c3, a2) => c3.addNotification(
|
|
17216
|
+
run: async (c3, a2) => c3.addNotification(readJsonInput(a2.file))
|
|
17332
17217
|
},
|
|
17333
17218
|
{
|
|
17334
17219
|
name: "edit",
|
|
@@ -17338,8 +17223,8 @@ var init_prowlarr3 = __esm(() => {
|
|
|
17338
17223
|
{ name: "file", description: "JSON file with fields to update", required: true }
|
|
17339
17224
|
],
|
|
17340
17225
|
run: async (c3, a2) => {
|
|
17341
|
-
const existing =
|
|
17342
|
-
return c3.updateNotification(a2.id, { ...existing, ...
|
|
17226
|
+
const existing = unwrapData(await c3.getNotification(a2.id));
|
|
17227
|
+
return c3.updateNotification(a2.id, { ...existing, ...readJsonInput(a2.file) });
|
|
17343
17228
|
}
|
|
17344
17229
|
},
|
|
17345
17230
|
{
|
|
@@ -17376,7 +17261,7 @@ var init_prowlarr3 = __esm(() => {
|
|
|
17376
17261
|
name: "add",
|
|
17377
17262
|
description: "Add a download client from JSON file or stdin",
|
|
17378
17263
|
args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
|
|
17379
|
-
run: async (c3, a2) => c3.addDownloadClient(
|
|
17264
|
+
run: async (c3, a2) => c3.addDownloadClient(readJsonInput(a2.file))
|
|
17380
17265
|
},
|
|
17381
17266
|
{
|
|
17382
17267
|
name: "edit",
|
|
@@ -17386,8 +17271,8 @@ var init_prowlarr3 = __esm(() => {
|
|
|
17386
17271
|
{ name: "file", description: "JSON file with fields to update", required: true }
|
|
17387
17272
|
],
|
|
17388
17273
|
run: async (c3, a2) => {
|
|
17389
|
-
const existing =
|
|
17390
|
-
return c3.updateDownloadClient(a2.id, { ...existing, ...
|
|
17274
|
+
const existing = unwrapData(await c3.getDownloadClient(a2.id));
|
|
17275
|
+
return c3.updateDownloadClient(a2.id, { ...existing, ...readJsonInput(a2.file) });
|
|
17391
17276
|
}
|
|
17392
17277
|
},
|
|
17393
17278
|
{
|
|
@@ -21328,18 +21213,7 @@ var init_doctor = __esm(() => {
|
|
|
21328
21213
|
}
|
|
21329
21214
|
hasAny = true;
|
|
21330
21215
|
try {
|
|
21331
|
-
const
|
|
21332
|
-
if (!factory) {
|
|
21333
|
-
results.push({
|
|
21334
|
-
service,
|
|
21335
|
-
configured: true,
|
|
21336
|
-
status: "fail",
|
|
21337
|
-
baseUrl: svcConfig.baseUrl,
|
|
21338
|
-
error: "No client factory available"
|
|
21339
|
-
});
|
|
21340
|
-
continue;
|
|
21341
|
-
}
|
|
21342
|
-
const client9 = factory(svcConfig);
|
|
21216
|
+
const client9 = clientFactories[service](svcConfig);
|
|
21343
21217
|
const status = await client9.getSystemStatus();
|
|
21344
21218
|
if (status?.error !== undefined) {
|
|
21345
21219
|
const err = status.error;
|
|
@@ -21790,7 +21664,7 @@ init_dist();
|
|
|
21790
21664
|
// package.json
|
|
21791
21665
|
var package_default = {
|
|
21792
21666
|
name: "tsarr",
|
|
21793
|
-
version: "2.7.
|
|
21667
|
+
version: "2.7.6",
|
|
21794
21668
|
author: "Robbe Verhelst",
|
|
21795
21669
|
repository: {
|
|
21796
21670
|
type: "git",
|