mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 09:48:26 -04:00
Make extensive use of raw string literals C#11 feature
This commit is contained in:
@@ -39,9 +39,9 @@ public static class MusicExtensions
|
||||
if (trackInfo.Duration == TimeSpan.MaxValue)
|
||||
return "∞";
|
||||
if (trackInfo.Duration.TotalHours >= 1)
|
||||
return trackInfo.Duration.ToString(@"hh\:mm\:ss");
|
||||
return trackInfo.Duration.ToString("""hh\:mm\:ss""");
|
||||
|
||||
return trackInfo.Duration.ToString(@"mm\:ss");
|
||||
return trackInfo.Duration.ToString("""mm\:ss""");
|
||||
}
|
||||
|
||||
public static ICachableTrackData ToCachedData(this ITrackInfo trackInfo, string id)
|
||||
|
@@ -5,10 +5,10 @@ namespace NadekoBot.Modules.Music.Resolvers;
|
||||
|
||||
public class RadioResolver : IRadioResolver
|
||||
{
|
||||
private readonly Regex _plsRegex = new("File1=(?<url>.*?)\\n", RegexOptions.Compiled);
|
||||
private readonly Regex _m3URegex = new("(?<url>^[^#].*)", RegexOptions.Compiled | RegexOptions.Multiline);
|
||||
private readonly Regex _asxRegex = new("<ref href=\"(?<url>.*?)\"", RegexOptions.Compiled);
|
||||
private readonly Regex _xspfRegex = new("<location>(?<url>.*?)</location>", RegexOptions.Compiled);
|
||||
private readonly Regex _plsRegex = new(@"File1=(?<url>.*?)\n", RegexOptions.Compiled);
|
||||
private readonly Regex _m3URegex = new(@"(?<url>^[^#].*)", RegexOptions.Compiled | RegexOptions.Multiline);
|
||||
private readonly Regex _asxRegex = new(@"<ref href=""(?<url>.*?)""", RegexOptions.Compiled);
|
||||
private readonly Regex _xspfRegex = new(@"<location>(?<url>.*?)</location>", RegexOptions.Compiled);
|
||||
|
||||
public async Task<ITrackInfo> ResolveByQueryAsync(string query)
|
||||
{
|
||||
|
Reference in New Issue
Block a user