mirror of
https://github.com/real-zony/ZonyLrcToolsX.git
synced 2025-08-31 09:36:53 +00:00
feat: Added a comparator for MusicInfo.
This commit is contained in:
@@ -57,5 +57,25 @@ namespace ZonyLrcTools.Common
|
||||
|
||||
[GeneratedRegex(@"[<>:""/\\|?*]")]
|
||||
private static partial Regex InvalidFilePathRegex();
|
||||
|
||||
public static bool operator ==(MusicInfo? left, MusicInfo? right)
|
||||
{
|
||||
if (left is null && right is null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (left is null || right is null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return left.FilePath == right.FilePath;
|
||||
}
|
||||
|
||||
public static bool operator !=(MusicInfo? left, MusicInfo? right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user