Skip to content

Commit 0478da7

Browse files
fix: ongoing live streams are not inserted into feed
1 parent 5c0ffb1 commit 0478da7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

library/src/commonMain/kotlin/project/pipepipe/app/database/DatabaseOperations.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ object DatabaseOperations {
144144
uploader = streamInfo.uploaderName ?: "Unknown",
145145
uploader_url = streamInfo.uploaderUrl,
146146
thumbnail_url = streamInfo.thumbnailUrl,
147-
upload_date = streamInfo.uploadDate ?: 0,
147+
upload_date = streamInfo.uploadDate,
148148
is_paid = if (streamInfo.isPaid) 1L else 0L,
149149
is_short = if (streamInfo.isShort) 1L else 0L,
150150
url = streamInfo.url

library/src/commonMain/sqldelight/project/pipepipe/database/AppDatabase.sq

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ selectFeedStreams:
396396
SELECT s.* FROM streams s
397397
INNER JOIN feed f ON s.uid = f.stream_id
398398
INNER JOIN subscriptions sub ON f.subscription_id = sub.uid
399-
ORDER BY s.upload_date DESC;
399+
ORDER BY s.upload_date IS NULL DESC, s.upload_date DESC;
400400

401401
insertFeedStream:
402402
INSERT OR IGNORE INTO feed (stream_id, subscription_id)
@@ -585,7 +585,7 @@ FROM streams s
585585
INNER JOIN feed f ON s.uid = f.stream_id
586586
INNER JOIN feed_group_subscription_join fgsj ON f.subscription_id = fgsj.subscription_id
587587
WHERE fgsj.group_id = ?
588-
ORDER BY s.upload_date DESC;
588+
ORDER BY s.upload_date IS NULL DESC, s.upload_date DESC;
589589

590590

591591
-- Feed last updated queries

0 commit comments

Comments
 (0)