From 2343a7314a9eb0dccbf62afcba3f798a5f226b2a Mon Sep 17 00:00:00 2001 From: Semyon Chetvertnyh Date: Fri, 15 Nov 2024 13:53:24 +0200 Subject: [PATCH] #505: Ability to hide media name --- src/lib/Main/ConditionalMedia.svelte | 218 ++++++++++---------- src/lib/Modal/ConditionalMediaConfig.svelte | 20 ++ static/translations/en.json | 1 + 3 files changed, 131 insertions(+), 108 deletions(-) diff --git a/src/lib/Main/ConditionalMedia.svelte b/src/lib/Main/ConditionalMedia.svelte index 296681ee..2152e745 100644 --- a/src/lib/Main/ConditionalMedia.svelte +++ b/src/lib/Main/ConditionalMedia.svelte @@ -329,76 +329,45 @@ {/if} -
-
-
- + {#if !sel?.hide_name} +
+
+
+ + + {#if active} + {#if currentAttr?.icon} + + {:else if current_media_player} + + {/if} - {#if active} - {#if currentAttr?.icon} - - {:else if current_media_player} - + + {:else if sel?.icon || entity?.attributes?.icon} + + {:else if sel?.entity_id} + + {:else} + {/if} - - - {:else if sel?.icon || entity?.attributes?.icon} - - {:else if sel?.entity_id} - - {:else} - - {/if} +
-
- -
- {#if active} - -
- {getName(undefined, current_media_player)} -
+
+ {#if active} + -
-
- - {#if media_artist && media_title} - {media_artist} - {media_title} - {:else if media_artist && !media_title} - {media_artist} - {:else if !media_artist && media_title} - {media_title} - {:else} - - {/if} +
+ {getName(undefined, current_media_player)}
-
- {#if sel?.marquee === true && contentWidth && contentWidth > 394 && !$editMode} - {#await import('$lib/Components/Marquee.svelte')} - loading - {:then Marquee} - - - {#if media_artist && media_title} - {media_artist} - {media_title} - {:else if media_artist && !media_title} - {media_artist} - {:else if !media_artist && media_title} - {media_title} - {:else} - - {/if} - {@html ' '.repeat(4)} - - {/await} - {:else} +
+
{#if media_artist && media_title} {media_artist} - {media_title} @@ -409,52 +378,51 @@ {:else} {/if} - {/if} +
+ +
+ {#if sel?.marquee === true && contentWidth && contentWidth > 394 && !$editMode} + {#await import('$lib/Components/Marquee.svelte')} + loading + {:then Marquee} + + + {#if media_artist && media_title} + {media_artist} - {media_title} + {:else if media_artist && !media_title} + {media_artist} + {:else if !media_artist && media_title} + {media_title} + {:else} + + {/if} + {@html ' '.repeat(4)} + + {/await} + {:else} + + {#if media_artist && media_title} + {media_artist} - {media_title} + {:else if media_artist && !media_title} + {media_artist} + {:else if !media_artist && media_title} + {media_title} + {:else} + + {/if} + {/if} +
-
- {:else} - - -
- {sel?.name || getName(undefined, entity) || $lang('nothing_playing')} -
- -
-
- - {#if entity_data?.title} - {entity_data?.title} + {:else} + - {#if entity_data?.aired} - ({entity_data?.aired?.split('-')?.[0]}) - {/if} - {:else} - - {/if} +
+ {sel?.name || getName(undefined, entity) || $lang('nothing_playing')}
-
- {#if sel?.marquee === true && contentWidth && contentWidth > 394 && !$editMode} - {#await import('$lib/Components/Marquee.svelte')} - loading - {:then Marquee} - - - {#if entity_data?.title} - {entity_data?.title} - - {#if entity_data?.aired} - ({entity_data?.aired?.split('-')?.[0]}) - {/if} - {:else} - - {/if} - {@html ' '.repeat(4)} - - {/await} - {:else} +
+
- {#if entity_data?.title} {entity_data?.title} @@ -464,12 +432,46 @@ {:else} {/if} - {/if} +
+ +
+ {#if sel?.marquee === true && contentWidth && contentWidth > 394 && !$editMode} + {#await import('$lib/Components/Marquee.svelte')} + loading + {:then Marquee} + + + {#if entity_data?.title} + {entity_data?.title} + + {#if entity_data?.aired} + ({entity_data?.aired?.split('-')?.[0]}) + {/if} + {:else} + + {/if} + {@html ' '.repeat(4)} + + {/await} + {:else} + + + {#if entity_data?.title} + {entity_data?.title} + + {#if entity_data?.aired} + ({entity_data?.aired?.split('-')?.[0]}) + {/if} + {:else} + + {/if} + {/if} +
-
- {/if} + {/if} +
-
+ {/if}