From 9886781afe4555f371001e24c50507563da6e196 Mon Sep 17 00:00:00 2001 From: Rudis Muiznieks Date: Fri, 28 Apr 2023 21:55:42 -0500 Subject: [PATCH] updated changelog --- site/partial/home.html | 2 ++ site/radiostasis.js | 17 +++++++++-------- src/Playlist.ts | 18 +++++++++--------- src/Radiostasis.ts | 1 + 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/site/partial/home.html b/site/partial/home.html index b8d4c5d..9d0805b 100644 --- a/site/partial/home.html +++ b/site/partial/home.html @@ -28,6 +28,8 @@

Radiostasis is an open source passion project by Rudis Muiznieks, a software engineer who happens to love Old Time Radio. Radiostasis is a constant work in progress, with many improvements planned for the future. Currently the site is completely free to use—Rudis foots all the bills to host this site on his own—but premium features may be introduced in future updates to help offset some of the costs.

Please send questions, bug reports, suggestions, or just say hello to Rudis at support@radiostasis.com.

Change Log

+

2023-04-28

+

The playlist now displays the currently playing episode at the top, and will re-queue that episode if another episode is played.

2023-04-13

Added toast notifications for queue operations and playback errors.

2023-04-09

diff --git a/site/radiostasis.js b/site/radiostasis.js index 4e2ebb8..696352c 100644 --- a/site/radiostasis.js +++ b/site/radiostasis.js @@ -444,6 +444,14 @@ var Playlist = /** @class */ (function () { this.notify('Playlist cleared.'); } }; + Playlist.prototype.reQueueNowPlaying = function () { + var currentEpisode = this.nowPlayingEpisodeHandler + ? this.nowPlayingEpisodeHandler() + : null; + if (currentEpisode) { + this.unshiftEpisodes([currentEpisode]); + } + }; Playlist.prototype.playlistChanged = function () { this.shiftCurrent(); this.unshiftCurrent(); @@ -491,14 +499,6 @@ var Playlist = /** @class */ (function () { this.queueTab.classList.remove('expanded'); } }; - Playlist.prototype.reQueueNowPlaying = function () { - var currentEpisode = this.nowPlayingEpisodeHandler - ? this.nowPlayingEpisodeHandler() - : null; - if (currentEpisode) { - this.unshiftEpisodes([currentEpisode]); - } - }; Playlist.prototype.createQueueListItem = function (episode, withControls) { var _this = this; if (withControls === void 0) { withControls = true; } @@ -600,6 +600,7 @@ var Radiostasis = /** @class */ (function () { .item(0)) === null || _a === void 0 ? void 0 : _a.addEventListener('click', function (e) { var _a; if (((_a = _this.player.currentEpisode()) === null || _a === void 0 ? void 0 : _a.id) !== episode.id) { + _this.playlist.reQueueNowPlaying(); _this.player.playEpisode(episode); } e.preventDefault(); diff --git a/src/Playlist.ts b/src/Playlist.ts index 2174469..96f153b 100644 --- a/src/Playlist.ts +++ b/src/Playlist.ts @@ -160,6 +160,15 @@ class Playlist { } } + public reQueueNowPlaying(): void { + const currentEpisode = this.nowPlayingEpisodeHandler + ? this.nowPlayingEpisodeHandler() + : null; + if (currentEpisode) { + this.unshiftEpisodes([currentEpisode]); + } + } + private playlistChanged(): void { this.shiftCurrent(); this.unshiftCurrent(); @@ -208,15 +217,6 @@ class Playlist { } } - private reQueueNowPlaying(): void { - const currentEpisode = this.nowPlayingEpisodeHandler - ? this.nowPlayingEpisodeHandler() - : null; - if (currentEpisode) { - this.unshiftEpisodes([currentEpisode]); - } - } - private createQueueListItem( episode: Episode, withControls = true diff --git a/src/Radiostasis.ts b/src/Radiostasis.ts index 9c038de..b7e0194 100644 --- a/src/Radiostasis.ts +++ b/src/Radiostasis.ts @@ -63,6 +63,7 @@ class Radiostasis { .item(0) ?.addEventListener('click', (e) => { if (this.player.currentEpisode()?.id !== episode.id) { + this.playlist.reQueueNowPlaying(); this.player.playEpisode(episode); } e.preventDefault();