aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/BaseItem.cs
diff options
context:
space:
mode:
authorVasily <JustAMan@users.noreply.github.com>2019-09-24 19:08:39 +0300
committerGitHub <noreply@github.com>2019-09-24 19:08:39 +0300
commitac9dfa8e93106d907bbf78fe2350adfa47c76cec (patch)
tree451a0af637b7114439b85ce7878ff82b43281cc8 /MediaBrowser.Controller/Entities/BaseItem.cs
parentb086f6d330503a055e1b073cdb3847c825839da3 (diff)
parentc9820d30edf1cb8fa99a52ec72b6571d6d4506f7 (diff)
Merge pull request #1775 from Bond-009/fixes
Fix multiple mistakes and warnings
Diffstat (limited to 'MediaBrowser.Controller/Entities/BaseItem.cs')
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs21
1 files changed, 14 insertions, 7 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index 0e9f7ee44..369f63b13 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -2045,7 +2045,7 @@ namespace MediaBrowser.Controller.Entities
if (itemByPath == null)
{
- //Logger.LogWarning("Unable to find linked item at path {0}", info.Path);
+ Logger.LogWarning("Unable to find linked item at path {0}", info.Path);
}
return itemByPath;
@@ -2057,7 +2057,7 @@ namespace MediaBrowser.Controller.Entities
if (item == null)
{
- //Logger.LogWarning("Unable to find linked item at path {0}", info.Path);
+ Logger.LogWarning("Unable to find linked item at path {0}", info.Path);
}
return item;
@@ -2085,14 +2085,17 @@ namespace MediaBrowser.Controller.Entities
if (!current.Contains(name, StringComparer.OrdinalIgnoreCase))
{
- if (current.Length == 0)
+ int curLen = current.Length;
+ if (curLen == 0)
{
Studios = new[] { name };
}
else
{
- var list =
- Studios = current.Concat(new[] { name }).ToArray();
+ var newArr = new string[curLen + 1];
+ current.CopyTo(newArr, 0);
+ newArr[curLen] = name;
+ Studios = newArr;
}
}
}
@@ -2231,8 +2234,12 @@ namespace MediaBrowser.Controller.Entities
else
{
- var currentCount = ImageInfos.Length;
- ImageInfos = ImageInfos.Concat(new[] { image }).ToArray();
+ var current = ImageInfos;
+ var currentCount = current.Length;
+ var newArr = new ItemImageInfo[currentCount + 1];
+ current.CopyTo(newArr, 0);
+ current[currentCount] = image;
+ ImageInfos = current;
}
}