wyzie-lib 2.2.5 → 2.2.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/lib/main.amd.js CHANGED
@@ -20,6 +20,14 @@ define(["exports"], function(exports) {
20
20
  hi,
21
21
  ...extraParams
22
22
  }) {
23
+ if (!tmdb_id && !imdb_id) {
24
+ throw new Error("Either tmdb_id or imdb_id must be provided.");
25
+ }
26
+ const hasSeason = season !== void 0;
27
+ const hasEpisode = episode !== void 0;
28
+ if (hasSeason && !hasEpisode || !hasSeason && hasEpisode) {
29
+ throw new Error("Season and episode must be provided together or omitted together.");
30
+ }
23
31
  const url = new URL(`${config.baseUrl}/search`);
24
32
  const queryParams = {
25
33
  id: String(tmdb_id || imdb_id),
package/lib/main.cjs CHANGED
@@ -20,6 +20,14 @@ async function constructUrl({
20
20
  hi,
21
21
  ...extraParams
22
22
  }) {
23
+ if (!tmdb_id && !imdb_id) {
24
+ throw new Error("Either tmdb_id or imdb_id must be provided.");
25
+ }
26
+ const hasSeason = season !== void 0;
27
+ const hasEpisode = episode !== void 0;
28
+ if (hasSeason && !hasEpisode || !hasSeason && hasEpisode) {
29
+ throw new Error("Season and episode must be provided together or omitted together.");
30
+ }
23
31
  const url = new URL(`${config.baseUrl}/search`);
24
32
  const queryParams = {
25
33
  id: String(tmdb_id || imdb_id),
package/lib/main.d.ts CHANGED
@@ -77,8 +77,8 @@ export declare type SearchSubtitlesParams = (
77
77
  format?: string | string[];
78
78
  /** Determines if you get hearing impaired subtitles. */
79
79
  hi?: boolean;
80
- /** The source where the subtitle where be scraped. */
81
- source?: string;
80
+ /** The source where the subtitle will be scraped. Accepts a single value or a list. */
81
+ source?: string | string[];
82
82
  /** Additional parameters that can be used for filtering or other purposes. */
83
83
  [key: string]: any;
84
84
  } & (
@@ -115,8 +115,8 @@ export declare type SubtitleData = {
115
115
  display: string;
116
116
  /** ISO 3166 code; Example: en (2 alphabetic letters). */
117
117
  language: string;
118
- /** The subtitle's source. */
119
- source: number;
118
+ /** The subtitle's source (ex: subdl, subf2m, opensubtitles). */
119
+ source?: string | string[];
120
120
  };
121
121
 
122
122
  export { }
package/lib/main.iife.js CHANGED
@@ -20,6 +20,14 @@ var main = function(exports) {
20
20
  hi,
21
21
  ...extraParams
22
22
  }) {
23
+ if (!tmdb_id && !imdb_id) {
24
+ throw new Error("Either tmdb_id or imdb_id must be provided.");
25
+ }
26
+ const hasSeason = season !== void 0;
27
+ const hasEpisode = episode !== void 0;
28
+ if (hasSeason && !hasEpisode || !hasSeason && hasEpisode) {
29
+ throw new Error("Season and episode must be provided together or omitted together.");
30
+ }
23
31
  const url = new URL(`${config.baseUrl}/search`);
24
32
  const queryParams = {
25
33
  id: String(tmdb_id || imdb_id),
package/lib/main.js CHANGED
@@ -18,6 +18,14 @@ async function constructUrl({
18
18
  hi,
19
19
  ...extraParams
20
20
  }) {
21
+ if (!tmdb_id && !imdb_id) {
22
+ throw new Error("Either tmdb_id or imdb_id must be provided.");
23
+ }
24
+ const hasSeason = season !== void 0;
25
+ const hasEpisode = episode !== void 0;
26
+ if (hasSeason && !hasEpisode || !hasSeason && hasEpisode) {
27
+ throw new Error("Season and episode must be provided together or omitted together.");
28
+ }
21
29
  const url = new URL(`${config.baseUrl}/search`);
22
30
  const queryParams = {
23
31
  id: String(tmdb_id || imdb_id),
package/lib/main.umd.cjs CHANGED
@@ -22,6 +22,14 @@
22
22
  hi,
23
23
  ...extraParams
24
24
  }) {
25
+ if (!tmdb_id && !imdb_id) {
26
+ throw new Error("Either tmdb_id or imdb_id must be provided.");
27
+ }
28
+ const hasSeason = season !== void 0;
29
+ const hasEpisode = episode !== void 0;
30
+ if (hasSeason && !hasEpisode || !hasSeason && hasEpisode) {
31
+ throw new Error("Season and episode must be provided together or omitted together.");
32
+ }
25
33
  const url = new URL(`${config.baseUrl}/search`);
26
34
  const queryParams = {
27
35
  id: String(tmdb_id || imdb_id),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wyzie-lib",
3
- "version": "2.2.5",
3
+ "version": "2.2.6",
4
4
  "icon": "https://i.postimg.cc/L5ppKYC5/cclogo.png",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -31,19 +31,19 @@
31
31
  },
32
32
  "require": {
33
33
  "types": "./lib/main.d.ts",
34
- "default": "./lib/main.umd.cjs"
34
+ "default": "./lib/main.cjs"
35
35
  },
36
36
  "umd": {
37
37
  "types": "./lib/main.d.ts",
38
- "default": "./lib/main.umd.js"
38
+ "default": "./lib/main.umd.cjs"
39
39
  },
40
40
  "es": {
41
41
  "types": "./lib/main.d.ts",
42
- "default": "./lib/main.es.js"
42
+ "default": "./lib/main.js"
43
43
  },
44
44
  "cjs": {
45
45
  "types": "./lib/main.d.ts",
46
- "default": "./lib/main.cjs.js"
46
+ "default": "./lib/main.cjs"
47
47
  },
48
48
  "iife": {
49
49
  "types": "./lib/main.d.ts",