[17] add global timeout

pull/995/head
meisnate12 2 years ago
parent 1f4c1f8e35
commit c10460f757

@ -1 +1 @@
1.17.2-develop16 1.17.2-develop17

@ -12,6 +12,7 @@ These docs are assuming you have a basic understanding of Docker concepts. One
| [Time to Run](#time-to-run) | `-t` or `--time` | `PMM_TIME` | | [Time to Run](#time-to-run) | `-t` or `--time` | `PMM_TIME` |
| [Run](#run) | `-r` or `--run` | `PMM_RUN` | | [Run](#run) | `-r` or `--run` | `PMM_RUN` |
| [Run Tests](#run-tests) | `-rt`, `--tests`, or `--run-tests` | `PMM_TEST` | | [Run Tests](#run-tests) | `-rt`, `--tests`, or `--run-tests` | `PMM_TEST` |
| [Timeout](#timeout) | `-ti` or `--timeout` | `PMM_TIMEOUT` |
| [Collections Only](#collections-only) | `-co` or `--collections-only` | `PMM_COLLECTIONS_ONLY` | | [Collections Only](#collections-only) | `-co` or `--collections-only` | `PMM_COLLECTIONS_ONLY` |
| [Playlists Only](#playlists-only) | `-po` or `--playlists-only` | `PMM_PLAYLISTS_ONLY` | | [Playlists Only](#playlists-only) | `-po` or `--playlists-only` | `PMM_PLAYLISTS_ONLY` |
| [Operations](#operations) | `-op` or `--operations` | `PMM_OPERATIONS` | | [Operations](#operations) | `-op` or `--operations` | `PMM_OPERATIONS` |
@ -211,6 +212,45 @@ docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex
</details> </details>
### Timeout
Change the main Plex Meta Manager timeout.
<table class="dualTable colwidths-auto align-default table">
<tr>
<th style="background-color: #222;"></th>
<th>Shell</th>
<th>Environment</th>
</tr>
<tr>
<th>Flags</th>
<td><code>-ti</code> or <code>--timeout</code></td>
<td><code>PMM_TIMEOUT</code></td>
</tr>
<tr>
<th>Example</th>
<td><code>--timeout 360</code></td>
<td><code>PMM_TIMEOUT=360</code></td>
</tr>
</table>
<details>
<summary>Local Environment</summary>
```shell
python plex_meta_manager.py ---timeout 360
```
</details>
<details>
<summary>Docker Environment</summary>
```shell
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager ---timeout 360
```
</details>
### Collections Only ### Collections Only
Only run collection metadata/YAML files, skip library operations, overlays, and collections/metadata. Only run collection metadata/YAML files, skip library operations, overlays, and collections/metadata.
@ -221,6 +261,7 @@ Only run collection metadata/YAML files, skip library operations, overlays, and
<th>Shell</th> <th>Shell</th>
<th>Environment</th> <th>Environment</th>
</tr> </tr>
<tr> <tr>
<th>Flags</th> <th>Flags</th>
<td><code>-co</code> or <code>--collections-only</code></td> <td><code>-co</code> or <code>--collections-only</code></td>

@ -36,6 +36,7 @@ class MDbObj:
self.tomatoesaudience_rating = None self.tomatoesaudience_rating = None
self.tmdb_rating = None self.tmdb_rating = None
self.letterboxd_rating = None self.letterboxd_rating = None
self.myanimelist_rating = None
for rating in data["ratings"]: for rating in data["ratings"]:
if rating["source"] == "imdb": if rating["source"] == "imdb":
self.imdb_rating = util.check_num(rating["value"], is_int=False) self.imdb_rating = util.check_num(rating["value"], is_int=False)

@ -22,6 +22,7 @@ parser.add_argument("-db", "--debug", dest="debug", help=argparse.SUPPRESS, acti
parser.add_argument("-tr", "--trace", dest="trace", help=argparse.SUPPRESS, action="store_true", default=False) parser.add_argument("-tr", "--trace", dest="trace", help=argparse.SUPPRESS, action="store_true", default=False)
parser.add_argument("-c", "--config", dest="config", help="Run with desired *.yml file", type=str) parser.add_argument("-c", "--config", dest="config", help="Run with desired *.yml file", type=str)
parser.add_argument("-t", "--time", "--times", dest="times", help="Times to update each day use format HH:MM (Default: 05:00) (comma-separated list)", default="05:00", type=str) parser.add_argument("-t", "--time", "--times", dest="times", help="Times to update each day use format HH:MM (Default: 05:00) (comma-separated list)", default="05:00", type=str)
parser.add_argument("-ti", "--timeout", dest="timeout", help="PMM Global Timeout (Default: 180)", default=180, type=int)
parser.add_argument("-re", "--resume", dest="resume", help="Resume collection run from a specific collection", type=str) parser.add_argument("-re", "--resume", dest="resume", help="Resume collection run from a specific collection", type=str)
parser.add_argument("-r", "--run", dest="run", help="Run without the scheduler", action="store_true", default=False) parser.add_argument("-r", "--run", dest="run", help="Run without the scheduler", action="store_true", default=False)
parser.add_argument("-is", "--ignore-schedules", dest="ignore_schedules", help="Run ignoring collection schedules", action="store_true", default=False) parser.add_argument("-is", "--ignore-schedules", dest="ignore_schedules", help="Run ignoring collection schedules", action="store_true", default=False)
@ -89,6 +90,7 @@ no_missing = get_arg("PMM_NO_MISSING", args.no_missing, arg_bool=True)
read_only_config = get_arg("PMM_READ_ONLY_CONFIG", args.read_only_config, arg_bool=True) read_only_config = get_arg("PMM_READ_ONLY_CONFIG", args.read_only_config, arg_bool=True)
divider = get_arg("PMM_DIVIDER", args.divider) divider = get_arg("PMM_DIVIDER", args.divider)
screen_width = get_arg("PMM_WIDTH", args.width, arg_int=True) screen_width = get_arg("PMM_WIDTH", args.width, arg_int=True)
timeout = get_arg("PMM_TIMEOUT", args.timeout, arg_int=True)
debug = get_arg("PMM_DEBUG", args.debug, arg_bool=True) debug = get_arg("PMM_DEBUG", args.debug, arg_bool=True)
trace = get_arg("PMM_TRACE", args.trace, arg_bool=True) trace = get_arg("PMM_TRACE", args.trace, arg_bool=True)
@ -125,6 +127,15 @@ def my_except_hook(exctype, value, tb):
sys.excepthook = my_except_hook sys.excepthook = my_except_hook
old_send = requests.Session.send
def new_send(*send_args, **kwargs):
if kwargs.get("timeout", None) is None:
kwargs["timeout"] = timeout
return old_send(*send_args, **kwargs)
requests.Session.send = new_send
version = ("Unknown", "Unknown", 0) version = ("Unknown", "Unknown", 0)
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "VERSION")) as handle: with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "VERSION")) as handle:
for line in handle.readlines(): for line in handle.readlines():

Loading…
Cancel
Save