Added ability to list all playlists

This commit is contained in:
Isaac Parenteau
2019-10-24 21:33:54 -05:00
parent 232fd1746d
commit 75c3892e61
4 changed files with 37 additions and 13 deletions

View File

@@ -42,6 +42,11 @@ public interface GuildPlaylistRepository extends CrudRepository<GuildPlaylist, L
@Query("SELECT gpl FROM GuildPlaylist gpl WHERE gpl.guild.guildId = ?1 AND gpl.userId = ?2 AND gpl.playlist = ?3")
GuildPlaylist findByGuildAndUserIdAndPlaylist(Long guild, Long userId, String playlist);
List<GuildPlaylist> findByGuild(DiscordGuild guild);
@Query("SELECT DISTINCT gpl FROM GuildPlaylist gpl LEFT JOIN FETCH gpl.guildPlaylistSongList WHERE gpl.guild.guildId = ?1")
List<GuildPlaylist> findByGuildFetchSongs(Long guild);
List<GuildPlaylist> findByGuildAndUserId(DiscordGuild guild, Long userId);
@Query("SELECT gpl FROM GuildPlaylist gpl WHERE gpl.guild.guildId = ?1 AND gpl.userId = ?2")