JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 13.05.2021, 15:24
vbs vbs is offline
Super Loader
 
Join Date: Aug 2020
Posts: 26
Default [API] - downloadsV2/setDownloadDirectory not working for extracted packages

Hi,

I am using the API "downloadsV2/setDownloadDirectory" for downloaded packages to move them into a "finished" directory. This works fine for packages in status "Fertiggestellt".

But for packages that got extracted and have status "Entpacken OK" it does not work because the actually data will not be moved to the new location. But the "Speichern unter..." column shows the new location. This behavior is 100% reproducible for me.

As the API is quite simple I suspect this might be a JD bug? I am using the latest versionon Windows 10.
Reply With Quote
  #2  
Old 13.05.2021, 15:53
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,371
Default

Quote:
Originally Posted by vbs View Post
But for packages that got extracted and have status "Entpacken OK" it does not work because the actually data will not be moved to the new location.
Appears to be working fine. It will move only the downloaded files (archives) and not the extracted files.
Reply With Quote
  #3  
Old 13.05.2021, 16:41
vbs vbs is offline
Super Loader
 
Join Date: Aug 2020
Posts: 26
Default

Hm okay, in a way that makes sense. But when I use the local JD UI and choose "Einstellungen -> Downloadpfad setzen" then it will also move the extracted files (unlike the API).
Reply With Quote
  #4  
Old 13.05.2021, 16:55
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,371
Default

I tried with context menu command "Properties > Set Download Directory". Only the downloaded files were moved. The extracted files remained in the original location. Perhaps @Jiaz can provide more info.

To move extracted files you can use packagizer rules (folder structure will not be preserved OR use the eventscripter API. It will give you more control over how/where the files are moved.
Reply With Quote
  #5  
Old 13.05.2021, 16:56
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

@vbs: That action also does only move the (downloaded)files in list. It does not move any extracted file.
Of course the files will be extracted into new directory after they have been moved.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #6  
Old 13.05.2021, 16:59
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

What exactly are you trying to achieve? Then we can help better
__________________
JD-Dev & Server-Admin
Reply With Quote
  #7  
Old 13.05.2021, 17:00
vbs vbs is offline
Super Loader
 
Join Date: Aug 2020
Posts: 26
Default

Oh, I have to apologize: I tested it again using the local UI and contradictory to what I claimed before it does *not* move the extracted files. So it is the same behavior as the API. It probably it is intended that way then.

Sorry, I must have done something wrong or overlooked something last time I checked.

Thanks for the info.

EDIT:
@Jiaz
Behaves for me as you just described it. Sorry, my bad. I can code it another way, thanks
Reply With Quote
  #8  
Old 13.05.2021, 17:44
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

@vbs: all fine nohing to be sorry for.
Yes, It's intended behaviour because JDownloader only knows about the downloaded file but doesn't *remember* everything extracted...
What exactly do you want to achieve? then we can try to help, for example via eventscripter api
__________________
JD-Dev & Server-Admin
Reply With Quote
  #9  
Old 13.05.2021, 20:11
vbs vbs is offline
Super Loader
 
Join Date: Aug 2020
Posts: 26
Default

In the end I just to want to move finished (and extracted downloads) to another folder and then delete the package from the download view automatically.

I guess there is also at least one way in JD itself to achieve this but since I am using the JD API anyway I tried to go that way.
Reply With Quote
  #10  
Old 14.05.2021, 10:17
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

@vbs: why wait for the extraction to finish and then move the files? why not specify final extraction directory before extraction?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #11  
Old 14.05.2021, 10:25
vbs vbs is offline
Super Loader
 
Join Date: Aug 2020
Posts: 26
Default

To avoid different situations that might lead to an "unclean" state in the finished directory like extractions in progress. Or extractions that got interrupted by a full HDD or a CRC error. Maybe other situations.
The aim is to have a target directory that only contains fully and correctly extracted packages.
Reply With Quote
  #12  
Old 14.05.2021, 11:22
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

@vbs: but you always have the *final* state within JDownloader. Just let it extract into destination XY and JDownloader will mark the file as finished/extracted if extraction was successful. So you just query status and then check if it is finished = fine, move the file
if the file is part of archive, then wait for extraction to be fininished and you can even enable auto deletion of archive parts, so nothing to move at all.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #13  
Old 14.05.2021, 12:09
vbs vbs is offline
Super Loader
 
Join Date: Aug 2020
Posts: 26
Default

Ok thank you, I will consider that.
Reply With Quote
  #14  
Old 14.05.2021, 12:49
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

In case you need help, just ask
__________________
JD-Dev & Server-Admin
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 22:38.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.