plex-prerolls/modules/statics.py
nwithan8 1616d91ebe - Rewrite nearly the whole thing for better parsing, support, readability, etc. (OOP forever!)
- Consolidate Plex API config with schedules, now in config.yaml
- Changes to schema for schedules
- No more priority of, e.g. date_range over monthly
- No more default
- `misc` reworked to `always`
- Update Docker files
- Update README
- Delete old files, linting stuff (screw mypy)
2023-12-08 17:50:12 -07:00

43 lines
941 B
Python

# Number 1-9, and A-Z
import enum
import subprocess
import sys
VERSION = "VERSIONADDEDBYGITHUB"
COPYRIGHT = "Copyright © YEARADDEDBYGITHUB Nate Harris. All rights reserved."
ASCII_ART = """
"""
def splash_logo() -> str:
version = VERSION
if "GITHUB" in version:
try:
last_commit = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("utf-8").strip()
version = f"git-{last_commit[:7]}"
except subprocess.SubprocessError:
version = "git-unknown-commit"
return f"""
{ASCII_ART}
Version {version}, Python {sys.version}
{COPYRIGHT}
"""
class ScheduleType(enum.Enum):
monthly = "monthly"
weekly = "weekly"
date_range = "date_range"
always = "always"
def schedule_types() -> list[str]:
"""Return a list of Schedule Types
Returns:
List[ScheduleType]: List of Schedule Types
"""
return [_enum.value for _enum in ScheduleType]