Add make() helper
import json
from os.path import dirname, join as join_path
+from typing import Union
+
+from trakt.tv import TVShow
from plex_trakt_sync.decorators import memoize
@@ -12,6 +15,12 @@ def load_mock(name: str):
return json.load(f)
+def make(cls=None, **kwargs) -> Union[TVShow]:
+ cls = cls if cls is not None else "object"
+ # https://stackoverflow.com/a/2827726/2314626
+ return type(cls, (object,), kwargs)
+
+
@memoize
def get_trakt_api():
from plex_trakt_sync.trakt_api import TraktApi
