Skip to content

Commit

Permalink
fix: [torrust#84] SQL query to get list of torrents without stats
Browse files Browse the repository at this point in the history
The query was not returning all the torrents regardless whether they
have traacker stats or not.
  • Loading branch information
josecelano committed Nov 30, 2022
1 parent c291557 commit 3c47ffc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/databases/mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ impl Database for MysqlDatabase {
INNER JOIN torrust_torrent_info ti ON tt.torrent_id = ti.torrent_id
LEFT JOIN torrust_torrent_tracker_stats ts ON tt.torrent_id = ts.torrent_id
WHERE title LIKE ?
GROUP BY torrent_id",
GROUP BY tt.torrent_id",
category_filter_query
);

Expand Down
2 changes: 1 addition & 1 deletion src/databases/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ impl Database for SqliteDatabase {
INNER JOIN torrust_torrent_info ti ON tt.torrent_id = ti.torrent_id
LEFT JOIN torrust_torrent_tracker_stats ts ON tt.torrent_id = ts.torrent_id
WHERE title LIKE ?
GROUP BY ts.torrent_id",
GROUP BY tt.torrent_id",
category_filter_query
);

Expand Down

0 comments on commit 3c47ffc

Please sign in to comment.