version 1.19.1

pull/1612/head
meisnate12 1 year ago
parent 288d94d0dd
commit f5d1882d66

@ -75,7 +75,7 @@ jobs:
author_icon_url: https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager/master/.github/docker.png author_icon_url: https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager/master/.github/docker.png
- name: Checkout Configs Repo - name: Checkout Configs Repo
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
repository: meisnate12/Plex-Meta-Manager-Configs repository: meisnate12/Plex-Meta-Manager-Configs
token: ${{ secrets.PAT }} token: ${{ secrets.PAT }}

@ -1,10 +1,13 @@
# Python Version
Drops Support for Python 3.7
# Requirements Update (requirements will need to be reinstalled) # Requirements Update (requirements will need to be reinstalled)
Updated GitPython requirement to 3.1.32 Updated ArrAPI requirement to 1.4.3
Updated GitPython requirement to 3.1.36
Updated lxml requirement to 4.9.3 Updated lxml requirement to 4.9.3
Updated pathvalidate requirement to 3.1.0 Updated pathvalidate requirement to 3.2.0
Updated pillow requirement to 10.0.0 Updated pillow requirement to 10.0.1
Updated PlexAPI requirement to 4.14.0 Updated PlexAPI requirement to 4.15.2
Updated psutil requirement to 5.9.5 Updated psutil requirement to 5.9.5
Updated requests requirement to 2.31.0 Updated requests requirement to 2.31.0
Updated ruamel.yaml requirement to 0.17.32 Updated ruamel.yaml requirement to 0.17.32
@ -17,6 +20,8 @@ Add `tmdb_birthday` [Detail](https://metamanager.wiki/en/latest/metadata/details
Add `match` [attribute](https://metamanager.wiki/en/latest/metadata/metadata/movie.html#matching-movies) to match movies within Plex to items within the Metadata file. Add `match` [attribute](https://metamanager.wiki/en/latest/metadata/metadata/movie.html#matching-movies) to match movies within Plex to items within the Metadata file.
Add `delete_collections_named` to [Shared Collection Variables](https://metamanager.wiki/en/latest/defaults/collection_variables.html) Add `delete_collections_named` to [Shared Collection Variables](https://metamanager.wiki/en/latest/defaults/collection_variables.html)
Add support for (GitHub Personal Access Tokens)[https://metamanager.wiki/en/latest/config/github.html] in config files. thanks @chazlarson Add support for (GitHub Personal Access Tokens)[https://metamanager.wiki/en/latest/config/github.html] in config files. thanks @chazlarson
Add runtime support for Shows, Seasons, Artists, and Albums.
Add multiple ranges to the schedule system.
# New Defaults Features # New Defaults Features
New Default Translations of Danish, Dutch, Italian, Norwegian Bokmål, Portuguese (Brazil), and Spanish. New Default Translations of Danish, Dutch, Italian, Norwegian Bokmål, Portuguese (Brazil), and Spanish.
@ -50,5 +55,6 @@ Fixes bug where TMDb Filters using a modifier were ignored.
Fixes bug with `mal_search` when using the `sfw` attribute Fixes bug with `mal_search` when using the `sfw` attribute
Fixes bug where sorting a collection would fail if the collection name had a `,` in it. Fixes bug where sorting a collection would fail if the collection name had a `,` in it.
Fixes run_end webhooks. Fixes run_end webhooks.
Fixes Letterboxd issue
Various other Minor Fixes Various other Minor Fixes

@ -1 +1 @@
1.19.0-develop109 1.19.1

@ -69,7 +69,6 @@ libraries:
sort_by: title.asc sort_by: title.asc
``` ```
## Default values ## Default values
These are lists provided for reference to show what values will be in use if you do no customization. If you want to customize these values, use the methods described above. These do not show how to change a name or a list. These are lists provided for reference to show what values will be in use if you do no customization. If you want to customize these values, use the methods described above. These do not show how to change a name or a list.
@ -77,241 +76,246 @@ These are lists provided for reference to show what values will be in use if you
### Default `include` ### Default `include`
```yaml ```yaml
include: include:
- "#0" - "#0"
- ABC - ABC
- ABC Family - ABC Family
- ABC Kids - ABC Kids
- ABC TV - ABC TV
- ABS-CBN - ABS-CBN
- Acorn TV - Acorn TV
- Adult Swim - Adult Swim
- AHC - AHC
- Alibi - Alibi
- ALTBalaji - ALTBalaji
- Amazon Kids+ - Amazon Kids+
- AMC - AMC
- Animal Planet - Animal Planet
- Antena 3 - Antena 3
- Apple TV+ - Apple TV+
- ARD - ARD
- Arte - Arte
- Atresplayer Premium - Atresplayer Premium
- AT-X - AT-X
- Audience - Audience
- AXN - AXN
- Azteca Uno - Azteca Uno
- A&E - A&E
- BBC America - BBC America
- BBC Four - BBC Four
- BBC iPlayer - BBC iPlayer
- BBC One - BBC One
- BBC Three - BBC Three
- BBC Two - BBC Two
- BET - BET
- BET+ - BET+
- bilibili - bilibili
- BluTV - BluTV
- Boomerang - Boomerang
- Bravo - Bravo
- BritBox - BritBox
- C More - C More
- Canale 5 - Canale 5
- Canal+ - Canal+
- Cartoon Network - Cartoon Network
- Cartoonito - Cartoonito
- CBC - CBC
- CBC Television - CBC Television
- Cbeebies - Cbeebies
- CBS - CBS
- Channel 3 - Channel 3
- Channel 4 - Channel 4
- Channel 5 - Channel 5
- CHCH-DT - CHCH-DT
- Cinemax - Cinemax
- Citytv - Citytv
- CNN - CNN
- Comedy Central - Comedy Central
- Cooking Channel - Cooking Channel
- Crackle - Crackle
- Criterion Channel - Criterion Channel
- Crunchyroll - Crunchyroll
- CTV - CTV
- Cuatro - Cuatro
- Curiosity Stream - Curiosity Stream
- Dave - Dave
- DC Universe - DC Universe
- Discovery - Discovery
- Discovery Kids - Discovery Kids
- discovery+ - discovery+
- Disney Channel - Disney Channel
- Disney Junior - Disney Junior
- Disney XD - Disney XD
- Disney+ - Disney+
- DR1 - DR1
- Eden - Eden
- Elisa Viihde - Elisa Viihde
- Elisa Viihde Viaplay - Elisa Viihde Viaplay
- Epix - Epix
- ESPN - ESPN
- E! - E!
- Facebook Watch - Facebook Watch
- Family Channel - Family Channel
- Ficción Producciones - Ficción Producciones
- Flooxer - Flooxer
- Food Network - Food Network
- FOX - FOX
- Fox Kids - Fox Kids
- France 2 - France 2
- Freeform - Freeform
- Freevee - Freevee
- Fuji TV - Fuji TV
- FX - FX
- FXX - FXX
- GAİN - GAİN
- Game Show Network - Game Show Network
- Global TV - Global TV
- Globoplay - Globoplay
- GMA Network - GMA Network
- Hallmark - Hallmark
- HBO - HBO
- HBO Max - HBO Max
- HGTV - HGTV
- History - History
- HOT3 - HOT3
- Hulu - Hulu
- ICTV - ICTV
- IFC - IFC
- IMDb TV - IMDb TV
- Investigation Discovery - Investigation Discovery
- ION Television - ION Television
- iQiyi - iQiyi
- ITV - ITV
- ITV Encore - ITV Encore
- ITV1 - ITV1
- ITVX - ITVX
- joyn - joyn
- Kan 11 - Kan 11
- KBS2 - KBS2
- Kids WB - Kids WB
- La 1 - La 1
- La Une - La Une
- Las Estrellas - Las Estrellas
- Lifetime - Lifetime
- Lionsgate+ - Lionsgate+
- Logo - Logo
- MasterClass - MasterClass
- Max - Max
- MBC - MBC
- MGM+ - MGM+
- mitele - mitele
- Movistar Plus+ - Movistar Plus+
- MTV - MTV
- M-Net - M-Net
- National Geographic - National Geographic
- NBC - NBC
- Netflix - Netflix
- Network 10 - Network 10
- NHK - NHK
- Nick - Nick
- Nick Jr - Nick Jr
- Nickelodeon - Nickelodeon
- Nicktoons - Nicktoons
- Nine Network - Nine Network
- Nippon TV - Nippon TV
- NRK1 - NRK1
- OCS City - OCS City
- OCS Max - OCS Max
- ORF - ORF
- Oxygen - Oxygen
- Pantaya - Pantaya
- Paramount Network - Paramount Network
- Paramount+ - Paramount+
- PBS - PBS
- PBS Kids - PBS Kids
- Peacock - Peacock
- Planète+ A&E - Planète+ A&E
- Prime Video - Prime Video
- Rai 1 - Rai 1
- Reelz - Reelz
- The Roku Channel - The Roku Channel
- RTÉ One - RTÉ One
- RTL - RTL
- RTL Télé - RTL Télé
- RTP1 - RTP1
- RÚV - RÚV
- S4C - S4C
- SAT.1 - SAT.1
- SBS - SBS
- Science - Science
- Shahid - Shahid
- Showcase - Showcase
- Showmax - Showmax
- Showtime - Showtime
- Shudder - Shudder
- Sky - Sky
- Smithsonian - Smithsonian
- Space - Space
- Spectrum - Spectrum
- Spike - Spike
- Stan - Stan
- Starz - Starz
- STAR+ - STAR+
- Sundance TV - Sundance TV
- SVT1 - SVT1
- Syfy - Syfy
- Syndication - Syndication
- TBS - TBS
- Telecinco - Telecinco
- Telefe - Telefe
- Telemundo - Telemundo
- Televisión de Galicia - Televisión de Galicia
- Televisión Pública Argentina - Televisión Pública Argentina
- Tencent Video - Tencent Video
- TF1 - TF1
- The CW - The CW
- The Roku Channel - The Roku Channel
- The WB - The WB
- TLC - TLC
- TNT - TNT
- Tokyo MX - Tokyo MX
- Travel Channel - Travel Channel
- truTV - truTV
- Turner Classic Movies - Turner Classic Movies
- TV 2 - TV 2
- tv asahi - tv asahi
- TV Globo - TV Globo
- TV Land - TV Land
- TV Tokyo - TV Tokyo
- TV3 - TV3
- TV4 - TV4
- TVB Jade - TVB Jade
- tving - tving
- tvN - tvN
- TVNZ 1 - TVNZ 1
- TVP1 - TVP1
- UKTV - UKTV
- UniMás - UniMás
- Universal Kids - Universal Kids
- Universal TV - Universal TV
- Univision - Univision
- UPN - UPN
- USA Network - USA Network
- VH1 - VH1
- Viaplay - Viaplay
- Vice - Vice
- Virgin Media One - Virgin Media One
- ViuTV - ViuTV
- ViX+ - ViX+
- VRT 1 - VRT 1
- VTM - VTM
- W - W
- WE tv - WE tv
- YLE - YLE
- Youku - Youku
- YouTube - YouTube
- ZDF - ZDF
- ZEE5 - ZEE5
```
### Default `addons`
```yaml
addons: addons:
ABC: ABC:

@ -10,17 +10,17 @@ These schedules do not trigger PMM to run; they control what PMM will do if it h
The scheduling options are: The scheduling options are:
| Name | Description | Format | Example | | Name | Description | Format | Example |
|:-------------|:-----------------------------------------------------------------------------------------------------------|:---------------------------------------------------|:-------------------------------------------------------------| |:-------------|:--------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------|:---------------------------------------------------------------------|
| Hourly | Update only when the script is run in that hour or hour range | hourly(Hour of Day)<br>hourly(Start Hour-End Hour) | `hourly(17)`<br>`hourly(17-04)` | | Hourly | Update only when the script is run in that hour or hour range | hourly(Hour of Day)<br>hourly(Start Hour-End Hour) | `hourly(17)`<br>`hourly(17-04)` |
| Daily | Update once a day | daily | `daily` | | Daily | Update once a day | daily | `daily` |
| Weekly | Update once a week on the specified days (For multiple days, use a bar-separated (<code>&#124;</code>) list)| weekly(Days of Week) | `weekly(sunday)`<br><code>weekly(sunday&#124;tuesday)</code> | | Weekly | Update once a week on the specified days (For multiple days, use a bar-separated (<code>&#124;</code>) list) | weekly(Days of Week) | `weekly(sunday)`<br><code>weekly(sunday&#124;tuesday)</code> |
| Monthly | Update once a month on the specified day | monthly(Day of Month) | `monthly(1)` | | Monthly | Update once a month on the specified day | monthly(Day of Month) | `monthly(1)` |
| Yearly | Update once a year on the specified day | yearly(MM/DD) | `yearly(01/30)` | | Yearly | Update once a year on the specified day | yearly(MM/DD) | `yearly(01/30)` |
| Range | Updates whenever the date is within the range (For mulitple ranges, use a bar-separated (`\|`) list) | range(MM/DD-MM/DD) | `range(12/01-12/31)`<br>`range(8/01-8/15\|9/01-9/15)` | | Range | Updates whenever the date is within the range (For mulitple ranges, use a bar-separated (<code>&#124;</code>) list) | range(MM/DD-MM/DD) | `range(12/01-12/31)`<br><code>range(8/01-8/15&#124;9/01-9/15)</code> |
| Never | Never updates | never | `never` | | Never | Never updates | never | `never` |
| Non Existing | Updates if it doesn't exist | non_existing | `non_existing` | | Non Existing | Updates if it doesn't exist | non_existing | `non_existing` |
| All | Requires that all comma separated scheduling options inside its brackets be meet in order to run | all[Options] | `all[weekly(sunday), hourly(17)]` | | All | Requires that all comma separated scheduling options inside its brackets be meet in order to run | all[Options] | `all[weekly(sunday), hourly(17)]` |
* `daily` is the default when `schedule` is not specified. * `daily` is the default when `schedule` is not specified.
* You can run the script multiple times per day but using the `--time` command line argument detailed on the [Run Commands & Environmental Variables Page](../../home/environmental.md#time-to-run). * You can run the script multiple times per day but using the `--time` command line argument detailed on the [Run Commands & Environmental Variables Page](../../home/environmental.md#time-to-run).

@ -464,7 +464,18 @@ class DataFile:
variables[f"{key}_encoded"] = util.quote(value) variables[f"{key}_encoded"] = util.quote(value)
default = {k: v for k, v in default.items() if k not in variables} default = {k: v for k, v in default.items() if k not in variables}
optional = [o for o in optional if o not in variables and o not in default] og_optional = optional
optional = []
for key in og_optional:
if "<<" in key and ">>" in key:
for k, v in variables.items():
if f"<<{k}>>" in key:
key = key.replace(f"<<{k}>>", v)
for k, v in default.items():
if f"<<{k}>>" in key:
key = key.replace(f"<<{k}>>", v)
if key not in variables and key not in default:
optional.append(key)
logger.trace("") logger.trace("")
logger.trace(f"Variables: {variables}") logger.trace(f"Variables: {variables}")
@ -499,8 +510,6 @@ class DataFile:
for i_check in range(8): for i_check in range(8):
for option in optional: for option in optional:
if option not in variables and f"<<{option}>>" in str(_data): if option not in variables and f"<<{option}>>" in str(_data):
if _debug:
logger.trace(f"Failed {_method}: {_data}")
raise Failed raise Failed
for variable, variable_data in variables.items(): for variable, variable_data in variables.items():
if (variable == "collection_name" or variable == "playlist_name") and _method in ["radarr_tag", "item_radarr_tag", "sonarr_tag", "item_sonarr_tag"]: if (variable == "collection_name" or variable == "playlist_name") and _method in ["radarr_tag", "item_radarr_tag", "sonarr_tag", "item_sonarr_tag"]:

@ -1,6 +1,7 @@
from json import JSONDecodeError from json import JSONDecodeError
from modules import util from modules import util
from modules.util import Failed from modules.util import Failed
from retrying import retry
logger = util.logger logger = util.logger
@ -13,17 +14,25 @@ class Notifiarr:
self.apikey = params["apikey"] self.apikey = params["apikey"]
self.header = {"X-API-Key": self.apikey} self.header = {"X-API-Key": self.apikey}
logger.secret(self.apikey) logger.secret(self.apikey)
response = self.config.get(f"{base_url}user/pmm/", headers=self.header, params={"fetch": "settings"}) try:
self.request(path="user", params={"fetch": "settings"})
except JSONDecodeError:
raise Failed("Notifiarr Error: Invalid response")
def notification(self, json):
return self.request(json=json)
@retry(stop_max_attempt_number=6, wait_fixed=10000, retry_on_exception=util.retry_if_not_failed)
def request(self, json=None, path="notification", params=None):
response = self.config.get(f"{base_url}{path}/pmm/", json=json, headers=self.header, params=params)
try: try:
response_json = response.json() response_json = response.json()
except JSONDecodeError as e: except JSONDecodeError as e:
logger.error(response.content)
logger.debug(e) logger.debug(e)
raise Failed("Notifiarr Error: Invalid response") raise e
if response.status_code >= 400 or ("result" in response_json and response_json["result"] == "error"): if response.status_code >= 400 or ("result" in response_json and response_json["result"] == "error"):
logger.debug(f"Response: {response_json}") logger.debug(f"Response: {response_json}")
raise Failed(f"({response.status_code} [{response.reason}]) {response_json}") raise Failed(f"({response.status_code} [{response.reason}]) {response_json}")
if not response_json["details"]["response"]: if not response_json["details"]["response"]:
raise Failed("Notifiarr Error: Invalid apikey") raise Failed("Notifiarr Error: Invalid apikey")
def notification(self, json):
return self.config.get(f"{base_url}notification/pmm/", json=json, headers=self.header)

@ -669,9 +669,9 @@ def schedule_check(attribute, data, current_time, run_hour, is_all=False):
except ValueError: except ValueError:
logger.error(f"Schedule Error: yearly {display} must be in the MM/DD format i.e. yearly(11/22)") logger.error(f"Schedule Error: yearly {display} must be in the MM/DD format i.e. yearly(11/22)")
elif run_time.startswith("range"): elif run_time.startswith("range"):
ok_ranges = param.lower().split("|") ranges = []
err = None range_pass = False
for ok_range in ok_ranges: for ok_range in param.lower().split("|"):
match = re.match("^(1[0-2]|0?[1-9])/(3[01]|[12][0-9]|0?[1-9])-(1[0-2]|0?[1-9])/(3[01]|[12][0-9]|0?[1-9])$", ok_range) match = re.match("^(1[0-2]|0?[1-9])/(3[01]|[12][0-9]|0?[1-9])-(1[0-2]|0?[1-9])/(3[01]|[12][0-9]|0?[1-9])$", ok_range)
if not match: if not match:
logger.error(f"Schedule Error: range {display} must be in the MM/DD-MM/DD format i.e. range(12/01-12/25)") logger.error(f"Schedule Error: range {display} must be in the MM/DD-MM/DD format i.e. range(12/01-12/25)")
@ -683,9 +683,13 @@ def schedule_check(attribute, data, current_time, run_hour, is_all=False):
start = datetime.strptime(f"{month_start}/{day_start}", "%m/%d") start = datetime.strptime(f"{month_start}/{day_start}", "%m/%d")
end = datetime.strptime(f"{month_end}/{day_end}", "%m/%d") end = datetime.strptime(f"{month_end}/{day_end}", "%m/%d")
range_collection = True range_collection = True
schedule_str += f"\nScheduled between {pretty_months[month_start]} {num2words(day_start, to='ordinal_num')} and {pretty_months[month_end]} {num2words(day_end, to='ordinal_num')}" ranges.append(f"{pretty_months[month_start]} {num2words(day_start, to='ordinal_num')} and {pretty_months[month_end]} {num2words(day_end, to='ordinal_num')}")
if start <= check <= end if start < end else (check <= end or check >= start): if start <= check <= end if start < end else (check <= end or check >= start):
all_check += 1 range_pass = True
if ranges:
schedule_str += f"\nScheduled {' or '.join(ranges)}"
if range_pass:
all_check += 1
else: else:
logger.error(f"Schedule Error: {display}") logger.error(f"Schedule Error: {display}")
if is_all: if is_all:

@ -3,7 +3,6 @@ from collections import Counter
from concurrent.futures import ProcessPoolExecutor from concurrent.futures import ProcessPoolExecutor
from datetime import datetime from datetime import datetime
from modules.logs import MyLogger from modules.logs import MyLogger
import importlib.metadata
if sys.version_info[0] != 3 or sys.version_info[1] < 8: if sys.version_info[0] != 3 or sys.version_info[1] < 8:
print("Version Error: Version: %s.%s.%s incompatible please use Python 3.8+" % (sys.version_info[0], sys.version_info[1], sys.version_info[2])) print("Version Error: Version: %s.%s.%s incompatible please use Python 3.8+" % (sys.version_info[0], sys.version_info[1], sys.version_info[2]))
@ -111,7 +110,6 @@ for arg_key, arg_data in arguments.items():
env_version = get_env("BRANCH_NAME", "master") env_version = get_env("BRANCH_NAME", "master")
is_docker = get_env("PMM_DOCKER", False, arg_bool=True) is_docker = get_env("PMM_DOCKER", False, arg_bool=True)
is_linuxserver = get_env("PMM_LINUXSERVER", False, arg_bool=True) is_linuxserver = get_env("PMM_LINUXSERVER", False, arg_bool=True)
plexapi_version = importlib.metadata.version('PlexAPI')
secret_args = {} secret_args = {}
plex_url = None plex_url = None
@ -240,7 +238,7 @@ def start(attrs):
new_version = latest_version[0] if latest_version and (version[1] != latest_version[1] or (version[2] and version[2] < latest_version[2])) else None new_version = latest_version[0] if latest_version and (version[1] != latest_version[1] or (version[2] and version[2] < latest_version[2])) else None
if new_version: if new_version:
logger.info(f" Newest Version: {new_version}") logger.info(f" Newest Version: {new_version}")
logger.info(f" PlexAPI library version: {plexapi_version}") logger.info(f" PlexAPI library version: {plexapi.VERSION}")
logger.info(f" Platform: {platform.platform()}") logger.info(f" Platform: {platform.platform()}")
logger.info(f" Memory: {round(psutil.virtual_memory().total / (1024.0 ** 3))} GB") logger.info(f" Memory: {round(psutil.virtual_memory().total / (1024.0 ** 3))} GB")
if "time" in attrs and attrs["time"]: start_type = f"{attrs['time']} " if "time" in attrs and attrs["time"]: start_type = f"{attrs['time']} "

@ -2,9 +2,9 @@ arrapi==1.4.3
GitPython==3.1.36 GitPython==3.1.36
lxml==4.9.3 lxml==4.9.3
num2words==0.5.12 num2words==0.5.12
pathvalidate==3.1.0 pathvalidate==3.2.0
pillow==10.0.0 pillow==10.0.1
PlexAPI==4.15.1 PlexAPI==4.15.2
psutil==5.9.5 psutil==5.9.5
python-dotenv==1.0.0 python-dotenv==1.0.0
requests==2.31.0 requests==2.31.0

Loading…
Cancel
Save