JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 22.02.2020, 08:16
zreenmkr zreenmkr is offline
JD Addict
 
Join Date: Feb 2020
Posts: 174
Default Packagizer to exitloop once condition is matched

how to exit filter once condition is found.

Say I need to download a few eBooks and would like to assign each book base on it title to go into separate category as <Package Name>

So the ebook title contains 'birds' then assign <Package Name> = '__Book Of Animals'
Then End and Exit at that filter. What I'm experience is although it maches 'birds' but it continue down the list of remain filters and match second time with <File Type> is pdf,epub,mobi. because of this now it reassign <Package Name> = '___eBooks' instead of '__Book Of Animals'


<Condition Name> = _Book Of Animals
if <File Name> contains (birds|elephant) [x]RegExp
then <Package Name> = __Book Of Animals

...

<Condition Name> = _eBooks
if <File Type> is pdf,epub,mobi [x]RegExp
then <Package Name> = ___eBooks
Reply With Quote
  #2  
Old 22.02.2020, 09:21
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,637
Default

You can not exit after the first matching, it matches all rules in order of sequence.
The best solution within the current design framework is to order them in a fashion that they can't overwrite. so that would be generic rules first and then specific rules last.

or use another method of adding links in which you can specify the package name & save path. 'directory/folder watch? which then you don't have to rely on package customiser.
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #3  
Old 23.02.2020, 02:34
zreenmkr zreenmkr is offline
JD Addict
 
Join Date: Feb 2020
Posts: 174
Default

@raztoki

thanks dev, not familiar with the meaning of 'directory/folder watch' yet, i'll read up on that and comeback.

have you guys ever considered adding exitloop option at some point? my rational is the reverse of you explained. have all the specific rules at the top if those conditions not met then assign unknown generic ebooks to general ebooks folder.

I want to have the similar rule for Audio and Video and Documents as well. Is there a workaround for this? All Audio files goto audios folder but audio with known Artist go to that artist folder? and so on with Directors for Video, Authors for Documents?
Reply With Quote
  #4  
Old 23.02.2020, 02:49
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,637
Default

I have thought about the need previously but each time I could solve by placing rules in correct order. When it comes to it package customiser can't be perfect even with exit condition. It could still have the same outcome of false positive, so order is king in respects to this.

Maybe alternative solution, 3rd party software out there to move/place/rename content, post download maybe this would work better as you could analyse content based on multiple conditions. for memory filebot? quick google shows: its not free anymore, and post on reddit mentions 'Free alternative to Filebot ' && 'I found Filebot, theRenamer, and Media Center Master', not sure if that would work for you outside of this software.
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #5  
Old 23.02.2020, 07:21
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by zreenmkr View Post
my rational is the reverse of you explained. have all the specific rules at the top if those conditions not met then assign unknown generic ebooks to general ebooks folder.
There are a couple of options to achieve it with packagzier. For e.g. you could add a second condition (package name contains not) in your generic package name rule and set a new one only if it has not already been set.

A better option would be to use a script (Javascript) with packagizer hook in the Eventscripter extension, where you can control the exit accurately. It is also more convenient to search/add/remove keywords.
Reply With Quote
  #6  
Old 26.02.2020, 00:51
zreenmkr zreenmkr is offline
JD Addict
 
Join Date: Feb 2020
Posts: 174
Default

Quote:
Originally Posted by mgpai View Post
A better option would be to use a script (Javascript) with packagizer hook in the Eventscripter extension, where you can control the exit accurately. It is also more convenient to search/add/remove keywords.
This sounds promising. Downloaded eventscripter ext. Where should start? Example scripts please.
Reply With Quote
  #7  
Old 26.02.2020, 00:53
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,920
Default

Quote:
Originally Posted by zreenmkr View Post
Example scripts please.
You'll find a lot of examples in THIS thread.

-psp-
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
  #8  
Old 28.02.2020, 00:41
zreenmkr zreenmkr is offline
JD Addict
 
Join Date: Feb 2020
Posts: 174
Default

thanks too all, will seek help from @mgpai at EventScripter
Reply With Quote
  #9  
Old 28.02.2020, 01:55
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,637
Default

still believe you can do it with standard package customiser, without exiting after first match. your generic rule has file extension rule (first), add that to all your other rules (specific matches) and just place them below. It should not match more than generic and single specific rule (assuming your regex isn't too broad, or filename of a item doesn't contain say car and animal, eg. 'cobra' or 'mustang' car model and animal) after that which overwrites the first rule resulting in outcome you want. If you do have cobra/mustang issue, even existing wont fix false positive.
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #10  
Old 05.03.2020, 04:10
zreenmkr zreenmkr is offline
JD Addict
 
Join Date: Feb 2020
Posts: 174
Default

Quote:
...your generic rule has file extension rule (first)...
yea, i didn't think of that.

in addition, custom eventscripter as an alternative to packagizer is kind of cool.

thanks for all the help, learning alot for the last couple of weeks.
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 14:23.
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 - 2024, Jelsoft Enterprises Ltd.