Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Graphe des révisions

61 commits

Auteur SHA1 Message Date
PantsuDev
e139f5e4db Fix most compiler errors 2017-06-29 21:15:23 +10:00
akuma06
5991a21818 First batch of changes for the refactor (#1078)
* First batch of changes for the refactor

Added the support of gin in routes and other services/utils
Begining implementation of JetHTML

* Remove os folder

* Move scrapers to own repo

* Second batch of changes

All .jet.html are the working templates.
You can now test this PR, the index Page and upload works. If you want to complete the other html templates, you're welcome

* Move captcha to util

* Move uploadService to utils

* Use govalidator instead of regex

* Third batch of changes

All the front end should as previously.
I also fixed some minor things unrelated to the refactor (mostly style issues on static pages)
Now errors can be accessed by importing the "errors" helpers and using the `yield errors(name="xxx")` command in templates.
Same for infos.
Templates are now more hierarchized with a base template "base.jet.html" which is extended depending on the context in "index_site" or "index_admin" layouts. Those layouts are extended than in every pages.
Other helpers are captcha to render a captcha `yield captcha(captchaid="xxx")`
And also csrf, with the command `yield csrf_field()`
To translate, you don't have anymore to do `call $.T "xxx"`, you just have to do `T("xxx")`.

Pages for the website part are in folders in the folder "templates/site". Pages for the admin part are in "templates/admin". Layouts are separated in "templates/layouts". Helpers and menu are in "templates/layouts/helpers" and "templates/layouts/menu". Error pages should be put in "templates/errors"

* Added test on templates

When adding a new template, you have to tell to template_test.go, the context of the new template (if it doesn't use the common context)

* Panel admin works

Now the templating part should work. The PR can now be fully tested.

I think we should push the templating PR  and do the routes/controllers/removal of services in another branch. So we know that this one is functional

* Updated dependencies

* Fixed test for modelhelper

* Fix testing for commentlist

* Fix travis :')

* Just renamed router and removed network

* Applying same SEO fix

* Update form_validator.go

* Added back regexp package
2017-06-28 21:42:38 +10:00
PantsuDev
496e1d4ba4 Start refactor 2017-06-25 23:27:05 +10:00
PantsuDev
cb13bcded9 Change max to limit 2017-06-22 11:21:30 +10:00
akuma06
eaf4e23266 Fix hidden on User Profile (#1039)
When a user had hidden torrents, they were still listed on his user page even if it's not the actual user who is viewing it.
That's why I added a new function for searching which filter out hidden torrents.
Now when a user go to his own page (or a moderator), he can see all his torrents.
However if another person visit the page, only non hidden torrents will be listed.
I added the hidden parameter in ES database, it permits also to use the search instead of SQL when listing torrents on the user page. Less load time, go with the idea that we should use ES everywhere when needed.
2017-06-21 11:58:54 +10:00
akuma06
9307087024 Refine form linked up & edited buildversion to commit hash (#1025)
Added the use of the new search form made by @kipukun
Buildversion are now commit hash. Please read the readme for new build
command (or just build using package.sh).
2017-06-20 10:06:01 +10:00
akuma06
13a15b3b2c Removing reparsing of pagenum in ES 2017-06-18 01:39:11 +02:00
akuma06
ad3a44e2f8 Torznab fix (#1019)
* Torznab fix

Added multiple category search
Fixed issues in #1017
Now category from searchParam & torrentParam are arrays of category
New Struct Categories

* Fix travis error due to database code
2017-06-18 08:30:12 +10:00
Ramon Dantas
dac4b5baf5 Add MinSize and MaxSize search parameters (#990)
Also removed some duplicate code from the search code, using the
methods in common/search.go.
2017-06-13 21:31:11 +10:00
Ramon Dantas
d8e17478f8 Country flags (language) for torrents. (#970)
* Add flags for torrents

Add a new field, .Language, to the Torrent model, and a new package,
torrentLanguages, which maps languages to flags. Added also a flag icon pack
from googlei18n/region-flags, with (mostly) public domain flags from Wikipedia.

* Optimize flags

* Use FlagSprites CSS instead of .png files

* Only use flags for languages we support

* Add test for CSS flags

Ensure that we have all the flags for the languages we support.

* Add AdditionalLanguages field to config

This allows us to support additional languages for new uploaded torrents,
even if we have no translation for it.

* Minor CSS fix

* Add "other" and "multiple" torrent languages

Also removed the TorrentLanguage struct, as it wasn't much useful.

* Fix test

* Add colspan=2 to category when language is empty

Also hide the language column if empty.

* Add lang field to search.

Hopefully it works with Elasticsearch as well, but I haven't tested
(lol Java)

* Add language field to ES index and settings

* Add language column to JS template

* Add keyword type to language ES field

* Remove 'raw' from keyword

* Set "simple" analyzer on language

* Document .Language field on Torrent model
2017-06-12 09:14:26 +10:00
tomleb
e60eceba63 Reduce number of queries, update systemd unit service (#925)
* Update/add systemd services

* Avoid roundtrip back to postgresql when doing ES search

* Use only one ES client
2017-06-05 11:33:02 +10:00
akuma06
61a0ab0bc3 Added also a maxage field
Now you can provide ?maxage=nb_days to get the torrents from the last
nb_days days
2017-06-02 16:25:45 +02:00
akuma06
f41f2c3a25 Field Date Filter
* Search can be filtered out with ?fromDate=2017-05-01 and
?toDate=2017-05-12
2017-06-02 16:10:31 +02:00
akuma06
b0cf17c77c Renamed the search argument FromID instead of TorrentID 2017-05-30 14:12:42 +02:00
akuma06
402fce9f02 Api Last Torrent + xhr automatic refresh
* Added a fiel torrentID in search param
* Search can be limited to torrentID > id provided
* Templates creation through simple JS object
* XHR management through simple JS object
* Torrents object that interface with Templates and Query to get new
torrent uploaded according to the search context
2017-05-30 00:28:21 +02:00
akuma06
6481e90a0c Golint friendly next (#756)
* Gofmt friendly

Keeping Go source code in line with what they preconize

* Golint Friendly Next

So I have made some variables unexported
Added comments in every function that I know what it does
Removed some deprecated stuff that I was sure of
Added a comment on possible deprecated methods "Is it deprecated?"
Changed some variable/method name according to golint recommendations

* Update filelist.go
2017-05-26 12:12:52 +02:00
tomleb
f22d11b35d Elasticsearch integration (WIP) (#730)
* Update mapping to be similar to TorrentJSON

* Implement ES search for TorrentParam

* Add seeders/leechers/completed to es index

* Fix filter, use analyzer

* Use ES for the search route

* Add upload_id filtering with ES

* Create/update ES index on torrent upload/update

* Delete from ES index on Delete

* Use ES everywhere, fallback to postgres query

Use Elasticsearch to search the index whenever a call to searchByQuery
is made. Big cleanup needed, but _it werks_.

* Only fetch ids from ES, nothing else

* Use ColumnUpdate instead of Save

* Add FIXME/info to search

* Template needs []TorrentJSON not []Torrent
2017-05-26 09:48:14 +10:00
akuma06
6edc68fe22 Deleted torrents mod done (#732)
* Torrent Mass Edit Api (WIP)

* Torrents can be deleted in mass from frontend with api post request
* Torrents status can be edited from frontend with api post request
-- Look to function doc for more info on how to use it

It is a WIP so it might not work =D

* Finished Mass mod Api

As per suggestion of @yiiTT in #720, I added:
* Changing torrents category
* Deletion of reports with deletion of a torrent
* Changing owner of multiple torrents

Commit also add some new translation strings.

* Make some changes

* Reports can now be cleared for the torrents selected without having to
delete them
* Users with no admin rights can't delete reports

* Fix moveto to status

moveto deprecated in api

* Tested and works!

Changes:
* Updates only the colomns of torrent table
* Moved categories config in config/torrents.go

* Forgot this file in last commit

* Less useless queries

The use of Save makes it that users are created and updates also all the
associatiated models. Better to just update the colomns needed (less
useless queries)

* Some Updates

* Added a new status of 5 for locking torrents
* Modifying the list torrents view for using it in deleted torrents view
* Added function to get deleted torrents
* Torrents (and reports) can be definitely deleted
* Some new translation string

* Fixing

* fix 2

* Added upload check for locked torrents

If a user owns a torrent, has deleted it and try to repload it. As long
as it has not been locked, he can.

* Fixing wrong condition in isdeleted

* Finished

* Info messages on success when deletes or lock
* Fixed double deleted_at is Null
* Added Link to view of deleted torrents
* Added new translation string
2017-05-25 02:19:05 +02:00
Eliot Whalan
b4b1b1c26a
go fmt all the code 2017-05-24 17:11:13 +10:00
akuma06
0d5e2abf7f Added multi action on torrents 2017-05-20 13:45:15 +02:00
akuma06
88bf3c0573 Fix #570 2 2017-05-17 23:41:18 +02:00
PantsuDev
70f87e7aac finish repo transfer 2017-05-17 15:58:40 +10:00
sfan5
b930997c68 Make sorting by date date work nicely 2017-05-14 17:35:10 +02:00
Mokhtar
a9019bb490 Fix search category filter when subcategory's length exceeds 1 character (#457)
* Fixed search category filter when subcategory's length exceeds 1 character

* Changed the subcategory's length check to not let the possibility to overflow
2017-05-14 14:03:04 +10:00
sfan5
c5fe70800d Disable CTEs and TSQuery for now 2017-05-12 19:38:08 +02:00
sfan5
38f23a3d7f Use ts_query on Postgres for performance reasons
Untested.
2017-05-12 17:41:26 +02:00
wranai
4b810494f3 Now really fixing the status filter (#354)
I managed to screw up in the last update. Normal is 0 and remake is 1, so that makes the "goodness" order of statuses non-monotonic, so I can't use the greater sign for filtering out remakes...
2017-05-11 14:46:23 -05:00
Jeff Becker
0e8a3cde3b Merge branch 'cache-interface' into merge-cache-interface 2017-05-11 09:24:20 -04:00
Jeff Becker
059ea7d2a8 abstract out cache 2017-05-11 09:01:53 -04:00
Eliot Whalan
c1cafb9d9a Remove broken caching stuff 2017-05-11 22:22:49 +10:00
Jeff Becker
57895251a3 fix torrent swarm ordering and add timeouts for udp scrape 2017-05-11 07:40:50 -04:00
akuma06
e8774abf21 Updated search
When in a user page and clicked on more torrents, show a list navigable
of the user torrent
On that list, we can make advance search (categories, order, ...)

Moderation search reimplemented
Clicking on user (id) in the torrent list redirect to the list of the
user torrents
Ability to search within the user torrents
2017-05-11 03:52:42 +02:00
Eliot Whalan
65ee41a10b Add orderby seeders/leechers/completed 2017-05-11 10:26:58 +10:00
wranai
12bb79b4f5 Fixing the status filter for good (#326)
"Trusted" should include A+ (a.k.a "Trusted A+") torrents as well.
2017-05-10 18:13:54 -05:00
Sirakain
6c479f33be Filter remakes excludes from SQL query, not A+ (#309)
Fixes #286
2017-05-10 16:09:38 -05:00
ayame-git
1bf4012eb2 yea.. 2017-05-10 21:42:20 +03:00
bakape
58ca34132c cache: Add total torrent count and fixes 2017-05-10 12:32:49 +03:00
bakape
6bf7ee3438 Search query caching 2017-05-10 12:03:49 +03:00
Chris MacLeod
c9b72206a5 Consistency, formatting, error checking, cleanup, and a couple bug fixes (#245)
* Checkpoint: it builds

The config, db, model, network, os, and public packages have had some
fixes to glaringly obvious flaws, dead code removed, and stylistic
changes.

* Style changes and old code removal in router

Router needs a lot of work done to its (lack of) error handling.

* Dead code removal and style changes

Now up to util/email/email.go. After I'm finished with the initial sweep
I'll go back and fix error handling and security issues. Then I'll fix
the broken API. Then I'll go through to add documentation and fix code
visibility.

* Finish dead code removal and style changes

Vendored libraries not touched. Everything still needs security fixes
and documentation. There's also one case of broken functionality.

* Fix accidental find-and-replace

* Style, error checking, saftey, bug fix changes

* Redo error checking erased during merge

* Re-add merge-erased fix. Make Safe safe.
2017-05-09 21:34:40 -05:00
Jeff
18d6ad3992 make rss fast again :^) 2017-05-09 11:07:42 -04:00
bakape
839bc46163 Workaround for SQLite search
At least we can test it in development now.
2017-05-09 15:31:47 +03:00
bakape
a0ae1f7e6a Refactor search
Optimise, error handling and avoid some exploits
2017-05-09 14:31:58 +03:00
Eliot Whalan
66a2adecfc Merge branch 'less-realloc' of git://github.com/bakape/nyaa into bakape-less-realloc 2017-05-09 13:16:42 +10:00
ayame-git
d3fc3f8b7a Revert "autism"
This reverts commit 59b1e2bb5f.
2017-05-09 06:14:31 +03:00
PantsuDev
7ab4d45505 Merge branch 'master' into less-realloc 2017-05-09 13:14:20 +10:00
ayame-git
ecaa9f765a autism 2017-05-09 05:44:08 +03:00
akuma06
86a2f3f110 Added User Search Functionality 2017-05-09 04:30:25 +02:00
ayame-git
711dc5fda0 category and status search not workign 2017-05-09 05:29:26 +03:00
bakape
d0d44a4849 Death to reallocations! 2017-05-09 02:56:57 +03:00
sfan5
9314cf1a47 Revert "Added user torrents search"
This reverts commit 65a543478a.
2017-05-08 22:50:25 +02:00