mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-22 03:33:08 +00:00
fix(scripts): offset butler tasks to reduce ci random failures (#1320)
* fix(scripts): offset butler tasks to reduce ci random failures * Apply suggestions from code review Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> --------- Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
This commit is contained in:
parent
768aa58c90
commit
097b989fab
1 changed files with 19 additions and 0 deletions
|
@ -11,6 +11,7 @@ python plex-bootraptest.py --no-docker --server-name name_of_server --account He
|
|||
|
||||
"""
|
||||
import argparse
|
||||
from datetime import datetime
|
||||
import os
|
||||
import shutil
|
||||
import socket
|
||||
|
@ -506,6 +507,24 @@ if __name__ == "__main__": # noqa: C901
|
|||
server.settings.get("GenerateBIFBehavior").set("never")
|
||||
server.settings.get("GenerateChapterThumbBehavior").set("never")
|
||||
server.settings.get("LoudnessAnalysisBehavior").set("never")
|
||||
|
||||
# disable butler tasks
|
||||
current_hour = datetime.now().hour
|
||||
start_hour = (current_hour + 12) % 24
|
||||
end_hour = (current_hour + 15) % 24
|
||||
server.settings.get("ButlerStartHour").set(start_hour)
|
||||
server.settings.get("ButlerEndHour").set(end_hour)
|
||||
|
||||
# find all butler settings
|
||||
for setting in server.settings.all():
|
||||
if setting.id.lower().startswith("butler") and isinstance(setting.value, bool):
|
||||
try:
|
||||
setting.set(False)
|
||||
print("Disabled setting '{}'".format(setting))
|
||||
except NotFound:
|
||||
print("Setting '{}' not found".format(setting))
|
||||
|
||||
# save settings
|
||||
server.settings.save()
|
||||
|
||||
sections = []
|
||||
|
|
Loading…
Reference in a new issue