|
|
|
@ -46,6 +46,8 @@ public class OtherVideoRepository : IOtherVideoRepository |
|
|
|
.ThenInclude(ovm => ovm.Directors) |
|
|
|
.ThenInclude(ovm => ovm.Directors) |
|
|
|
.Include(i => i.OtherVideoMetadata) |
|
|
|
.Include(i => i.OtherVideoMetadata) |
|
|
|
.ThenInclude(ovm => ovm.Writers) |
|
|
|
.ThenInclude(ovm => ovm.Writers) |
|
|
|
|
|
|
|
.Include(i => i.OtherVideoMetadata) |
|
|
|
|
|
|
|
.ThenInclude(ovm => ovm.Artwork) |
|
|
|
.Include(ov => ov.LibraryPath) |
|
|
|
.Include(ov => ov.LibraryPath) |
|
|
|
.ThenInclude(lp => lp.Library) |
|
|
|
.ThenInclude(lp => lp.Library) |
|
|
|
.Include(ov => ov.MediaVersions) |
|
|
|
.Include(ov => ov.MediaVersions) |
|
|
|
@ -173,6 +175,15 @@ public class OtherVideoRepository : IOtherVideoRepository |
|
|
|
new { writer.Name, MetadataId = metadata.Id }).Map(result => result > 0); |
|
|
|
new { writer.Name, MetadataId = metadata.Id }).Map(result => result > 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task<bool> RemoveArtwork(OtherVideoMetadata metadata, ArtworkKind artworkKind) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
await using TvContext dbContext = await _dbContextFactory.CreateDbContextAsync(); |
|
|
|
|
|
|
|
var ids = metadata.Artwork.Where(a => a.ArtworkKind == artworkKind).Select(a => a.Id).ToHashSet(); |
|
|
|
|
|
|
|
return await dbContext.Artwork |
|
|
|
|
|
|
|
.Where(a => ids.Contains(a.Id)) |
|
|
|
|
|
|
|
.ExecuteDeleteAsync() > 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private async Task<Either<BaseError, MediaItemScanResult<OtherVideo>>> AddOtherVideo( |
|
|
|
private async Task<Either<BaseError, MediaItemScanResult<OtherVideo>>> AddOtherVideo( |
|
|
|
TvContext dbContext, |
|
|
|
TvContext dbContext, |
|
|
|
int libraryPathId, |
|
|
|
int libraryPathId, |
|
|
|
|