mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-26 10:36:23 -07:00
Exclude embed entries from the list of thread files retrieved
This commit is contained in:
parent
d0dbf82574
commit
7690bad025
1 changed files with 3 additions and 1 deletions
|
@ -22,10 +22,12 @@ var (
|
|||
)
|
||||
|
||||
// GetThreadFiles gets a list of the files owned by posts in the thread, including thumbnails for convenience.
|
||||
// It does not include deleted file entries or embeds
|
||||
func GetThreadFiles(post *Post) ([]Upload, error) {
|
||||
query := selectFilesBaseSQL + `WHERE post_id IN (
|
||||
SELECT id FROM DBPREFIXposts WHERE thread_id = (
|
||||
SELECT thread_id FROM DBPREFIXposts WHERE id = ?)) AND filename != 'deleted'`
|
||||
SELECT thread_id FROM DBPREFIXposts WHERE id = ?)) AND filename != 'deleted' AND filename NOT LIKE 'embed:%'`
|
||||
|
||||
rows, err := Query(nil, query, post.ID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue