Skip to content

Commit

Permalink
#190 Added custom field in the Track interface to store additional data
Browse files Browse the repository at this point in the history
  • Loading branch information
SxMAbel committed May 18, 2024
1 parent a96cfb2 commit 880fd9d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "magmastream",
"version": "2.5.2",
"version": "2.5.3",
"description": "A user-friendly Lavalink client designed for NodeJS.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/structures/Player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ export interface Track {
displayThumbnail(size?: Sizes): string;
/** Additional track info provided by plugins. */
pluginInfo: TrackPluginInfo;
/** Add your own data to the track. */
customData: Record<string, unknown>;
}

export interface TrackPluginInfo {
Expand Down
1 change: 1 addition & 0 deletions src/structures/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export abstract class TrackUtils {
isPreview: data.pluginInfo?.isPreview,
previewUrl: data.pluginInfo?.previewUrl,
},
customData: {},
};

track.displayThumbnail = track.displayThumbnail.bind(track);
Expand Down

0 comments on commit 880fd9d

Please sign in to comment.