TraktPlugin.TraktHelper.AddRemoveEpisodeInUserList C# (CSharp) Méthode

AddRemoveEpisodeInUserList() static private méthode

static private AddRemoveEpisodeInUserList ( TraktEpisode episode, bool remove ) : void
episode TraktPlugin.TraktAPI.DataStructures.TraktEpisode
remove bool
Résultat void
        internal static void AddRemoveEpisodeInUserList(TraktEpisode episode, bool remove)
        {
            if (!GUICommon.CheckLogin(false)) return;

            GUIBackgroundTask.Instance.ExecuteInBackgroundAndCallback(() =>
            {
                return TraktLists.GetListsForUser(TraktSettings.Username);
            },
            delegate(bool success, object result)
            {
                if (success)
                {
                    var customlists = result as IEnumerable<TraktListDetail>;

                    // get slug of lists selected
                    List<int> slugs = TraktLists.GetUserListSelections(customlists.ToList());
                    if (slugs == null || slugs.Count == 0) return;

                    // add the movie to add/remove to a new sync list
                    var items = new TraktSyncAll
                    {
                        Episodes = new List<TraktEpisode>
                        {
                            new TraktEpisode
                            {
                                Ids = episode.Ids
                            }
                        }
                    };

                    AddRemoveItemInList(slugs, items, remove);
                }
            }, Translation.GettingLists, true);
        }