fix odd resolution padding; fix updating plex episode artwork (#173)
* fix padding odd resolutions * fix updating plex episode artwork only as needed
This commit is contained in:
@@ -4,9 +4,6 @@ namespace ErsatzTV.Core.FFmpeg
|
||||
{
|
||||
public static class DisplaySizeExtensions
|
||||
{
|
||||
internal static IDisplaySize PadToEven(this IDisplaySize size) =>
|
||||
new DisplaySize(size.Width + size.Width % 2, size.Height + size.Height % 2);
|
||||
|
||||
internal static bool IsSameSizeAs(this IDisplaySize @this, IDisplaySize that) =>
|
||||
@this.Width == that.Width && @this.Height == that.Height;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,6 @@ namespace ErsatzTV.Core.FFmpeg
|
||||
builder = builder.WithDeinterlace(playbackSettings.Deinterlace)
|
||||
.WithScaling(scaledSize);
|
||||
|
||||
scaledSize = scaledSize.PadToEven();
|
||||
if (NeedToPad(channel.FFmpegProfile.Resolution, scaledSize))
|
||||
{
|
||||
builder = builder.WithBlackBars(channel.FFmpegProfile.Resolution);
|
||||
|
||||
@@ -23,5 +23,6 @@ namespace ErsatzTV.Core.Interfaces.Repositories
|
||||
Task<Unit> MarkAsUpdated(ShowMetadata metadata, DateTime dateUpdated);
|
||||
Task<Unit> MarkAsUpdated(SeasonMetadata metadata, DateTime dateUpdated);
|
||||
Task<Unit> MarkAsUpdated(MovieMetadata metadata, DateTime dateUpdated);
|
||||
Task<Unit> MarkAsUpdated(EpisodeMetadata metadata, DateTime dateUpdated);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,6 +382,7 @@ namespace ErsatzTV.Core.Plex
|
||||
if (incomingMetadata.DateUpdated > existingMetadata.DateUpdated)
|
||||
{
|
||||
await UpdateArtworkIfNeeded(existingMetadata, incomingMetadata, ArtworkKind.Thumbnail);
|
||||
await _metadataRepository.MarkAsUpdated(existingMetadata, incomingMetadata.DateUpdated);
|
||||
}
|
||||
|
||||
return existing;
|
||||
|
||||
@@ -222,6 +222,11 @@ namespace ErsatzTV.Infrastructure.Data.Repositories
|
||||
_dbConnection.ExecuteAsync(
|
||||
@"UPDATE MovieMetadata SET DateUpdated = @DateUpdated WHERE Id = @Id",
|
||||
new { DateUpdated = dateUpdated, metadata.Id }).ToUnit();
|
||||
|
||||
public Task<Unit> MarkAsUpdated(EpisodeMetadata metadata, DateTime dateUpdated) =>
|
||||
_dbConnection.ExecuteAsync(
|
||||
@"UPDATE EpisodeMetadata SET DateUpdated = @DateUpdated WHERE Id = @Id",
|
||||
new { DateUpdated = dateUpdated, metadata.Id }).ToUnit();
|
||||
|
||||
public Task<bool> RemoveGenre(Genre genre) =>
|
||||
_dbConnection.ExecuteAsync("DELETE FROM Genre WHERE Id = @GenreId", new { GenreId = genre.Id })
|
||||
|
||||
Reference in New Issue
Block a user