Skip to content

Commit

Permalink
feat: add master relay capabilities front and back, improvements: str…
Browse files Browse the repository at this point in the history
…eam auto-reconnect to newly created media session on producer end. (#84)
  • Loading branch information
ramiroaisen authored Jun 24, 2023
2 parents 6de9574 + 488444a commit 8d19065
Show file tree
Hide file tree
Showing 47 changed files with 1,357 additions and 752 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions defs/UserPublicStation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export type UserPublicStation = {
google_play_url: string | null;
user_metadata: Metadata;
playlist_is_randomly_shuffled: boolean;
external_relay_url: string | null;
source_password: string;
created_at: DateTime;
updated_at: DateTime;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { EmptyStruct } from "../../../../../EmptyStruct";

export type Output = EmptyStruct;
4 changes: 4 additions & 0 deletions defs/api/runtime/station-deleted/[station]/POST/Output.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { EmptyStruct } from "../../../../../EmptyStruct";

export type Output = EmptyStruct;
1 change: 1 addition & 0 deletions defs/api/stations/POST/Payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type Payload = {
google_play_url: string | null;
app_store_url: string | null;
frequencies: Array<StationFrequency> | null;
external_relay_url: string | null;
user_metadata?: Metadata;
system_metadata?: Metadata;
};
6 changes: 5 additions & 1 deletion defs/api/stations/[station]/now-playing/GET/Output.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export type Output =
| ({ kind: "none" } & { start_on_connect: boolean })
| ({ kind: "none" } & {
start_on_connect: boolean;
external_relay_url: string | null;
})
| ({ kind: "live" } & { title: string | null; artist: string | null })
| ({ kind: "external-relay" } & { url: string })
| ({ kind: "playlist" } & {
file_id: string;
filename: string;
Expand Down
2 changes: 2 additions & 0 deletions defs/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export const EMAIL_VERIFICATION_CODE_LEN = 6;

export const EMAIL_VERIFICATION_VALIDITY_SECS = 3600;

export const EXTERNAL_RELAY_NO_LISTENERS_SHUTDOWN_DELAY_SECS = 30;

export const FORWARD_IP_HEADER = "x-openstream-forwarded-ip";

export const PAYMENTS_ACCESS_TOKEN_HEADER = "x-access-token";
Expand Down
3 changes: 2 additions & 1 deletion defs/db/MediaSessionKind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ export type MediaSessionKind =
last_audio_chunk_skip_parts: number;
last_audio_chunk_date: DateTime;
})
| ({ kind: "live" } & { request: Request });
| ({ kind: "live" } & { request: Request })
| ({ kind: "external-relay" } & { url: string });
1 change: 1 addition & 0 deletions defs/db/Station.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export type Station = {
system_metadata: Metadata;
owner_deployment_info: OwnerDeploymentInfo | null;
playlist_is_randomly_shuffled: boolean;
external_relay_url: string | null;
source_password: string;
created_at: DateTime;
updated_at: DateTime;
Expand Down
1 change: 1 addition & 0 deletions defs/error/PublicErrorCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export type PublicErrorCode =
| "UNRESOLVABLE_ADMIN_ME"
| "UNRESOLVABLE_USER_ME"
| "PLAYLIST_START_IS_LIVE"
| "PLAYLIST_START_IS_EXTERNAL_RELAY"
| "PLAYLIST_START_NO_FILES"
| "RENDER_MAIL"
| "SEND_MAIL"
Expand Down
5 changes: 3 additions & 2 deletions defs/ops/StationPatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export type StationPatch = {
picture_id?: string;
slogan?: string | null;
description?: string | null;
type_of_content: StationTypeOfContent | null;
country_code: CountryCode | null;
type_of_content?: StationTypeOfContent;
country_code?: CountryCode;
frequencies?: Array<StationFrequency>;
email?: string | null;
phone?: string | null;
Expand All @@ -23,6 +23,7 @@ export type StationPatch = {
twitch_url?: string | null;
google_play_url?: string | null;
app_store_url?: string | null;
external_relay_url?: string | null;
user_metadata?: Metadata;
system_metadata?: Metadata;
};
4 changes: 1 addition & 3 deletions front/admin/src/lib/components/Dashboard/Drawer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
// @ts-ignore
import logo from "$share/img/logo-trans-128.png?w=64&format=webp";
import { player_state } from "../Player/player";
$: if(browser) {
document.documentElement.classList[fixed_open ? "add" : "remove"](HTML_OPEN_CLASSNAME);
}
Expand Down Expand Up @@ -171,7 +169,7 @@
<div class="drawer-overlay" transition:fade|local={{ duration: 250 }} on:click={close_drawer_fixed} />
{/if}

<div class="drawer" class:player-open={$player_state.type !== "closed"} class:fixed-open={fixed_open}>
<div class="drawer" class:fixed-open={fixed_open}>
<div class="inner">
<div class="top">
<button class="toggle ripple-container" use:ripple aria-label="Toogle drawer" on:click={close_drawer_fixed}>
Expand Down
2 changes: 1 addition & 1 deletion front/admin/src/lib/components/Form/BooleanField.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import Icon from "$share/Icon.svelte";
import { ripple } from "$share/ripple";
import { mdiCheck, mdiCheckBold, mdiCheckboxBlank, mdiCheckboxBlankOutline } from "@mdi/js";
import { mdiCheckBold, mdiCheckboxBlankOutline } from "@mdi/js";
import { scale } from "svelte/transition";
</script>

Expand Down
197 changes: 0 additions & 197 deletions front/admin/src/lib/components/Player/Player.svelte

This file was deleted.

Loading

0 comments on commit 8d19065

Please sign in to comment.