Registered Member
|
I would like to suggest a new option for KTorrent.
The ability to have KTorrent save incomplete downloads in a "Incomplete downloads" directory, moving them to the user-selected directory when the download is finished. The option could be added under "Preferences -> General": Store incomplete downloads in: [Directory text box] [Browse button] Useful when the user wants a directory with only complete downloads (eg. if sharing it over a network, where the other user don't know that the files is incomplete). Another scenario is when amarok autoindexes new files, and does so before the file is completely downloaded, resulting in wrong tags in the collection database. It could also be useful when using a storage media with slow seeking etc. Doing all the seeking on a fast hard drive, moving it to the slow media in one operation when finished. * Edit: I've coded the functionality. Patch at http://www.tveitdata.com/files/incomplete_dir_rev2.patch Already installed the first patch? Read about the bugs in the first patch in my last post in this thread, and reapply the new one please. First patch (with bugs): http://www.tveitdata.com/files/incomplete_dir.patch
Last edited by imported4-espen on Thu Jul 12, 2007 2:36 pm, edited 2 times in total.
|
Registered Member
|
|
Registered Member
|
I'm aware of the new feature, it's just that I don't get why it's reversed like that. You usually want multiple download locations, not multiple incomplete download locations. I've got separate locations for movies, music, series, audio books and so on, but only need one for the incomplete downloads.
I know that some people may use only one download directory, but when you download lots of different files (movies, series, music), and want to seed them afterwards you want them to be accessible by KTorrent in the correct directories. Moving them afterwards from the one universal download directory would cause the seeding to stop. (This is especially important on private trackers where the upload is registered) The patch does play nice with the feature you mentioned, so it doesn't remove the functionality (It's coded against the latest SVN). It downloads to the incomplete directory, and moves it over to the universal download directory the user have opted for when it's completed. |
Moderator
|
|
Moderator
|
|
Registered Member
|
Your change makes sense.
Anyways. I reviewed my code, and it seems that some problems may arise if the user changes the configuration while the download is in progress. The outputdir_real also wasn't saved in the stats file (resulting in KTorrent not knowing where to put it when closed while a download was incomplete/in progress). I've created a new patch with the changes I've listed below. http://www.tveitdata.com/files/incomplete_dir_rev2.patch ** User changes the configuration ** Eg. "Download to incomplete" was checked when torrent was started, and is unchecked before the download is complete: The files will be left in the incomplete downloads directory. "Download to incomplete" was not checked when torrent was started, and is checked before the download is complete: The files may be moved to "" (probably the home directory of the user). Added (torrentcontrol.cpp, TorrentControl::TorrentControl()): First. We initialize the outputdir_real with QString::null
Checks added that will counter the behavior mentioned above: Added (torrentcontrol.cpp, TorrentControl::update()):
Code block after adding:
Added (torrentcontrol.cpp, TorrentControl::update()):
Code block after adding:
** Save (and load) outputdir_real in the stats file ** torrentcontrol.cpp, TorrentControl::saveStats(): right under st.write("OUTPUTDIR", cman->getDataDir());
torrentcontrol.cpp, TorrentControl::loadStats(): right under outputdir = st.readString("OUTPUTDIR").stripWhiteSpace()
Sorry about missing those points in the first patch. It was late night coding . |
Moderator
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]