Skip to content

Commit 6f40e33

Browse files
committed
Use explicit default limits for various favorite endpoints. Fix comments
1 parent 29d5153 commit 6f40e33

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

tidalapi/user.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ def public_playlists(
167167
) -> List[Union["Playlist", "UserPlaylist"]]:
168168
"""Get the (public) playlists created by the user.
169169
170-
:param limit: The index of the first item you want included.
171-
:param offset: The amount of items you want returned.
170+
:param limit: The number of items you want returned.
171+
:param offset: The index of the first item you want included.
172172
:return: List of public playlists.
173173
"""
174174
params = {"limit": limit, "offset": offset}
@@ -564,14 +564,14 @@ def artists_paginated(
564564

565565
def artists(
566566
self,
567-
limit: Optional[int] = None,
567+
limit: int = 50,
568568
offset: int = 0,
569569
order: Optional[ArtistOrder] = None,
570570
order_direction: Optional[OrderDirection] = None,
571571
) -> List["Artist"]:
572572
"""Get the users favorite artists.
573573
574-
:param limit: Optional; The amount of artists you want returned.
574+
:param limit: The number of artist you want returned.
575575
:param offset: The index of the first artist you want included.
576576
:param order: Optional; A :class:`ArtistOrder` describing the ordering type when returning the user favorite artists. eg.: "NAME, "DATE"
577577
:param order_direction: Optional; A :class:`OrderDirection` describing the ordering direction when sorting by `order`. eg.: "ASC", "DESC"
@@ -625,14 +625,14 @@ def albums_paginated(
625625

626626
def albums(
627627
self,
628-
limit: Optional[int] = None,
628+
limit: int = 50,
629629
offset: int = 0,
630630
order: Optional[AlbumOrder] = None,
631631
order_direction: Optional[OrderDirection] = None,
632632
) -> List["Album"]:
633633
"""Get the users favorite albums.
634634
635-
:param limit: Optional; The amount of albums you want returned.
635+
:param limit: The number of albums you want returned.
636636
:param offset: The index of the first album you want included.
637637
:param order: Optional; A :class:`AlbumOrder` describing the ordering type when returning the user favorite albums. eg.: "NAME, "DATE"
638638
:param order_direction: Optional; A :class:`OrderDirection` describing the ordering direction when sorting by `order`. eg.: "ASC", "DESC"
@@ -684,15 +684,15 @@ def playlists_paginated(
684684

685685
def playlists(
686686
self,
687-
limit: Optional[int] = 50,
687+
limit: int = 50,
688688
offset: int = 0,
689689
order: Optional[PlaylistOrder] = None,
690690
order_direction: Optional[OrderDirection] = None,
691691
) -> List["Playlist"]:
692692
"""Get the users favorite playlists (v2 endpoint), relative to the root folder
693693
This function is limited to 50 by TIDAL, requiring pagination.
694694
695-
:param limit: Optional; The number of playlists you want returned (Note: Cannot exceed 50)
695+
:param limit: The number of playlists you want returned (Note: Cannot exceed 50)
696696
:param offset: The index of the first playlist to fetch
697697
:param order: Optional; A :class:`PlaylistOrder` describing the ordering type when returning the user favorite playlists. eg.: "NAME, "DATE"
698698
:param order_direction: Optional; A :class:`OrderDirection` describing the ordering direction when sorting by `order`. eg.: "ASC", "DESC"
@@ -728,15 +728,15 @@ def playlists(
728728

729729
def playlist_folders(
730730
self,
731-
limit: Optional[int] = 50,
731+
limit: int = 50,
732732
offset: int = 0,
733733
order: Optional[PlaylistOrder] = None,
734734
order_direction: Optional[OrderDirection] = None,
735735
parent_folder_id: str = "root",
736736
) -> List["Folder"]:
737737
"""Get a list of folders created by the user.
738738
739-
:param limit: Optional; The number of playlists you want returned (Note: Cannot exceed 50)
739+
:param limit: The number of playlists you want returned (Note: Cannot exceed 50)
740740
:param offset: The index of the first playlist folder to fetch
741741
:param order: Optional; A :class:`PlaylistOrder` describing the ordering type when returning the user favorite playlists. eg.: "NAME, "DATE"
742742
:param order_direction: Optional; A :class:`OrderDirection` describing the ordering direction when sorting by `order`. eg.: "ASC", "DESC"
@@ -797,7 +797,7 @@ def tracks_paginated(
797797
798798
:param order: Optional; A :class:`ItemOrder` describing the ordering type when returning the user favorite tracks. eg.: "NAME, "DATE"
799799
:param order_direction: Optional; A :class:`OrderDirection` describing the ordering direction when sorting by `order`. eg.: "ASC", "DESC"
800-
:return: A :class:`list` :class:`~tidalapi.playlist.Playlist` objects containing the favorite tracks.
800+
:return: A :class:`list` :class:`~tidalapi.media.Track` objects containing the favorite tracks.
801801
"""
802802
count = self.session.user.favorites.get_tracks_count()
803803
return get_items(
@@ -806,15 +806,15 @@ def tracks_paginated(
806806

807807
def tracks(
808808
self,
809-
limit: Optional[int] = None,
809+
limit: int = 50,
810810
offset: int = 0,
811811
order: Optional[ItemOrder] = None,
812812
order_direction: Optional[OrderDirection] = None,
813813
) -> List["Track"]:
814814
"""Get the users favorite tracks.
815815
816-
:param limit: Optional; The amount of items you want returned.
817-
:param offset: The index of the first item you want included.
816+
:param limit: The number of tracks you want returned.
817+
:param offset: The index of the first track you want included.
818818
:param order: Optional; A :class:`ItemOrder` describing the ordering type when returning the user favorite tracks. eg.: "NAME, "DATE"
819819
:param order_direction: Optional; A :class:`OrderDirection` describing the ordering direction when sorting by `order`. eg.: "ASC", "DESC"
820820
:return: A :class:`list` of :class:`~tidalapi.media.Track` objects containing all of the favorite tracks.
@@ -849,14 +849,14 @@ def get_tracks_count(
849849

850850
def videos(
851851
self,
852-
limit: Optional[int] = None,
852+
limit: int = 50,
853853
offset: int = 0,
854854
order: Optional[VideoOrder] = None,
855855
order_direction: Optional[OrderDirection] = None,
856856
) -> List["Video"]:
857857
"""Get the users favorite videos.
858858
859-
:param limit: Optional; The amount of videos you want returned.
859+
:param limit: The number of videos you want returned.
860860
:param offset: The index of the first video you want included.
861861
:param order: Optional; A :class:`VideoOrder` describing the ordering type when returning the user favorite videos. eg.: "NAME, "DATE"
862862
:param order_direction: Optional; A :class:`OrderDirection` describing the ordering direction when sorting by `order`. eg.: "ASC", "DESC"
@@ -879,14 +879,14 @@ def videos(
879879

880880
def mixes(
881881
self,
882-
limit: Optional[int] = 50,
882+
limit: int = 50,
883883
offset: int = 0,
884884
order: Optional[MixOrder] = None,
885885
order_direction: Optional[OrderDirection] = None,
886886
) -> List["MixV2"]:
887887
"""Get the users favorite mixes & radio.
888888
889-
:param limit: Optional; The amount of mixes you want returned.
889+
:param limit: The number of mixes you want returned.
890890
:param offset: The index of the first mix you want included.
891891
:param order: Optional; A :class:`MixOrder` describing the ordering type when returning the user favorite mixes. eg.: "NAME, "DATE"
892892
:param order_direction: Optional; A :class:`OrderDirection` describing the ordering direction when sorting by `order`. eg.: "ASC", "DESC"

0 commit comments

Comments
 (0)