Skip to content

Commit 4ef5aa7

Browse files
authored
Merge pull request #13055 from dustdfg/playlist_add_empty
Fixed a bug that prevented the display of multiple empty playlists
2 parents 2f063a7 + 402f43e commit 4ef5aa7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/src/main/java/org/schabi/newpipe/database/playlist/dao/PlaylistStreamDAO.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ interface PlaylistStreamDAO : BasicDAO<PlaylistStreamEntity> {
6868
)
6969
fun getOrderedStreamsOf(playlistId: Long): Flowable<MutableList<PlaylistStreamEntry>>
7070

71+
// If a playlist has no streams, there won’t be any rows in the **playlist_stream_join** table
72+
// that have a foreign key to that playlist. Thus, the **playlist_id** will not have a
73+
// corresponding value in any rows of the join table. So, if you group by the **playlist_id**,
74+
// only playlists that contain videos are grouped and displayed. Look at #9642 #13055
75+
7176
@Transaction
7277
@Query(
7378
"""
@@ -103,6 +108,11 @@ interface PlaylistStreamDAO : BasicDAO<PlaylistStreamEntity> {
103108
)
104109
fun getStreamsWithoutDuplicates(playlistId: Long): Flowable<MutableList<PlaylistStreamEntry>>
105110

111+
// If a playlist has no streams, there won’t be any rows in the **playlist_stream_join** table
112+
// that have a foreign key to that playlist. Thus, the **playlist_id** will not have a
113+
// corresponding value in any rows of the join table. So, if you group by the **playlist_id**,
114+
// only playlists that contain videos are grouped and displayed. Look at #9642 #13055
115+
106116
@Transaction
107117
@Query(
108118
"""
@@ -118,7 +128,7 @@ interface PlaylistStreamDAO : BasicDAO<PlaylistStreamEntity> {
118128
LEFT JOIN streams
119129
ON streams.uid = stream_id AND :streamUrl = :streamUrl
120130
121-
GROUP BY playlist_id
131+
GROUP BY playlists.uid
122132
ORDER BY display_index, name
123133
"""
124134
)

0 commit comments

Comments
 (0)