Skip to content

Commit

Permalink
fix file type check with new discord url suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
OliBomby committed Oct 3, 2023
1 parent 9999626 commit d40c0c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions osu-collaboration-bot/Services/FileHandlingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void Initialize(string path) {

public async Task<string> DownloadBaseFile(IGuild guild, string projectName, Attachment att) {
try {
if (!IsFilePermissible(att.Url, PermissibleFileType.DotOsu)) return Strings.FileTypeNeedsToBeOsu;
if (!IsFilePermissible(att.Filename, PermissibleFileType.DotOsu)) return Strings.FileTypeNeedsToBeOsu;

var localProjectPath = GetProjectPath(guild, projectName);

Expand Down Expand Up @@ -71,7 +71,7 @@ public async Task<string> DownloadBaseFile(IGuild guild, string projectName, Att

public async Task<string> DownloadPartSubmit(IGuild guild, string projectName, Attachment att) {
try {
if (!IsFilePermissible(att.Url, PermissibleFileType.DotOsu)) return null;
if (!IsFilePermissible(att.Filename, PermissibleFileType.DotOsu)) return null;

var localProjectPath = GetProjectPath(guild, projectName);

Expand Down Expand Up @@ -110,7 +110,7 @@ public class PartRecord {

public async Task<List<PartRecord>> DownloadPartsCSV(Attachment att, bool hasHeaders = true) {
try {
if (!IsFilePermissible(att.Url, PermissibleFileType.DotCSV)) return null;
if (!IsFilePermissible(att.Filename, PermissibleFileType.DotCSV)) return null;

if (!Uri.TryCreate(att.Url, UriKind.Absolute, out var uri)) return null;

Expand Down

0 comments on commit d40c0c1

Please sign in to comment.