Added RemoveSongFromAutoPlay
This commit is contained in:
parent
d47379aacc
commit
d08afcc4d6
2
dist/common.js
vendored
2
dist/common.js
vendored
@ -13,7 +13,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|||||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||||
};
|
};
|
||||||
exports.__esModule = true;
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
__exportStar(require("./dataTypes"), exports);
|
__exportStar(require("./dataTypes"), exports);
|
||||||
__exportStar(require("./messageTypes"), exports);
|
__exportStar(require("./messageTypes"), exports);
|
||||||
__exportStar(require("./parseMessage"), exports);
|
__exportStar(require("./parseMessage"), exports);
|
||||||
|
|||||||
4
dist/dataTypes.js
vendored
4
dist/dataTypes.js
vendored
@ -14,13 +14,13 @@ var __extends = (this && this.__extends) || (function () {
|
|||||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
exports.__esModule = true;
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.PlaylistDescription = exports.Playlist = exports.PlayingSong = exports.QueuedSong = exports.Song = exports.SongType = void 0;
|
exports.PlaylistDescription = exports.Playlist = exports.PlayingSong = exports.QueuedSong = exports.Song = exports.SongType = void 0;
|
||||||
var SongType;
|
var SongType;
|
||||||
(function (SongType) {
|
(function (SongType) {
|
||||||
SongType[SongType["YouTube"] = 0] = "YouTube";
|
SongType[SongType["YouTube"] = 0] = "YouTube";
|
||||||
SongType[SongType["Spotify"] = 1] = "Spotify";
|
SongType[SongType["Spotify"] = 1] = "Spotify";
|
||||||
})(SongType = exports.SongType || (exports.SongType = {}));
|
})(SongType || (exports.SongType = SongType = {}));
|
||||||
var Song = /** @class */ (function () {
|
var Song = /** @class */ (function () {
|
||||||
function Song(type, title, songId, image) {
|
function Song(type, title, songId, image) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|||||||
5
dist/messageTypes.d.ts
vendored
5
dist/messageTypes.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
import { Song, PlayingSong, QueuedSong, Playlist, PlaylistDescription } from "./dataTypes";
|
import { Song, PlayingSong, QueuedSong, Playlist, PlaylistDescription } from "./dataTypes";
|
||||||
export declare type StuenMessages = ListenerLeft | ListenerList | ListenerJoined | SendChatMessage | SearchSong | SearchSongResult | Join | QueueSong | CurrentQueue | CurrentSong | UnqueueSong | ReorderSong | SkipSong | SongLikes | ToggleSongLike | CreatePlaylist | RemovePlaylist | AddSongToPlaylist | RemoveSongFromPlaylist | Playlists | GetPlaylist | PlaylistSongs | ToggleTag | Shuffle;
|
export type StuenMessages = ListenerLeft | ListenerList | ListenerJoined | SendChatMessage | SearchSong | SearchSongResult | Join | QueueSong | CurrentQueue | CurrentSong | UnqueueSong | ReorderSong | SkipSong | SongLikes | ToggleSongLike | CreatePlaylist | RemovePlaylist | AddSongToPlaylist | RemoveSongFromPlaylist | Playlists | GetPlaylist | PlaylistSongs | ToggleTag | Shuffle | RemoveFromAutoPlay;
|
||||||
export declare abstract class StuenMessage {
|
export declare abstract class StuenMessage {
|
||||||
type: string;
|
type: string;
|
||||||
constructor(type: string);
|
constructor(type: string);
|
||||||
@ -107,3 +107,6 @@ export declare class ToggleTag extends StuenMessage {
|
|||||||
export declare class Shuffle extends StuenMessage {
|
export declare class Shuffle extends StuenMessage {
|
||||||
constructor();
|
constructor();
|
||||||
}
|
}
|
||||||
|
export declare class RemoveFromAutoPlay extends StuenMessage {
|
||||||
|
constructor();
|
||||||
|
}
|
||||||
|
|||||||
12
dist/messageTypes.js
vendored
12
dist/messageTypes.js
vendored
@ -14,8 +14,8 @@ var __extends = (this && this.__extends) || (function () {
|
|||||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
exports.__esModule = true;
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.Shuffle = exports.ToggleTag = exports.RemoveSongFromPlaylist = exports.AddSongToPlaylist = exports.PlaylistSongs = exports.GetPlaylist = exports.Playlists = exports.RemovePlaylist = exports.CreatePlaylist = exports.SongLikes = exports.ToggleSongLike = exports.SkipSong = exports.ReorderSong = exports.UnqueueSong = exports.CurrentSong = exports.CurrentQueue = exports.QueueSong = exports.SearchSongResult = exports.SearchSong = exports.ChatMessage = exports.SendChatMessage = exports.ListenerList = exports.ListenerLeft = exports.ListenerJoined = exports.Join = exports.StuenMessage = void 0;
|
exports.RemoveFromAutoPlay = exports.Shuffle = exports.ToggleTag = exports.RemoveSongFromPlaylist = exports.AddSongToPlaylist = exports.PlaylistSongs = exports.GetPlaylist = exports.Playlists = exports.RemovePlaylist = exports.CreatePlaylist = exports.SongLikes = exports.ToggleSongLike = exports.SkipSong = exports.ReorderSong = exports.UnqueueSong = exports.CurrentSong = exports.CurrentQueue = exports.QueueSong = exports.SearchSongResult = exports.SearchSong = exports.ChatMessage = exports.SendChatMessage = exports.ListenerList = exports.ListenerLeft = exports.ListenerJoined = exports.Join = exports.StuenMessage = void 0;
|
||||||
var StuenMessage = /** @class */ (function () {
|
var StuenMessage = /** @class */ (function () {
|
||||||
function StuenMessage(type) {
|
function StuenMessage(type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
@ -274,3 +274,11 @@ var Shuffle = /** @class */ (function (_super) {
|
|||||||
return Shuffle;
|
return Shuffle;
|
||||||
}(StuenMessage));
|
}(StuenMessage));
|
||||||
exports.Shuffle = Shuffle;
|
exports.Shuffle = Shuffle;
|
||||||
|
var RemoveFromAutoPlay = /** @class */ (function (_super) {
|
||||||
|
__extends(RemoveFromAutoPlay, _super);
|
||||||
|
function RemoveFromAutoPlay() {
|
||||||
|
return _super.call(this, 'RemoveFromAutoPlay') || this;
|
||||||
|
}
|
||||||
|
return RemoveFromAutoPlay;
|
||||||
|
}(StuenMessage));
|
||||||
|
exports.RemoveFromAutoPlay = RemoveFromAutoPlay;
|
||||||
|
|||||||
6
dist/parseMessage.js
vendored
6
dist/parseMessage.js
vendored
@ -1,5 +1,5 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
exports.__esModule = true;
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
var messageTypes_1 = require("./messageTypes");
|
var messageTypes_1 = require("./messageTypes");
|
||||||
function parseMessage(message) {
|
function parseMessage(message) {
|
||||||
try {
|
try {
|
||||||
@ -55,6 +55,8 @@ function parseMessage(message) {
|
|||||||
return new messageTypes_1.ToggleTag(data.song, data.tag);
|
return new messageTypes_1.ToggleTag(data.song, data.tag);
|
||||||
case 'Shuffle':
|
case 'Shuffle':
|
||||||
return new messageTypes_1.Shuffle();
|
return new messageTypes_1.Shuffle();
|
||||||
|
case 'RemoveFromAutoPlay':
|
||||||
|
return new messageTypes_1.RemoveFromAutoPlay();
|
||||||
default:
|
default:
|
||||||
console.error('Unknown message type:', data.type);
|
console.error('Unknown message type:', data.type);
|
||||||
return null;
|
return null;
|
||||||
@ -65,4 +67,4 @@ function parseMessage(message) {
|
|||||||
return null; // Handle parsing errors
|
return null; // Handle parsing errors
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports["default"] = parseMessage;
|
exports.default = parseMessage;
|
||||||
|
|||||||
@ -25,6 +25,7 @@ export type StuenMessages =
|
|||||||
| PlaylistSongs
|
| PlaylistSongs
|
||||||
| ToggleTag
|
| ToggleTag
|
||||||
| Shuffle
|
| Shuffle
|
||||||
|
| RemoveFromAutoPlay
|
||||||
|
|
||||||
export abstract class StuenMessage {
|
export abstract class StuenMessage {
|
||||||
constructor(public type: string) {
|
constructor(public type: string) {
|
||||||
@ -181,3 +182,9 @@ export class Shuffle extends StuenMessage {
|
|||||||
super('Shuffle');
|
super('Shuffle');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class RemoveFromAutoPlay extends StuenMessage {
|
||||||
|
constructor() {
|
||||||
|
super('RemoveFromAutoPlay');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "stuen-common",
|
"name": "stuen-common",
|
||||||
"version": "1.2.9",
|
"version": "1.2.10",
|
||||||
"main": "dist/common.js",
|
"main": "dist/common.js",
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"types": "dist/common.d.ts",
|
"types": "dist/common.d.ts",
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import {
|
|||||||
ListenerList,
|
ListenerList,
|
||||||
Playlists,
|
Playlists,
|
||||||
PlaylistSongs,
|
PlaylistSongs,
|
||||||
QueueSong, RemovePlaylist,
|
QueueSong, RemoveFromAutoPlay, RemovePlaylist,
|
||||||
RemoveSongFromPlaylist,
|
RemoveSongFromPlaylist,
|
||||||
ReorderSong,
|
ReorderSong,
|
||||||
SearchSong,
|
SearchSong,
|
||||||
@ -79,6 +79,8 @@ export default function parseMessage(message: string): StuenMessage | null {
|
|||||||
return new ToggleTag(data.song, data.tag);
|
return new ToggleTag(data.song, data.tag);
|
||||||
case 'Shuffle':
|
case 'Shuffle':
|
||||||
return new Shuffle();
|
return new Shuffle();
|
||||||
|
case 'RemoveFromAutoPlay':
|
||||||
|
return new RemoveFromAutoPlay();
|
||||||
default:
|
default:
|
||||||
console.error('Unknown message type:', data.type);
|
console.error('Unknown message type:', data.type);
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user