fix mixed platform directory mapping (#106)

* sync plex platform and platform version

* fix mixed-platform path replacements
This commit is contained in:
Jason Dove
2021-03-28 01:40:40 +00:00
committed by GitHub
parent 22c4fe2a27
commit 104d4a0cbd
15 changed files with 2075 additions and 35 deletions
@@ -135,6 +135,7 @@ namespace ErsatzTV.Infrastructure.Data.Repositories
inner join PlexPathReplacement ppr on ppr.PlexMediaSourceId = l.MediaSourceId
where lp.Id = {0}",
plexLibraryPathId)
.Include(ppr => ppr.PlexMediaSource)
.ToListAsync();
}
@@ -158,8 +159,20 @@ namespace ErsatzTV.Infrastructure.Data.Repositories
List<PlexConnection> toDelete)
{
await _dbConnection.ExecuteAsync(
@"UPDATE PlexMediaSource SET ProductVersion = @ProductVersion, ServerName = @ServerName WHERE Id = @Id",
new { plexMediaSource.ProductVersion, plexMediaSource.ServerName, plexMediaSource.Id });
@"UPDATE PlexMediaSource SET
ProductVersion = @ProductVersion,
Platform = @Platform,
PlatformVersion = @PlatformVersion,
ServerName = @ServerName
WHERE Id = @Id",
new
{
plexMediaSource.ProductVersion,
plexMediaSource.Platform,
plexMediaSource.PlatformVersion,
plexMediaSource.ServerName,
plexMediaSource.Id
});
await using TvContext dbContext = _dbContextFactory.CreateDbContext();