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

Medialibrary: folder & video groups equals methods

parent a1196a83
No related branches found
No related tags found
No related merge requests found
......@@ -64,4 +64,20 @@ public abstract class AbstractFolder extends MediaLibraryItem {
super(in);
this.mMrl = in.readString();
}
public boolean equals(AbstractFolder other) {
return mId == other.getId();
}
@Override
public boolean equals(MediaLibraryItem other) {
if (other instanceof AbstractFolder) return equals((AbstractFolder)other);
return super.equals(other);
}
@Override
public boolean equals(Object obj) {
if (obj instanceof AbstractFolder) return equals((AbstractFolder)obj);
return super.equals(obj);
}
}
......@@ -2,6 +2,7 @@ package org.videolan.medialibrary.interfaces.media;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import org.videolan.medialibrary.MLServiceLocator;
import org.videolan.medialibrary.media.MediaLibraryItem;
......@@ -61,4 +62,20 @@ public abstract class AbstractVideoGroup extends MediaLibraryItem {
super(in);
this.mCount = in.readInt();
}
public boolean equals(AbstractVideoGroup other) {
return TextUtils.equals(mTitle, other.getTitle());
}
@Override
public boolean equals(Object obj) {
if (obj instanceof AbstractVideoGroup) return equals((AbstractVideoGroup)obj);
return super.equals(obj);
}
@Override
public boolean equals(MediaLibraryItem other) {
if (other instanceof AbstractVideoGroup) return equals((AbstractVideoGroup)other);
return super.equals(other);
}
}
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