From 912765203a351d96eecb29eda66cd88e65de9874 Mon Sep 17 00:00:00 2001 From: William Oldham Date: Tue, 3 Oct 2023 23:02:53 +0100 Subject: [PATCH] docs: add dev-cli page --- .docs/content/3.Developer/0.dev-cli.md | 31 ++++++++++++++++++++++++++ .docs/content/3.Developer/_dir.yml | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 .docs/content/3.Developer/0.dev-cli.md create mode 100644 .docs/content/3.Developer/_dir.yml diff --git a/.docs/content/3.Developer/0.dev-cli.md b/.docs/content/3.Developer/0.dev-cli.md new file mode 100644 index 0000000..11fb5ba --- /dev/null +++ b/.docs/content/3.Developer/0.dev-cli.md @@ -0,0 +1,31 @@ +# Testing Providers + +In order to test providers effectively, a built-in tool can be used which allows testing of individual source and embed providers. + +There are two ways to use the tool: +- Command Line Mode - For passing in arguments directly to the script. This is useful in non-interactive environments such as CI or to repeatedly test during development. +- Question Mode - Where the script asks you questions about which source you wish to test. + +::code-group + ```bash [Interactive] + npm run test:dev + ``` + ```bash [Command Line] + npm run test:dev -- [options] + + # Example testing FlixHQ with "Spirited Away" + npm run test:dev -- -sid flixhq -tid 129 -t movie + ``` +:: + +The following Command Line Mode arguments are available: +| Argument | Alias | Description | Default | +|---------------|--------|-------------------------------------------------------------------------|--------------| +| `--fetcher` | `-f` | Fetcher type. Either `node-fetch` or `native` | `node-fetch` | +| `--source-id` | `-sid` | Source ID for the source to be tested | | +| `--tmdb-id` | `-tid` | TMDB ID for the media to scrape. Only used if source is a provider | | +| `--type` | `-t` | Media type. Either `movie` or `show`. Only used if source is a provider | `movie` | +| `--season` | `-s` | Season number. Only used if type is `show` | `0` | +| `--episode` | `-e` | Episode number. Only used if type is `show` | `0` | +| `--url` | `-u` | URL to a video embed. Only used if source is an embed | | +| `--help` | `-h` | Shows help for the command arguments | | diff --git a/.docs/content/3.Developer/_dir.yml b/.docs/content/3.Developer/_dir.yml new file mode 100644 index 0000000..ed98397 --- /dev/null +++ b/.docs/content/3.Developer/_dir.yml @@ -0,0 +1,2 @@ +icon: ph:code +navigation.redirect: /developer/dev-cli