From 6159b6a5b2126c614d8b45e1685a295ea7520bc5 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Mon, 4 Aug 2025 23:17:16 +0000 Subject: [PATCH] support more music video thumbnail filenames (#2258) --- CHANGELOG.md | 2 + .../Core/Metadata/MusicVideoFolderScanner.cs | 10 ++++- ErsatzTV/Pages/Artist.razor | 41 ++++++++++++------- ErsatzTV/wwwroot/css/site.css | 9 ++++ 4 files changed, 47 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e6124d2d..0904085f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add channel `Idle Behavior` setting to control the transcoding behavior after all clients have disconnected - `Stop On Disconnect` - stops the transcoder after all clients have disconnected + the global idle timeout - `Keep Running` - transcoder will run until manually stopped +- Add support for music video thumbnails that end in `-thumb` + - For example `Music Video.mkv` could have a corresponding thumbnail `Music Video-thumb.jpg` ### Fixed - Fix app startup with MySql/MariaDB diff --git a/ErsatzTV.Scanner/Core/Metadata/MusicVideoFolderScanner.cs b/ErsatzTV.Scanner/Core/Metadata/MusicVideoFolderScanner.cs index 80f1d76e3..a837cf555 100644 --- a/ErsatzTV.Scanner/Core/Metadata/MusicVideoFolderScanner.cs +++ b/ErsatzTV.Scanner/Core/Metadata/MusicVideoFolderScanner.cs @@ -546,8 +546,16 @@ public class MusicVideoFolderScanner : LocalFolderScanner, IMusicVideoFolderScan private Option LocateThumbnail(MusicVideo musicVideo) { string path = musicVideo.MediaVersions.Head().MediaFiles.Head().Path; + + string directory = Path.GetDirectoryName(path) ?? string.Empty; + string filenameWithoutExtension = Path.GetFileNameWithoutExtension(path); + string extension = Path.GetExtension(path); + + string thumbFilename = filenameWithoutExtension + "-thumb" + extension; + string thumbPath = Path.Combine(directory, thumbFilename); + return ImageFileExtensions - .Map(ext => Path.ChangeExtension(path, ext)) + .SelectMany(ext => new[] { Path.ChangeExtension(path, ext), Path.ChangeExtension(thumbPath, ext) }) .Filter(f => _localFileSystem.FileExists(f)) .HeadOrNone(); } diff --git a/ErsatzTV/Pages/Artist.razor b/ErsatzTV/Pages/Artist.razor index a3b79f220..682dcf2a7 100644 --- a/ErsatzTV/Pages/Artist.razor +++ b/ErsatzTV/Pages/Artist.razor @@ -18,6 +18,10 @@ { fan art } + else + { + + } @@ -25,7 +29,11 @@ { } -
+ else + { + + } +
@_artist?.Name @@ -35,23 +43,28 @@ @_artist.Disambiguation - @if (!string.IsNullOrWhiteSpace(_artist.Biography)) - { - - @if (_artist.Biography.Length > 400) - { - @(_artist.Biography.Substring(0, 400) + "...") - } - else - { - @_artist.Biography - } - + @if (!string.IsNullOrWhiteSpace(_artist.Biography)) + { + + @if (_artist.Biography.Length > 400) + { + @(_artist.Biography.Substring(0, 400) + "...") + } + else + { + @_artist.Biography + } + + } + else + { +
+
+ }
- } .fanart-tint { background: linear-gradient(rgba(var(--fanart-background-rgb), 0.47) 0%, rgb(var(--fanart-background-rgb)) 100%); height: 400px;