update plex plot during deep scan (#2105)
This commit is contained in:
@@ -86,6 +86,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Classify HDHR endpoints as streaming endpoints
|
||||
- This allows these endpoints to be accessed through port `ETV_STREAMING_PORT` (default `8409`)
|
||||
- This only matters if you configured `ETV_UI_PORT` to be a different value, which makes UI endpoints inaccessible on the streaming port
|
||||
- Update Plex movie/other video plot ("summary") during library deep scan
|
||||
|
||||
## [25.2.0] - 2025-06-24
|
||||
### Added
|
||||
|
||||
@@ -36,6 +36,8 @@ public interface IMetadataRepository
|
||||
Task<Unit> MarkAsExternal(OtherVideoMetadata metadata);
|
||||
Task<Unit> SetContentRating(MovieMetadata metadata, string contentRating);
|
||||
Task<Unit> SetContentRating(OtherVideoMetadata metadata, string contentRating);
|
||||
Task<Unit> SetPlot(MovieMetadata metadata, string plot);
|
||||
Task<Unit> SetPlot(OtherVideoMetadata metadata, string plot);
|
||||
|
||||
[SuppressMessage("Naming", "CA1720:Identifier contains type name")]
|
||||
Task<bool> RemoveGuid(MetadataGuid guid);
|
||||
|
||||
@@ -456,6 +456,21 @@ public class MetadataRepository : IMetadataRepository
|
||||
new { metadata.Id, ContentRating = contentRating }).ToUnit();
|
||||
}
|
||||
|
||||
public async Task<Unit> SetPlot(MovieMetadata metadata, string plot)
|
||||
{
|
||||
await using TvContext dbContext = await _dbContextFactory.CreateDbContextAsync();
|
||||
return await dbContext.Connection.ExecuteAsync(
|
||||
@"UPDATE MovieMetadata SET Plot = @Plot WHERE Id = @Id",
|
||||
new { metadata.Id, Plot = plot }).ToUnit(); }
|
||||
|
||||
public async Task<Unit> SetPlot(OtherVideoMetadata metadata, string plot)
|
||||
{
|
||||
await using TvContext dbContext = await _dbContextFactory.CreateDbContextAsync();
|
||||
return await dbContext.Connection.ExecuteAsync(
|
||||
@"UPDATE OtherVideoMetadata SET Plot = @Plot WHERE Id = @Id",
|
||||
new { metadata.Id, Plot = plot }).ToUnit();
|
||||
}
|
||||
|
||||
public async Task<bool> RemoveGuid(MetadataGuid guid)
|
||||
{
|
||||
await using TvContext dbContext = await _dbContextFactory.CreateDbContextAsync();
|
||||
|
||||
@@ -174,6 +174,13 @@ public class PlexMovieLibraryScanner :
|
||||
result.IsUpdated = true;
|
||||
}
|
||||
|
||||
if (existingMetadata.Plot != fullMetadata.Plot)
|
||||
{
|
||||
existingMetadata.Plot = fullMetadata.Plot;
|
||||
await _metadataRepository.SetPlot(existingMetadata, fullMetadata.Plot);
|
||||
result.IsUpdated = true;
|
||||
}
|
||||
|
||||
foreach (Genre genre in existingMetadata.Genres
|
||||
.Filter(g => fullMetadata.Genres.All(g2 => g2.Name != g.Name))
|
||||
.ToList())
|
||||
|
||||
@@ -177,6 +177,13 @@ public class PlexOtherVideoLibraryScanner :
|
||||
result.IsUpdated = true;
|
||||
}
|
||||
|
||||
if (existingMetadata.Plot != fullMetadata.Plot)
|
||||
{
|
||||
existingMetadata.Plot = fullMetadata.Plot;
|
||||
await _metadataRepository.SetPlot(existingMetadata, fullMetadata.Plot);
|
||||
result.IsUpdated = true;
|
||||
}
|
||||
|
||||
foreach (Genre genre in existingMetadata.Genres
|
||||
.Filter(g => fullMetadata.Genres.All(g2 => g2.Name != g.Name))
|
||||
.ToList())
|
||||
|
||||
Reference in New Issue
Block a user