shiningw / ncdownloader

An easy-to-use web interface for Aria2 and Youtube-dl (downloading bittorrents, videos from twitter, youtube and the likes)运行在nextcloud下的多功能下载工具(Aria2 and youtube-dl)
GNU Affero General Public License v3.0
93 stars 29 forks source link

Downloaded file does not appear in Files #58

Open TtuxX opened 2 years ago

TtuxX commented 2 years ago

Hi there @shiningw :)

I hope you are doing fine.

When downloading the following torrent from BitSearch the file gets downloaded but never appears in Nextcloud Files while command line reveals it is however indeed fully downloaded in the right folder.

magnet:?xt=urn:btih:8183B475A77B526CFAEC71B498C09FA734E79A28&tr=udp%3A%2F%2Ftracker.bitsearch.to%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.moeking.me%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80%2Fannounce&tr=udp%3A%2F%2Fopen.stealth.si%3A80%2Fannounce&dn=%5BBitsearch.to%5D+Le+Triporteur.1957.Darry+Cowl.French+DViX%5Bles-stefs79%5D.avi

The config.php parameter 'filesystem_check_changes' => 1, was not enabled on my instance in hope to get better folder loading speed.

Would it be possible to trigger an occ scan of each downloaded file at the end of the download routine in order to be sure the file appears in Nextcloud Files even if the administrator has not enabled 'filesystem_check_changes' config option ?

shiningw commented 2 years ago

Hi, Normally, ncdownloader updates the download folder as new files are downloaded to it, and it also does so when a download is finished or when you click on any file links in the ncdownloader interface. It is probably caused by filesystem_check_changes

CRUDOBHM commented 2 years ago

I can confirm that I had that issue but with youtube downloads(as i'm not torrenting i guess it happened to everything that has been downloaded) and today's update of the NCDownloader fixed the issue.

If you encounter such a problem in future you can create a bash script that checks the last known size of downloads folder, compares it to current size and if it's not equal then it's scanning it by command - cron job every 5 minutes works good.

piece of shit but it works:

lastuser1size=`cat /home/strona/ytsync/lastuser1.log`
lastuser2size=`cat /home/strona/ytsync/lastuser2.log`
user1size=`du -s /var/www/nextcloud/data/user1/files/Pobrano | cut -f1`
user2size=`du -s /var/www/nextcloud/data/user2/files/Downloads | cut -f1`
if [ $user1size -ne $lastuser1size ];
then
sudo -u www-data php /var/www/nextcloud/occ files:scan --all --path="user1/files/Pobrano"
echo "Synchronied NC with catalog content"
echo $user1size > /home/strona/ytsync/lastuser1.log
echo "Time to sleep..."
sleep 60
else
echo "Synchronization unwanted."
fi
if [ $user2size -ne $lastuser2size ];
then
sudo -u www-data php /var/www/nextcloud/occ files:scan --all --path="user2/files/Downloads"
echo "Synchronized NC with catalog content"
echo $user2size > /home/strona/ytsync/lastuser2.log
echo "Time to sleep..."
sleep 60
else
echo "Synchronization unwanted"
fi