allow block items to disable watermarks (#2139)
* allow block items to disable watermarks * fix test
This commit is contained in:
@@ -72,6 +72,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- `remaining_duration`: duration of the content after this mid-roll point, in seconds
|
||||
- `point`: the position of the mid-roll point, in seconds
|
||||
- `num`: the mid-roll point number, starting with 1
|
||||
- Add `Disable Watermarks` checkbox to block items
|
||||
- Block items that have this checked will never display a watermark, even with Deco set to override watermark
|
||||
|
||||
### Changed
|
||||
- Allow `Other Video` libraries and `Image` libraries to use the same folders
|
||||
|
||||
@@ -13,4 +13,5 @@ public record BlockItemViewModel(
|
||||
SmartCollectionViewModel SmartCollection,
|
||||
NamedMediaItemViewModel MediaItem,
|
||||
PlaybackOrder PlaybackOrder,
|
||||
bool IncludeInProgramGuide);
|
||||
bool IncludeInProgramGuide,
|
||||
bool DisableWatermarks);
|
||||
|
||||
@@ -10,4 +10,5 @@ public record ReplaceBlockItem(
|
||||
int? SmartCollectionId,
|
||||
int? MediaItemId,
|
||||
PlaybackOrder PlaybackOrder,
|
||||
bool IncludeInProgramGuide);
|
||||
bool IncludeInProgramGuide,
|
||||
bool DisableWatermarks);
|
||||
|
||||
@@ -54,7 +54,8 @@ public class ReplaceBlockItemsHandler(IDbContextFactory<TvContext> dbContextFact
|
||||
SmartCollectionId = item.SmartCollectionId,
|
||||
MediaItemId = item.MediaItemId,
|
||||
PlaybackOrder = item.PlaybackOrder,
|
||||
IncludeInProgramGuide = item.IncludeInProgramGuide
|
||||
IncludeInProgramGuide = item.IncludeInProgramGuide,
|
||||
DisableWatermarks = item.DisableWatermarks
|
||||
};
|
||||
|
||||
private static Task<Validation<BaseError, Block>> Validate(TvContext dbContext, ReplaceBlockItems request) =>
|
||||
|
||||
@@ -31,7 +31,8 @@ internal static class Mapper
|
||||
_ => null
|
||||
},
|
||||
blockItem.PlaybackOrder,
|
||||
blockItem.IncludeInProgramGuide);
|
||||
blockItem.IncludeInProgramGuide,
|
||||
blockItem.DisableWatermarks);
|
||||
|
||||
internal static TemplateGroupViewModel ProjectToViewModel(TemplateGroup templateGroup) =>
|
||||
new(templateGroup.Id, templateGroup.Name, templateGroup.Templates.Count);
|
||||
|
||||
@@ -689,6 +689,11 @@ public class GetPlayoutItemProcessByChannelNumberHandler : FFmpegProcessHandler<
|
||||
|
||||
private WatermarkResult GetPlayoutItemWatermark(PlayoutItem playoutItem, DateTimeOffset now)
|
||||
{
|
||||
if (playoutItem.DisableWatermarks)
|
||||
{
|
||||
return new DisableWatermark();
|
||||
}
|
||||
|
||||
DecoEntries decoEntries = GetDecoEntries(playoutItem.Playout, now);
|
||||
|
||||
// first, check deco template / active deco
|
||||
|
||||
@@ -432,7 +432,7 @@ public class PlayoutModeSchedulerBaseTests : SchedulerTestBase
|
||||
PadToNearestMinute = 60,
|
||||
CollectionId = 2,
|
||||
Collection = collectionTwo,
|
||||
Expression = "chapter_num % 2 == 0"
|
||||
Expression = "num % 2 == 0"
|
||||
},
|
||||
PostRollFiller = new FillerPreset
|
||||
{
|
||||
|
||||
@@ -17,4 +17,5 @@ public class BlockItem
|
||||
public SmartCollection SmartCollection { get; set; }
|
||||
public PlaybackOrder PlaybackOrder { get; set; }
|
||||
public bool IncludeInProgramGuide { get; set; }
|
||||
public bool DisableWatermarks { get; set; }
|
||||
}
|
||||
|
||||
@@ -167,6 +167,7 @@ public class BlockPlayoutBuilder(
|
||||
InPoint = TimeSpan.Zero,
|
||||
OutPoint = itemDuration,
|
||||
FillerKind = blockItem.IncludeInProgramGuide ? FillerKind.None : FillerKind.GuideMode,
|
||||
DisableWatermarks = blockItem.DisableWatermarks,
|
||||
//CustomTitle = scheduleItem.CustomTitle,
|
||||
//WatermarkId = scheduleItem.WatermarkId,
|
||||
//PreferredAudioLanguageCode = scheduleItem.PreferredAudioLanguageCode,
|
||||
|
||||
Generated
+5917
File diff suppressed because it is too large
Load Diff
+29
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ErsatzTV.Infrastructure.MySql.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Add_BlockItemDisableWatermarks : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "DisableWatermarks",
|
||||
table: "BlockItem",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisableWatermarks",
|
||||
table: "BlockItem");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2259,6 +2259,9 @@ namespace ErsatzTV.Infrastructure.MySql.Migrations
|
||||
b.Property<int>("CollectionType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("DisableWatermarks")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<bool>("IncludeInProgramGuide")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
|
||||
Generated
+5756
File diff suppressed because it is too large
Load Diff
+29
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Add_BlockItemDisableWatermarks : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "DisableWatermarks",
|
||||
table: "BlockItem",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisableWatermarks",
|
||||
table: "BlockItem");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2146,6 +2146,9 @@ namespace ErsatzTV.Infrastructure.Sqlite.Migrations
|
||||
b.Property<int>("CollectionType")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("DisableWatermarks")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("IncludeInProgramGuide")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
|
||||
@@ -628,6 +628,8 @@ public sealed class LuceneSearchIndex : ISearchIndex
|
||||
List<string> subLanguages = await searchRepository.GetSubLanguagesForShow(show);
|
||||
await AddSubLanguages(searchRepository, doc, subLanguages);
|
||||
|
||||
AddCollections(doc, show.Collections);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(metadata.ContentRating))
|
||||
{
|
||||
foreach (string contentRating in (metadata.ContentRating ?? string.Empty).Split("/")
|
||||
@@ -772,6 +774,8 @@ public sealed class LuceneSearchIndex : ISearchIndex
|
||||
List<string> subLanguages = await searchRepository.GetSubLanguagesForSeason(season);
|
||||
await AddSubLanguages(searchRepository, doc, subLanguages);
|
||||
|
||||
AddCollections(doc, season.Collections);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(showMetadata.ContentRating))
|
||||
{
|
||||
foreach (string contentRating in (showMetadata.ContentRating ?? string.Empty).Split("/")
|
||||
@@ -854,6 +858,8 @@ public sealed class LuceneSearchIndex : ISearchIndex
|
||||
List<string> subLanguages = await searchRepository.GetSubLanguagesForArtist(artist);
|
||||
await AddSubLanguages(searchRepository, doc, subLanguages);
|
||||
|
||||
AddCollections(doc, artist.Collections);
|
||||
|
||||
doc.Add(
|
||||
new StringField(
|
||||
AddedDateField,
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
<MudTh>Collection</MudTh>
|
||||
<MudTh>Playback Order</MudTh>
|
||||
<MudTh>Show In EPG</MudTh>
|
||||
<MudTh>Disable Watermarks</MudTh>
|
||||
<MudTh/>
|
||||
<MudTh/>
|
||||
<MudTh/>
|
||||
@@ -96,6 +97,9 @@
|
||||
<MudTd>
|
||||
<MudCheckBox T="bool" Value="@context.IncludeInProgramGuide" ValueChanged="@(e => UpdateEPG(context, e))"/>
|
||||
</MudTd>
|
||||
<MudTd>
|
||||
<MudCheckBox T="bool" Value="@context.DisableWatermarks" ValueChanged="@(e => UpdateWatermark(context, e))"/>
|
||||
</MudTd>
|
||||
<MudTd>
|
||||
<MudIconButton Icon="@Icons.Material.Filled.ContentCopy"
|
||||
OnClick="@(_ => CopyItem(context))">
|
||||
@@ -406,7 +410,8 @@
|
||||
SmartCollection = item.SmartCollection,
|
||||
MediaItem = item.MediaItem,
|
||||
PlaybackOrder = item.PlaybackOrder,
|
||||
IncludeInProgramGuide = item.IncludeInProgramGuide
|
||||
IncludeInProgramGuide = item.IncludeInProgramGuide,
|
||||
DisableWatermarks = item.DisableWatermarks
|
||||
};
|
||||
|
||||
private void AddBlockItem()
|
||||
@@ -433,7 +438,8 @@
|
||||
MultiCollection = item.MultiCollection,
|
||||
SmartCollection = item.SmartCollection,
|
||||
MediaItem = item.MediaItem,
|
||||
IncludeInProgramGuide = item.IncludeInProgramGuide
|
||||
IncludeInProgramGuide = item.IncludeInProgramGuide,
|
||||
DisableWatermarks = item.DisableWatermarks
|
||||
};
|
||||
|
||||
foreach (BlockItemEditViewModel i in _block.Items.Filter(bi => bi.Index >= newItem.Index))
|
||||
@@ -490,7 +496,8 @@
|
||||
item.SmartCollection?.Id,
|
||||
item.MediaItem?.MediaItemId,
|
||||
item.PlaybackOrder,
|
||||
item.IncludeInProgramGuide)).ToList();
|
||||
item.IncludeInProgramGuide,
|
||||
item.DisableWatermarks)).ToList();
|
||||
|
||||
_block.Minutes = _durationHours * 60 + _durationMinutes;
|
||||
|
||||
@@ -505,4 +512,6 @@
|
||||
|
||||
private static void UpdateEPG(BlockItemEditViewModel context, bool includeInProgramGuide) => context.IncludeInProgramGuide = includeInProgramGuide;
|
||||
|
||||
private static void UpdateWatermark(BlockItemEditViewModel context, bool disableWatermarks) => context.DisableWatermarks = disableWatermarks;
|
||||
|
||||
}
|
||||
@@ -60,6 +60,8 @@ public class BlockItemEditViewModel : INotifyPropertyChanged
|
||||
|
||||
public bool IncludeInProgramGuide { get; set; }
|
||||
|
||||
public bool DisableWatermarks { get; set; }
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) =>
|
||||
|
||||
Reference in New Issue
Block a user