Skip to content

Commit

Permalink
Merge pull request #160 from Zechiax/feature/releaseFilter
Browse files Browse the repository at this point in the history
Release type filter
  • Loading branch information
Zechiax authored Sep 27, 2024
2 parents 98833a5 + a5c96a3 commit 1fd3ef1
Show file tree
Hide file tree
Showing 11 changed files with 526 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Asterion.Test/Asterion.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Modrinth.Net" Version="3.4.5" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
Expand Down
2 changes: 1 addition & 1 deletion Asterion/Asterion.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageReference Include="ByteSize" Version="2.1.2" />
<PackageReference Include="Discord.Net" Version="3.16.0" />
<PackageReference Include="Discord.Net.Core" Version="3.16.0" />
<PackageReference Include="Fergun.Interactive" Version="1.7.7" />
<PackageReference Include="Fergun.Interactive" Version="1.8.0" />
<PackageReference Include="Figgle" Version="0.5.1" />
<PackageReference Include="Html2Markdown" Version="7.0.1.9" />
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
Expand Down
4 changes: 4 additions & 0 deletions Asterion/Database/DataContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.Entity<GuildSettings>().Property(p => p.MessageStyle).HasDefaultValue(MessageStyle.Full);
modelBuilder.Entity<GuildSettings>().Property(p => p.ChangelogStyle).HasDefaultValue(ChangelogStyle.PlainText);
modelBuilder.Entity<GuildSettings>().Property(p => p.ChangeLogMaxLength).HasDefaultValue(2000);

modelBuilder.Entity<ModrinthEntry>()
.Property(e => e.ReleaseFilter)
.HasDefaultValue(ReleaseType.Alpha | ReleaseType.Beta | ReleaseType.Release);
}
}
12 changes: 11 additions & 1 deletion Asterion/Database/Models/ModrinthEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,14 @@ public class ModrinthEntry
public virtual Guild Guild { get; set; } = null!;

[Required] public DateTime Created { get; set; }
}

[Required] public ReleaseType ReleaseFilter { get; set; } = ReleaseType.Alpha | ReleaseType.Beta | ReleaseType.Release;
}

[Flags]
public enum ReleaseType
{
Alpha = 1,
Beta = 2,
Release = 4
}
1 change: 1 addition & 0 deletions Asterion/Interfaces/IDataService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,5 @@ public Task<bool> UpdateModrinthProjectAsync(string projectId, string? newVersio

public Task<bool> SetPingRoleAsync(ulong guildId, ulong? roleId, string? projectId = null);
public Task<ulong?> GetPingRoleIdAsync(ulong guildId, string? projectId = null);
public Task<bool> SetReleaseFilterAsync(ulong entryId, ReleaseType releaseType);
}
317 changes: 317 additions & 0 deletions Asterion/Migrations/20240926184037_add_releasetype.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1fd3ef1

Please sign in to comment.