diff options
| author | Andrew Rabert <6550543+nvllsvm@users.noreply.github.com> | 2019-01-24 22:57:44 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-24 22:57:44 -0500 |
| commit | 2c9e056d52840dd98da27a6527fab970150c139f (patch) | |
| tree | 8af78ab36731a998807633e5b76d26f26de9faed /Emby.Server.Implementations | |
| parent | e05e002b8bb4d13eb2b80b56a0aad8903ddb701e (diff) | |
| parent | 1d7d4c573875093b97a5929fdee976cd0dcbedea (diff) | |
Merge pull request #699 from jellyfin/dev
Dev sync
Diffstat (limited to 'Emby.Server.Implementations')
| -rw-r--r-- | Emby.Server.Implementations/Data/SqliteItemRepository.cs | 14 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Diagnostics/CommonProcess.cs | 18 |
2 files changed, 20 insertions, 12 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 492adef6a..21294f96f 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -4712,9 +4712,21 @@ namespace Emby.Server.Implementations.Data continue; } - var paramName = "@HasAnyProviderId" + index; + // TODO this seems to be an idea for a better schema where ProviderIds are their own table + // buut this is not implemented //hasProviderIds.Add("(COALESCE((select value from ProviderIds where ItemId=Guid and Name = '" + pair.Key + "'), '') <> " + paramName + ")"); + + // TODO this is a really BAD way to do it since the pair: + // Tmdb, 1234 matches Tmdb=1234 but also Tmdb=1234567 + // and maybe even NotTmdb=1234. + + // this is a placeholder for this specific pair to correlate it in the bigger query + var paramName = "@HasAnyProviderId" + index; + + // this is a search for the placeholder hasProviderIds.Add("ProviderIds like " + paramName + ""); + + // this replaces the placeholder with a value, here: %key=val% if (statement != null) { statement.TryBind(paramName, "%" + pair.Key + "=" + pair.Value + "%"); diff --git a/Emby.Server.Implementations/Diagnostics/CommonProcess.cs b/Emby.Server.Implementations/Diagnostics/CommonProcess.cs index d8a798c46..55539eafc 100644 --- a/Emby.Server.Implementations/Diagnostics/CommonProcess.cs +++ b/Emby.Server.Implementations/Diagnostics/CommonProcess.cs @@ -105,26 +105,22 @@ namespace Emby.Server.Implementations.Diagnostics { return _process.WaitForExit(timeMs); } - + public Task<bool> WaitForExitAsync(int timeMs) { - //if (_process.WaitForExit(100)) - //{ - // return Task.FromResult(true); - //} + //Note: For this function to work correctly, the option EnableRisingEvents needs to be set to true. + + if (HasExited) + { + return Task.FromResult(true); + } - //timeMs -= 100; timeMs = Math.Max(0, timeMs); var tcs = new TaskCompletionSource<bool>(); var cancellationToken = new CancellationTokenSource(timeMs).Token; - if (HasExited) - { - return Task.FromResult(true); - } - _process.Exited += (sender, args) => tcs.TrySetResult(true); cancellationToken.Register(() => tcs.TrySetResult(HasExited)); |
