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