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;
|
int result = 1;
|
||||||
result = prime * result + ((getStartDate() == null) ? 0 : (int) (getStartDate().toEpochMilli() ^ (getStartDate().toEpochMilli() >>> 32)));
|
result = prime * result + ((getStartDate() == null) ? 0 : (int) (getStartDate().toEpochMilli() ^ (getStartDate().toEpochMilli() >>> 32)));
|
||||||
result = prime * result + ((model == null) ? 0 : model.hashCode());
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,11 +241,7 @@ public class Recording implements Serializable {
|
||||||
} else if (!getModel().equals(other.getModel())) {
|
} else if (!getModel().equals(other.getModel())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (path == null) {
|
if (!getAbsoluteFile().equals(other.getAbsoluteFile())) {
|
||||||
if (other.path != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!path.equals(other.path)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (getStartDate() == null) {
|
if (getStartDate() == null) {
|
||||||
|
|
Loading…
Reference in New Issue