Skip to content
This repository has been archived by the owner on Oct 3, 2022. It is now read-only.

Improve now playing banner #1268

Merged
merged 6 commits into from
Feb 10, 2021
Merged

Improve now playing banner #1268

merged 6 commits into from
Feb 10, 2021

Conversation

nukooo
Copy link

@nukooo nukooo commented Feb 5, 2021

Rewrite banners as independent objects

The current implementation is fragile. Because updates are performed sequentially, an inaccessible API blocks all radios from updating until the fetch times out. Likewise, an unhandled exception in an unmarshalfn will abort the update for all stations.

The new implementation:

  • Makes updating banners concurrent and independent
  • Allows easier addition, removal, and rearrangement of banners by eliminating the implicit coupling between declaration order and bit field index in the nowPlaying option
  • Improves type safety

Horizontal banner option

Stacked banners waste screen space and many users prefer the original layout. While this can be fixed by the user with custom CSS, an official option is more convenient.

This option is enabled by default to match how the banner used to be displayed. As pointed out in PR #1241, horizontal banners can be problematic on small screens. I believe the majority of users have enough screen width that this isn't a problem. Those that don't can easily turn it off.

Eden default streamer

Eden Radio lacks a bot streamer name. This is inconsistent with the other banners so I've added a default.

@nukooo nukooo changed the title Improve Now Playing Banner Improve now playing banner Feb 5, 2021
client/main.ts Outdated
localStorage.setItem("eden", "true")
break
default:
const flags = parseInt(nowPlaying, 10)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's amazing how this still works with nowPlaying=null.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NaN is converted to 0 in bitwise contexts. That migration should only run if nowPlaying exists however. Good catch.

@bakape
Copy link
Owner

bakape commented Feb 10, 2021

Please resolve conflicts and I'll merge it.

@bakape bakape merged commit 34e2cbe into bakape:v6 Feb 10, 2021
@bakape
Copy link
Owner

bakape commented Feb 10, 2021

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants