feat: show explicit badge on YouTube Music results
This commit is contained in:
@@ -8,7 +8,8 @@ namespace Musify.Application.Contracts
|
||||
string Artist,
|
||||
string Album,
|
||||
int DurationSeconds,
|
||||
string ThumbnailUrl);
|
||||
string ThumbnailUrl,
|
||||
bool IsExplicit);
|
||||
|
||||
public record YouTubeSearchResult(
|
||||
IReadOnlyList<YouTubeSongResult> Items,
|
||||
|
||||
@@ -48,7 +48,8 @@ namespace Musify.Infrastructure.Services
|
||||
song.Thumbnails
|
||||
.OrderByDescending(thumbnail => thumbnail.Width)
|
||||
.Select(thumbnail => thumbnail.Url)
|
||||
.FirstOrDefault() ?? string.Empty))
|
||||
.FirstOrDefault() ?? string.Empty,
|
||||
song.IsExplicit))
|
||||
.ToList();
|
||||
|
||||
var nextToken = string.Empty;
|
||||
@@ -122,7 +123,8 @@ namespace Musify.Infrastructure.Services
|
||||
info.Thumbnails
|
||||
.OrderByDescending(thumbnail => thumbnail.Width)
|
||||
.Select(thumbnail => thumbnail.Url)
|
||||
.FirstOrDefault() ?? string.Empty);
|
||||
.FirstOrDefault() ?? string.Empty,
|
||||
info.IsExplicit);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
|
||||
Vendored
+1
@@ -562,6 +562,7 @@ export interface components {
|
||||
/** Format: int32 */
|
||||
durationSeconds: number | string;
|
||||
thumbnailUrl: string;
|
||||
isExplicit: boolean;
|
||||
};
|
||||
/** @enum {unknown} */
|
||||
YouTubeStreamMode: "Server" | "YouTube";
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
album: string;
|
||||
durationSeconds: number;
|
||||
thumbnailUrl: string;
|
||||
isExplicit: boolean;
|
||||
}
|
||||
|
||||
type Source = 'all' | 'local' | 'yt';
|
||||
@@ -319,8 +320,16 @@
|
||||
<div class="mt-2.5 truncate text-sm font-semibold text-[var(--mf-text)]" title={song.title}>
|
||||
{song.title}
|
||||
</div>
|
||||
<div class="mt-0.5 truncate text-xs text-neutral-500" title={song.artist}>
|
||||
{song.artist}
|
||||
<div class="mt-0.5 flex min-w-0 items-center gap-1.5">
|
||||
{#if song.isExplicit}
|
||||
<span
|
||||
class="grid h-3.5 w-3.5 shrink-0 place-items-center rounded-[3px] bg-white/20 text-[9px] font-bold leading-none text-neutral-200"
|
||||
title="Contenido explícito"
|
||||
>
|
||||
E
|
||||
</span>
|
||||
{/if}
|
||||
<span class="truncate text-xs text-neutral-500" title={song.artist}>{song.artist}</span>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user