cross-seed 6.0.0-8 → 6.0.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/action.js +177 -71
- package/dist/action.js.map +1 -1
- package/dist/arr.js +62 -54
- package/dist/arr.js.map +1 -1
- package/dist/clients/Deluge.js +70 -46
- package/dist/clients/Deluge.js.map +1 -1
- package/dist/clients/QBittorrent.js +110 -68
- package/dist/clients/QBittorrent.js.map +1 -1
- package/dist/clients/RTorrent.js +46 -23
- package/dist/clients/RTorrent.js.map +1 -1
- package/dist/clients/TorrentClient.js +14 -1
- package/dist/clients/TorrentClient.js.map +1 -1
- package/dist/clients/Transmission.js +30 -10
- package/dist/clients/Transmission.js.map +1 -1
- package/dist/cmd.js +46 -23
- package/dist/cmd.js.map +1 -1
- package/dist/config.template.cjs +59 -59
- package/dist/config.template.cjs.map +1 -1
- package/dist/configSchema.js +90 -26
- package/dist/configSchema.js.map +1 -1
- package/dist/configuration.js +4 -1
- package/dist/configuration.js.map +1 -1
- package/dist/constants.js +77 -9
- package/dist/constants.js.map +1 -1
- package/dist/dataFiles.js +4 -5
- package/dist/dataFiles.js.map +1 -1
- package/dist/db.js +2 -1
- package/dist/db.js.map +1 -1
- package/dist/decide.js +279 -169
- package/dist/decide.js.map +1 -1
- package/dist/diff.js +13 -3
- package/dist/diff.js.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/indexers.js +94 -33
- package/dist/indexers.js.map +1 -1
- package/dist/inject.js +448 -0
- package/dist/inject.js.map +1 -0
- package/dist/jobs.js +13 -6
- package/dist/jobs.js.map +1 -1
- package/dist/logger.js +27 -9
- package/dist/logger.js.map +1 -1
- package/dist/migrations/00-initialSchema.js.map +1 -1
- package/dist/migrations/05-caps.js.map +1 -1
- package/dist/migrations/06-uniqueDecisions.js +29 -0
- package/dist/migrations/06-uniqueDecisions.js.map +1 -0
- package/dist/migrations/07-limits.js +12 -0
- package/dist/migrations/07-limits.js.map +1 -0
- package/dist/migrations/migrations.js +4 -0
- package/dist/migrations/migrations.js.map +1 -1
- package/dist/parseTorrent.js +6 -0
- package/dist/parseTorrent.js.map +1 -1
- package/dist/pipeline.js +224 -112
- package/dist/pipeline.js.map +1 -1
- package/dist/preFilter.js +122 -55
- package/dist/preFilter.js.map +1 -1
- package/dist/pushNotifier.js +7 -5
- package/dist/pushNotifier.js.map +1 -1
- package/dist/searchee.js +198 -17
- package/dist/searchee.js.map +1 -1
- package/dist/server.js +106 -54
- package/dist/server.js.map +1 -1
- package/dist/startup.js +16 -7
- package/dist/startup.js.map +1 -1
- package/dist/torrent.js +116 -50
- package/dist/torrent.js.map +1 -1
- package/dist/torznab.js +323 -153
- package/dist/torznab.js.map +1 -1
- package/dist/utils.js +229 -44
- package/dist/utils.js.map +1 -1
- package/package.json +11 -6
package/dist/config.template.cjs
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
// If you find yourself always using the same command-line flag, you can set it
|
3
3
|
// here as a default.
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
5
4
|
module.exports = {
|
6
5
|
/**
|
7
6
|
* WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
|
@@ -31,30 +30,30 @@ module.exports = {
|
|
31
30
|
* URL(s) to your Sonarr instance(s), included in the same way as torznab
|
32
31
|
* URLs but for your Sonarr: note that api is not at the end. see below.
|
33
32
|
*
|
34
|
-
* You should order these in most likely to match -> least likely order.
|
33
|
+
* You should order these in most likely to match -> the least likely order.
|
35
34
|
* They are searched sequentially as they are listed.
|
36
35
|
*
|
37
36
|
* This apikey parameter comes from Sonarr
|
38
37
|
*
|
39
38
|
* Example: sonarr: ["http://sonarr:8989/?apikey=12345"],
|
40
39
|
*
|
41
|
-
*
|
42
|
-
*
|
40
|
+
* sonarr: ["http://sonarr:8989/?apikey=12345",
|
41
|
+
* "http://sonarr4k:8989/?apikey=12345"],
|
43
42
|
*/
|
44
43
|
sonarr: undefined,
|
45
44
|
/**
|
46
45
|
* URL(s) to your Radarr instance(s), included in the same way as torznab
|
47
|
-
* URLs but for your
|
46
|
+
* URLs but for your Radarr: note that api is not at the end. see below.
|
48
47
|
*
|
49
|
-
* You should order these in most likely to match -> least likely order.
|
48
|
+
* You should order these in most likely to match -> the least likely order.
|
50
49
|
* They are searched sequentially as they are listed.
|
51
50
|
*
|
52
|
-
* This apikey parameter comes from
|
51
|
+
* This apikey parameter comes from Radarr
|
53
52
|
*
|
54
53
|
* Example: radarr: ["http://radarr:7878/?apikey=12345"],
|
55
54
|
*
|
56
|
-
*
|
57
|
-
*
|
55
|
+
* radarr: ["http://radarr:7878/?apikey=12345",
|
56
|
+
* "http://radarr4k:7878/?apikey=12345"],
|
58
57
|
*/
|
59
58
|
radarr: undefined,
|
60
59
|
/**
|
@@ -81,6 +80,10 @@ module.exports = {
|
|
81
80
|
/**
|
82
81
|
* The url of your qBittorrent webui.
|
83
82
|
* Only relevant with action: "inject".
|
83
|
+
*
|
84
|
+
* If using Automatic Torrent Management, please read:
|
85
|
+
* https://www.cross-seed.org/docs/v6-migration#qbittorrent
|
86
|
+
*
|
84
87
|
* Supply your username and password inside the url like so:
|
85
88
|
* "http://username:password@localhost:8080"
|
86
89
|
*/
|
@@ -107,33 +110,33 @@ module.exports = {
|
|
107
110
|
/**
|
108
111
|
* Pause at least this many seconds in between each search. Higher is safer
|
109
112
|
* for you and friendlier for trackers.
|
110
|
-
* Minimum value of
|
113
|
+
* Minimum value of 30.
|
111
114
|
*/
|
112
115
|
delay: 30,
|
113
116
|
/**
|
114
|
-
* To search with already downloaded data, you can enter
|
117
|
+
* To search with already downloaded data, you can enter the directories
|
115
118
|
* to your downloaded torrent data to find matches, rather than relying
|
116
119
|
* entirely on the .torrent files themselves for matching.
|
117
120
|
*
|
118
|
-
* If directories are entered, they must all be
|
121
|
+
* If directories are entered, they must all be in a single option, and they
|
119
122
|
* need to be surrounded by brackets.
|
123
|
+
*
|
120
124
|
* Windows users will need to use double backslash in all paths in this
|
121
125
|
* config.
|
122
126
|
*
|
123
127
|
* example:
|
124
128
|
* dataDirs: ["/downloads/movies", "/downloads/packs"],
|
125
|
-
* or for
|
129
|
+
* or for Windows users
|
126
130
|
* dataDirs: ["C:\\My Data\\Downloads\\Movies"],
|
127
131
|
*/
|
128
132
|
dataDirs: [],
|
129
133
|
/**
|
130
134
|
* Defines what qBittorrent or Deluge category to set on linked torrents
|
131
|
-
* Default is "cross-seed-link".
|
132
135
|
*
|
133
136
|
* qBittorrent: If you have linking enabled, all torrents will be injected
|
134
137
|
* to this category.
|
135
138
|
*
|
136
|
-
* Default is "cross-seed-
|
139
|
+
* Default is "cross-seed-link".
|
137
140
|
*/
|
138
141
|
linkCategory: "cross-seed-link",
|
139
142
|
/**
|
@@ -164,11 +167,11 @@ module.exports = {
|
|
164
167
|
/**
|
165
168
|
* Enabling this will link files using v5's flat folder style.
|
166
169
|
*
|
167
|
-
* Each individual Torznab tracker's cross-seeds, otherwise, will have
|
170
|
+
* Each individual Torznab tracker's cross-seeds, otherwise, will have its
|
168
171
|
* own folder with the tracker's name and it's links within it.
|
169
172
|
*
|
170
|
-
*
|
171
|
-
*
|
173
|
+
* If using Automatic Torrent Management in qBittorrent, please read:
|
174
|
+
* https://www.cross-seed.org/docs/v6-migration#qbittorrent
|
172
175
|
*
|
173
176
|
* Default: false.
|
174
177
|
*/
|
@@ -191,7 +194,7 @@ module.exports = {
|
|
191
194
|
* searchees. Setting this to higher values will result in more searchees
|
192
195
|
* and more API hits to your indexers.
|
193
196
|
*/
|
194
|
-
maxDataDepth:
|
197
|
+
maxDataDepth: 2,
|
195
198
|
/**
|
196
199
|
* Directory containing .torrent files.
|
197
200
|
* For qBittorrent, this is BT_Backup.
|
@@ -210,47 +213,39 @@ module.exports = {
|
|
210
213
|
*/
|
211
214
|
outputDir: ".",
|
212
215
|
/**
|
213
|
-
* Whether to
|
214
|
-
* packs.
|
215
|
-
* This option overrides includeSingleEpisodes when set to true.
|
216
|
-
*/
|
217
|
-
includeEpisodes: false,
|
218
|
-
/**
|
219
|
-
* Whether to include single episode torrents in the search (not those from
|
216
|
+
* Whether to include single episode torrents in a search (not those from
|
220
217
|
* season packs).
|
221
|
-
*
|
218
|
+
*
|
219
|
+
* This setting does not affect matching episodes from rss and
|
220
|
+
* announce.
|
222
221
|
*/
|
223
222
|
includeSingleEpisodes: false,
|
224
223
|
/**
|
225
|
-
* Include torrents which
|
226
|
-
* This option does not override includeEpisodes or includeSingleEpisodes.
|
224
|
+
* Include torrents which are comprised of non-video files.
|
227
225
|
*
|
228
|
-
* If this option is set to false, any folders or torrents
|
229
|
-
*
|
226
|
+
* If this option is set to false, any folders or torrents whose
|
227
|
+
* totalNonVideoFilesSize / totalSize > fuzzySizeThreshold
|
228
|
+
* will be excluded.
|
230
229
|
*
|
231
|
-
* For example, if you have .srt or .nfo files inside
|
232
|
-
*
|
230
|
+
* For example, if you have .srt or .nfo files inside a torrent, using
|
231
|
+
* false will still allow the torrent to be considered for cross-seeding
|
232
|
+
* while disallowing torrents that are music, games, books, etc.
|
233
233
|
* For full disc based folders (not .ISO) you may wish to set this as true.
|
234
|
-
* You may also want to set this as false to exclude things like music,
|
235
|
-
* games, or books.
|
236
234
|
*
|
237
|
-
* To search for
|
235
|
+
* To search for all video media except individual episodes, use:
|
238
236
|
*
|
239
|
-
*
|
240
|
-
*
|
241
|
-
* includeNonVideos: true
|
237
|
+
* includeSingleEpisodes: false
|
238
|
+
* includeNonVideos: false
|
242
239
|
*
|
243
|
-
* To search for
|
240
|
+
* To search for all video media including individual episodes, use:
|
244
241
|
*
|
245
|
-
*
|
246
|
-
*
|
242
|
+
* includeSingleEpisodes: true
|
243
|
+
* includeNonVideos: false
|
247
244
|
*
|
248
|
-
* To search for
|
249
|
-
*
|
250
|
-
* includeEpisodes: false
|
251
|
-
* includeSingleEpisodes: true
|
252
|
-
* includeNonVideos: true
|
245
|
+
* To search for absolutely ALL types of content, including non-video, configure
|
246
|
+
* your episode settings based on the above examples and use:
|
253
247
|
*
|
248
|
+
* includeNonVideos: true
|
254
249
|
*/
|
255
250
|
includeNonVideos: false,
|
256
251
|
/**
|
@@ -268,9 +263,10 @@ module.exports = {
|
|
268
263
|
/**
|
269
264
|
* Exclude torrents first seen by cross-seed more than this long ago.
|
270
265
|
* Examples:
|
271
|
-
* "
|
272
|
-
* "
|
273
|
-
*
|
266
|
+
* "5 days"
|
267
|
+
* "2 weeks"
|
268
|
+
*
|
269
|
+
* This value must be in the range of 2-5 times your excludeRecentSearch
|
274
270
|
*/
|
275
271
|
excludeOlder: "2 weeks",
|
276
272
|
/**
|
@@ -279,11 +275,13 @@ module.exports = {
|
|
279
275
|
* Doesn't exclude previously failed searches.
|
280
276
|
* Examples:
|
281
277
|
* "2 days"
|
282
|
-
* "
|
278
|
+
* "5 days"
|
279
|
+
*
|
280
|
+
* This value must be 2-5x less than excludeOlder.
|
283
281
|
*/
|
284
282
|
excludeRecentSearch: "3 days",
|
285
283
|
/**
|
286
|
-
*
|
284
|
+
* Which action to take upon a match being found.
|
287
285
|
* Options: "save", "inject".
|
288
286
|
*/
|
289
287
|
action: "inject",
|
@@ -294,7 +292,7 @@ module.exports = {
|
|
294
292
|
*
|
295
293
|
* qBittorrent: This will apply the category's original category as a tag.
|
296
294
|
*
|
297
|
-
* Example: if you have
|
295
|
+
* Example: if you have an original label/category called "Movies", this will
|
298
296
|
* automatically inject cross-seeds to "Movies.cross-seed".
|
299
297
|
*/
|
300
298
|
duplicateCategories: false,
|
@@ -312,6 +310,8 @@ module.exports = {
|
|
312
310
|
* Examples:
|
313
311
|
* "2 weeks"
|
314
312
|
* "3 days"
|
313
|
+
*
|
314
|
+
* This value must be at least 3x less than your excludeRecentSearch
|
315
315
|
*/
|
316
316
|
searchCadence: "1 day",
|
317
317
|
/**
|
@@ -321,7 +321,7 @@ module.exports = {
|
|
321
321
|
* "30 seconds"
|
322
322
|
* null
|
323
323
|
*/
|
324
|
-
snatchTimeout:
|
324
|
+
snatchTimeout: "30 seconds",
|
325
325
|
/**
|
326
326
|
* Fail search requests that haven't responded after this long.
|
327
327
|
* Set to null for an infinite timeout.
|
@@ -329,7 +329,7 @@ module.exports = {
|
|
329
329
|
* "30 seconds"
|
330
330
|
* null
|
331
331
|
*/
|
332
|
-
searchTimeout:
|
332
|
+
searchTimeout: "2 minutes",
|
333
333
|
/**
|
334
334
|
* The number of searches to make in one run/batch.
|
335
335
|
* If more than this many searches are queued,
|
@@ -350,10 +350,10 @@ module.exports = {
|
|
350
350
|
*
|
351
351
|
* examples:
|
352
352
|
*
|
353
|
-
*
|
354
|
-
*
|
355
|
-
*
|
356
|
-
*
|
353
|
+
* blockList: ["-excludedGroup", "-excludedGroup2"],
|
354
|
+
* blocklist: ["x265"],
|
355
|
+
* blocklist: ["Release.Name"],
|
356
|
+
* blocklist: ["3317e6485454354751555555366a8308c1e92093"],
|
357
357
|
*/
|
358
358
|
blockList: undefined,
|
359
359
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"config.template.cjs","sourceRoot":"","sources":["../src/config.template.cjs"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,qBAAqB
|
1
|
+
{"version":3,"file":"config.template.cjs","sourceRoot":"","sources":["../src/config.template.cjs"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,qBAAqB;AAErB,MAAM,CAAC,OAAO,GAAG;IAChB;;;;;;;;QAQI;IAEJ;;;;;OAKG;IACH,MAAM,EAAE,SAAS;IAEjB;;;;;;OAMG;IACH,OAAO,EAAE,EAAE;IAEX;;;;;;;;;;;;;OAaG;IACH,MAAM,EAAE,SAAS;IAEjB;;;;;;;;;;;;;OAaG;IACH,MAAM,EAAE,SAAS;IAEjB;;;;OAIG;IACH,IAAI,EAAE,SAAS;IAEf;;OAEG;IACH,IAAI,EAAE,IAAI;IAEV;;;OAGG;IACH,sBAAsB,EAAE,SAAS;IAEjC;;;;OAIG;IACH,cAAc,EAAE,SAAS;IAEzB;;;;;;;;;OASG;IACH,cAAc,EAAE,S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
1
1
|
import ms from "ms";
|
2
|
+
import { isAbsolute, relative, resolve } from "path";
|
2
3
|
import { z } from "zod";
|
3
|
-
import { Action, LinkType, MatchMode } from "./constants.js";
|
4
|
+
import { Action, LinkType, MatchMode, NEWLINE_INDENT } from "./constants.js";
|
4
5
|
import { logger } from "./logger.js";
|
5
|
-
import { resolve, relative, isAbsolute } from "path";
|
6
6
|
/**
|
7
7
|
* error messages and map returned upon Zod validation failure
|
8
8
|
*/
|
9
9
|
const ZodErrorMessages = {
|
10
10
|
vercel: "format does not follow vercel's `ms` style ( https://github.com/vercel/ms#examples )",
|
11
11
|
emptyString: "cannot have an empty string. If you want to unset it, use null or undefined.",
|
12
|
-
|
13
|
-
|
12
|
+
delayNegative: "delay is in seconds, you can't travel back in time.",
|
13
|
+
delayUnsupported: `delay must be 30 seconds to 1 hour.${NEWLINE_INDENT}To even out search loads please see the following documentation:${NEWLINE_INDENT}(https://www.cross-seed.org/docs/basics/daemon#set-up-periodic-searches)`,
|
14
|
+
rssCadenceUnsupported: "rssCadence must be 10-120 minutes",
|
15
|
+
searchCadenceUnsupported: "searchCadence must be at least 1 day.",
|
16
|
+
searchCadenceExcludeRecent: "excludeRecentSearch must be at least 3x searchCadence.",
|
17
|
+
excludeRecentOlder: "excludeOlder and excludeRecentSearch must be defined for searching. excludeOlder must be 2-5x excludeRecentSearch.",
|
18
|
+
fuzzySizeThreshold: "fuzzySizeThreshold must be between 0 and 1 with a maximum of 0.1 when using searchCadence or rssCadence",
|
14
19
|
injectUrl: "You need to specify rtorrentRpcUrl, transmissionRpcUrl, qbittorrentUrl, or delugeRpcUrl when using 'inject'",
|
15
|
-
qBitAutoTMM: "
|
20
|
+
qBitAutoTMM: "If using Automatic Torrent Management in qBittorrent, please read: https://www.cross-seed.org/docs/v6-migration#qbittorrent",
|
21
|
+
includeSingleEpisodes: "includeSingleEpisodes is not recommended when using announce, please read: https://www.cross-seed.org/docs/v6-migration#updated-includesingleepisodes-behavior",
|
22
|
+
needsTorrentDir: "You need to set torrentDir for rss and announce matching to work.",
|
23
|
+
needsInject: "You need to use the 'inject' action for partial matching.",
|
16
24
|
needsLinkDir: "You need to set a linkDir (and have your data accessible) for risky or partial matching to work.",
|
17
25
|
linkDirInDataDir: "You cannot have your linkDir inside of your dataDirs. Please adjust your paths to correct this.",
|
26
|
+
outputDirInInputDir: "You cannot have your outputDir inside of your torrentDir/dataDirs. Please adjust your paths to correct this.",
|
18
27
|
};
|
19
28
|
/**
|
20
29
|
* custom zod error map for logging
|
@@ -61,15 +70,15 @@ function transformDurationString(durationStr, ctx) {
|
|
61
70
|
return duration;
|
62
71
|
}
|
63
72
|
/**
|
64
|
-
* check a potential child path being inside
|
65
|
-
* @param
|
66
|
-
* @param
|
67
|
-
* @returns true if `
|
73
|
+
* check a potential child path being inside an array of parent paths
|
74
|
+
* @param childDir path of the potential child (e.g. linkDir)
|
75
|
+
* @param parentDirs array of parentDir paths (e.g. dataDirs)
|
76
|
+
* @returns true if `childDir` is inside any `parentDirs` at any nesting level, false otherwise.
|
68
77
|
*/
|
69
|
-
function isChildPath(
|
70
|
-
return
|
71
|
-
const resolvedParent = resolve(
|
72
|
-
const resolvedChild = resolve(
|
78
|
+
function isChildPath(childDir, parentDirs) {
|
79
|
+
return parentDirs.some((parentDir) => {
|
80
|
+
const resolvedParent = resolve(parentDir);
|
81
|
+
const resolvedChild = resolve(childDir);
|
73
82
|
const relativePath = relative(resolvedParent, resolvedChild);
|
74
83
|
// if the path does not start with '..' and is not absolute
|
75
84
|
return !(relativePath.startsWith("..") || isAbsolute(relativePath));
|
@@ -81,9 +90,13 @@ function isChildPath(linkDir, dataDirs) {
|
|
81
90
|
*/
|
82
91
|
export const VALIDATION_SCHEMA = z
|
83
92
|
.object({
|
84
|
-
delay: z
|
85
|
-
|
86
|
-
|
93
|
+
delay: z
|
94
|
+
.number()
|
95
|
+
.nonnegative({
|
96
|
+
message: ZodErrorMessages.delayNegative,
|
97
|
+
})
|
98
|
+
.gte(process.env.DEV ? 0 : 30, ZodErrorMessages.delayUnsupported)
|
99
|
+
.lte(3600, ZodErrorMessages.delayUnsupported),
|
87
100
|
torznab: z.array(z.string().url()),
|
88
101
|
dataDirs: z.array(z.string()).nullish(),
|
89
102
|
matchMode: z.nativeEnum(MatchMode),
|
@@ -97,7 +110,7 @@ export const VALIDATION_SCHEMA = z
|
|
97
110
|
maxDataDepth: z.number().gte(1),
|
98
111
|
torrentDir: z.string().nullable(),
|
99
112
|
outputDir: z.string(),
|
100
|
-
|
113
|
+
injectDir: z.string().optional(),
|
101
114
|
includeSingleEpisodes: z.boolean(),
|
102
115
|
includeNonVideos: z.boolean(),
|
103
116
|
fuzzySizeThreshold: z.number().positive().lte(1, {
|
@@ -107,12 +120,24 @@ export const VALIDATION_SCHEMA = z
|
|
107
120
|
.string()
|
108
121
|
.min(1, { message: ZodErrorMessages.emptyString })
|
109
122
|
.transform(transformDurationString)
|
110
|
-
.nullish()
|
123
|
+
.nullish()
|
124
|
+
.or(z
|
125
|
+
.boolean()
|
126
|
+
.refine((value) => value !== true, {
|
127
|
+
message: "Expected string, received boolean (true)",
|
128
|
+
})
|
129
|
+
.transform(() => null)),
|
111
130
|
excludeRecentSearch: z
|
112
131
|
.string()
|
113
132
|
.min(1, { message: ZodErrorMessages.emptyString })
|
114
133
|
.transform(transformDurationString)
|
115
|
-
.nullish()
|
134
|
+
.nullish()
|
135
|
+
.or(z
|
136
|
+
.boolean()
|
137
|
+
.refine((value) => value !== true, {
|
138
|
+
message: "Expected string, received boolean (true)",
|
139
|
+
})
|
140
|
+
.transform(() => null)),
|
116
141
|
action: z.nativeEnum(Action),
|
117
142
|
qbittorrentUrl: z.string().url().nullish(),
|
118
143
|
rtorrentRpcUrl: z.string().url().nullish(),
|
@@ -131,12 +156,16 @@ export const VALIDATION_SCHEMA = z
|
|
131
156
|
.string()
|
132
157
|
.min(1, { message: ZodErrorMessages.emptyString })
|
133
158
|
.transform(transformDurationString)
|
134
|
-
.nullish()
|
159
|
+
.nullish()
|
160
|
+
.refine((cadence) => process.env.DEV ||
|
161
|
+
!cadence ||
|
162
|
+
(cadence >= ms("10 minutes") && cadence <= ms("2 hours")), ZodErrorMessages.rssCadenceUnsupported),
|
135
163
|
searchCadence: z
|
136
164
|
.string()
|
137
165
|
.min(1, { message: ZodErrorMessages.emptyString })
|
138
166
|
.transform(transformDurationString)
|
139
|
-
.nullish()
|
167
|
+
.nullish()
|
168
|
+
.refine((cadence) => process.env.DEV || !cadence || cadence >= ms("1 day"), ZodErrorMessages.searchCadenceUnsupported),
|
140
169
|
snatchTimeout: z
|
141
170
|
.string()
|
142
171
|
.min(1, { message: ZodErrorMessages.emptyString })
|
@@ -155,10 +184,26 @@ export const VALIDATION_SCHEMA = z
|
|
155
184
|
.nullish()
|
156
185
|
.transform((value) => (Array.isArray(value) ? value : [])),
|
157
186
|
apiKey: z.string().min(24).nullish(),
|
158
|
-
radarr: z
|
159
|
-
|
187
|
+
radarr: z
|
188
|
+
.array(z.string().url())
|
189
|
+
.nullish()
|
190
|
+
.transform((value) => value ?? []),
|
191
|
+
sonarr: z
|
192
|
+
.array(z.string().url())
|
193
|
+
.nullish()
|
194
|
+
.transform((value) => value ?? []),
|
160
195
|
})
|
161
196
|
.strict()
|
197
|
+
.refine((config) => !config.searchCadence ||
|
198
|
+
!config.excludeRecentSearch ||
|
199
|
+
3 * config.searchCadence <= config.excludeRecentSearch, ZodErrorMessages.searchCadenceExcludeRecent)
|
200
|
+
.refine((config) => !config.searchCadence ||
|
201
|
+
(config.excludeOlder &&
|
202
|
+
config.excludeRecentSearch &&
|
203
|
+
config.excludeOlder >= 2 * config.excludeRecentSearch &&
|
204
|
+
config.excludeOlder <= 5 * config.excludeRecentSearch), ZodErrorMessages.excludeRecentOlder)
|
205
|
+
.refine((config) => config.fuzzySizeThreshold <= 0.1 ||
|
206
|
+
(!config.searchCadence && !config.rssCadence), ZodErrorMessages.fuzzySizeThreshold)
|
162
207
|
.refine((config) => {
|
163
208
|
if (config.action === Action.INJECT &&
|
164
209
|
config.qbittorrentUrl &&
|
@@ -168,16 +213,35 @@ export const VALIDATION_SCHEMA = z
|
|
168
213
|
}
|
169
214
|
return true;
|
170
215
|
})
|
171
|
-
.refine((config) =>
|
216
|
+
.refine((config) => {
|
217
|
+
if (config.includeSingleEpisodes && config.rssCadence) {
|
218
|
+
logger.warn(ZodErrorMessages.includeSingleEpisodes);
|
219
|
+
}
|
220
|
+
return true;
|
221
|
+
})
|
222
|
+
.refine((config) => !((config.action === Action.INJECT || config.injectDir) &&
|
172
223
|
!config.rtorrentRpcUrl &&
|
173
224
|
!config.qbittorrentUrl &&
|
174
225
|
!config.transmissionRpcUrl &&
|
175
226
|
!config.delugeRpcUrl), ZodErrorMessages.injectUrl)
|
176
|
-
.refine((config) =>
|
227
|
+
.refine((config) => process.env.DEV ||
|
228
|
+
config.action === Action.INJECT ||
|
229
|
+
config.matchMode !== MatchMode.PARTIAL, ZodErrorMessages.needsInject)
|
230
|
+
.refine((config) => config.torrentDir || !config.rssCadence, ZodErrorMessages.needsTorrentDir)
|
231
|
+
.refine((config) => config.linkDir || config.matchMode === MatchMode.SAFE, ZodErrorMessages.needsLinkDir)
|
177
232
|
.refine((config) => {
|
178
233
|
if (config.linkDir && config.dataDirs) {
|
179
234
|
return !isChildPath(config.linkDir, config.dataDirs);
|
180
235
|
}
|
181
236
|
return true;
|
182
|
-
}, ZodErrorMessages.linkDirInDataDir)
|
237
|
+
}, ZodErrorMessages.linkDirInDataDir)
|
238
|
+
.refine((config) => {
|
239
|
+
if (config.torrentDir) {
|
240
|
+
return !isChildPath(config.outputDir, [
|
241
|
+
config.torrentDir,
|
242
|
+
...(config.dataDirs ?? []),
|
243
|
+
]);
|
244
|
+
}
|
245
|
+
return true;
|
246
|
+
}, ZodErrorMessages.outputDirInInputDir);
|
183
247
|
//# sourceMappingURL=configSchema.js.map
|
package/dist/configSchema.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../src/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAA8B,CAAC,EAA2B,MAAM,KAAK,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../src/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,EAA8B,CAAC,EAA2B,MAAM,KAAK,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,MAAM,gBAAgB,GAAG;IACxB,MAAM,EAAE,sFAAsF;IAC9F,WAAW,EACV,8EAA8E;IAC/E,aAAa,EAAE,qDAAqD;IACpE,gBAAgB,EAAE,sCAAsC,cAAc,mEAAmE,cAAc,0EAA0E;IACjO,qBAAqB,EAAE,mCAAmC;IAC1D,wBAAwB,EAAE,uCAAuC;IACjE,0BAA0B,EACzB,wDAAwD;IACzD,kBAAkB,EACjB,oHAAoH;IACrH,kBAAkB,EACjB,yGAAyG;IAC1G,SAAS,EACR,6GAA6G;IAC9G,WAAW,EACV,6HAA6H;IAC9H,qBAAqB,EACpB,gKAAgK;IACjK,eAAe,EACd,mEAAmE;IACpE,WAAW,EAAE,2DAA2D;IACxE,YAAY,EACX,kGAAkG;IACnG,gBAAgB,EACf,iGAAiG;IAClG,mBAAmB,EAClB,8GAA8G;CAC/G,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACpC,KAA8B,EAC9B,GAAgB;IAEhB,QAAQ,KAAK,CAAC,IAAI,EAAE,C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C;AACb,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC;KACpC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;IAClB,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACvB,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE;YACrC,MAAM,CAAC,UAAU;YACjB,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;SAC1B,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC,EAAE,gBAAgB,CAAC,mBAAmB,CAAC,CAAC"}
|
package/dist/configuration.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import chalk from "chalk";
|
2
|
-
import { accessSync, copyFileSync, existsSync, mkdirSync
|
2
|
+
import { accessSync, constants, copyFileSync, existsSync, mkdirSync } from "fs";
|
3
3
|
import { createRequire } from "module";
|
4
4
|
import path from "path";
|
5
5
|
import { pathToFileURL } from "url";
|
@@ -23,6 +23,9 @@ export function appDir() {
|
|
23
23
|
accessSync(appDir, constants.R_OK | constants.W_OK);
|
24
24
|
}
|
25
25
|
catch (e) {
|
26
|
+
if (e.code === "ENOENT") {
|
27
|
+
return appDir;
|
28
|
+
}
|
26
29
|
const dockerMessage = process.env.DOCKER_ENV === "true"
|
27
30
|
? ` Use chown to set the owner to ${process.getuid()}:${process.getgid()}`
|
28
31
|
: "";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC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