aboutsummaryrefslogtreecommitdiff
path: root/src/Jellyfin.LiveTv/Timers/ItemDataProvider.cs
diff options
context:
space:
mode:
authorNyanmisaka <nst799610810@gmail.com>2024-07-23 15:37:33 +0800
committerGitHub <noreply@github.com>2024-07-23 15:37:33 +0800
commit00088c295445fe2710cae468e1b09f98a32e40a5 (patch)
tree77614fb434409bc2ddf3d7d0b5830339a6374bfb /src/Jellyfin.LiveTv/Timers/ItemDataProvider.cs
parentdeb36eeedaba2f1421b92d290d85d45bfe48d1f5 (diff)
parent19dca018b2604ff8666cabaf9d0f9c8974572756 (diff)
Merge branch 'master' into fix-hwa-video-rotation
Diffstat (limited to 'src/Jellyfin.LiveTv/Timers/ItemDataProvider.cs')
-rw-r--r--src/Jellyfin.LiveTv/Timers/ItemDataProvider.cs12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/Jellyfin.LiveTv/Timers/ItemDataProvider.cs b/src/Jellyfin.LiveTv/Timers/ItemDataProvider.cs
index 18e4810a2..9e7323f5b 100644
--- a/src/Jellyfin.LiveTv/Timers/ItemDataProvider.cs
+++ b/src/Jellyfin.LiveTv/Timers/ItemDataProvider.cs
@@ -115,11 +115,7 @@ namespace Jellyfin.LiveTv.Timers
throw new ArgumentException("item already exists", nameof(item));
}
- int oldLen = _items.Length;
- var newList = new T[oldLen + 1];
- _items.CopyTo(newList, 0);
- newList[oldLen] = item;
- _items = newList;
+ _items = [.._items, item];
SaveList();
}
@@ -134,11 +130,7 @@ namespace Jellyfin.LiveTv.Timers
int index = Array.FindIndex(_items, i => EqualityComparer(i, item));
if (index == -1)
{
- int oldLen = _items.Length;
- var newList = new T[oldLen + 1];
- _items.CopyTo(newList, 0);
- newList[oldLen] = item;
- _items = newList;
+ _items = [.._items, item];
}
else
{