summaryrefslogtreecommitdiffstats
path: root/src/org/lineageos/eleven/utils/MusicUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/lineageos/eleven/utils/MusicUtils.java')
-rw-r--r--src/org/lineageos/eleven/utils/MusicUtils.java29
1 files changed, 6 insertions, 23 deletions
diff --git a/src/org/lineageos/eleven/utils/MusicUtils.java b/src/org/lineageos/eleven/utils/MusicUtils.java
index d409fc7..1dacd5d 100644
--- a/src/org/lineageos/eleven/utils/MusicUtils.java
+++ b/src/org/lineageos/eleven/utils/MusicUtils.java
@@ -48,6 +48,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.WorkerThread;
+import org.lineageos.eleven.BuildConfig;
import org.lineageos.eleven.Config.IdType;
import org.lineageos.eleven.Config.SmartPlaylistType;
import org.lineageos.eleven.IElevenService;
@@ -1006,8 +1007,11 @@ public final class MusicUtils {
* @return The ID for a playlist.
*/
public static long getIdForPlaylist(final Context context, final String name) {
- try (Cursor cursor = context.getContentResolver().query(
- Playlists.EXTERNAL_CONTENT_URI,
+ if (BuildConfig.DEBUG) {
+ Log.d(TAG, "getIdForPlaylist(" + name + ")");
+ }
+
+ try (Cursor cursor = context.getContentResolver().query(Playlists.EXTERNAL_CONTENT_URI,
new String[]{BaseColumns._ID}, PlaylistsColumns.NAME + "=?",
new String[]{name}, PlaylistsColumns.NAME)) {
if (cursor != null) {
@@ -1504,27 +1508,6 @@ public final class MusicUtils {
}
/**
- * Creates a sub menu used to add items to a new playlist or an existing
- * one.
- *
- * @param context The {@link Context} to use.
- * @param groupId The group Id of the menu.
- * @param menu The {@link Menu} to add to.
- */
- public static void makePlaylistMenu(final Context context, final int groupId,
- final Menu menu) {
- menu.clear();
-
- final List<String> menuItemList = makePlaylist(context);
- for (final String name : menuItemList) {
- final Intent intent = new Intent();
- intent.putExtra("playlist", getIdForPlaylist(context, name));
- menu.add(groupId, FragmentMenuItems.PLAYLIST_SELECTED, Menu.NONE, name)
- .setIntent(intent);
- }
- }
-
- /**
* Called when one of the lists should refresh or requery.
*/
public static void refresh() {