diff --git a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java index 744ce876e..2d6d4cac1 100644 --- a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java +++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java @@ -12,10 +12,10 @@ import android.view.MenuInflater; import android.view.MenuItem; import android.widget.Toast; -import java.util.ArrayList; import java.util.Arrays; +import java.util.HashSet; import java.util.Iterator; -import java.util.List; +import java.util.Set; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.dialog.ConfirmationDialog; @@ -116,7 +116,7 @@ public class FeedMenuHandler { final String[] values = context.getResources().getStringArray(R.array.episode_hide_values); final boolean[] checkedItems = new boolean[items.length]; - final List hidden = new ArrayList(Arrays.asList(feed.getItemFilter().getValues())); + final Set hidden = new HashSet(Arrays.asList(feed.getItemFilter().getValues())); Iterator it = hidden.iterator(); while(it.hasNext()) { // make sure we have no empty strings in the filter list diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java index 8072e3aab..24519f10d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java @@ -19,6 +19,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.List; +import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; @@ -1008,7 +1009,7 @@ public class DBWriter { * @param filterValues Values that represent properties to filter by */ public static Future setFeedItemsFilter(final long feedId, - final List filterValues) { + final Set filterValues) { Log.d(TAG, "setFeedItemsFilter() called with: " + "feedId = [" + feedId + "], filterValues = [" + filterValues + "]"); return dbExec.submit(() -> { PodDBAdapter adapter = PodDBAdapter.getInstance(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index fc5a25732..18457a330 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -16,6 +16,7 @@ import android.util.Log; import java.util.Arrays; import java.util.List; +import java.util.Set; import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.event.ProgressEvent; @@ -407,7 +408,7 @@ public class PodDBAdapter { db.update(TABLE_NAME_FEEDS, values, KEY_ID + "=?", new String[]{String.valueOf(prefs.getFeedID())}); } - public void setFeedItemFilter(long feedId, List filterValues) { + public void setFeedItemFilter(long feedId, Set filterValues) { Log.d(TAG, "setFeedItemFilter() called with: " + "feedId = [" + feedId + "], " + "filterValues = [" + TextUtils.join(",", filterValues) + "]"); ContentValues values = new ContentValues();