diff --git a/src/ZonyLrcTools.Common/MusicInfo.cs b/src/ZonyLrcTools.Common/MusicInfo.cs index 060b677..6f149a2 100644 --- a/src/ZonyLrcTools.Common/MusicInfo.cs +++ b/src/ZonyLrcTools.Common/MusicInfo.cs @@ -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); + } } } \ No newline at end of file