summaryrefslogtreecommitdiff
path: root/src/server/__main__.py
blob: 77bb42a7566770087a021b211fc2385ece8eacf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import argparse
from platformdirs import user_config_dir
from pathlib import Path

from .flaskapi import app, socketio
from .settings import Config
from .manager import PixMan


def main():
    config_dir = Path(user_config_dir("immich-frame"))
    config_file = config_dir / "config.json"

    p = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    p.add_argument("--fullscreen", help="start viewer window in fullscreen", action="store_true")
    p.add_argument("--config", type=str, help="set config file path", default=config_file)
    p.add_argument("--host", type=str, help="set web interface host", default="0.0.0.0")
    p.add_argument("--port", type=int, help="set web interface port", default=8080)
    args = p.parse_args()

    PixMan.initialize(args, app, socketio)


if __name__ == "__main__":
    main()