Add type annotations to methods that take timestamp parameter (#442)
Co-authored-by: Eugene Simonov <eugene.simonov@evergen.com.au> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
This commit is contained in:
parent
6f30559a3a
commit
b4c8dc7282
|
@ -529,25 +529,25 @@ class _Network:
|
||||||
|
|
||||||
def scrobble(
|
def scrobble(
|
||||||
self,
|
self,
|
||||||
artist,
|
artist: str,
|
||||||
title,
|
title: str,
|
||||||
timestamp,
|
timestamp: int,
|
||||||
album=None,
|
album: str | None = None,
|
||||||
album_artist=None,
|
album_artist: str | None = None,
|
||||||
track_number=None,
|
track_number: int | None = None,
|
||||||
duration=None,
|
duration: int | None = None,
|
||||||
stream_id=None,
|
stream_id: str | None = None,
|
||||||
context=None,
|
context: str | None = None,
|
||||||
mbid=None,
|
mbid: str | None = None,
|
||||||
):
|
):
|
||||||
"""Used to add a track-play to a user's profile.
|
"""Used to add a track-play to a user's profile.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
artist (Required) : The artist name.
|
artist (Required) : The artist name.
|
||||||
title (Required) : The track name.
|
title (Required) : The track name.
|
||||||
timestamp (Required) : The time the track started playing, in UNIX
|
timestamp (Required) : The time the track started playing, in Unix
|
||||||
timestamp format (integer number of seconds since 00:00:00,
|
timestamp format (integer number of seconds since 00:00:00,
|
||||||
January 1st 1970 UTC). This must be in the UTC time zone.
|
January 1st 1970 UTC).
|
||||||
album (Optional) : The album name.
|
album (Optional) : The album name.
|
||||||
album_artist (Optional) : The album artist - if this differs from
|
album_artist (Optional) : The album artist - if this differs from
|
||||||
the track artist.
|
the track artist.
|
||||||
|
@ -2295,8 +2295,8 @@ class User(_Chartable):
|
||||||
self,
|
self,
|
||||||
limit: int = 10,
|
limit: int = 10,
|
||||||
cacheable: bool = True,
|
cacheable: bool = True,
|
||||||
time_from=None,
|
time_from: int | None = None,
|
||||||
time_to=None,
|
time_to: int | None = None,
|
||||||
stream: bool = False,
|
stream: bool = False,
|
||||||
now_playing: bool = False,
|
now_playing: bool = False,
|
||||||
):
|
):
|
||||||
|
@ -2307,13 +2307,11 @@ class User(_Chartable):
|
||||||
Parameters:
|
Parameters:
|
||||||
limit : If None, it will try to pull all the available data.
|
limit : If None, it will try to pull all the available data.
|
||||||
from (Optional) : Beginning timestamp of a range - only display
|
from (Optional) : Beginning timestamp of a range - only display
|
||||||
scrobbles after this time, in UNIX timestamp format (integer
|
scrobbles after this time, in Unix timestamp format (integer
|
||||||
number of seconds since 00:00:00, January 1st 1970 UTC). This
|
number of seconds since 00:00:00, January 1st 1970 UTC).
|
||||||
must be in the UTC time zone.
|
|
||||||
to (Optional) : End timestamp of a range - only display scrobbles
|
to (Optional) : End timestamp of a range - only display scrobbles
|
||||||
before this time, in UNIX timestamp format (integer number of
|
before this time, in Unix timestamp format (integer number of
|
||||||
seconds since 00:00:00, January 1st 1970 UTC). This must be in
|
seconds since 00:00:00, January 1st 1970 UTC).
|
||||||
the UTC time zone.
|
|
||||||
stream: If True, it will yield tracks as soon as a page has been retrieved.
|
stream: If True, it will yield tracks as soon as a page has been retrieved.
|
||||||
|
|
||||||
This method uses caching. Enable caching only if you're pulling a
|
This method uses caching. Enable caching only if you're pulling a
|
||||||
|
@ -2382,7 +2380,7 @@ class User(_Chartable):
|
||||||
return _extract(doc, "registered")
|
return _extract(doc, "registered")
|
||||||
|
|
||||||
def get_unixtime_registered(self):
|
def get_unixtime_registered(self):
|
||||||
"""Returns the user's registration date as a UNIX timestamp."""
|
"""Returns the user's registration date as a Unix timestamp."""
|
||||||
|
|
||||||
doc = self._request(self.ws_prefix + ".getInfo", True)
|
doc = self._request(self.ws_prefix + ".getInfo", True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue