From 4d3834be1df028c86a5006d8b20ffe87d5410c7c Mon Sep 17 00:00:00 2001 From: Torben Pi Jensen Date: Thu, 9 Nov 2023 22:12:28 +0100 Subject: [PATCH] More stuff --- .idea/common.iml | 4 +++- dataTypes.ts | 10 ++++++++-- dist/dataTypes.d.ts | 8 ++++++-- dist/dataTypes.js | 18 ++++++++++++++---- dist/messageTypes.d.ts | 6 +++--- messageTypes.ts | 4 ++-- 6 files changed, 36 insertions(+), 14 deletions(-) diff --git a/.idea/common.iml b/.idea/common.iml index c956989..94b5823 100644 --- a/.idea/common.iml +++ b/.idea/common.iml @@ -1,7 +1,9 @@ - + + + diff --git a/dataTypes.ts b/dataTypes.ts index cf5b407..fd7cac7 100644 --- a/dataTypes.ts +++ b/dataTypes.ts @@ -10,8 +10,14 @@ export class Song { } } -export class PlayingSong extends Song { - constructor(type: SongType, title: string, songId: string, image: string, public length: number, public position: number) { +export class QueuedSong extends Song { + constructor(type: SongType, title: string, songId: string, image: string, public listener: string) { super(type, title, songId, image); } } + +export class PlayingSong extends QueuedSong { + constructor(type: SongType, title: string, songId: string, image: string, listener: string, public length: number, public position: number) { + super(type, title, songId, image, listener); + } +} diff --git a/dist/dataTypes.d.ts b/dist/dataTypes.d.ts index f6e5313..64ec72b 100644 --- a/dist/dataTypes.d.ts +++ b/dist/dataTypes.d.ts @@ -9,8 +9,12 @@ export declare class Song { image: string; constructor(type: SongType, title: string, songId: string, image: string); } -export declare class PlayingSong extends Song { +export declare class QueuedSong extends Song { + listener: string; + constructor(type: SongType, title: string, songId: string, image: string, listener: string); +} +export declare class PlayingSong extends QueuedSong { length: number; position: number; - constructor(type: SongType, title: string, songId: string, image: string, length: number, position: number); + constructor(type: SongType, title: string, songId: string, image: string, listener: string, length: number, position: number); } diff --git a/dist/dataTypes.js b/dist/dataTypes.js index cf5281a..4cc9b47 100644 --- a/dist/dataTypes.js +++ b/dist/dataTypes.js @@ -15,7 +15,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); exports.__esModule = true; -exports.PlayingSong = exports.Song = exports.SongType = void 0; +exports.PlayingSong = exports.QueuedSong = exports.Song = exports.SongType = void 0; var SongType; (function (SongType) { SongType[SongType["YouTube"] = 0] = "YouTube"; @@ -31,14 +31,24 @@ var Song = /** @class */ (function () { return Song; }()); exports.Song = Song; +var QueuedSong = /** @class */ (function (_super) { + __extends(QueuedSong, _super); + function QueuedSong(type, title, songId, image, listener) { + var _this = _super.call(this, type, title, songId, image) || this; + _this.listener = listener; + return _this; + } + return QueuedSong; +}(Song)); +exports.QueuedSong = QueuedSong; var PlayingSong = /** @class */ (function (_super) { __extends(PlayingSong, _super); - function PlayingSong(type, title, songId, image, length, position) { - var _this = _super.call(this, type, title, songId, image) || this; + function PlayingSong(type, title, songId, image, listener, length, position) { + var _this = _super.call(this, type, title, songId, image, listener) || this; _this.length = length; _this.position = position; return _this; } return PlayingSong; -}(Song)); +}(QueuedSong)); exports.PlayingSong = PlayingSong; diff --git a/dist/messageTypes.d.ts b/dist/messageTypes.d.ts index e5d1ab6..03b71e2 100644 --- a/dist/messageTypes.d.ts +++ b/dist/messageTypes.d.ts @@ -1,4 +1,4 @@ -import { Song, PlayingSong } from "./dataTypes"; +import { Song, PlayingSong, QueuedSong } from "./dataTypes"; export declare type StuenMessages = ListenerLeft | ListenerList | ListenerJoined | SendChatMessage | SearchSong | SearchSongResult | Join | QueueSong | CurrentQueue | CurrentSong | UnqueueSong | ReorderSong; export declare abstract class StuenMessage { type: string; @@ -42,8 +42,8 @@ export declare class QueueSong extends StuenMessage { constructor(song: Song); } export declare class CurrentQueue extends StuenMessage { - songs: Song[]; - constructor(songs: Song[]); + songs: QueuedSong[]; + constructor(songs: QueuedSong[]); } export declare class CurrentSong extends StuenMessage { song: PlayingSong | null; diff --git a/messageTypes.ts b/messageTypes.ts index 98376ba..b601d55 100644 --- a/messageTypes.ts +++ b/messageTypes.ts @@ -1,4 +1,4 @@ -import {Song, PlayingSong} from "./dataTypes"; +import {Song, PlayingSong, QueuedSong} from "./dataTypes"; export type StuenMessages = ListenerLeft | ListenerList | ListenerJoined | SendChatMessage | SearchSong | SearchSongResult | Join | QueueSong | CurrentQueue | CurrentSong | UnqueueSong | ReorderSong; export abstract class StuenMessage { @@ -62,7 +62,7 @@ export class QueueSong extends StuenMessage { } export class CurrentQueue extends StuenMessage { - constructor(public songs: Song[]) { + constructor(public songs: QueuedSong[]) { super('CurrentQueue'); } }