aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Playlists/Playlist.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2019-01-07 00:47:06 -0500
committerGitHub <noreply@github.com>2019-01-07 00:47:06 -0500
commitc986340c02cb0b7fe06569d25a1b5d1c8375f7f6 (patch)
tree4971c970bbdb797cc5b3da2d8bae506231b173a5 /MediaBrowser.Controller/Playlists/Playlist.cs
parent76b647e0a8eddd65dc9c4de7b887a3faf6e12bcc (diff)
parent0b804629b85498370c882f5562dfc7acd84bfd11 (diff)
Merge pull request #419 from jellyfin/dev
Master 10.0.0
Diffstat (limited to 'MediaBrowser.Controller/Playlists/Playlist.cs')
-rw-r--r--MediaBrowser.Controller/Playlists/Playlist.cs29
1 files changed, 13 insertions, 16 deletions
diff --git a/MediaBrowser.Controller/Playlists/Playlist.cs b/MediaBrowser.Controller/Playlists/Playlist.cs
index 78614340a..642dfde80 100644
--- a/MediaBrowser.Controller/Playlists/Playlist.cs
+++ b/MediaBrowser.Controller/Playlists/Playlist.cs
@@ -15,14 +15,14 @@ namespace MediaBrowser.Controller.Playlists
{
public class Playlist : Folder, IHasShares
{
- public static string[] SupportedExtensions = new string[] {
-
- ".m3u",
- ".m3u8",
- ".pls",
- ".wpl",
- ".zpl"
- };
+ public static string[] SupportedExtensions =
+ {
+ ".m3u",
+ ".m3u8",
+ ".pls",
+ ".wpl",
+ ".zpl"
+ };
public Guid OwnerUserId { get; set; }
@@ -30,7 +30,7 @@ namespace MediaBrowser.Controller.Playlists
public Playlist()
{
- Shares = new Share[] { };
+ Shares = Array.Empty<Share>();
}
[IgnoreDataMember]
@@ -131,7 +131,7 @@ namespace MediaBrowser.Controller.Playlists
protected override Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)
{
- return Task.FromResult(true);
+ return Task.CompletedTask;
}
public override List<BaseItem> GetChildren(User user, bool includeLinkedChildren, InternalItemsQuery query)
@@ -186,8 +186,7 @@ namespace MediaBrowser.Controller.Playlists
private static IEnumerable<BaseItem> GetPlaylistItems(BaseItem item, User user, string mediaType, DtoOptions options)
{
- var musicGenre = item as MusicGenre;
- if (musicGenre != null)
+ if (item is MusicGenre musicGenre)
{
return LibraryManager.GetItemList(new InternalItemsQuery(user)
{
@@ -199,8 +198,7 @@ namespace MediaBrowser.Controller.Playlists
});
}
- var musicArtist = item as MusicArtist;
- if (musicArtist != null)
+ if (item is MusicArtist musicArtist)
{
return LibraryManager.GetItemList(new InternalItemsQuery(user)
{
@@ -212,8 +210,7 @@ namespace MediaBrowser.Controller.Playlists
});
}
- var folder = item as Folder;
- if (folder != null)
+ if (item is Folder folder)
{
var query = new InternalItemsQuery(user)
{