Exemple #1
0
    def construct(cls, client, media, item, keys=None, **kwargs):
        if keys is None:
            _, keys = cls.get_ids(media, item)

        if media == 'movie':
            return Movie._construct(client, keys, item, **kwargs)

        if media == 'show':
            return Show._construct(client, keys, item, **kwargs)

        if media == 'season':
            return Season._construct(client, keys, item, **kwargs)

        if media == 'episode':
            return Episode._construct(client, keys, item, **kwargs)

        if media == 'comment':
            return Comment._construct(client, keys, item, **kwargs)

        if media == 'custom_list':
            return CustomList._construct(client, keys, item, **kwargs)

        if media == 'person':
            return Person._construct(client, keys, item, **kwargs)

        if media == 'watched_progress':
            return WatchedProgress._construct(client, item, **kwargs)

        if media == 'collection_progress':
            return CollectionProgress._construct(client, item, **kwargs)

        raise ValueError('Unknown media type provided')
Exemple #2
0
    def construct(cls, client, media, item, keys=None, **kwargs):
        if keys is None:
            _, keys = cls.get_ids(media, item)

        if media == 'movie':
            return Movie._construct(client, keys, item, **kwargs)

        if media == 'show':
            return Show._construct(client, keys, item, **kwargs)

        if media == 'season':
            return Season._construct(client, keys, item, **kwargs)

        if media == 'episode':
            return Episode._construct(client, keys, item, **kwargs)

        if media == 'person':
            return Person._construct(client, keys, item, **kwargs)

        if media == 'comment':
            return Comment._construct(client, keys, item, **kwargs)

        if media == 'custom_list':
            return CustomList._construct(client, keys, item, **kwargs)

        raise ValueError('Unknown media type provided')
Exemple #3
0
    def create(cls, media, item, keys=None, **kwargs):
        if keys is None:
            pk, keys = cls.get_ids(media, item)
        else:
            pk = keys[0]

        if media == 'show':
            return Show.create(keys, item, **kwargs)

        if media == 'movie':
            return Movie.create(keys, item, **kwargs)

        if media == 'episode':
            return Episode.create(pk, **kwargs)

        raise ValueError('Unknown media type provided')
    def create(cls, media, item, keys=None, **kwargs):
        if keys is None:
            pk, keys = cls.get_keys(media, item)
        else:
            pk = keys[0]

        if media == 'shows':
            return Show.create(keys, item, **kwargs)

        if media == 'movies':
            return Movie.create(keys, item, **kwargs)

        if media == 'episodes':
            return Episode.create(pk, **kwargs)

        raise ValueError('Unknown media type provided')
    def create(cls, media, item, keys=None, **kwargs):
        if keys is None:
            _, keys = cls.get_ids(media, item)

        if media == 'movie':
            return Movie.create(keys, item, **kwargs)

        if media == 'show':
            return Show.create(keys, item, **kwargs)

        if media == 'season':
            return Season.create(keys, item, **kwargs)

        if media == 'episode':
            return Episode.create(keys, item, **kwargs)

        raise ValueError('Unknown media type provided')
Exemple #6
0
    def construct(cls, client, media, item, keys=None, **kwargs):
        if keys is None:
            _, keys = cls.get_ids(media, item)

        if media == 'movie':
            return Movie._construct(client, keys, item, **kwargs)

        if media == 'show':
            return Show._construct(client, keys, item, **kwargs)

        if media == 'season':
            return Season._construct(client, keys, item, **kwargs)

        if media == 'episode':
            return Episode._construct(client, keys, item, **kwargs)

        if media == 'custom_list':
            return CustomList._construct(client, keys, item, **kwargs)

        raise ValueError('Unknown media type provided')