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 type: keyword
category: category:
type: text type: text
description:
type: text
sub_category: sub_category:
type: text type: text
status: status:

Voir le fichier

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

Voir le fichier

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