Skip to content

Commit 952abc4

Browse files
committed
Fix formatting. Removed redundant method
1 parent 523dec1 commit 952abc4

File tree

4 files changed

+17
-29
lines changed

4 files changed

+17
-29
lines changed

tests/test_playlist.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import tidalapi
2626
from tidalapi.exceptions import ObjectNotFound
27+
2728
from .cover import verify_image_cover, verify_image_resolution
2829

2930

tidalapi/playlist.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,7 @@ def parse(self, json_obj: JsonObj) -> "Folder":
338338
return copy.copy(self)
339339

340340
def rename(self, name: str) -> bool:
341-
"""
342-
Rename the selected folder
341+
"""Rename the selected folder.
343342
344343
:param name: The name to be used for the folder
345344
:return: True, if operation was successful.
@@ -356,8 +355,7 @@ def rename(self, name: str) -> bool:
356355
return res.ok
357356

358357
def remove(self) -> bool:
359-
"""
360-
Remove the selected folder
358+
"""Remove the selected folder.
361359
362360
:return: True, if operation was successful.
363361
"""
@@ -373,8 +371,7 @@ def remove(self) -> bool:
373371
def items(
374372
self, offset: int = 0, limit: int = 50
375373
) -> List[Union["Playlist", "UserPlaylist"]]:
376-
"""
377-
Return the items in the folder
374+
"""Return the items in the folder.
378375
379376
:param offset: Optional; The index of the first item to be returned. Default: 0
380377
:param limit: Optional; The amount of items you want returned. Default: 50
@@ -405,26 +402,23 @@ def items(
405402
return []
406403

407404
def add_items(self, trns: [str]):
408-
"""
409-
Convenience method to add items to the current folder
405+
"""Convenience method to add items to the current folder.
410406
411407
:param trns: List of playlist trns to be added to the current folder
412408
:return: True, if operation was successful.
413409
"""
414410
self.move_items_to_folder(trns, self.id)
415411

416412
def move_items_to_root(self, trns: [str]):
417-
"""
418-
Convenience method to move items from the current folder to the root folder
413+
"""Convenience method to move items from the current folder to the root folder.
419414
420415
:param trns: List of playlist trns to be moved from the current folder
421416
:return: True, if operation was successful.
422417
"""
423418
self.move_items_to_folder(trns, folder="root")
424419

425420
def move_items_to_folder(self, trns: [str], folder: str = None):
426-
"""
427-
Move item(s) in one folder to another folder.
421+
"""Move item(s) in one folder to another folder.
428422
429423
:param trns: List of playlist trns to be moved.
430424
:param folder: Destination folder. Default: Use the current folder
@@ -534,12 +528,13 @@ def add(
534528
def merge(
535529
self, playlist: str, allow_duplicates: bool = False, allow_missing: bool = True
536530
) -> List[int]:
537-
"""
538-
Add (merge) items from a playlist with the current playlist
531+
"""Add (merge) items from a playlist with the current playlist.
539532
540533
:param playlist: Playlist UUID to be merged in the current playlist
541-
:param allow_duplicates: If true, duplicate tracks are allowed. Otherwise, tracks will be skipped.
542-
:param allow_missing: If true, missing tracks are allowed. Otherwise, exception will be thrown
534+
:param allow_duplicates: If true, duplicate tracks are allowed. Otherwise,
535+
tracks will be skipped.
536+
:param allow_missing: If true, missing tracks are allowed. Otherwise, exception
537+
will be thrown
543538
:return:
544539
"""
545540
data = {

tidalapi/session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252

5353
from tidalapi.exceptions import *
5454
from tidalapi.types import JsonObj
55+
5556
from . import album, artist, genre, media, mix, page, playlist, request, user
5657

5758
if TYPE_CHECKING:
@@ -848,8 +849,7 @@ def playlist(
848849
raise
849850

850851
def folder(self, folder_id: Optional[str] = None) -> playlist.Folder:
851-
"""
852-
Function to create a Folder object with access to the session instance in a
852+
"""Function to create a Folder object with access to the session instance in a
853853
smoother way. Calls :class:`tidalapi.Folder(session=session, folder_id=track_id)
854854
<.Folder>` internally.
855855

tidalapi/user.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from tidalapi.artist import Artist
3737
from tidalapi.media import Track, Video
3838
from tidalapi.mix import MixV2
39-
from tidalapi.playlist import Playlist, UserPlaylist, Folder
39+
from tidalapi.playlist import Folder, Playlist, UserPlaylist
4040
from tidalapi.session import Session
4141

4242

@@ -406,7 +406,8 @@ def remove_video(self, video_id: str) -> bool:
406406
return self.requests.request("DELETE", f"{self.base_url}/videos/{video_id}").ok
407407

408408
def remove_folders_playlists(self, trns: [str], type: str = "folder") -> bool:
409-
"""Removes one or more folders or playlists from the users favourites, using the v2 endpoint
409+
"""Removes one or more folders or playlists from the users favourites, using the
410+
v2 endpoint.
410411
411412
:param trns: List of folder (or playlist) trns to be deleted
412413
:param type: Type of trn: as string, either `folder` or `playlist`. Default `folder`
@@ -431,15 +432,6 @@ def remove_folders_playlists(self, trns: [str], type: str = "folder") -> bool:
431432
params=params,
432433
).ok
433434

434-
def remove_folder_playlist(self, trn: str, type: str = "folder") -> bool:
435-
"""Removes a folder (or playlist) from the users favourites, using the v2 endpoint
436-
437-
:param trn: Folder or playlist id (trn) of the item to be deleted
438-
:param type: Type of trn: as string, either `folder` or `playlist`
439-
:return: A boolean indicating whether the request was successful or not.
440-
"""
441-
return self.remove_folders_playlists([trn], type)
442-
443435
def artists(self, limit: Optional[int] = None, offset: int = 0) -> List["Artist"]:
444436
"""Get the users favorite artists.
445437

0 commit comments

Comments
 (0)