Conversation
b570938 to
6d6f2f9
Compare
6d6f2f9 to
91cecac
Compare
d468b29 to
db8d769
Compare
|
This is very basic right now only a "successfully imported" page, plus a list, and upload form. Maybe the success page is completely useless and can be removed. Right now nothing is done with the magnets we're just storing them in the DB. Feedback welcome @Gabatxo1312 |
8aedba2 to
9db740e
Compare
|
@angrynode I think you can merge this PR ! |
64ded3a to
1bdfb08
Compare
70ad423 to
2a34db6
Compare
| <i class="fa fa-download me-2"></i> | ||
| Download new torrent | ||
| </a> | ||
| {% if state.resolved_magnets_count != 0 %} |
There was a problem hiding this comment.
We may want to still have a link to the magnet list (with a counter) so a user is not tempted to add one more magnet that has already been uploaded.
|
9f6ea24 to
4b70914
Compare
|
OK the basic features are here. I'm not really happy with the implementation. I feel like we have a lot of boilerplate due to separation of category / content_folder. I think we could make the I'll try something along those lines. |
| @@ -4,13 +4,18 @@ <h2 class="text-center"> | |||
| <label for="magnet">Magnet link</label> | |||
There was a problem hiding this comment.
This file should be removed.
| @@ -2,13 +2,19 @@ | |||
| <div class="card-body"> | |||
There was a problem hiding this comment.
This file should be removed.
| pub torrent_id: TorrentID, | ||
| pub link: MagnetLink, | ||
| pub name: String, | ||
| pub resolved: bool, |
There was a problem hiding this comment.
This should be changed to an actual TorrentFile so we don't have to perform additional checks. When the background resolver resolves the magnet, it just sets the torrent accordingly.
|
Before rebasing or opening a new PR, time for some cleanup. |
| pub content_folder: HasOne<content_folder::Entity>, | ||
| pub category_id: i32, | ||
| #[sea_orm(belongs_to, from = "category_id", to = "id")] | ||
| pub category: HasOne<category::Entity>, |
There was a problem hiding this comment.
What if the folder is changed from a category to another? It's better to have a single source of truth, the content folder ID.
There was a problem hiding this comment.
Ha no because the usecase was having a Magnet at the top of a category. So in this case we should either have a category ID, or a content folder ID. On the rust side this is a simple enum but how to represent it on seaorm ?
dddf795 to
e345809
Compare
e345809 to
0db441c
Compare
0db441c to
3b5d68b
Compare
|
For failing the forms we should have something like: /// A template which contains a form which can fail.
pub trait FormTemplate: FallibleTemplate + Sized {
type Form;
fn with_form(&mut self, form: Self::Form);
fn with_failed_form(&mut self, form: Self::Form, message: String) {
self.with_form(form);
self.with_optional_flash(OperationStatus::error_message(message));
}
} |
Only parsing of the magnet upload is supported yet.
TODO:
In a future PR: