song-of-the-day/song_of_the_day/SongValidators/UriBasedSongValidatorBase.cs
Simon Diesenreiter dbd83ebb6a
Some checks failed
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m3s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
SonarQube Scan / SonarQube Trigger (push) Failing after 4m47s
feat: basic initial implementation of spotify client link validator and song submission form refs: NOISSUE
2025-05-30 22:51:44 +02:00

12 lines
363 B
C#

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;
}
}