-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add apprtype and apprlevel to AllPagesGenerator #105
base: master
Are you sure you want to change the base?
Add apprtype and apprlevel to AllPagesGenerator #105
Conversation
Upload | ||
} | ||
|
||
public enum ProtectionLevel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some wikis may have more level. I used the English Wikipedia as a reference, the enum can be extended later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked DB table and pr_level
is a column of free text. Then probably you can use string
as protection level, and use a another static class like ProtectionLevels
to define common protection levels, like what I've been doing in LogActions
class.
In the future we might consider introducing some utility structures like HttpMethod
class for better strong-typing support.
@@ -85,6 +88,8 @@ public AllPagesGenerator(WikiSite site) : base(site) | |||
{"apfilterlanglinks", LanguageLinkFilter.ToString("withlanglinks", "withoutlanglinks")}, | |||
{"apminsize", MinPageContentLength}, | |||
{"apmaxsize", MaxPageContentLength}, | |||
{"apprtype", ProtectionType != null && ProtectionType.Count != 0 ? string.Join('|', ProtectionType.Select(x => x.ToString().ToLower())) : null}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use MediaWikiHelper.JoinValues
instead of string.Join('|', ...)
.
Upload | ||
} | ||
|
||
public enum ProtectionLevel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked DB table and pr_level
is a column of free text. Then probably you can use string
as protection level, and use a another static class like ProtectionLevels
to define common protection levels, like what I've been doing in LogActions
class.
In the future we might consider introducing some utility structures like HttpMethod
class for better strong-typing support.
@@ -110,4 +115,19 @@ public enum PropertyFilterOption | |||
/// </summary> | |||
WithoutProperty, | |||
} | |||
|
|||
public enum ProtectionType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as ProtectionLevel
.
No description provided.