From e287e3a50d0f83a43905c17434e928fd6d754d9f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 26 Aug 2017 20:32:33 -0400 Subject: remove async when there's nothing to await --- .../Data/SqliteItemRepository.cs | 31 +++++++++------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'Emby.Server.Implementations/Data/SqliteItemRepository.cs') diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index ff1d217e55..74e009bd99 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -132,8 +132,7 @@ namespace Emby.Server.Implementations.Data /// /// Opens the connection to the database /// - /// Task. - public async Task Initialize(SqliteUserDataRepository userDataRepo) + public void Initialize(SqliteUserDataRepository userDataRepo) { using (var connection = CreateConnection()) { @@ -600,16 +599,15 @@ namespace Emby.Server.Implementations.Data /// /// The item. /// The cancellation token. - /// Task. /// item - public Task SaveItem(BaseItem item, CancellationToken cancellationToken) + public void SaveItem(BaseItem item, CancellationToken cancellationToken) { if (item == null) { throw new ArgumentNullException("item"); } - return SaveItems(new List { item }, cancellationToken); + SaveItems(new List { item }, cancellationToken); } /// @@ -617,13 +615,12 @@ namespace Emby.Server.Implementations.Data /// /// The items. /// The cancellation token. - /// Task. /// /// items /// or /// cancellationToken /// - public async Task SaveItems(List items, CancellationToken cancellationToken) + public void SaveItems(List items, CancellationToken cancellationToken) { if (items == null) { @@ -1959,22 +1956,18 @@ namespace Emby.Server.Implementations.Data /// Gets the critic reviews. /// /// The item id. - /// Task{IEnumerable{ItemReview}}. public List GetCriticReviews(Guid itemId) { return new List(); } - private readonly Task _cachedTask = Task.FromResult(true); /// /// Saves the critic reviews. /// /// The item id. /// The critic reviews. - /// Task. - public Task SaveCriticReviews(Guid itemId, IEnumerable criticReviews) + public void SaveCriticReviews(Guid itemId, IEnumerable criticReviews) { - return _cachedTask; } /// @@ -2079,7 +2072,7 @@ namespace Emby.Server.Implementations.Data /// /// Saves the chapters. /// - public async Task SaveChapters(Guid id, List chapters) + public void SaveChapters(Guid id, List chapters) { CheckDisposed(); @@ -4654,12 +4647,12 @@ namespace Emby.Server.Implementations.Data typeof(AggregateFolder) }; - public async Task UpdateInheritedValues(CancellationToken cancellationToken) + public void UpdateInheritedValues(CancellationToken cancellationToken) { - await UpdateInheritedTags(cancellationToken).ConfigureAwait(false); + UpdateInheritedTags(cancellationToken); } - private async Task UpdateInheritedTags(CancellationToken cancellationToken) + private void UpdateInheritedTags(CancellationToken cancellationToken) { var newValues = new List>(); @@ -4754,7 +4747,7 @@ limit 100"; return new[] { value }.Where(IsValidType); } - public async Task DeleteItem(Guid id, CancellationToken cancellationToken) + public void DeleteItem(Guid id, CancellationToken cancellationToken) { if (id == Guid.Empty) { @@ -5485,7 +5478,7 @@ limit 100"; } } - public async Task UpdatePeople(Guid itemId, List people) + public void UpdatePeople(Guid itemId, List people) { if (itemId == Guid.Empty) { @@ -5615,7 +5608,7 @@ limit 100"; } } - public async Task SaveMediaStreams(Guid id, List streams, CancellationToken cancellationToken) + public void SaveMediaStreams(Guid id, List streams, CancellationToken cancellationToken) { CheckDisposed(); -- cgit v1.2.3