1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-11-29 13:30:36 +01:00

Merge pull request #7910 from avently/equalscheck

Better equals check
This commit is contained in:
litetex 2022-02-26 16:20:27 +01:00 committed by GitHub
commit ccc3d38c45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -528,7 +528,19 @@ public abstract class PlayQueue implements Serializable {
return false;
}
final PlayQueue other = (PlayQueue) obj;
return streams.equals(other.streams);
if (size() != other.size()) {
return false;
}
for (int i = 0; i < size(); i++) {
final PlayQueueItem stream = streams.get(i);
final PlayQueueItem otherStream = other.streams.get(i);
// Check is based on serviceId and URL
if (stream.getServiceId() != otherStream.getServiceId()
|| !stream.getUrl().equals(otherStream.getUrl())) {
return false;
}
}
return true;
}
@Override