feat: basic initial implementation of spotify client link validator and song submission form refs: NOISSUE
This commit is contained in:
12
song_of_the_day/SongValidators/UriBasedSongValidatorBase.cs
Normal file
12
song_of_the_day/SongValidators/UriBasedSongValidatorBase.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
public abstract class UriBasedSongValidatorBase : SongValidatorBase
|
||||
{
|
||||
public abstract string UriValidatorRegex { get; }
|
||||
|
||||
public override bool CanValidateUri(Uri songUri)
|
||||
{
|
||||
var regexp = new Regex(UriValidatorRegex, RegexOptions.IgnoreCase);
|
||||
return regexp.Match(songUri.ToString()).Success;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user