platypush/plugins/music/spotify/__init__.py
def history(self, limit: int = 20, before: Optional[Union[datetime, str, int]] = None,
                after: Optional[Union[datetime, str, int]] = None):
        """
        Get a list of recently played track on the account.

        :param limit: Maximum number of tracks to be retrieved (default: 20, max: 50).
        :param before: Retrieve only the tracks played before this timestamp, specified as a UNIX timestamp, a datetime
            object or an ISO datetime string. If ``before`` is set then ``after`` cannot be set.
        :param after: Retrieve only the tracks played after this timestamp, specified as a UNIX timestamp, a datetime
            object or an ISO datetime string. If ``after`` is set then ``before`` cannot be set.
        :return:
        """
        before = self._parse_datetime(before)
        after = self._parse_datetime(after)
        assert not (before and after), 'before and after cannot both be set'

        results = self._spotify_paginate_results('/v1/me/player/recently-played',
                                                 limit=limit,
                                                 params={
                                                     'limit': min(limit, 50),
                                                     **({'before': before} if before else {}),
                                                     **({'after': after} if after else {}),
                                                 })

        return SpotifyHistoryItemSchema().dump([
            {
                **item.pop('track'),
                **item,
            }
            for item in results
        ], many=True)

        Get a list of recently played track on the account.

        :param limit: Maximum number of tracks to be retrieved (default: 20, max: 50).
        :param before: Retrieve only the tracks played before this timestamp, specified as a UNIX timestamp, a datetime
            object or an ISO datetime string. If ``before`` is set then ``after`` cannot be set.
        :param after: Retrieve only the tracks played after this timestamp, specified as a UNIX timestamp, a datetime
            object or an ISO datetime string. If ``after`` is set then ``before`` cannot be set.
        :return:
        
Get a list of recently played track on the account.
Get a list of recently played track on the account .
def history(self, limit: int = 20, before: Optional[Union[datetime, str, int]] = None,
                after: Optional[Union[datetime, str, int]] = None):
        before = self._parse_datetime(before)
        after = self._parse_datetime(after)
        assert not (before and after), 'before and after cannot both be set'
        results = self._spotify_paginate_results('/v1/me/player/recently-played',
                                                 limit=limit,
                                                 params={
                                                     'limit': min(limit, 50),
                                                     **({'before': before} if before else {}),
                                                     **({'after': after} if after else {}),
                                                 })
        return SpotifyHistoryItemSchema().dump([
            {
                **item.pop('track'),
                **item,
            }
            for item in results
        ], many=True)
def history ( self , limit : int = 20 , before : Optional [ Union [ datetime , str , int ] ] = None , after : Optional [ Union [ datetime , str , int ] ] = None ) : before = self . _parse_datetime ( before ) after = self . _parse_datetime ( after ) assert not ( before and after ) , 'before and after cannot both be set' results = self . _spotify_paginate_results ( '/v1/me/player/recently-played' , limit = limit , params = { 'limit' : min ( limit , 50 ) , ** ( { 'before' : before } if before else { } ) , ** ( { 'after' : after } if after else { } ) , } ) return SpotifyHistoryItemSchema ( ) . dump ( [ { ** item . pop ( 'track' ) , ** item , } for item in results ] , many = True )
Get a list of recently played track on the account.
Get a list of recently played track on the account .
"""
        Get a list of recently played track on the account.

        :param limit: Maximum number of tracks to be retrieved (default: 20, max: 50).
        :param before: Retrieve only the tracks played before this timestamp, specified as a UNIX timestamp, a datetime
            object or an ISO datetime string. If ``before`` is set then ``after`` cannot be set.
        :param after: Retrieve only the tracks played after this timestamp, specified as a UNIX timestamp, a datetime
            object or an ISO datetime string. If ``after`` is set then ``before`` cannot be set.
        :return:
        """
None
self
limit
int
Maximum number of tracks to be retrieved (default: 20, max: 50).
Maximum number of tracks to be retrieved ( default : 20 max : 50 ) .
before
Optional[Union[datetime, str, int]]
Retrieve only the tracks played before this timestamp, specified as a UNIX timestamp, a datetime
object or an ISO datetime string. If ``before`` is set then ``after`` cannot be set.
Retrieve only the tracks played before this timestamp specified as a UNIX timestamp a datetime object or an ISO datetime string . If ` ` before ` ` is set then ` ` after ` ` cannot be set .
after
Optional[Union[datetime, str, int]]
Retrieve only the tracks played after this timestamp, specified as a UNIX timestamp, a datetime
object or an ISO datetime string. If ``after`` is set then ``before`` cannot be set.
Retrieve only the tracks played after this timestamp specified as a UNIX timestamp a datetime object or an ISO datetime string . If ` ` after ` ` is set then ` ` before ` ` cannot be set .