fix: make dedupe work correctly
This commit is contained in:
parent
8517a4bae4
commit
085b1c3edb
|
@ -141,7 +141,7 @@ public class ScreenshotMetadata {
|
|||
}
|
||||
}
|
||||
|
||||
foreach (var mod in modsInUse) {
|
||||
foreach (var mod in modsInUse.OrderBy(mod => mod.Name)) {
|
||||
Plugin.Log.Info($"{mod.Name} at {mod.Path}");
|
||||
}
|
||||
|
||||
|
@ -232,6 +232,28 @@ public struct EorzeaTime {
|
|||
|
||||
[Serializable]
|
||||
public class PenumbraMod {
|
||||
public required string Path;
|
||||
public required string Name;
|
||||
public required string Path { get; init; }
|
||||
public required string Name { get; init; }
|
||||
|
||||
protected bool Equals(PenumbraMod other) {
|
||||
return this.Path == other.Path && this.Name == other.Name;
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj) {
|
||||
if (ReferenceEquals(null, obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ReferenceEquals(this, obj)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return obj.GetType() == this.GetType() && this.Equals((PenumbraMod) obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
unchecked {
|
||||
return (this.Path.GetHashCode() * 397) ^ this.Name.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue