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

AddRemoveSeasonInUserList() static private méthode

static private AddRemoveSeasonInUserList ( TraktSeason season, bool remove ) : void
season TraktPlugin.TraktAPI.DataStructures.TraktSeason
remove bool
Résultat void
        internal static void AddRemoveSeasonInUserList(TraktSeason season, 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
                    {
                        Seasons = new List<TraktSeason>
                        {
                            new TraktSeason
                            {
                                Ids = new TraktSeasonId { Trakt = season.Ids.Trakt }
                            }
                        }
                    };

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