@ -126,8 +126,6 @@ public class SongVideoGenerator : ISongVideoGenerator
int leftMarginPercent = HORIZONTAL_MARGIN_PERCENT ;
int leftMarginPercent = HORIZONTAL_MARGIN_PERCENT ;
int rightMarginPercent = HORIZONTAL_MARGIN_PERCENT ;
int rightMarginPercent = HORIZONTAL_MARGIN_PERCENT ;
if ( metadata . Artwork . Any ( a = > a . ArtworkKind = = ArtworkKind . Thumbnail ) )
{
switch ( watermarkLocation )
switch ( watermarkLocation )
{
{
case WatermarkLocation . BottomLeft :
case WatermarkLocation . BottomLeft :
@ -138,7 +136,6 @@ public class SongVideoGenerator : ISongVideoGenerator
rightMarginPercent + = WATERMARK_WIDTH_PERCENT + HORIZONTAL_MARGIN_PERCENT ;
rightMarginPercent + = WATERMARK_WIDTH_PERCENT + HORIZONTAL_MARGIN_PERCENT ;
break ;
break ;
}
}
}
var leftMargin = ( int ) Math . Round ( leftMarginPercent / 1 0 0.0 * channel . FFmpegProfile . Resolution . Width ) ;
var leftMargin = ( int ) Math . Round ( leftMarginPercent / 1 0 0.0 * channel . FFmpegProfile . Resolution . Width ) ;
var rightMargin = ( int ) Math . Round ( rightMarginPercent / 1 0 0.0 * channel . FFmpegProfile . Resolution . Width ) ;
var rightMargin = ( int ) Math . Round ( rightMarginPercent / 1 0 0.0 * channel . FFmpegProfile . Resolution . Width ) ;
@ -161,13 +158,20 @@ public class SongVideoGenerator : ISongVideoGenerator
. BuildFile ( ) ;
. BuildFile ( ) ;
// use thumbnail (cover art) if present
// use thumbnail (cover art) if present
foreach ( Artwork artwork in Optional (
// fall back to default art
metadata . Artwork . Find ( a = > a . ArtworkKind = = ArtworkKind . Thumbnail ) ) )
Artwork artwork = await Optional ( metadata . Artwork . Find ( a = > a . ArtworkKind = = ArtworkKind . Thumbnail ) )
. IfNoneAsync (
new Artwork
{
{
Id = 0 ,
ArtworkKind = ArtworkKind . Thumbnail ,
Path = Path . Combine ( FileSystemLayout . ResourcesCacheFolder , "song_album_cover_512.png" ) ,
} ) ;
// signal that we want to use cover art as watermark
// signal that we want to use cover art as watermark
videoVersion = new CoverArtMediaVersion
videoVersion = new CoverArtMediaVersion
{
{
Chapters = new List < MediaChapter > ( ) ,
Chapters = [ ] ,
// always stretch cover art
// always stretch cover art
Width = 1 9 2 ,
Width = 1 9 2 ,
Height = 1 0 8 ,
Height = 1 0 8 ,
@ -185,6 +189,9 @@ public class SongVideoGenerator : ISongVideoGenerator
watermarkPath = customPath ;
watermarkPath = customPath ;
// only blurhash real album art
if ( artwork . Id > 0 )
{
// randomize selected blur hash
// randomize selected blur hash
var hashes = new List < string >
var hashes = new List < string >
{
{