TraktPlugin.TraktLists.GetListItemsForUser C# (CSharp) Méthode

GetListItemsForUser() public static méthode

Get list items for user
public static GetListItemsForUser ( string username, int id ) : IEnumerable
username string
id int
Résultat IEnumerable
        public static IEnumerable<TraktListItem> GetListItemsForUser(string username, int id)
        {
            string key = username + ":" + id;

            // use the username:id to cache items in a users list
            if (!UserListItems.Keys.Contains(key) || LastRequest < DateTime.UtcNow.Subtract(new TimeSpan(0, TraktSettings.WebRequestCacheMinutes, 0)))
            {
                // get list items
                var listItems = TraktAPI.TraktAPI.GetUserListItems(username == TraktSettings.Username ? "me" : username, id.ToString(), "full");
                if (listItems == null) return null;

                // remove any cached items for user
                if (UserListItems.Keys.Contains(key))
                    UserListItems.Remove(key);

                // add to list items cache
                UserListItems.Add(key, listItems);
            }
            return UserListItems[key];
        }