aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Data/SqliteItemRepository.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2019-01-13 12:14:53 -0500
committerGitHub <noreply@github.com>2019-01-13 12:14:53 -0500
commit9dcaafe700b7130b49bafbadf0d47b37c6ecf53b (patch)
tree6ca1b2b3decac1a86b886dafd2645954a13601fd /Emby.Server.Implementations/Data/SqliteItemRepository.cs
parent17d8de4962ea9d78f6ddb557fe26465be1944b38 (diff)
parentb936c439321b55bf89c99dac96fc78cefe752e84 (diff)
Merge pull request #458 from EraYaN/code-cleanup
Clean up several minor issues and add TODOs
Diffstat (limited to 'Emby.Server.Implementations/Data/SqliteItemRepository.cs')
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs68
1 files changed, 34 insertions, 34 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index f18a0ba08..f1894fd4f 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -82,11 +82,11 @@ namespace Emby.Server.Implementations.Data
{
if (config == null)
{
- throw new ArgumentNullException("config");
+ throw new ArgumentNullException(nameof(config));
}
if (jsonSerializer == null)
{
- throw new ArgumentNullException("jsonSerializer");
+ throw new ArgumentNullException(nameof(jsonSerializer));
}
_appHost = appHost;
@@ -455,7 +455,7 @@ namespace Emby.Server.Implementations.Data
"ColorTransfer"
};
- private string GetSaveItemCommandText()
+ private static string GetSaveItemCommandText()
{
var saveColumns = new List<string>
{
@@ -558,7 +558,7 @@ namespace Emby.Server.Implementations.Data
{
if (item == null)
{
- throw new ArgumentNullException("item");
+ throw new ArgumentNullException(nameof(item));
}
SaveItems(new List<BaseItem> { item }, cancellationToken);
@@ -568,7 +568,7 @@ namespace Emby.Server.Implementations.Data
{
if (item == null)
{
- throw new ArgumentNullException("item");
+ throw new ArgumentNullException(nameof(item));
}
CheckDisposed();
@@ -605,7 +605,7 @@ namespace Emby.Server.Implementations.Data
{
if (items == null)
{
- throw new ArgumentNullException("items");
+ throw new ArgumentNullException(nameof(items));
}
cancellationToken.ThrowIfCancellationRequested();
@@ -1070,7 +1070,7 @@ namespace Emby.Server.Implementations.Data
saveItemStatement.MoveNext();
}
- private string SerializeProviderIds(BaseItem item)
+ private static string SerializeProviderIds(BaseItem item)
{
// Ideally we shouldn't need this IsNullOrWhiteSpace check but we're seeing some cases of bad data slip through
var ids = item.ProviderIds
@@ -1085,7 +1085,7 @@ namespace Emby.Server.Implementations.Data
return string.Join("|", ids.Select(i => i.Key + "=" + i.Value).ToArray());
}
- private void DeserializeProviderIds(string value, BaseItem item)
+ private static void DeserializeProviderIds(string value, BaseItem item)
{
if (string.IsNullOrWhiteSpace(value))
{
@@ -1226,7 +1226,7 @@ namespace Emby.Server.Implementations.Data
{
if (id.Equals(Guid.Empty))
{
- throw new ArgumentNullException("id");
+ throw new ArgumentNullException(nameof(id));
}
CheckDisposed();
@@ -1948,7 +1948,7 @@ namespace Emby.Server.Implementations.Data
return item;
}
- private Guid[] SplitToGuids(string value)
+ private static Guid[] SplitToGuids(string value)
{
var ids = value.Split('|');
@@ -1965,7 +1965,7 @@ namespace Emby.Server.Implementations.Data
/// <summary>
/// Gets chapters for an item
/// </summary>
- /// <param name="id">The id.</param>
+ /// <param name="item">The item.</param>
/// <returns>IEnumerable{ChapterInfo}.</returns>
/// <exception cref="System.ArgumentNullException">id</exception>
public List<ChapterInfo> GetChapters(BaseItem item)
@@ -1996,7 +1996,7 @@ namespace Emby.Server.Implementations.Data
/// <summary>
/// Gets a single chapter for an item
/// </summary>
- /// <param name="id">The id.</param>
+ /// <param name="item">The item.</param>
/// <param name="index">The index.</param>
/// <returns>ChapterInfo.</returns>
/// <exception cref="System.ArgumentNullException">id</exception>
@@ -2067,12 +2067,12 @@ namespace Emby.Server.Implementations.Data
if (id.Equals(Guid.Empty))
{
- throw new ArgumentNullException("id");
+ throw new ArgumentNullException(nameof(id));
}
if (chapters == null)
{
- throw new ArgumentNullException("chapters");
+ throw new ArgumentNullException(nameof(chapters));
}
using (WriteLock.Write())
@@ -2144,7 +2144,7 @@ namespace Emby.Server.Implementations.Data
}
}
- private bool EnableJoinUserData(InternalItemsQuery query)
+ private static bool EnableJoinUserData(InternalItemsQuery query)
{
if (query.User == null)
{
@@ -2681,7 +2681,7 @@ namespace Emby.Server.Implementations.Data
{
if (query == null)
{
- throw new ArgumentNullException("query");
+ throw new ArgumentNullException(nameof(query));
}
CheckDisposed();
@@ -2739,7 +2739,7 @@ namespace Emby.Server.Implementations.Data
{
if (query == null)
{
- throw new ArgumentNullException("query");
+ throw new ArgumentNullException(nameof(query));
}
CheckDisposed();
@@ -2928,7 +2928,7 @@ namespace Emby.Server.Implementations.Data
{
if (query == null)
{
- throw new ArgumentNullException("query");
+ throw new ArgumentNullException(nameof(query));
}
CheckDisposed();
@@ -3212,7 +3212,7 @@ namespace Emby.Server.Implementations.Data
{
if (query == null)
{
- throw new ArgumentNullException("query");
+ throw new ArgumentNullException(nameof(query));
}
CheckDisposed();
@@ -3286,7 +3286,7 @@ namespace Emby.Server.Implementations.Data
{
if (query == null)
{
- throw new ArgumentNullException("query");
+ throw new ArgumentNullException(nameof(query));
}
CheckDisposed();
@@ -3362,7 +3362,7 @@ namespace Emby.Server.Implementations.Data
{
if (query == null)
{
- throw new ArgumentNullException("query");
+ throw new ArgumentNullException(nameof(query));
}
CheckDisposed();
@@ -5184,7 +5184,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
{
if (id.Equals(Guid.Empty))
{
- throw new ArgumentNullException("id");
+ throw new ArgumentNullException(nameof(id));
}
CheckDisposed();
@@ -5233,7 +5233,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
{
if (query == null)
{
- throw new ArgumentNullException("query");
+ throw new ArgumentNullException(nameof(query));
}
CheckDisposed();
@@ -5273,7 +5273,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
{
if (query == null)
{
- throw new ArgumentNullException("query");
+ throw new ArgumentNullException(nameof(query));
}
CheckDisposed();
@@ -5387,12 +5387,12 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
{
if (itemId.Equals(Guid.Empty))
{
- throw new ArgumentNullException("itemId");
+ throw new ArgumentNullException(nameof(itemId));
}
if (ancestorIds == null)
{
- throw new ArgumentNullException("ancestorIds");
+ throw new ArgumentNullException(nameof(ancestorIds));
}
CheckDisposed();
@@ -5556,7 +5556,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
{
if (query == null)
{
- throw new ArgumentNullException("query");
+ throw new ArgumentNullException(nameof(query));
}
if (!query.Limit.HasValue)
@@ -5915,12 +5915,12 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
{
if (itemId.Equals(Guid.Empty))
{
- throw new ArgumentNullException("itemId");
+ throw new ArgumentNullException(nameof(itemId));
}
if (values == null)
{
- throw new ArgumentNullException("keys");
+ throw new ArgumentNullException(nameof(values));
}
CheckDisposed();
@@ -5991,12 +5991,12 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
{
if (itemId.Equals(Guid.Empty))
{
- throw new ArgumentNullException("itemId");
+ throw new ArgumentNullException(nameof(itemId));
}
if (people == null)
{
- throw new ArgumentNullException("people");
+ throw new ArgumentNullException(nameof(people));
}
CheckDisposed();
@@ -6102,7 +6102,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
if (query == null)
{
- throw new ArgumentNullException("query");
+ throw new ArgumentNullException(nameof(query));
}
var cmdText = "select " + string.Join(",", _mediaStreamSaveColumns) + " from mediastreams where";
@@ -6158,12 +6158,12 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
if (id.Equals(Guid.Empty))
{
- throw new ArgumentNullException("id");
+ throw new ArgumentNullException(nameof(id));
}
if (streams == null)
{
- throw new ArgumentNullException("streams");
+ throw new ArgumentNullException(nameof(streams));
}
cancellationToken.ThrowIfCancellationRequested();