diff --git a/backend/Musify.Application/Contracts/IYouTubeMusicService.cs b/backend/Musify.Application/Contracts/IYouTubeMusicService.cs index b19f6a3..6fa0af2 100644 --- a/backend/Musify.Application/Contracts/IYouTubeMusicService.cs +++ b/backend/Musify.Application/Contracts/IYouTubeMusicService.cs @@ -8,7 +8,8 @@ namespace Musify.Application.Contracts string Artist, string Album, int DurationSeconds, - string ThumbnailUrl); + string ThumbnailUrl, + bool IsExplicit); public record YouTubeSearchResult( IReadOnlyList Items, diff --git a/backend/Musify.Infrastructure/Services/YouTubeMusicService.cs b/backend/Musify.Infrastructure/Services/YouTubeMusicService.cs index 23aacc3..1e1d9d7 100644 --- a/backend/Musify.Infrastructure/Services/YouTubeMusicService.cs +++ b/backend/Musify.Infrastructure/Services/YouTubeMusicService.cs @@ -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) { diff --git a/frontend/src/lib/api/schema.d.ts b/frontend/src/lib/api/schema.d.ts index 118d780..a1e37f0 100644 --- a/frontend/src/lib/api/schema.d.ts +++ b/frontend/src/lib/api/schema.d.ts @@ -562,6 +562,7 @@ export interface components { /** Format: int32 */ durationSeconds: number | string; thumbnailUrl: string; + isExplicit: boolean; }; /** @enum {unknown} */ YouTubeStreamMode: "Server" | "YouTube"; diff --git a/frontend/src/routes/(app)/explore/+page.svelte b/frontend/src/routes/(app)/explore/+page.svelte index d4d9dcd..535b731 100644 --- a/frontend/src/routes/(app)/explore/+page.svelte +++ b/frontend/src/routes/(app)/explore/+page.svelte @@ -17,6 +17,7 @@ album: string; durationSeconds: number; thumbnailUrl: string; + isExplicit: boolean; } type Source = 'all' | 'local' | 'yt'; @@ -319,8 +320,16 @@
{song.title}
-
- {song.artist} +
+ {#if song.isExplicit} + + E + + {/if} + {song.artist}