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

29 Révisions

Auteur SHA1 Message Date
kilo d5c2c6b676 Upload to nyaa.si, anidex & TokyoTosho [done] (#1633)
* Update upload.go

* Update helpers.go

* Update template_test.go

* Update upload_multiple.jet.html

* change variable names

* wrong copypaste

* change variable name

* ditto

* Fix travis

* Update main.css

* Update upload.go

* Update upload.jet.html

* Update main.css

* Update upload.go

* More compact form

* CSS changes to go along

* Update main.css

* Update upload.jet.html

* Slightly lower bottom margin

* Update upload_multiple.jet.html

* tomorrow color adjustements

* small css adjustements

* Update upload.go

* Update default_config.yml

* Update default_config.yml

* Update structs.go

* Update user.go

* Update structs.go

* Update upload.go

* Update default_config.yml

* Update upload_multiple.jet.html

* Update upload.go

* Update upload.jet.html

* Update template_test.go

* this one is optional for anidex

* Update default_config.yml

* Possible improvement
As mentionned in my comment, it seems that having a checkbox already checked and disabled for logged in user + having the input text for apikey is a bit tedious.
Moreover, asking to check and fill the input text to upload in anidex when you are not logged is doing things twice. If you don't want to upload to anidex, don't fill the input.

So this commit push a new behaviour:
* If you are logged in and you have filled your anidex/nyaasi api key : the form should only show the checkbox asking if you want to upload to nyaasi.
* If you're not logged in or you don't have filled your api key in your profile settings: you only show the input text for the api key and not the checkbox. If someone wants to upload to nyaasi/anidex, he will just need to fill the input.

* This adds back the support of anonymous upload when logged in or not.
This works simply by checking if the user wants to upload as anon (when he checks the checkbox "upload as anonymous") or by checking the emptyness of apikey.
+ reverts the condition statements since it was needed to have apikey empty

* Forgot to save this file

* This commit adds the go routines for each upload service (anidex, nyaasi, tosho).
New controller and url to check the upload status (/upload/status/:id).
If you add ?json at the end, it outputs a json format of the multi upload status.
To prevent memory overload, we only keep in memory the multiupload status for 5 minutes.
Moved multipleform struct from templates to upload utils.

* fix form display on classic theme

* This commit adds:
* Javascript refreshing of the upload status
* Localization of the pages
* Fixed some bugs

This works, only need to get torrent file now.

* Added a new function to get the Path to the torrent file.

* Added a function to check that a torrent file exists and if not generate it on multiupload

* Enabled file upload through http post request to anidex

* Fixed bugs

* Modified the behaviour to generate torrent preivously. It is a synchrone function now. So we need to make it asynchronous in download.go

Now torrents file are always generated at upload time in a background processus with the correct trackers (needed ones + the ones provided by the user).
I made the anidex tracker as a needed one to allow multiupload even if the user hasn't included in his torrent file/magnet url.

* Moving deadtrackers list to default config
Support torrent file creation when upload without scraping
* Fix possible bug where no one is seeding a torrent yet (first time upload)
Add primary tracker in torrent file

* Fixing issue with boolean pointer for private torrent

* fixing index out of range for announcelist filtering
Fixing anidex tracker not found

* Fixing lang id error

* Anidex upload works

* Fix for multiupload with magnet

* This adds TokyoTosho support. Since TokyoTosho API only support upload by URL (and not torrent file upload). We need to make the download url available without ddos protection.

Also TokyoTosho doesn't need a category select. Since it does have limited option, we can automatically convert our categories to the tokyotosho one.

* Removing the folder tosho and put categories.go directly in upload package.
Added category conversion for nyaasi too.
Added tests on category conversion.

* This should add nyaasi support.
Is not tested though.

* Updated defaut config with new nyaa.si behaviour?

* Forgot to commit this file
2018-01-03 18:21:07 +10:00
kilo 1956dba9d9
Update forms.go 2017-11-02 04:20:48 +01:00
akuma06 33c83030b9 Fix Api documetation (#1685)
* Fix Api documetation

Fix #1682
* Remove unused SubCategory field from struct TorrentRequest
* Change `category` argument in documentation to correct `c` (same key as the one in Search)

* Apidoc generation

* Remove SubCategory from template_test's torrentValidator

* Update template_test.go
2017-10-18 22:27:55 +02:00
kilo d6c030d9e6 [WIP] Anidex, TT & Nyaa.si uploading (#1604)
* Update main.css

* Update tomorrow.css

* Create upload_multiple.jet.html

* Create upload.js

* Update upload.jet.html

* Update upload.jet.html

* Update upload.jet.html

* Update tomorrow.css

* Update main.css

* Update tomorrow.css

* Update main.css

* Update user.go

* Update template_test.go

* Update main.css

* Update upload.jet.html

* Update edit.jet.html

* Update template_test.go

* Update upload.jet.html

* Update main.css

* new design for user edit

* Fix CRSF token

* Update upload_multiple.jet.html

* Update upload.jet.html

* Update profile.jet.html

* Update base.jet.html

* Update edit.jet.html

* Update forms.go

* Update forms_test.go

* Update forms_test.go

* Update forms.go

* Update forms_test.go

* Update main.css

* Fix 4+ torrent flags display on IE

* Fix userprofile buttons on IE, remove fancy css

* Fix torrent link being hidden on IE

* Update listing.jet.html

* Update main.css

* Update listing.jet.html

* Delete torrent_item_upload.jet.html

* Update torrent_item.jet.html

* Update main.css

* Update classic.css

* Update listing.jet.html

* Update classic.css

* Update profile.jet.html

* Update upload.jet.html

* Update classic.css

* Update classic.css

* Update main.css

* Update user.go

* Update upload.jet.html

* Update upload.jet.html

* Update edit.jet.html

* Update template_test.go

* Update forms.go

* Update forms_test.go

* Update main.css

* Update classic.css

* checkboxes next to language div

* wooo responsive checkboxes

* remove empty space

* need an !important here

* Fix flags being unaligned on IE

* Fix some inputs being too big on classic.css, remove fancy shit

* Update classic.css

* fix travis

* Update main.css

* Update upload.jet.html

* Update edit.jet.html
2017-09-30 15:10:47 +02:00
akuma06 421935f8be Change DLSite to String (#1576)
* Change DLSite to String

Fix #1573
Plus it seems the filtering search for ES didn't work for anidbid, vndbid and vgmdb. Should be fixed now.

* Update helpers.go
2017-09-17 21:27:20 +02:00
akuma06 53ba669ba6 Add remember me checkbox back (#1397)
I tried locally and I'm kept logged in. @ewhal check after update that you do have the same hash set in both nyaa and sukebei. If you do, just change the domain name (".pantsu.cat") in the functions getDomainName() to the subdomain. Because I don't see why it wouldn't work otherwise
2017-08-26 12:57:02 +10:00
akuma06 c6168be8b1 Tag Search + Tests + Search slight refactor [DONE] (#1342)
* Tag Search + Tests + Search slight refactor

First commit improving search. Different struct have their own file with their tests. This way of separating struct by files is inspired by the go packages I've seen so far.

Added new behaviour as discussed in #1334

* fix fallback to ES

* Added some comments to explain PG fallback + log err moved

* Refactored search

Nearly fully covered
WhereParams struct has disappeared for Query struct instead
In DB model, we use an interface implementing Query struct methods

* 1rst Refactor of Tags (WTF already?!)

Prepare Tags for the refactored system. Now there will be descriptive tags for a particular release (ecchi, BDSM, ....) and typed tags.
Typed tags are tags relevant to all torrents and can be limited to some input value. For example, video quality is a typed tag limited to some values (hd, full hd, sd, ...). In the same way, anidbid is also a typed tag but doesn't have default values.

Furthermore, the location storage of tags have changed, now accepted descriptive tags are stored in the torrents table in the column "tags" and they are separated by commas.
In the opposite, accepted typed tags can have have their own column in the torrents table. For example, anidbid, vndbid will populate the column DbID when accepted. On the other hand, videoquality will populate the same way as descriptive tags.

This behaviour depends on the callbackOnType function in tag/helpers.go

* fix for modtools :')

* Added anidb, vndb, dlsite & vmdb id fields in torrent model.
Tags don't have an accepted field anymore.
Accepted Tags are in torrent.AcceptedTags and non-accepted ones in torrrent.Tags.

New Helper + New Changelog for translation string.

* New upload/edit form for torrent tags.
Now the inputs are dynamically generated by the helper tag_form.
No more modal window in those form, only inputs.
Support of tags in API
New translation string for the  link to the modal on torrent view.
More comments in the functions for tags

* Improving how config for tags work. Adding a test on them with understandable messages.
Config for tags have now a Field attribute which is linked to the Torrent model. For example anidbid tag type has now a AnidbID field in config which is the name of the field in torrent model (AnidbID). Every new tag type need to have a field attribute with its counterpart in torrent Model.
Fixing some errors

* Fix compile error + Tests Errors

* Improve performance by caching the list of tags with an index
Adding/removing tags works/tested
New translation strings

TODO: test/fix adding tag on upload/edit

* Mini fix to display video quality
+ tags works/tested on modo edit

* Fix editing tags on modpanel

* Edit tags works

* Add translation string

* Add search backend for tags.
?tags=xxx,eee,ddd
?anidb=21
?vndb=23
?vgmdb=24
?vq=full_hd

* Fix Ajax tag Removal&Add

* Added form for descriptive tags

* Forgot to add the link between database and form for descriptive tags.

* Adding the increase/decrease pantsu for descriptive tags

* Fix #1370

* When you actually forgot to commit files after having forgotten commits
2017-08-22 11:48:10 +10:00
akuma06 1dbfe1b3b4 Added moderation part + tests 2017-08-03 03:38:07 +02:00
akuma06 d0a647bf8e fix travis error 2017-08-02 18:04:44 +02:00
akuma06 0db143d685 Possibility to add tags from edit panel + upload 2017-08-01 23:38:13 +02:00
akuma06 93a2c5b98e add validator package 2017-07-31 03:23:21 +02:00
akuma06 03ea72595d OAuth API [done] (#1275)
* Initial Commit for OAuth API

This builds and run and return the right error.
Need to test it and then adding all users as possible client

* Added mising dependency

* just compile already...

* Fixing template test

* Imrpovements

Moved db stuff in models
Added some tests
Added form in modpanel to add/update a client
Added controllers for add/update of client

* Added Forms + speed improvements

Controller oauth client listing + html
Controller oauth client delete + messages
Messages on comment delete
New ES config that disable ES if set to false. Improve load speed on local development
Fix a load config bug
Fix index admin & translation string sign_out broken by @ewhal

* Sanitize empty strig in form array + css

Multiple empty array of strings are sanitized for the oauth client create form
Added some css for the form display

* Upload and Create form works

* Fix splitting response types

* Removing required on secret when updating

* fix travis error

* Fix travis template test

* Update dependency

* Moved to jinzhu instead of azhao

* randomizen secret on creation

* Final touch on oath api

improved display name
fix grant form csrf
fix login csrf on oauth

* Fix gorm test

* fix template test

* Fixing deleted dependency issue

* Make travis faster

* Fix typo

* Fix csrf for api calls

* This shouldn't be exempt

* Removing hard coded hash

@ewhal Don't forget to replace the hash in tokens.go with another one

* Added an example on how to use OAuth middleware

* Renamed fosite utils to oauth2 utils
2017-07-28 13:46:40 +10:00
PantsuDev d9142a73c3 Fix most go lint warnings 2017-07-23 15:50:18 +10:00
akuma06 4714c5c0f5 Improviong dynamic load of configs by putting only one variable one 2017-07-21 01:36:25 +02:00
akuma06 6e63555a33 Forgot to commit those files 2017-07-19 21:40:44 +02:00
akuma06 e98ce1d318 Fix #1199 by converting a model to a map of interface 2017-07-17 21:32:55 +02:00
akuma06 ee95510242 Template refactor (#1212)
* Template rafactor

Now templates go files are in /templates in a templates package. Controllers only have controller files

* Fix template test. Forgot I moved ReassignForm
2017-07-16 17:20:35 +02:00
akuma06 32315bc7bb Fixing form registration tests 2017-07-13 18:10:38 +02:00
akuma06 8122015a2e Fixing registration + Added a log on request errors 2017-07-13 18:05:53 +02:00
akuma06 cd3c728b64 Added some tests + fix for es lang
Fix #1164
2017-07-13 00:20:43 +02:00
akuma06 713ab02450 Added configor as a new library (#1126)
* Added configor as a new library

Now config is a singleton. You only need to do config.Get() instead of doing config.Conf.

* Forgot godep save 🐤

* Fix accidental removal of }
2017-07-10 22:11:05 +10:00
akuma06 e54a2e59e2 Fixed alphabetical order for languages and categories
Also improved the name of exported functions for categories
2017-07-06 21:53:13 +02:00
akuma06 487060c1a4 Forgot the login form test modification 2017-07-04 03:10:46 +02:00
akuma06 d74d337c25 Adding redirecto when login 2017-07-04 02:48:20 +02:00
akuma06 b2e00dce1f Removing debug message 2017-07-03 02:19:37 +02:00
akuma06 d84c294c1b Binding requirements for gin 2017-07-03 01:47:31 +02:00
akuma06 b11c02e54e Fixed templates with new functions 2017-07-03 00:34:18 +02:00
akuma06 7846d999ff No errors on api controllers 2017-07-02 18:00:12 +02:00
akuma06 97b3a1d7ea Remove common package
Common is no more a thing
Use of TorrentParam instead of SearchParam now
Common structs for search are exported in utils/search/structs
Util has been renamed utils
2017-07-02 16:54:55 +02:00