Commit Graph

19 Commits

Author SHA1 Message Date
Kfir Hadas 87dd95f1e0 Refactor into an app factory [2 of 2] (#322)
* Replace all `from nyaa import app` imports with `app = flask.current_app` (or `from flask import current_app as app` where possible)
* Add a separate config object for top-level and class statements as `nyaa.extensions.config`
Required because those codes don't have app context at the time of evaluation/execution.
* Remove `routes.py` file and register all blueprints in `nyaa/__init__.py`
* Refactor `nyaa/__init__.py` into an app factory
* Update tools
* Update tests (temporary, will be replaced)
2017-08-01 21:02:08 +03:00
Kfir Hadas 0181d6cb33 Prepare for app factory [1 of 2] (#315)
* Move db, assets, debug toolbar and fix_paginate into nyaa.extensions
* Change all `from nyaa import db` imports to `from nyaa.extensions import db`
* Move `nyaa.torrents.create_magnet_from_es_info` context processor into template-utils blueprint
* Fix tools (wrap in `with app.app_context():` where needed)
2017-07-30 20:35:16 +03:00
TheAMM 1dae331156 Completely handle qBittorrent webseeds
Fixes #319

Zero webseeds: empty bytestring
One webseed: bytestring
More than one: a list of bytestrings (as the spec asks for!)
2017-07-30 11:49:13 +03:00
TheAMM 987103b213 Handle qButtorrent empty url-list/webseeds
url-list is supposed to be omitted in case of no webseeds,
but qB will instead use an empty bytestring '' as the value.
This commit makes the validation more lenient regarding url-list.
2017-07-30 11:36:38 +03:00
Anna-Maria Meriniemi 1bc36c5a17 [Schema change] Add webseed support (BEP-19) (#317)
Store webseeds in Trackers table with is_webseed flag
Adjusts torrent creation accordingly
2017-07-30 00:00:39 +03:00
Kfir Hadas b992467dad Apply isort & flake8 (#312)
* Update isort settings
* Apply import sorting (isort) on all files in nyaa/
* Fixed Flake8 errors in nyaa/ (see PR for list)
* Add isort to lint.sh and requirements.txt
2017-07-28 20:01:19 +03:00
Kfir Hadas 9fef343c1b Move torrent edit and upload into 'torrents' blueprint
Move supporting functions and variables into other files
* nyaa.views.torrents:
  - _create_upload_category_choices
* nyaa.backend:
  - get_category_id_map
2017-07-27 14:14:00 +03:00
nyaadev 1b76eaea35 fix race condition? 2017-05-23 15:18:17 +02:00
katnyaa 159d5a5d9e Fix lint errors 2017-05-22 15:12:17 +01:00
aldacron 29e878a1ec fixed api_uploader and reverted backend.py change 2017-05-22 00:36:01 -07:00
aldacron 8fc81b395e if is_trusted is not sent and user is trusted, torrent will marked as trusted unless specified. this also enable backward compat of v1 2017-05-21 22:53:28 -07:00
nyaadev 9af778217b DB CHANGE: Add uploader ip address to torrent column and show on torrent view page for superadmins.
Added migration script!: remove sukebei_ lines if your local db does not have those.
Show users ip address on user page for superadmins.
Rename Admin to Moderator internally.
Moderators can now change user level to trusted.
Superadmins can make users moderator.
Improve changing user level.
2017-05-21 19:12:15 +02:00
TheAMM 752a5a1f95 Clean up models.User.level helpers 2017-05-20 21:59:24 +03:00
TheAMM 4b4a7b9830 Support BitComet empty directories (ew)
This will allow most (if not all) torrents that have been rejected by 'Malformed torrent metadata (path part is empty)'

Adjusts _validate_bytes to disable empty check
Adds the empty check to file tree parsing
2017-05-20 10:12:32 +03:00
nyaadev 2a1f8fab87 pep8 2017-05-19 14:36:33 +02:00
kyamiko 785a8db0c8 Updated api/upload 2017-05-17 23:56:36 -04:00
sharkykh 5e60847cb6 More E501 line too long - multiple files
nyaa/backend.py:75
nyaa/forms.py:129,175
nyaa/models.py:88
2017-05-16 12:43:33 +03:00
sharkykh a79c0f8a93 PEP8 (a run of lint.sh) 2017-05-16 12:42:12 +03:00
TheAMM b2106089b6 [backend] Move upload handling from routes.py into backend.py
Preparing for a better api
2017-05-13 03:38:38 +03:00