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 à :
Parent
cb13bcded9
révision
d12ffb92ba
|
@ -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:
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Référencer dans un nouveau ticket