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

11 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 213780f0eb
Small fixes (#1715)
* Update main.css

* saving settings now clear old cookies of current domain

* Update main.js

* Update classic.css

* Update settings.go

* Update main.css

* Update commentlist.jet.html

* Update generate.go

* Update default_config.yml

* Update structs.go

* Update default_config.yml

* Update find.go

* Update find.go

* Update stats.go

* Update interaction.go
2017-11-08 09:32:06 +01:00
kilo dd94402f04
Fixes & improvements (#1684)
* Update main.css

* Update torrent_item.jet.html

* Update main.js

* Update torrent_item.jet.html

* Update main.js

* Update main.js

* Update main.js

* Update main.js

* Update main.js

* Update template_functions_test.go

* Update template_functions_test.go

* Update user.go

* Update profile.jet.html

* Update view.jet.html

* Update template_functions.go

* Update en-us.all.json

* Add files via upload

* Update CHANGELOG.md

* Update main.css

* Update template_functions.go

* Add files via upload

* Update en-us.all.json

* Update template_functions_test.go

* Update view.jet.html

* Update main.css

* Update ja-jp.all.json

* Update main.css

* Update edit.jet.html

* Update main.css

* Update tomorrow.css

* Update ja-jp.all.json

* Update main.css

* Update view.jet.html

* Update comment.go

* Update create.go

* Update classic.css

* Make GetOldNavFromRequest return true by default

* Update view.jet.html

* Force torrent date in UTC+0 timezone during display

* ditto

* Update ja-jp.all.json

* Update oldNav.jet.html

* Update structs.go

* Update default_config.yml

* Update torrent.go

* Update stats.go

* Update stats.go

* Update user.go

* Update template_functions.go

* Update template_functions_test.go

* Update torrent.go

* Update comment.go

* Update view.jet.html

* Update main.css

* Update user.go

* Update template_functions.go

* Update profile.jet.html

* Update main.js
2017-10-28 18:28:59 +02:00
kilo 88904bade9 Medium changes (#1642)
* lower top margin for comment usernames & avatar

* Update classic.css

* temporary workaround to hide quadrupled comments

* Update view.jet.html

* Add "search from user" input below user rss link, change styling of follow button to fit other links

* all into the same div

* Remove padding of usersearch input in panel, remove useless css rule

* min-width for user buttons, max-width for the input

* Don't show "search from this user" if it's your profile

* remove max-width when responsive userprofile kicks in

* remove useless css rule

* Update view.jet.html

* le fix

* optimize stats.go a bit and add comments

* Update stats.go

* Update template_functions_test.go

* Update template_functions.go

* Remove hardcoded theme list, generate dynamically

* ditto

* Add possibility of forcing a theme for everyone

* in the .yml config file

* Make it ignore both user settings and cookies

* add forced theme in default theme config struct

* Update publicSettings.go

* fix missing , & travis

* Update template_functions_test.go

* Update main.css

* fix travis

* Update template_functions_test.go

* travis
2017-10-07 01:39:38 +02:00
kilo 6ca8ffe5fc Default & dark theme set in .yml (#1610)
* Update default_config.yml

* Update publicSettings.go

* Update base.jet.html

* Update config.go

* Update structs.go

* Update base.jet.html

* Update base.jet.html

* Update main.js

* Update base.jet.html

* Update base.jet.html

* Update publicSettings.go

* Update template.go

* Update template_test.go

* Update template.go

* Update classic.css

* allow user profile URl to contain just ID

* Update router.go

* Add nyaa.pt to mirrors

* Update main.js

* Update main.js

* Add /username/:username userprofile route

* Update profile.go
2017-09-22 14:54:19 +10:00
akuma06 195912d11f Change default struct of Tags in Search Struct (#1437)
Doing this makes it possible to use the method from ArrayString (Contains and Join).
Therefore:
* Tags.Join() would return a string of all the tags separated by commas
* Tags.Contains(str) would return a boolean on whether there is the str or not
2017-08-29 11:44:20 +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 51d7fe2ef7 Added html views + fix template test + View & JSON Controller 2017-07-29 14:43:12 +02:00
akuma06 62ea1aaf10 Adding tag post controller 2017-07-29 14:41:56 +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
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
Renamed from config/types.go (Browse further)