Update docs and some missing commands to the new standards.

This commit is contained in:
abdulmohsen
2024-03-09 02:06:23 +03:00
parent 7bd0c7ca34
commit aaf764819f
5 changed files with 17 additions and 29 deletions

14
FAQ.md
View File

@@ -100,7 +100,7 @@ $ docker exec -ti watchstate console state:export -vvif -s new_backend_name
Running this command will force full export your current database state to the selected backend. Once that done you can
turn on import from the new backend. by editing the backend setting
via `docker exec -ti watchstate console config:manage backend_name`
via `docker exec -ti watchstate console config:manage -s backend_name`
----
@@ -146,11 +146,11 @@ For Plex, You should use your admin token and by running the `config:add` comman
attempt to generate a token for that user.
> [!Note]
> If the tool fails to generate a access token for the user, you can run the following command to generate the access
> If the tool fails to generate an access token for the user, you can run the following command to generate the access
> token manually.
```bash
$ docker exec -ti console backend:users:list --with-tokens -- [BACKEND_NAME]
$ docker exec -ti console backend:users:list -s backend_name --with-tokens
```
----
@@ -203,7 +203,7 @@ after that you can do `./ws command` for example, `./ws db:list`
Sometimes there are problems related to HTTP/2, so before reporting bug please try running the following command:
```bash
$ docker exec -ti watchstate console config:edit --key options.client.http_version --set 1.0 -- [BACKEND_NAME]
$ docker exec -ti watchstate console config:edit --key options.client.http_version --set 1.0 -s backend_name
```
This will force set the internal http client to use http v1 if it does not fix your problem, please open bug report
@@ -216,7 +216,7 @@ about it.
If you want to increase the timeout for specific backend you can run the following command:
```bash
$ docker exec -ti watchstate console config:edit --key options.client.timeout --set 600 -- [BACKEND_NAME]
$ docker exec -ti watchstate console config:edit --key options.client.timeout --set 600 -s backend_name
```
where `600` is the number of secs before the timeout handler will kill the request.
@@ -361,7 +361,7 @@ $ docker exec -ti watchstate console config:view webhook.token
If you see 'Not configured, or invalid key.' or empty value. run the following command
```bash
$ docker exec -ti watchstate console config:edit --regenerate-webhook-token -- [BACKEND_NAME]
$ docker exec -ti watchstate console config:edit --regenerate-webhook-token -s backend_name
```
-----
@@ -644,7 +644,7 @@ If this is not enough for your library content. fear not we have you covered you
following command:
```bash
$ docker exec -ti watchstate console config:edit --key options.MAX_EPISODE_RANGE --set 10 -- [BACKEND_NAME]
$ docker exec -ti watchstate console config:edit --key options.MAX_EPISODE_RANGE --set 10 -s backend_name
```
where `10` is the new limit. You can set it to any number you want. However, Please do inspect the reported records as

View File

@@ -91,7 +91,7 @@ Create directory called `data` next to the `docker-compose.yaml` file. After cre
the container.
```bash
$ mkdir -p ./data && docker-compose pull && docker-compose up
$ mkdir -p ./data && docker-compose pull && docker-compose up -d
```
> [!IMPORTANT]
@@ -124,7 +124,7 @@ After starting the container you should start adding your backends and to do so
> For jellyfin & emby. Go to Dashboard > Advanced > API keys > then create new api keys.
```bash
$ docker exec -ti watchstate console config:add [BACKEND_NAME]
$ docker exec -ti watchstate console config:add
```
This command is interactive and will ask you for some questions to add your backend.
@@ -134,7 +134,7 @@ This command is interactive and will ask you for some questions to add your back
To edit backend settings run
```bash
$ docker exec -ti watchstate console config:manage [BACKEND_NAME]
$ docker exec -ti watchstate console config:manage -s backend_name
```
# Importing play state.

View File

@@ -14,7 +14,6 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Yaml\Yaml;
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface;
@@ -33,7 +32,7 @@ final class AccessTokenCommand extends Command
{
$this->setName(self::ROUTE)
->setDescription('Generate Access tokens for plex backend users.')
->addArgument('backend', InputArgument::REQUIRED, 'Already Added Plex server with plex admin token.')
->addOption('select-backend', 's', InputOption::VALUE_REQUIRED, 'Select backend.')
->addArgument(
'uuid',
InputArgument::REQUIRED,
@@ -41,7 +40,6 @@ final class AccessTokenCommand extends Command
)
->addOption('include-raw-response', null, InputOption::VALUE_NONE, 'Include unfiltered raw response.')
->addOption('use-token', 'u', InputOption::VALUE_REQUIRED, 'Override backend token with this one.')
->addOption('config', 'c', InputOption::VALUE_REQUIRED, 'Use Alternative config file.')
->setHelp(
r(
<<<HELP
@@ -53,7 +51,7 @@ final class AccessTokenCommand extends Command
-------
<question># How to see the raw response?</question>
{cmd} <cmd>{route}</cmd> <flag>--output</flag> <value>yaml</value> <flag>--include-raw-response</flag> -- <value>backend_name</value> <value>plex_user_uuid</value>
{cmd} <cmd>{route}</cmd> <flag>--output</flag> <value>yaml</value> <flag>--include-raw-response -s</flag> <value>backend_name</value> -- <value>plex_user_uuid</value>
HELP,
[
@@ -72,17 +70,7 @@ final class AccessTokenCommand extends Command
protected function runCommand(InputInterface $input, OutputInterface $output, null|array $rerun = null): int
{
$uuid = $input->getArgument('uuid');
$backend = $input->getArgument('backend');
// -- Use Custom servers.yaml file.
if (($config = $input->getOption('config'))) {
try {
Config::save('servers', Yaml::parseFile($this->checkCustomBackendsFile($config)));
} catch (\App\Libs\Exceptions\RuntimeException $e) {
$output->writeln(r('<error>{message}</error>', ['message' => $e->getMessage()]));
return self::FAILURE;
}
}
$backend = $input->getOption('select-backend');
if (null === ag(Config::get('servers', []), $backend, null)) {
$output->writeln(r("<error>ERROR: Backend '{backend}' not found.</error>", ['backend' => $backend]));

View File

@@ -34,8 +34,8 @@ final class DiscoverCommand extends Command
$this->setName(self::ROUTE)
->setDescription('Discover servers linked to plex token.')
->addOption('with-tokens', 't', InputOption::VALUE_NONE, 'Include access tokens in response.')
->addArgument('token', InputArgument::REQUIRED, 'Plex token')
->addOption('include-raw-response', null, InputOption::VALUE_NONE, 'Include unfiltered raw response.')
->addArgument('token', InputArgument::REQUIRED, 'Plex token')
->setHelp(
r(
<<<HELP
@@ -48,11 +48,11 @@ final class DiscoverCommand extends Command
<question># How to get list servers associated with token?</question>
{cmd} <cmd>{route}</cmd> <flag>--with-tokens</flag> -- <value>backend_name</value>
{cmd} <cmd>{route}</cmd> <flag>--with-tokens</flag> -- <value>plex_token</value>
<question># How to see the raw response?</question>
{cmd} <cmd>{route}</cmd> <flag>--output</flag> <value>yaml</value> <flag>--include-raw-response</flag> -- <value>backend_name</value>
{cmd} <cmd>{route}</cmd> <flag>--output</flag> <value>yaml</value> <flag>--include-raw-response</flag> -- <value>plex_token</value>
HELP,
[

View File

@@ -18,7 +18,7 @@ use Symfony\Component\Console\Question\Question;
*
* This command allow you to add new backend. This command is mainly proxy to config:manage command.
* And act as shortcut for running the following command:
* config:manage --add -- backend_name
* config:manage --add -s backend_name
*/
#[Cli(command: self::ROUTE)]
final class AddCommand extends Command