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

AddRemovePersonInUserList() static private méthode

static private AddRemovePersonInUserList ( TraktPerson person, bool remove ) : void
person TraktPlugin.TraktAPI.DataStructures.TraktPerson
remove bool
Résultat void
        internal static void AddRemovePersonInUserList(TraktPerson person, 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
                    {
                        People = new List<TraktPerson>
                        {
                            new TraktPerson
                            {
                                Ids = person.Ids
                            }
                        }
                    };

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