diff --git a/UnitTestProject1/Tests/PageTests.cs b/UnitTestProject1/Tests/PageTests.cs index a4ffde480..8dd5c09d9 100644 --- a/UnitTestProject1/Tests/PageTests.cs +++ b/UnitTestProject1/Tests/PageTests.cs @@ -224,7 +224,7 @@ public async Task WpLzhPageLanguageLinksTest() public async Task WpLzhFetchRevisionsTest() { var site = await WpLzhSiteAsync; - var revIds = new[] { 248199, 248197, 255289 }; + var revIds = new[] { 248199L, 248197, 255289 }; var pageTitles = new[] { "清", "清", "香草" }; var rev = await Revision.FetchRevisionsAsync(site, revIds).ToListAsync(); ShallowTrace(rev); diff --git a/WikiClientLibrary.Wikia/Discussions/Board.cs b/WikiClientLibrary.Wikia/Discussions/Board.cs index 560402cb2..5d4412e5e 100644 --- a/WikiClientLibrary.Wikia/Discussions/Board.cs +++ b/WikiClientLibrary.Wikia/Discussions/Board.cs @@ -43,7 +43,7 @@ public Board(WikiaSite site, string title, int defaultNamespaceId) /// The Wikia site. /// Page ID of the board. /// is null. - public Board(WikiaSite site, int pageId) + public Board(WikiaSite site, long pageId) { Site = site ?? throw new ArgumentNullException(nameof(site)); Page = new WikiPageStub(pageId); diff --git a/WikiClientLibrary.Wikia/Discussions/Post.cs b/WikiClientLibrary.Wikia/Discussions/Post.cs index a07f6241d..ed584ec25 100644 --- a/WikiClientLibrary.Wikia/Discussions/Post.cs +++ b/WikiClientLibrary.Wikia/Discussions/Post.cs @@ -35,7 +35,7 @@ public class Post /// For now, it is not possible to get the replies by using the constructor provided here. /// To achieve this, you need to invoke on a instance. /// - public Post(WikiaSite site, WikiPageStub ownerPage, int id) + public Post(WikiaSite site, WikiPageStub ownerPage, long id) { if (ownerPage.IsEmpty) throw new ArgumentException("ownerPage is empty.", nameof(ownerPage)); Site = site ?? throw new ArgumentNullException(nameof(site)); @@ -47,7 +47,7 @@ public Post(WikiaSite site, WikiPageStub ownerPage, int id) public WikiaSite Site { get; } /// Gets the ID of the post. - public int Id { get; private set; } + public long Id { get; private set; } /// Gets the stub of the page that owns the comment. public WikiPageStub OwnerPage { get; private set; } diff --git a/WikiClientLibrary.Wikia/RequestHelper.cs b/WikiClientLibrary.Wikia/RequestHelper.cs index 3ef957cb2..90aff9639 100644 --- a/WikiClientLibrary.Wikia/RequestHelper.cs +++ b/WikiClientLibrary.Wikia/RequestHelper.cs @@ -131,19 +131,19 @@ public static async Task RefreshPostsAsync(IEnumerable posts, var pages = partition.Select(p => new WikiPage(site, p.Id)).ToList(); var lastRevisionTask = pages.RefreshAsync(postLastRevisionQueryProvider, cancellationToken); // Fetch the first revisions, when needed, to determine author. - Dictionary firstRevisionDict = null; + Dictionary firstRevisionDict = null; if (partition.Count == 1 || (options & PostQueryOptions.ExactAuthoringInformation) == PostQueryOptions.ExactAuthoringInformation) { // We can only fetch for 1 page at a time, with rvdir = "newer" - firstRevisionDict = new Dictionary(); + firstRevisionDict = new Dictionary(); foreach (var post in partition) { var generator = new RevisionsGenerator(site, post.Id) { TimeAscending = true, PaginationSize = 1, - PropertyProvider = postRevisionWithContentProvider + PropertyProvider = postRevisionWithContentProvider, }; var rev = await generator.EnumItemsAsync().FirstAsync(cancellationToken); firstRevisionDict[post.Id] = rev; @@ -163,7 +163,7 @@ public static async Task RefreshPostsAsync(IEnumerable posts, } } - public static async Task PostCommentAsync(WikiaSite site, object scopeInst, WikiPageStub owner, int? parentId, string content, CancellationToken cancellationToken) + public static async Task PostCommentAsync(WikiaSite site, object scopeInst, WikiPageStub owner, long? parentId, string content, CancellationToken cancellationToken) { Debug.Assert(site != null); Debug.Assert(owner.HasTitle); @@ -267,7 +267,7 @@ public static async Task PostWallMessageAsync(WikiaSite site, object scope } public static async Task ReplyWallMessageAsync(WikiaSite site, object scopeInst, WikiPageStub owner, - int parentId, string messageBody, CancellationToken cancellationToken) + long parentId, string messageBody, CancellationToken cancellationToken) { Debug.Assert(site != null); using (site.BeginActionScope(scopeInst, owner, parentId)) diff --git a/WikiClientLibrary.Wikia/WikiaApi/WikiaSiteWikiaApiExtensions.cs b/WikiClientLibrary.Wikia/WikiaApi/WikiaSiteWikiaApiExtensions.cs index 5120d58fb..e23dfce42 100644 --- a/WikiClientLibrary.Wikia/WikiaApi/WikiaSiteWikiaApiExtensions.cs +++ b/WikiClientLibrary.Wikia/WikiaApi/WikiaSiteWikiaApiExtensions.cs @@ -106,15 +106,15 @@ public static async IAsyncEnumerable FetchUsersAsync(this WikiaSite si } } - /// + /// /// This overload fetches 10 items at most. - public static Task> FetchRelatedPagesAsync(this WikiaSite site, int pageId) + public static Task> FetchRelatedPagesAsync(this WikiaSite site, long pageId) { return FetchRelatedPagesAsync(site, pageId, 10, CancellationToken.None); } - /// - public static Task> FetchRelatedPagesAsync(this WikiaSite site, int pageId, int maxCount) + /// + public static Task> FetchRelatedPagesAsync(this WikiaSite site, long pageId, int maxCount) { return FetchRelatedPagesAsync(site, pageId, maxCount, CancellationToken.None); } @@ -131,7 +131,7 @@ public static Task> FetchRelatedPagesAsync(this WikiaSite /// Related Pages extension is not available. /// public static async Task> FetchRelatedPagesAsync(this WikiaSite site, - int pageId, int maxCount, CancellationToken cancellationToken) + long pageId, int maxCount, CancellationToken cancellationToken) { if (site == null) throw new ArgumentNullException(nameof(site)); if (maxCount <= 0) throw new ArgumentOutOfRangeException(nameof(maxCount)); diff --git a/WikiClientLibrary.Wikibase/Entity.cs b/WikiClientLibrary.Wikibase/Entity.cs index 84d2d16c1..e0f3d87f9 100644 --- a/WikiClientLibrary.Wikibase/Entity.cs +++ b/WikiClientLibrary.Wikibase/Entity.cs @@ -124,7 +124,7 @@ public Entity(WikiSite site, string id) /// The property value is invalidated after you have performed edits on this instance. /// To fetch the latest value, use . /// - public int PageId { get; private set; } + public long PageId { get; private set; } /// /// Namespace ID of the entity page. @@ -164,7 +164,7 @@ public Entity(WikiSite site, string id) /// /// The revid of the last revision. /// - public int LastRevisionId { get; private set; } + public long LastRevisionId { get; private set; } /// public WbMonolingualTextCollection Labels { get; private set; } = emptyStringDict; @@ -268,12 +268,12 @@ internal void LoadFromContract(Contracts.Entity entity, EntityQueryOptions optio if (!isPostEditing) { // wbeditentity response does not have these properties. - PageId = (int)extensionData["pageid"]; + PageId = (long)extensionData["pageid"]; NamespaceId = (int)extensionData["ns"]; Title = (string)extensionData["title"]; LastModified = (DateTime)extensionData["modified"]; } - LastRevisionId = (int)extensionData["lastrevid"]; + LastRevisionId = (long)extensionData["lastrevid"]; } Labels = (options & EntityQueryOptions.FetchLabels) == EntityQueryOptions.FetchLabels && serializable.Labels.Count > 0 diff --git a/WikiClientLibrary/Generators/LogEventsList.cs b/WikiClientLibrary/Generators/LogEventsList.cs index 4a883cfa2..cb241c734 100644 --- a/WikiClientLibrary/Generators/LogEventsList.cs +++ b/WikiClientLibrary/Generators/LogEventsList.cs @@ -217,7 +217,7 @@ internal static LogEventItem FromRecentChangeItem(RecentChangeItem rc) /// the page id at the time the log was stored. [JsonProperty("logpage")] - public int PageId { get; private set; } + public long PageId { get; private set; } /// Name of the user making this recent change. [JsonProperty("user")] @@ -229,13 +229,13 @@ internal static LogEventItem FromRecentChangeItem(RecentChangeItem rc) /// for account creation events, this is user ID of the creating user is returned. /// When absent, this is the user ID returned is that of the created account /// (see phab:T73020). - /// In most cases (such as in or , + /// In most cases (such as in or ), /// userid property is specified implicitly. /// To get the user ID for the created user, especially in log action, /// use . . /// [JsonProperty] - public int UserId { get; private set; } + public long UserId { get; private set; } /// The time and date of the change. [JsonProperty] @@ -404,12 +404,12 @@ static LogParameterCollection() /// /// () /// - public int CurrentRevisionId => GetInt32Value("curid", 0); + public long CurrentRevisionId => GetInt64Value("curid", 0); /// /// () /// - public int PreviousRevisionId => GetInt32Value("previd", 0); + public long PreviousRevisionId => GetInt64Value("previd", 0); /// /// () @@ -420,7 +420,7 @@ static LogParameterCollection() /// () The user ID of the created user. /// /// - public int UserId => GetInt32Value("userid", 0); + public long UserId => GetInt64Value("userid", 0); } diff --git a/WikiClientLibrary/Generators/Primitive/WikiPagePropertyList.cs b/WikiClientLibrary/Generators/Primitive/WikiPagePropertyList.cs index ed73e455c..c73507b9c 100644 --- a/WikiClientLibrary/Generators/Primitive/WikiPagePropertyList.cs +++ b/WikiClientLibrary/Generators/Primitive/WikiPagePropertyList.cs @@ -61,8 +61,8 @@ protected WikiPagePropertyList(WikiSite site, WikiPageStub pageStub) /// Gets/sets the page ID from which to get the list-like property value. /// /// If is null, the value of this property will be used. - /// Otherwise the other one will be effective. - public int PageId { get; set; } + /// Otherwise, the other one will be effective. + public long PageId { get; set; } /// /// Gets/sets maximum items returned per MediaWiki API invocation. diff --git a/WikiClientLibrary/Generators/RecentChangeItem.cs b/WikiClientLibrary/Generators/RecentChangeItem.cs index cc895693a..c5051b96d 100644 --- a/WikiClientLibrary/Generators/RecentChangeItem.cs +++ b/WikiClientLibrary/Generators/RecentChangeItem.cs @@ -78,19 +78,19 @@ private string TypeName /// ID of the page affected by this item. [JsonProperty] - public int PageId { get; private set; } + public long PageId { get; private set; } /// ID of the new revision affected by this item. [JsonProperty("revid")] - public int RevisionId { get; private set; } + public long RevisionId { get; private set; } /// ID of the old revision affected by this item. [JsonProperty("old_revid")] - public int OldRevisionId { get; private set; } + public long OldRevisionId { get; private set; } /// ID of recent change entry. [JsonProperty("rcid")] - public int Id { get; private set; } + public long Id { get; private set; } /// Name of the user making this recent change. [JsonProperty("user")] @@ -100,7 +100,7 @@ private string TypeName /// When using this property with log events, there are some caveats. /// See for more information. [JsonProperty] - public int UserId { get; private set; } + public long UserId { get; private set; } /// Content length of the old revision affected by this item. [JsonProperty("oldlen")] diff --git a/WikiClientLibrary/Generators/RevisionsGenerator.cs b/WikiClientLibrary/Generators/RevisionsGenerator.cs index 8b1a1c8ff..a91dd85ac 100644 --- a/WikiClientLibrary/Generators/RevisionsGenerator.cs +++ b/WikiClientLibrary/Generators/RevisionsGenerator.cs @@ -92,12 +92,12 @@ protected override Revision ItemFromJson(JToken json, JObject jpage) /// /// Revision ID to start listing from. /// - public int? StartRevisionId { get; set; } + public long? StartRevisionId { get; set; } /// /// Revision ID to stop listing at. /// - public int? EndRevisionId { get; set; } + public long? EndRevisionId { get; set; } /// /// Only list revisions made by this user. diff --git a/WikiClientLibrary/Infrastructures/WikiReadOnlyDictionary.cs b/WikiClientLibrary/Infrastructures/WikiReadOnlyDictionary.cs index 0e0009dc5..10eb54735 100644 --- a/WikiClientLibrary/Infrastructures/WikiReadOnlyDictionary.cs +++ b/WikiClientLibrary/Infrastructures/WikiReadOnlyDictionary.cs @@ -58,29 +58,51 @@ public JToken this[string key] return null; } + /// /// /// Gets the value by property name. /// This overload raises exception for missing key. /// + /// + public int GetInt32Value(string key) + { + return (int)myDict[key]; + } + + /// + /// + /// Gets the value by property name. + /// A default value can be provided in case the specified key does not exist. + /// + public int GetInt32Value(string key, int defaultValue) + { + if (myDict.TryGetValue(key, out var value)) return (int)value; + return defaultValue; + } + + /// + /// Gets the value by property name. + /// This overload raises exception for missing key. + /// /// The property name. /// The converted value. /// The property is not found. /// - public int GetInt32Value(string key) + public long GetInt64Value(string key) { - return (int)myDict[key]; + return (long)myDict[key]; } /// - /// Gets the value by property name. + /// Gets the value by property name. /// A default value can be provided in case the specified key does not exist. /// /// The property name. /// The default value. /// The converted value - or - . - public int GetInt32Value(string key, int defaultValue) + public long GetInt64Value(string key, long defaultValue) { - if (myDict.TryGetValue(key, out var value)) return (int)value; + if (myDict.TryGetValue(key, out var value)) return (long)value; return defaultValue; } diff --git a/WikiClientLibrary/Pages/Parsing/ParsedContentInfo.cs b/WikiClientLibrary/Pages/Parsing/ParsedContentInfo.cs index 6a7fd9e73..d6bb61474 100644 --- a/WikiClientLibrary/Pages/Parsing/ParsedContentInfo.cs +++ b/WikiClientLibrary/Pages/Parsing/ParsedContentInfo.cs @@ -36,10 +36,10 @@ public ParsedContentInfo() public string DisplayTitle { get; private set; } [JsonProperty] - public int PageId { get; private set; } + public long PageId { get; private set; } [JsonProperty("revid")] - public int RevisionId { get; private set; } + public long RevisionId { get; private set; } /// /// Parsed content, in HTML form. diff --git a/WikiClientLibrary/Pages/Queries/Properties/PageInfoPropertyProvider.cs b/WikiClientLibrary/Pages/Queries/Properties/PageInfoPropertyProvider.cs index eae481206..faa2a3473 100644 --- a/WikiClientLibrary/Pages/Queries/Properties/PageInfoPropertyProvider.cs +++ b/WikiClientLibrary/Pages/Queries/Properties/PageInfoPropertyProvider.cs @@ -69,7 +69,7 @@ protected internal PageInfoPropertyGroup(JObject jPage) public DateTime LastTouched { get; } - public int LastRevisionId { get; } + public long LastRevisionId { get; } public int ContentLength { get; } diff --git a/WikiClientLibrary/Pages/Revision.cs b/WikiClientLibrary/Pages/Revision.cs index 6c52824f3..014a84a86 100644 --- a/WikiClientLibrary/Pages/Revision.cs +++ b/WikiClientLibrary/Pages/Revision.cs @@ -34,31 +34,31 @@ public class Revision /// share the same reference. /// /// is not an existing revision id. - public static ValueTask FetchRevisionAsync(WikiSite site, int revisionId) + public static ValueTask FetchRevisionAsync(WikiSite site, long revisionId) { return FetchRevisionsAsync(site, new[] { revisionId }, PageQueryOptions.FetchContent).FirstAsync()!; } - /// - public static IAsyncEnumerable FetchRevisionsAsync(WikiSite site, params int[] revisionIds) + /// + public static IAsyncEnumerable FetchRevisionsAsync(WikiSite site, params long[] revisionIds) { return FetchRevisionsAsync(site, revisionIds, PageQueryOptions.FetchContent, CancellationToken.None); } - /// - public static IAsyncEnumerable FetchRevisionsAsync(WikiSite site, IEnumerable revisionIds) + /// + public static IAsyncEnumerable FetchRevisionsAsync(WikiSite site, IEnumerable revisionIds) { return FetchRevisionsAsync(site, revisionIds, PageQueryOptions.FetchContent, CancellationToken.None); } - /// - public static IAsyncEnumerable FetchRevisionsAsync(WikiSite site, IEnumerable revisionIds, PageQueryOptions options) + /// + public static IAsyncEnumerable FetchRevisionsAsync(WikiSite site, IEnumerable revisionIds, PageQueryOptions options) { return FetchRevisionsAsync(site, revisionIds, options, CancellationToken.None); } - /// - public static IAsyncEnumerable FetchRevisionsAsync(WikiSite site, IEnumerable revisionIds, PageQueryOptions options, CancellationToken cancellationToken) + /// + public static IAsyncEnumerable FetchRevisionsAsync(WikiSite site, IEnumerable revisionIds, PageQueryOptions options, CancellationToken cancellationToken) { return FetchRevisionsAsync(site, revisionIds, MediaWikiHelper.QueryProviderFromOptions(options), cancellationToken); } @@ -81,7 +81,7 @@ public static ValueTask FetchRevisionAsync(WikiSite site, int revision /// If there's invalid revision id in , an /// will be thrown while enumerating. /// - public static IAsyncEnumerable FetchRevisionsAsync(WikiSite site, IEnumerable revisionIds, IWikiPageQueryProvider options, CancellationToken cancellationToken) + public static IAsyncEnumerable FetchRevisionsAsync(WikiSite site, IEnumerable revisionIds, IWikiPageQueryProvider options, CancellationToken cancellationToken) { if (site == null) throw new ArgumentNullException(nameof(site)); if (revisionIds == null) throw new ArgumentNullException(nameof(revisionIds)); @@ -94,10 +94,10 @@ public static ValueTask FetchRevisionAsync(WikiSite site, int revision public WikiPageStub Page { get; internal set; } [JsonProperty("revid")] - public int Id { get; private set; } + public long Id { get; private set; } [JsonProperty] - public int ParentId { get; private set; } + public long ParentId { get; private set; } /// /// Gets the content of the revision. @@ -145,7 +145,7 @@ public static ValueTask FetchRevisionAsync(WikiSite site, int revision /// /// [JsonProperty] - public int UserId { get; private set; } + public long UserId { get; private set; } /// /// Gets a containing the name and ID of the user made this revision. diff --git a/WikiClientLibrary/Pages/WikiPage.cs b/WikiClientLibrary/Pages/WikiPage.cs index 7d3c6901d..7757fd8e3 100644 --- a/WikiClientLibrary/Pages/WikiPage.cs +++ b/WikiClientLibrary/Pages/WikiPage.cs @@ -57,7 +57,7 @@ public WikiPage(WikiSite site, string title, int defaultNamespaceId) /// Page ID. /// The initialized instance does not contain any live information from MediaWiki site. /// Use to fetch for information from server. - public WikiPage(WikiSite site, int id) + public WikiPage(WikiSite site, long id) { if (site == null) throw new ArgumentNullException(nameof(site)); Site = site; @@ -72,7 +72,7 @@ public WikiPage(WikiSite site, int id) /// /// Id of the page. /// - public int Id => PageStub.Id; + public long Id => PageStub.Id; /// /// Namespace id of the page. @@ -138,7 +138,7 @@ public IReadOnlyCollection PropertyGroups /// See for more information. /// /// - public int LastRevisionId { get; private set; } + public long LastRevisionId { get; private set; } /// /// Content length, in bytes. diff --git a/WikiClientLibrary/Pages/WikiPageStub.cs b/WikiClientLibrary/Pages/WikiPageStub.cs index 88c3c782c..e000f73dc 100644 --- a/WikiClientLibrary/Pages/WikiPageStub.cs +++ b/WikiClientLibrary/Pages/WikiPageStub.cs @@ -31,14 +31,14 @@ namespace WikiClientLibrary.Pages /// The value used for missing page. /// For how the missing pages are handled, see the "remarks" section of . - public const int MissingPageIdMask = unchecked((int)0x8F000001); + public const long MissingPageIdMask = unchecked((long)0x8F00_0000_0000_0001); /// The value used for invalid page. /// For how the missing pages are handled, see the "remarks" section of . - public const int InvalidPageIdMask = unchecked((int)0x8F000002); + public const long InvalidPageIdMask = unchecked((long)0x8F00_0000_0000_0002); /// The value used for Special page. - public const int SpecialPageIdMask = unchecked((int)0x8F000011); + public const long SpecialPageIdMask = unchecked((long)0x8F00_0000_0000_0011); /// The value used for missing page. /// For how the missing pages are handled, see the "remarks" section of . @@ -53,17 +53,17 @@ namespace WikiClientLibrary.Pages /// public static readonly WikiPageStub Empty = new WikiPageStub(); - /// + /// public WikiPageStub(string title, int namespaceId) : this(0, title, namespaceId) { } - /// - public WikiPageStub(int id) : this(id, null, UnknownNamespaceId) + /// + public WikiPageStub(long id) : this(id, null, UnknownNamespaceId) { } - /// + /// public WikiPageStub(string title) : this(0, title, UnknownNamespaceId) { } @@ -74,9 +74,9 @@ public WikiPageStub(string title) : this(0, title, UnknownNamespaceId) /// Page ID. 0 for unknown. /// Page full title. null for unknown. will be normalized into null. /// Page namespace ID. for unknown. - public WikiPageStub(int id, string? title, int namespaceId) : this() + public WikiPageStub(long id, string? title, int namespaceId) : this() { - const int idMasks = SpecialPageIdMask | MissingPageIdMask | InvalidPageIdMask; + const long idMasks = SpecialPageIdMask | MissingPageIdMask | InvalidPageIdMask; if (id < 0 && (id & idMasks) != id) throw new ArgumentOutOfRangeException(nameof(id), "Invalid page ID. ID should be positive; 0 for unknown; bitwise-or of one or more WikiPageStub.****Mask fields."); @@ -90,7 +90,7 @@ public static WikiPageStub NewMissingPage(string title, int namespaceId) return new WikiPageStub(MissingPageIdMask, title, namespaceId); } - public static WikiPageStub NewMissingPage(int id) + public static WikiPageStub NewMissingPage(long id) { return new WikiPageStub(id, MissingPageTitle, UnknownNamespaceId); } @@ -115,7 +115,7 @@ public static WikiPageStub NewInvalidPage(string title) /// Gets the page ID. /// Page ID; or 0 if the information is not available; /// or for the confirmed missing page. - public int Id { get; } + public long Id { get; } /// Gets the full title of the page. /// Normalized or un-normalized page title; or null if the information is not available; @@ -205,12 +205,12 @@ public static implicit operator WikiPageStub(string? pageTitle) return string.IsNullOrEmpty(pageTitle) ? Empty : new WikiPageStub(pageTitle); } - public static implicit operator WikiPageStub(int pageId) + public static implicit operator WikiPageStub(long pageId) { return new WikiPageStub(pageId); } - public static implicit operator WikiPageStub(int? pageId) + public static implicit operator WikiPageStub(long? pageId) { return new WikiPageStub(pageId ?? 0); } diff --git a/WikiClientLibrary/RequestHelper.cs b/WikiClientLibrary/RequestHelper.cs index fb77302dc..d0dbdec72 100644 --- a/WikiClientLibrary/RequestHelper.cs +++ b/WikiClientLibrary/RequestHelper.cs @@ -281,7 +281,7 @@ public static async Task RefreshPagesAsync(IEnumerable pages, IWikiPag /// /// If there's invalid revision id in , an will be thrown while enumerating. /// - public static async IAsyncEnumerable FetchRevisionsAsync(WikiSite site, IEnumerable revIds, + public static async IAsyncEnumerable FetchRevisionsAsync(WikiSite site, IEnumerable revIds, IWikiPageQueryProvider options, [EnumeratorCancellation] CancellationToken cancellationToken = default) { if (revIds == null) throw new ArgumentNullException(nameof(revIds)); @@ -291,8 +291,8 @@ public static async Task RefreshPagesAsync(IEnumerable pages, IWikiPag queryParams.Remove("rvlimit"); var titleLimit = options.GetMaxPaginationSize(site.SiteInfo.Version, site.AccountInfo.HasRight(UserRights.ApiHighLimits)); // Page ID --> Page Stub - var stubDict = new Dictionary(); - var revDict = new Dictionary(); + var stubDict = new Dictionary(); + var revDict = new Dictionary(); using (site.BeginActionScope(null, (object)revIds)) { foreach (var partition in revIds.Partition(titleLimit)) @@ -395,7 +395,7 @@ public static async Task> PurgePagesAsync( return failedPages ?? (IReadOnlyCollection) Array.Empty(); } - public static async Task PatrolAsync(WikiSite site, int? recentChangeId, int? revisionId, CancellationToken cancellationToken) + public static async Task PatrolAsync(WikiSite site, long? recentChangeId, long? revisionId, CancellationToken cancellationToken) { if (site == null) throw new ArgumentNullException(nameof(site)); if (recentChangeId == null && revisionId == null) diff --git a/WikiClientLibrary/Sites/AccountInfo.cs b/WikiClientLibrary/Sites/AccountInfo.cs index 678df278e..6d025fc9c 100644 --- a/WikiClientLibrary/Sites/AccountInfo.cs +++ b/WikiClientLibrary/Sites/AccountInfo.cs @@ -20,7 +20,7 @@ internal AccountInfo() } [JsonProperty] - public int Id { get; private set; } + public long Id { get; private set; } [JsonProperty] public string Name { get; private set; } diff --git a/WikiClientLibrary/UserStub.cs b/WikiClientLibrary/UserStub.cs index d50f414bf..51eb3531b 100644 --- a/WikiClientLibrary/UserStub.cs +++ b/WikiClientLibrary/UserStub.cs @@ -13,15 +13,15 @@ namespace WikiClientLibrary public static readonly UserStub Empty = new UserStub(); - public UserStub(string name, int id) : this(name, id, Gender.Unknown, null) + public UserStub(string name, long id) : this(name, id, Gender.Unknown, null) { } - public UserStub(string name, int id, Gender gender) : this(name, id, gender, null) + public UserStub(string name, long id, Gender gender) : this(name, id, gender, null) { } - public UserStub(string name, int id, Gender gender, string? siteName) + public UserStub(string name, long id, Gender gender, string? siteName) { Name = name ?? throw new ArgumentNullException(nameof(name)); Id = id; @@ -34,7 +34,7 @@ public UserStub(string name, int id, Gender gender, string? siteName) /// Gets user ID on the MediaWiki site. /// User ID on the MediaWiki site, or 0 for anonymous users. - public int Id { get; } + public long Id { get; } /// Gets user's gender. public Gender Gender { get; }