Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mnemonic to set_playlist() #174

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions fortnitepy/party.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,13 +1180,16 @@ def set_squad_assignments(self, data: List[dict]) -> Dict[str, Any]:
return {key: self.set_prop(key, final)}

def set_playlist(self, playlist: Optional[str] = None, *,
mnemonic: Optional[str] = None,
tournament: Optional[str] = None,
event_window: Optional[str] = None,
region: Optional[Region] = None) -> Dict[str, Any]:
data = (self.get_prop('Default:PlaylistData_j'))['PlaylistData']

if playlist is not None:
data['playlistName'] = playlist
if mnemonic is not None:
data['linkId'] = {'mnemonic': mnemonic}
if tournament is not None:
data['tournamentId'] = tournament
if event_window is not None:
Expand Down Expand Up @@ -3913,6 +3916,7 @@ async def set_privacy(self, privacy: PartyPrivacy) -> None:
)

async def set_playlist(self, playlist: Optional[str] = None,
mnemonic: Optional[str] = None,
tournament: Optional[str] = None,
event_window: Optional[str] = None,
region: Optional[Region] = None) -> None:
Expand Down Expand Up @@ -3942,6 +3946,8 @@ async def set_playlist(self, playlist: Optional[str] = None,
playlist: Optional[:class:`str`]
The name of the playlist.
Defaults to :attr:`Region.EUROPE`
mnemonic: Optional[:class:`str`]
The mnemonic code of island.
tournament: Optional[:class:`str`]
The tournament id.
event_window: Optional[:class:`str`]
Expand All @@ -3963,6 +3969,7 @@ async def set_playlist(self, playlist: Optional[str] = None,

prop = self.meta.set_playlist(
playlist=playlist,
mnemonic=mnemonic,
tournament=tournament,
event_window=event_window,
region=region
Expand Down