Closed TEMtheLEM closed 12 months ago
Credit to @amogusussy for writing the majority of the code in this PR. I couldn't find a way to pull the PR as it was 'merged', so I just CTRL+C CTRL+V'ed a lot of it.
What changes (beside the docker stuff) are made from my original code?
?
@amogusussy
src/torrent_sites/nyaa.py
is no different.src/torrent_sites/torrentgalaxy.py
has the following changes;
`text.replace(',','')` is used as the text could include commas, and Python cannot parse integers from those strings.
src/torrents.py
has no effective difference, other than the quoting you added on 9/25. templates/torrents.html
has the following changes;
^ The double quotes in double quotes seemed wrong. Can't remember if this caused any actual bugs or not, but regardless my text editor took `"{{ result["magnet"] }}"` weirdly, so I changed it to `"{{ result['magnet'] }}"`.
```diff
^ Same story here.
```diff
{% if result["views"] is not None %}{{ result["views"] }} views • {% endif %}{{ result["size"] }}
{% if result["views"] %}{{ result["views"] }} views • {% endif %}{{ result["size"] }}
^ Flask got mad about `{% if result["views"] is not None %}` and crashed there. It didn't like `is not None`, so I removed that and relied on truthiness instead. That solution ended up working.
And I think that's all for the differences. Again, a lot of it is your old code, but with all the applicable patches that I went over.
@Extravi anything you specifically need me to clear up? I'm not sure what you're confused about. This PR patches all the issues (that at least I encountered) with PR #59.
Also, just to parody recent changes you made, I've just quoted the queries in both src/torrent_sites/nyaa.py
and src/torrent_sites/torrentgalaxy.py
. See the most recent commit.
Okay, thank you :)
this has some of amogusussys code so @amogusussy you fine if i pull this?
Yes :+1:
Resolved merge conflicts.
@Extravi PLEASE merge this before doing ANYTHING else.
Patches issues with #59 and gets it working.
Subsequently, the docker image also now allows users to configure
NYAA_DOMAIN
and what sites are enabled (ENABLED_TORRENT_SITES
). This change is only present due to the patch.