forked from j62/ctbrec
Fix equals and hashcode
equals and hashcode used the path field, which is empty for old recordings. Fixed by using getAbsoluteFile() instead
This commit is contained in:
parent
93deeb3e52
commit
f575958fe9
|
@ -220,7 +220,7 @@ public class Recording implements Serializable {
|
|||
int result = 1;
|
||||
result = prime * result + ((getStartDate() == null) ? 0 : (int) (getStartDate().toEpochMilli() ^ (getStartDate().toEpochMilli() >>> 32)));
|
||||
result = prime * result + ((model == null) ? 0 : model.hashCode());
|
||||
result = prime * result + ((path == null) ? 0 : path.hashCode());
|
||||
result = prime * result + ((getAbsoluteFile() == null) ? 0 : getAbsoluteFile().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -241,11 +241,7 @@ public class Recording implements Serializable {
|
|||
} else if (!getModel().equals(other.getModel())) {
|
||||
return false;
|
||||
}
|
||||
if (path == null) {
|
||||
if (other.path != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!path.equals(other.path)) {
|
||||
if (!getAbsoluteFile().equals(other.getAbsoluteFile())) {
|
||||
return false;
|
||||
}
|
||||
if (getStartDate() == null) {
|
||||
|
|
Loading…
Reference in New Issue