< Summary - Jellyfin

Information
Class: MediaBrowser.Controller.SyncPlay.PlaybackRequests.RemoveFromPlaylistGroupRequest
Assembly: MediaBrowser.Controller
File(s): /srv/git/jellyfin/MediaBrowser.Controller/SyncPlay/PlaybackRequests/RemoveFromPlaylistGroupRequest.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 56
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)0%620%
Apply(...)100%210%

File(s)

/srv/git/jellyfin/MediaBrowser.Controller/SyncPlay/PlaybackRequests/RemoveFromPlaylistGroupRequest.cs

#LineLine coverage
 1#nullable disable
 2
 3using System;
 4using System.Collections.Generic;
 5using System.Threading;
 6using MediaBrowser.Controller.Session;
 7using MediaBrowser.Model.SyncPlay;
 8
 9namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
 10{
 11    /// <summary>
 12    /// Class RemoveFromPlaylistGroupRequest.
 13    /// </summary>
 14    public class RemoveFromPlaylistGroupRequest : AbstractPlaybackRequest
 15    {
 16        /// <summary>
 17        /// Initializes a new instance of the <see cref="RemoveFromPlaylistGroupRequest"/> class.
 18        /// </summary>
 19        /// <param name="items">The playlist ids of the items to remove.</param>
 20        /// <param name="clearPlaylist">Whether to clear the entire playlist. The items list will be ignored.</param>
 21        /// <param name="clearPlayingItem">Whether to remove the playing item as well. Used only when clearing the playl
 022        public RemoveFromPlaylistGroupRequest(IReadOnlyList<Guid> items, bool clearPlaylist = false, bool clearPlayingIt
 23        {
 024            PlaylistItemIds = items ?? Array.Empty<Guid>();
 25            ClearPlaylist = clearPlaylist;
 26            ClearPlayingItem = clearPlayingItem;
 027        }
 28
 29        /// <summary>
 30        /// Gets the playlist identifiers of the items.
 31        /// </summary>
 32        /// <value>The playlist identifiers of the items.</value>
 33        public IReadOnlyList<Guid> PlaylistItemIds { get; }
 34
 35        /// <summary>
 36        /// Gets a value indicating whether the entire playlist should be cleared.
 37        /// </summary>
 38        /// <value>Whether the entire playlist should be cleared.</value>
 39        public bool ClearPlaylist { get; }
 40
 41        /// <summary>
 42        /// Gets a value indicating whether the playing item should be removed as well.
 43        /// </summary>
 44        /// <value>Whether the playing item should be removed as well.</value>
 45        public bool ClearPlayingItem { get; }
 46
 47        /// <inheritdoc />
 48        public override PlaybackRequestType Action { get; } = PlaybackRequestType.RemoveFromPlaylist;
 49
 50        /// <inheritdoc />
 51        public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken
 52        {
 053            state.HandleRequest(this, context, state.Type, session, cancellationToken);
 054        }
 55    }
 56}