Skip to content
Snippets Groups Projects
Commit d3614460 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Fix MediaLibraryItem equality check

parent 1b4c7cfe
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ package org.videolan.medialibrary.media;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import org.videolan.medialibrary.Medialibrary;
......@@ -72,6 +73,14 @@ public abstract class MediaLibraryItem implements Parcelable {
}
public boolean equals(MediaLibraryItem other) {
return this == other || (other != null && other.getItemType() == getItemType() && mId == other.getId());
if (this == other)
return true;
if (other == null)
return false;
if (getItemType() != other.getItemType())
return false;
if (getItemType() == TYPE_DUMMY)
return TextUtils.equals(getTitle(), other.getTitle());
return mId == other.getId();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment