4
0
mirror of https://github.com/AzuraCast/AzuraCast.git synced 2024-06-14 21:26:37 +00:00

Add "Podcasts" to the Embed Widgets modal dialog in the station profile.

This commit is contained in:
Buster Neece 2024-01-20 17:19:34 -06:00
parent e783895317
commit d7b8c59ff9
No known key found for this signature in database
3 changed files with 23 additions and 3 deletions

View File

@ -120,6 +120,10 @@ const types = computed(() => {
value: 'history',
text: $gettext('History')
},
{
value: 'podcasts',
text: $gettext('Podcasts')
},
{
value: 'schedule',
text: $gettext('Schedule')
@ -174,6 +178,9 @@ const baseEmbedUrl = computed(() => {
case 'schedule':
return props.publicScheduleEmbedUri;
case 'podcasts':
return props.publicPodcastsEmbedUri;
case 'player':
default:
return props.publicPageEmbedUri;
@ -181,14 +188,17 @@ const baseEmbedUrl = computed(() => {
});
const embedUrl = computed(() => {
return (selectedTheme.value !== "browser")
? baseEmbedUrl.value + '?theme=' + selectedTheme.value
: baseEmbedUrl.value;
const baseUrl = new URL(baseEmbedUrl.value);
if (selectedTheme.value !== 'browser') {
baseUrl.searchParams.set('theme', selectedTheme.value);
}
return baseUrl.toString();
});
const embedHeight = computed(() => {
switch (selectedType.value) {
case 'ondemand':
case 'podcasts':
return '400px';
case 'requests':

View File

@ -42,5 +42,9 @@ export default {
publicScheduleEmbedUri: {
type: String,
required: true
},
publicPodcastsEmbedUri: {
type: String,
required: true
}
}

View File

@ -140,6 +140,12 @@ final class ProfileAction implements SingleActionInterface
routeParams: ['station_id' => $station->getShortName(), 'embed' => 'embed'],
absolute: true
),
'publicPodcastsEmbedUri' => $router->named(
routeName: 'public:podcasts',
routeParams: ['station_id' => $station->getShortName()],
queryParams: ['embed' => 'true'],
absolute: true
),
// Frontend
'frontendAdminUri' => (string)$frontend?->getAdminUrl($station, $router->getBaseUrl()),