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

feat: add serialization and deserialization methods #1823

Merged
merged 2 commits into from
Oct 5, 2023
Merged

Conversation

twlite
Copy link
Collaborator

@twlite twlite commented Oct 5, 2023

Changes

This pr introduces 4 new helper functions:

  • encode(): Produces base64 representation of serialized data
  • decode(): Produces serialized json data from encoded string
  • serialize(): Transforms structures such as Track or Playlist into raw json
  • deserialize(): Produces Track or Playlist from the serialized json data

This is helpful to people who want to store tracks and playlists inside database and quickly re-initialize it.

Status

  • These changes have been tested and formatted properly.
  • This PR includes only documentation changes, no code change.
  • This PR introduces some Breaking changes.

@twlite twlite added enhancement New feature or request area:main Related to discord-player labels Oct 5, 2023
@vercel
Copy link

vercel bot commented Oct 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
discord-player-website ⬜️ Ignored (Inspect) Oct 5, 2023 8:47am

@twlite twlite merged commit 55eaf1f into master Oct 5, 2023
4 checks passed
@twlite twlite deleted the serialization branch October 5, 2023 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:main Related to discord-player enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant