diff options
| author | Eric Reed <ebr@mediabrowser3.com> | 2013-05-28 13:37:17 -0400 |
|---|---|---|
| committer | Eric Reed <ebr@mediabrowser3.com> | 2013-05-28 13:37:17 -0400 |
| commit | 316b2b80a36ee5a7032a0f9076818c2df4be60fa (patch) | |
| tree | aa67dc2fe78ebe5d5785da5065ed02a228e93016 /MediaBrowser.Server.Implementations | |
| parent | 4268800589653e57f6130c66bf92a5a406e9cbf1 (diff) | |
| parent | 9274f9f35f1269c147c6815bb85e196e3128374a (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Server.Implementations')
6 files changed, 35 insertions, 35 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs index 8e715e47c..115114e3a 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -381,6 +381,14 @@ namespace MediaBrowser.Server.Implementations.HttpServer } if (contentType.StartsWith("application/", StringComparison.OrdinalIgnoreCase)) { + if (string.Equals(contentType, "application/x-javascript", StringComparison.OrdinalIgnoreCase)) + { + return true; + } + if (string.Equals(contentType, "application/xml", StringComparison.OrdinalIgnoreCase)) + { + return true; + } return false; } diff --git a/MediaBrowser.Server.Implementations/Sqlite/SQLiteDisplayPreferencesRepository.cs b/MediaBrowser.Server.Implementations/Sqlite/SQLiteDisplayPreferencesRepository.cs index 2df377cbc..60c3c1fe0 100644 --- a/MediaBrowser.Server.Implementations/Sqlite/SQLiteDisplayPreferencesRepository.cs +++ b/MediaBrowser.Server.Implementations/Sqlite/SQLiteDisplayPreferencesRepository.cs @@ -148,6 +148,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } catch (Exception e) { @@ -157,6 +159,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } finally { diff --git a/MediaBrowser.Server.Implementations/Sqlite/SQLiteItemRepository.cs b/MediaBrowser.Server.Implementations/Sqlite/SQLiteItemRepository.cs index 33e9c7fe3..a0acd523e 100644 --- a/MediaBrowser.Server.Implementations/Sqlite/SQLiteItemRepository.cs +++ b/MediaBrowser.Server.Implementations/Sqlite/SQLiteItemRepository.cs @@ -236,15 +236,19 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } catch (Exception e) { - Logger.ErrorException("Failed to save item:", e); + Logger.ErrorException("Failed to save items:", e); if (transaction != null) { transaction.Rollback(); } + + throw; } finally { @@ -439,15 +443,19 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } catch (Exception e) { - Logger.ErrorException("Failed to save item:", e); + Logger.ErrorException("Failed to save children:", e); if (transaction != null) { transaction.Rollback(); } + + throw; } finally { diff --git a/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs b/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs index ee2fcc10c..7547212c5 100644 --- a/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs +++ b/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs @@ -152,38 +152,6 @@ namespace MediaBrowser.Server.Implementations.Sqlite } /// <summary> - /// Executes the command. - /// </summary> - /// <param name="cmd">The CMD.</param> - /// <returns>Task.</returns> - /// <exception cref="System.ArgumentNullException">cmd</exception> - public async Task ExecuteCommand(DbCommand cmd) - { - if (cmd == null) - { - throw new ArgumentNullException("cmd"); - } - - using (var tran = Connection.BeginTransaction()) - { - try - { - cmd.Connection = Connection; - cmd.Transaction = tran; - - await cmd.ExecuteNonQueryAsync().ConfigureAwait(false); - - tran.Commit(); - } - catch (Exception e) - { - Logger.ErrorException("Failed to commit transaction.", e); - tran.Rollback(); - } - } - } - - /// <summary> /// Gets a stream from a DataReader at a given ordinal /// </summary> /// <param name="reader">The reader.</param> diff --git a/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.cs b/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.cs index 284ef10fb..d378809ff 100644 --- a/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.cs +++ b/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.cs @@ -203,6 +203,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } catch (Exception e) { @@ -212,6 +214,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } finally { diff --git a/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserRepository.cs b/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserRepository.cs index df0d13b62..335841549 100644 --- a/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserRepository.cs +++ b/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserRepository.cs @@ -145,6 +145,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } catch (Exception e) { @@ -154,6 +156,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } finally { @@ -228,7 +232,7 @@ namespace MediaBrowser.Server.Implementations.Sqlite cmd.Transaction = transaction; - await ExecuteCommand(cmd).ConfigureAwait(false); + await cmd.ExecuteNonQueryAsync(cancellationToken).ConfigureAwait(false); } transaction.Commit(); @@ -239,6 +243,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } catch (Exception e) { @@ -248,6 +254,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } finally { |
