-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] On-demand filelist fetching #1719
base: dev
Are you sure you want to change the base?
Conversation
} | ||
|
||
t, _ := client.AddMagnet(magnet) | ||
<-t.GotInfo() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's only for the filelist, you should detect before if you have the torrent file and then if you have it already, load the files from it (since you won't have to wait to connect to peers to have them). You can check how I access to a torrent file information in the upload process here with tfile
the content of the torrent file
nyaa/utils/validator/torrent/functions.go
Line 195 in 860f9c8
torrent, err := metainfo.Load(tfile) |
In the opposite, if you don't have it, you should save it after the scrapping so you save ressource power
} | ||
|
||
t, _ := client.AddMagnet(magnet) | ||
<-t.GotInfo() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might also be better to make it in a go func()
when you try to scrap. So you don't keep the connection between the user and the server hanging. It might a while before yhe scrapper connects to a peer and gets the information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That itself is not a problem, since the torrent page load is not affected by this. The filelist fetching is generally done with JS, if the user doesn't have JS then a /files/:torrentid page is loaded but the user will known full well that if that page takes time to load, it's because it's loading the filelist
So it's not really necessary here
It's not fully completed (the JS that updates filelist doesnt show icons & no padding for stuff within folders) but it's fine for now and a mere refresh shows a proper filelist
Also it's very slow for long filelists right now, and outputs empty filename if there's only one file