Skip to content

Commit

Permalink
Update frontend to handle some changes in the backend
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Jul 6, 2023
1 parent 2c8fd12 commit 7ee1c82
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/VolumeControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ defineProps<Props>();
const getVolumePlayers = function (player: Player) {
const items: Player[] = [];
if (player.type != PlayerType.GROUP) {
if (player.type != PlayerType.GROUP && !player.group_childs.includes(player.player_id)) {
items.push(player);
}
for (const groupChildId of player.group_childs) {
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/default/PlayerOSD/PlayerTrackDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
v-bind="props"
>
<div class="d-flex justify-center" style="width: 100%">
{{ curQueueItem?.streamdetails.content_type.toUpperCase() }}
{{ curQueueItem?.streamdetails.audio_format.content_type.toUpperCase() }}
</div>
</v-chip>
</template>
Expand Down
14 changes: 10 additions & 4 deletions src/plugins/api/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,14 +463,20 @@ export interface SearchResults {
radio: Radio[];
}

export interface AudioFormat {
content_type: ContentType;
sample_rate: number;
bit_depth: number;
channels: number;
output_format_str: string;
bit_rate: number;
}

export interface StreamDetails {
provider: string;
item_id: string;
content_type: ContentType;
audio_format: AudioFormat;
media_type: MediaType;
sample_rate: number;
bit_depth: number;
channels: number;
stream_title?: string;
duration?: number;
size?: number;
Expand Down
6 changes: 3 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ export const getBrowseFolderName = function (browseItem: BrowseFolder, t: any) {

export const getPlayerName = function (player: Player, truncate = 26) {
if (!player) return '';
if (player.type != PlayerType.GROUP && player.group_childs.length > 0) {
if (player.type != PlayerType.GROUP && player.group_childs.length > 1) {
// create pretty name for syncgroup (e.g. playername +2)
// TODO: move to APi and only count available players
return `${truncateString(player.display_name, truncate - 3)} +${player.group_childs.length}`;
// TODO: move to API and only count available players
return `${truncateString(player.display_name, truncate - 3)} +${player.group_childs.length-1}`;
}
return truncateString(player.display_name, truncate);
};
Expand Down

0 comments on commit 7ee1c82

Please sign in to comment.