mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
bug fix and cleanup
This commit is contained in:
parent
80e4429c37
commit
d935072dd4
8 changed files with 2916 additions and 2316 deletions
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"FilterLists": [
|
||||
{
|
||||
"Languages": null,
|
||||
"Description": "A sample list to filter out advertisements.",
|
||||
"DescriptionSourceUrl": "https://mysample.list/advertisements",
|
||||
"DonateUrl": "https://mysample.list/donate/",
|
||||
|
|
@ -12,6 +13,7 @@
|
|||
"ViewUrl": "https://mysample.list/list.txt"
|
||||
},
|
||||
{
|
||||
"Languages": null,
|
||||
"Description": "A sample list to filter out malware.",
|
||||
"DescriptionSourceUrl": "https://mysample.list/malware",
|
||||
"DonateUrl": "https://mysample.list/donate/",
|
||||
|
|
|
|||
|
|
@ -6,6 +6,15 @@
|
|||
"null"
|
||||
],
|
||||
"properties": {
|
||||
"Languages": {
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"$ref": "#/definitions/Language"
|
||||
}
|
||||
},
|
||||
"Description": {
|
||||
"description": "A brief description of the list's functionality. Preferably, this is quoted (if non-English, translate to English via translator or Google Translate for consistency) from the list's documentation or composed by a maintainer of the list. If neither are available, a generic description should be composed by the FilterLists contributor.",
|
||||
"type": [
|
||||
|
|
@ -88,6 +97,7 @@
|
|||
}
|
||||
},
|
||||
"required": [
|
||||
"Languages",
|
||||
"Description",
|
||||
"DescriptionSourceUrl",
|
||||
"DonateUrl",
|
||||
|
|
@ -98,6 +108,65 @@
|
|||
"Name",
|
||||
"ViewUrl"
|
||||
]
|
||||
},
|
||||
"Language": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"properties": {
|
||||
"Iso6391": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"Iso6392": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"Iso6392B": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"Iso6392T": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"Iso6393": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"LocalName": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"Name": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"Iso6391",
|
||||
"Iso6392",
|
||||
"Iso6392B",
|
||||
"Iso6392T",
|
||||
"Iso6393",
|
||||
"LocalName",
|
||||
"Name"
|
||||
]
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
|
|
|
|||
5147
data/List.json
5147
data/List.json
File diff suppressed because it is too large
Load diff
|
|
@ -16,10 +16,10 @@ public FilterListsDbContext(DbContextOptions options)
|
|||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<Maintainer>()
|
||||
modelBuilder.Entity<FilterList>()
|
||||
.Property(b => b.CreatedDateUtc)
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP");
|
||||
modelBuilder.Entity<FilterList>()
|
||||
modelBuilder.Entity<Maintainer>()
|
||||
.Property(b => b.CreatedDateUtc)
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP");
|
||||
modelBuilder.Entity<Language>()
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ namespace FilterLists.Data.Contexts
|
|||
{
|
||||
public interface IFilterListsDbContext
|
||||
{
|
||||
DbSet<Maintainer> Maintainers { get; set; }
|
||||
DbSet<FilterList> FilterLists { get; set; }
|
||||
DbSet<Maintainer> Maintainers { get; set; }
|
||||
DbSet<Language> Languages { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@ namespace FilterLists.Data.Models.Implementations
|
|||
{
|
||||
public class FilterList : BaseEntity, IFilterList
|
||||
{
|
||||
public List<ILanguage> FilterLists { get; set; }
|
||||
public List<Language> Languages { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual Maintainer Maintainer { get; set; }
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace FilterLists.Data.Models.Implementations
|
|||
{
|
||||
public class Maintainer : BaseEntity, IMaintainer
|
||||
{
|
||||
public List<IFilterList> FilterLists { get; set; }
|
||||
public List<FilterList> FilterLists { get; set; }
|
||||
|
||||
[Description(@"The email address of the list maintainer.")]
|
||||
[EmailAddress]
|
||||
|
|
|
|||
|
|
@ -17,12 +17,12 @@ public FilterListRepository(FilterListsDbContext filterListsDbContext)
|
|||
|
||||
public IEnumerable<IFilterList> GetAll()
|
||||
{
|
||||
return filterListsDbContext.FilterList.AsEnumerable();
|
||||
return filterListsDbContext.FilterLists.AsEnumerable();
|
||||
}
|
||||
|
||||
public IFilterList GetByName(string filterListName)
|
||||
{
|
||||
return filterListsDbContext.FilterList.First(x => x.Name == filterListName);
|
||||
return filterListsDbContext.FilterLists.First(x => x.Name == filterListName);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue