jellyfin-mpv-shim/run-desktop-edge.py

24 lines
795 B
Python
Raw Normal View History

#!/usr/bin/env python3
# Newer revisions of python-mpv require mpv-1.dll in the PATH.
import os
import sys
import multiprocessing
2020-08-22 15:38:07 +00:00
if sys.platform.startswith("win32") or sys.platform.startswith("cygwin"):
# Detect if bundled via pyinstaller.
# From: https://stackoverflow.com/questions/404744/
2020-08-22 15:38:07 +00:00
if getattr(sys, "frozen", False):
2020-08-22 19:00:24 +00:00
application_path = getattr(sys, "_MEIPASS")
else:
application_path = os.path.dirname(os.path.abspath(__file__))
os.environ["PATH"] = application_path + os.pathsep + os.environ["PATH"]
from jellyfin_mpv_shim.mpv_shim import main_desktop
2020-08-22 15:38:07 +00:00
if __name__ == "__main__":
# https://stackoverflow.com/questions/24944558/pyinstaller-built-windows-exe-fails-with-multiprocessing
multiprocessing.freeze_support()
2020-08-22 15:38:07 +00:00
main_desktop()