Skip to content

Commit 157b1b4

Browse files
committed
Fixed formatting
1 parent cc1ce83 commit 157b1b4

File tree

6 files changed

+30
-54
lines changed

6 files changed

+30
-54
lines changed

tidalapi/album.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ def parse(
126126

127127
@property
128128
def year(self) -> Optional[int]:
129-
"""
130-
Convenience function to get the year using :class:`available_release_date`
129+
"""Convenience function to get the year using :class:`available_release_date`
131130
132131
:return: An :any:`python:int` containing the year the track was released
133132
"""
@@ -138,9 +137,8 @@ def available_release_date(self) -> Optional[datetime]:
138137
"""Get the release date if it's available, otherwise get the day it was released
139138
on TIDAL.
140139
141-
:return: A
142-
:any:`python:datetime.datetime` object with the release date, or the tidal
143-
release date, can be None
140+
:return: A :any:`python:datetime.datetime` object with the release date, or the
141+
tidal release date, can be None
144142
"""
145143
if self.release_date:
146144
return self.release_date
@@ -153,8 +151,7 @@ def tracks(self, limit: Optional[int] = None, offset: int = 0) -> List["Track"]:
153151
154152
:param limit: The amount of items you want returned.
155153
:param offset: The position of the first item you want to include.
156-
:return: A list of the
157-
:class:`Tracks <.Track>` in the album.
154+
:return: A list of the :class:`Tracks <.Track>` in the album.
158155
"""
159156
params = {"limit": limit, "offset": offset}
160157
tracks = self.requests.map_request(

tidalapi/artist.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ def parse_artists(self, json_obj) -> List["Artist"]:
7676
inside of the python tidalapi module.
7777
7878
:param json_obj: Json data returned from api.tidal.com containing an artist
79-
:return: Returns a copy of the original
80-
:exc: 'Artist': object
79+
:return: Returns a copy of the original :exc: 'Artist': object
8180
"""
8281
return list(map(self.parse_artist, json_obj))
8382

@@ -89,35 +88,31 @@ def _get_albums(self, params=None):
8988
def get_albums(self, limit=None, offset=0):
9089
"""Queries TIDAL for the artists albums.
9190
92-
:return: A list of
93-
:class:`Albums<tidalapi.album.Album>`
91+
:return: A list of :class:`Albums<tidalapi.album.Album>`
9492
"""
9593
params = {"limit": limit, "offset": offset}
9694
return self._get_albums(params)
9795

9896
def get_albums_ep_singles(self, limit=None, offset=0):
9997
"""Queries TIDAL for the artists extended plays and singles.
10098
101-
:return: A list of
102-
:class:`Albums <tidalapi.album.Album>`
99+
:return: A list of :class:`Albums <tidalapi.album.Album>`
103100
"""
104101
params = {"filter": "EPSANDSINGLES", "limit": limit, "offset": offset}
105102
return self._get_albums(params)
106103

107104
def get_albums_other(self, limit=None, offset=0):
108105
"""Queries TIDAL for albums the artist has appeared on as a featured artist.
109106
110-
:return: A list of
111-
:class:`Albums <tidalapi.album.Album>`
107+
:return: A list of :class:`Albums <tidalapi.album.Album>`
112108
"""
113109
params = {"filter": "COMPILATIONS", "limit": limit, "offset": offset}
114110
return self._get_albums(params)
115111

116112
def get_top_tracks(self, limit=None, offset=0):
117113
"""Queries TIDAL for the artists tracks, sorted by popularity.
118114
119-
:return: A list of
120-
:class:`Tracks <tidalapi.media.Track>`
115+
:return: A list of :class:`Tracks <tidalapi.media.Track>`
121116
"""
122117
params = {"limit": limit, "offset": offset}
123118
return self.request.map_request(
@@ -129,8 +124,7 @@ def get_top_tracks(self, limit=None, offset=0):
129124
def get_videos(self, limit=None, offset=0):
130125
"""Queries tidal for the artists videos.
131126
132-
:return: A list of
133-
:class:`Videos <tidalapi.media.Video>`
127+
:return: A list of :class:`Videos <tidalapi.media.Video>`
134128
"""
135129
params = {"limit": limit, "offset": offset}
136130
return self.request.map_request(
@@ -149,8 +143,7 @@ def get_bio(self):
149143
def get_similar(self):
150144
"""Queries TIDAL for similar artists.
151145
152-
:return: A list of
153-
:class:`Artists <tidalapi.artist.Artist>`
146+
:return: A list of :class:`Artists <tidalapi.artist.Artist>`
154147
"""
155148
return self.request.map_request(
156149
"artists/%s/similar" % self.id, parse=self.parse_artist
@@ -160,8 +153,7 @@ def get_radio(self):
160153
"""Queries TIDAL for the artist radio, which is a mix of tracks that are similar
161154
to what the artist makes.
162155
163-
:return: A list of
164-
:class:`Tracks <tidalapi.media.Track>`
156+
:return: A list of :class:`Tracks <tidalapi.media.Track>`
165157
"""
166158
params = {"limit": 100}
167159
return self.request.map_request(

tidalapi/media.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,13 @@ class VideoQuality(Enum):
5050

5151

5252
class Media:
53-
"""
54-
Base class for generic media, specifically :class:`Track` and :class:`Video`
53+
"""Base class for generic media, specifically :class:`Track` and :class:`Video`
5554
5655
This class includes data used by both of the subclasses, and a function to parse
5756
both of them.
5857
59-
The date_added attribute is only relevant for playlists.
60-
For the release date of the actual media, use the release date of the album.
58+
The date_added attribute is only relevant for playlists. For the release date of the
59+
actual media, use the release date of the album.
6160
"""
6261

6362
id = None
@@ -218,8 +217,7 @@ def get_track_radio(self) -> List["Track"]:
218217
"""Queries TIDAL for the track radio, which is a mix of tracks that are similar
219218
to this track.
220219
221-
:return: A list of
222-
:class:`Tracks <tidalapi.media.Track>`
220+
:return: A list of :class:`Tracks <tidalapi.media.Track>`
223221
"""
224222
params = {"limit": 100}
225223
tracks = self.requests.map_request(

tidalapi/mix.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def get(self, mix_id: Optional[str] = None) -> "Mix":
9797
return self
9898

9999
def parse(self, json_obj: JsonObj) -> "Mix":
100-
"""Parse a mix into a :class:`Mix`, replaces the calling object
100+
"""Parse a mix into a :class:`Mix`, replaces the calling object.
101101
102102
:param json_obj: The json of a mix to be parsed
103103
:return: A copy of the parsed mix
@@ -119,8 +119,8 @@ def parse(self, json_obj: JsonObj) -> "Mix":
119119
return copy.copy(self)
120120

121121
def items(self) -> List[Union["Video", "Track"]]:
122-
"""
123-
Returns all the items in the mix, retrieves them with :class:`get` as well if not already done
122+
"""Returns all the items in the mix, retrieves them with :class:`get` as well if
123+
not already done.
124124
125125
:return: A :class:`list` of videos and/or tracks from the mix
126126
"""

tidalapi/page.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ def parse(self, json_obj):
159159
return category.parse(json_obj)
160160

161161
def show_more(self):
162-
"""
163-
Get the full list of items on their own :class:`.Page` from a :class:`.PageCategory`
162+
"""Get the full list of items on their own :class:`.Page` from a
163+
:class:`.PageCategory`
164164
165165
:return: A :class:`.Page` more of the items in the category, None if there aren't any
166166
"""
@@ -196,9 +196,7 @@ def parse(self, json_obj):
196196

197197

198198
class PageLinks(PageCategory):
199-
"""
200-
A list of :class:`.PageLink` to other parts of TIDAL
201-
"""
199+
"""A list of :class:`.PageLink` to other parts of TIDAL."""
202200

203201
items: Optional[list["PageLink"]] = None
204202

@@ -257,9 +255,7 @@ def parse(self, json_obj):
257255

258256

259257
class PageLink(object):
260-
"""
261-
A Link to another :class:`.Page` on TIDAL, Call get() to retrieve the Page
262-
"""
258+
"""A Link to another :class:`.Page` on TIDAL, Call get() to retrieve the Page."""
263259

264260
title = None
265261
icon = None
@@ -275,10 +271,8 @@ def __init__(self, session: "tidalapi.session.Session", json_obj):
275271
self.image_id = json_obj["imageId"]
276272

277273
def get(self):
278-
"""
279-
Requests the linked page from TIDAL
280-
:return: A :class:`Page` at the api_path
281-
"""
274+
"""Requests the linked page from TIDAL :return: A :class:`Page` at the
275+
api_path."""
282276
return self.request.map_request(
283277
self.api_path,
284278
params={"deviceType": "DESKTOP"},
@@ -287,9 +281,8 @@ def get(self):
287281

288282

289283
class PageItem(object):
290-
"""
291-
An Item from a :class:`.PageCategory` from the /pages endpoint, call get() to retrieve the actual item
292-
"""
284+
"""An Item from a :class:`.PageCategory` from the /pages endpoint, call get() to
285+
retrieve the actual item."""
293286

294287
header = ""
295288
short_header = ""

tidalapi/playlist.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ def parse(self, json_obj):
6565
"""Parses a playlist from tidal, replaces the current playlist object.
6666
6767
:param json_obj: Json data returned from api.tidal.com containing a playlist
68-
:return: Returns a copy of the original
69-
:exc: 'Playlist': object
68+
:return: Returns a copy of the original :exc: 'Playlist': object
7069
"""
7170
self.id = json_obj["uuid"]
7271
self.name = json_obj["title"]
@@ -128,8 +127,7 @@ def tracks(self, limit: Optional[int] = None, offset=0) -> List[tidalapi.Track]:
128127
129128
:param limit: The amount of items you want returned.
130129
:param offset: The index of the first item you want included.
131-
:return: A list of
132-
:class:`Tracks <.Track>`
130+
:return: A list of :class:`Tracks <.Track>`
133131
"""
134132
params = {"limit": limit, "offset": offset}
135133
request = self.requests.request(
@@ -145,9 +143,7 @@ def items(self, limit=100, offset=0):
145143
146144
:param limit: The amount of items you want, up to 100.
147145
:param offset: The index of the first item you want returned
148-
:return: A list of
149-
:class:`Tracks<.Track>` and
150-
:class:`Videos<.Video>`
146+
:return: A list of :class:`Tracks<.Track>` and :class:`Videos<.Video>`
151147
"""
152148
params = {"limit": limit, "offset": offset}
153149
request = self.requests.request(

0 commit comments

Comments
 (0)