diff --git a/deploy/ansible/roles/elasticsearch/files/elasticsearch_settings.yml b/deploy/ansible/roles/elasticsearch/files/elasticsearch_settings.yml index 31323efb..9d57e59f 100644 --- a/deploy/ansible/roles/elasticsearch/files/elasticsearch_settings.yml +++ b/deploy/ansible/roles/elasticsearch/files/elasticsearch_settings.yml @@ -52,6 +52,8 @@ mappings: type: keyword category: type: text + description: + type: text sub_category: type: text status: diff --git a/deploy/ansible/roles/elasticsearch/files/reindex_nyaapantsu.py b/deploy/ansible/roles/elasticsearch/files/reindex_nyaapantsu.py index 13b9687b..0b887406 100644 --- a/deploy/ansible/roles/elasticsearch/files/reindex_nyaapantsu.py +++ b/deploy/ansible/roles/elasticsearch/files/reindex_nyaapantsu.py @@ -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, diff --git a/model/torrent.go b/model/torrent.go index 73a0d0db..e98e56e5 100644 --- a/model/torrent.go +++ b/model/torrent.go @@ -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,