Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Fix description in API search/RSS

There were no descriptions in torrents in API/RSS search on dev. The cause was that ES didn't have the field description in it.

You should reindex after the merge
Cette révision appartient à :
akuma06 2017-06-22 17:35:21 +02:00
Parent cb13bcded9
révision d12ffb92ba
3 fichiers modifiés avec 8 ajouts et 4 suppressions

Voir le fichier

@ -52,6 +52,8 @@ mappings:
type: keyword
category:
type: text
description:
type: text
sub_category:
type: text
status:

Voir le fichier

@ -38,11 +38,11 @@ while fetches:
}
if action == 'index':
select_cur = pgconn.cursor()
select_cur.execute("""SELECT torrent_id, torrent_name, hidden, category, sub_category, status,
select_cur.execute("""SELECT torrent_id, torrent_name, description, hidden, category, sub_category, status,
torrent_hash, date, uploader, downloads, filesize, seeders, leechers, completed, language
FROM {torrent_tablename}
WHERE torrent_id = {torrent_id}""".format(torrent_id=torrent_id, torrent_tablename=torrent_tablename))
torrent_id, torrent_name, hidden, category, sub_category, status, torrent_hash, date, uploader, downloads, filesize, seeders, leechers, completed, language = select_cur.fetchone()
torrent_id, torrent_name, description, hidden, category, sub_category, status, torrent_hash, date, uploader, downloads, filesize, seeders, leechers, completed, language = select_cur.fetchone()
doc = {
'id': torrent_id,
'name': torrent_name.decode('utf-8'),
@ -50,6 +50,7 @@ while fetches:
'sub_category': str(sub_category),
'status': status,
'hidden': hidden,
'description': description,
'hash': torrent_hash,
'date': date,
'uploader_id': uploader,

Voir le fichier

@ -269,8 +269,9 @@ func (t *TorrentJSON) ToTorrent() Torrent {
UploaderID: t.UploaderID,
Downloads: t.Downloads,
//Stardom: t.Stardom,
Filesize: t.Filesize,
//Description: t.Description,
Filesize: t.Filesize,
Description: string(t.Description),
Hidden: t.Hidden,
//WebsiteLink: t.WebsiteLink,
//Trackers: t.Trackers,
//DeletedAt: t.DeletedAt,