From f632a08256881a6bd9ab060cbb3ef56c13d74dc1 Mon Sep 17 00:00:00 2001 From: sebastian Date: Fri, 1 Nov 2024 09:21:55 +0100 Subject: [PATCH] Only Show referenced note sheets --- app/src/main/java/core/notevault/data/MusicNoteDAO.java | 4 ++-- app/src/main/java/core/notevault/ui/home/NoteSongAdapter.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/core/notevault/data/MusicNoteDAO.java b/app/src/main/java/core/notevault/data/MusicNoteDAO.java index 63c9a0a..21a9f9e 100644 --- a/app/src/main/java/core/notevault/data/MusicNoteDAO.java +++ b/app/src/main/java/core/notevault/data/MusicNoteDAO.java @@ -18,6 +18,6 @@ public interface MusicNoteDAO { @Query("SELECT * FROM music_notes") List getAllNotes(); - @Query("SELECT * FROM note_sheets") - List getNoteSheetsForMusicSong(); + @Query("SELECT * FROM note_sheets WHERE musicNoteId = :musicNoteId") + List getNoteSheetsForMusicSong(long musicNoteId); } diff --git a/app/src/main/java/core/notevault/ui/home/NoteSongAdapter.java b/app/src/main/java/core/notevault/ui/home/NoteSongAdapter.java index 51b839c..964cae2 100644 --- a/app/src/main/java/core/notevault/ui/home/NoteSongAdapter.java +++ b/app/src/main/java/core/notevault/ui/home/NoteSongAdapter.java @@ -110,7 +110,7 @@ public class NoteSongAdapter extends RecyclerView.Adapter doInBackground(Void... voids) { - List sheets = musicNoteDAO.getNoteSheetsForMusicSong(); + List sheets = musicNoteDAO.getNoteSheetsForMusicSong(this.musicNoteId); Log.d("LoadNoteSheetsTask", "Loaded NoteSheets: " + sheets.get(0)); return sheets; }