POSTBUCKET - where random posts in unrelated topics go

Any questions? Need some help?
AbedlaPaille
Posts: 101
Joined: 12 Apr 2020, 04:02

Re: MediaInfo Inspector

Post by AbedlaPaille »

What's the best way to work with files lacking mediainfo, for example audio languages?

I was thinking i might be able to modify the mediainfo audio language directly with the mediainfo program you linked, seems i can only visualize it though.
AbedlaPaille
Posts: 101
Joined: 12 Apr 2020, 04:02

Re: Conditional Structures (if-then-else)

Post by AbedlaPaille »

Often find myself in cases where i could use either {any} or { x ? x : y } pretty much interchangeably. In those cases is there a better option ? Like one less hungry in computing power ?
User avatar
rednoah
The Source
Posts: 19345
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Conditional Structures (if-then-else)

Post by rednoah »

I'd use the one that is more readable. They're not interchangeable though, because the ternary operator does not catch exceptions, and because it does less, I'd expect it to be faster, but definitely not noticeably faster in human time scales.
:idea: Please read the FAQ and How to Request Help.
AbedlaPaille
Posts: 101
Joined: 12 Apr 2020, 04:02

Re: Conditional Structures (if-then-else)

Post by AbedlaPaille »

Cheers. So the complex format i posted earlier is pretty sound and i wouldn't be able to optimize its speed much more, correct?

For reference viewtopic.php?f=5&t=11862
User avatar
rednoah
The Source
Posts: 19345
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Conditional Structures (if-then-else)

Post by rednoah »

AbedlaPaille wrote: 27 May 2020, 15:06 So the complex format i posted earlier is pretty sound and i wouldn't be able to optimize its speed much more, correct?
I'm sure it's possible to optimize speed, and the first step would to profile each part, to see which one is slower than expected. As with everything, the 20 / 80 principle applies, 20% of your code will be responsible for 80% of run time, so it's integral to find out what those 20% are first.
:idea: Please read the FAQ and How to Request Help.
AbedlaPaille
Posts: 101
Joined: 12 Apr 2020, 04:02

Re: Conditional Structures (if-then-else)

Post by AbedlaPaille »

Thanks for the pointers !
nomadicleo
Posts: 2
Joined: 27 Jun 2020, 14:52

Re: Conditional Structures (if-then-else)

Post by nomadicleo »

Hi,

Could someone please help me with a conditional statement for (certification). My original preset is:

Code: Select all

{n.replaceAll(/[:|]/, " - ")} ({y})\{n.replaceAll(/[:|]/, " - ")} ({y}) {vf} - {certification}
When it does not find a certification, it simply appends the hyphen at the end of the name but I would like it to only add the hyphen when there is a certification found.
User avatar
rednoah
The Source
Posts: 19345
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Conditional Structures (if-then-else)

Post by rednoah »

nomadicleo wrote: 27 Jun 2020, 14:57 When it does not find a certification, it simply appends the hyphen at the end of the name but I would like it to only add the hyphen when there is a certification found.
e.g.

Code: Select all

{" - " + certification}
:arrow: viewtopic.php?t=1895
:idea: Please read the FAQ and How to Request Help.
nomadicleo
Posts: 2
Joined: 27 Jun 2020, 14:52

Re: Conditional Structures (if-then-else)

Post by nomadicleo »

Thank you, @rednoah!! Worked perfectly.
aryanprincesanty
Posts: 2
Joined: 24 Mar 2020, 05:32

Re: Conditional Structures (if-then-else)

Post by aryanprincesanty »

FileBot might not find all the groups for the TV shows I have. How do I make a format such that when {group} exists - it should be added, if not - it should be blank.

My current format is:

Code: Select all

{ny}/Season 0{s}/{ny} - {s00e00} - {t} [{vf} {source} {vc} {if (bitdepth == 10) '10-bit'} {ac} {channels} {if (group != null) {group} else ""}]

What changes should I apply to have my files look like this:
no group:

Code: Select all

Brooklyn Nine-Nine - S02E01 - Undercover [480p x264 8-bit AAC 2.0]
xyz group:

Code: Select all

Brooklyn Nine-Nine - S02E02 - Chocolate Milk [480p x264 8-bit AAC 2.0 XYZ]
User avatar
rednoah
The Source
Posts: 19345
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Conditional Structures (if-then-else)

Post by rednoah »

aryanprincesanty wrote: 28 Jun 2020, 18:09 How do I make a format such that when {group} exists - it should be added, if not - it should be blank.
That is default. You're probably asking about the preceding blank though, so that you don't end up with a superfluous blank if {group} is undefined.

e.g.

Code: Select all

{" " + group}

Code: Select all

{" " + ac}{" " + channels}{" " + group}
:arrow: viewtopic.php?t=1895



Note the conceptual similarity to previously asked questions:
rednoah wrote: 27 Jun 2020, 15:10
nomadicleo wrote: 27 Jun 2020, 14:57 When it does not find a certification, it simply appends the hyphen at the end of the name but I would like it to only add the hyphen when there is a certification found.
e.g.

Code: Select all

{" - " + certification}
:arrow: viewtopic.php?t=1895
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1067
Joined: 15 May 2014, 16:17

Re: Conditional Structures (if-then-else)

Post by kim »

Code: Select all

{ny}{'/Season ' + s.pad(2)}{'/' + ny}{' - ' + s00e00}{' - ' + t}{allOf{vf}{source}{vc}{bitdepth == 10 ? ' 10-bit' : ''}{ac}{channels}{group}.joining(' ', ' [', ']')}
glad148
Posts: 1
Joined: 05 Jul 2020, 07:46

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by glad148 »

otr wrote: 17 Aug 2018, 12:10 Hi,

sorry for being silent for a bit, I have been on a short trip. In the meantime, my setup is now working and I wanted to report back my specifics, so that others may benefit, but also so that I can learn in case I have missed something important.

This is what is working for me:

1. jDownloader Event Scripter calls this script

Code: Select all

[{"eventTrigger":"ON_PACKAGE_FINISHED", "enabled":true, "name":"FileBot", "script":"var amcFile = '/volume1/Downloads/jdtofilebotv2.sh';var path = '/volume1/Downloads/'; callAsync(function() {}, amcFile, path);", "eventTriggerSettings":{}, "id":123654}]
For people that were new to this, just like me:
- The above is the exact "text" that you can see in the jDownloader UI. Compare this screenshot: https://snag.gy/kYHCEN.jpg
- id:123654 is a random number I thought of. The way I understand it this is the ID the process runs under and I would be able to find it under this ID, if I had to look for it.

2. the jdtofilebotv2.sh script that is called above

Code: Select all

#!/bin/sh
export JAVA_OPTS="-Xmx256m"
/var/packages/filebot/target/filebot.sh -script 'fn:amc' /volume1/Downloads --output /volume1/Media/ --conflict auto --lang en --def 'clean=y' 'skipExtract=y'  'excludeList=.excludes'
I would be happy to get comments on this, especially since people later might look at this and assume that I did smart things (I did not - I just figured out what works for me somehow).
One issue I have is that I still do not find the filebot log file created by this setup.

Hello, I am a little lost would it be possible to give me the procedure that you followed from a to z because I can not find the configuration files of eventscripter did you use an alternative method Thank's
User avatar
rednoah
The Source
Posts: 19345
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [IRC] Discord Support Channel

Post by rednoah »

The FileBot Forums is Wikipedia. The FileBot Discord is Twitter. Each have strengths and weaknesses. Neither replaces the other. Both run in your browser no need to install anything. ;)
:idea: Please read the FAQ and How to Request Help.
Brax
Posts: 7
Joined: 31 Mar 2018, 09:58

Re: Conditional Structures (if-then-else)

Post by Brax »

Hi RedNoah and Happy New Year !

Thanks to your help i'm using and arguments file to dispatch my files according to their characteristics in various drives/folders like this :
2160P HDR --> B:\2160P HDR10\
2160P non HDR --> B:\2160P\
720P --> B:\720P\
DVDRIP --> H:\DVDRIPS\
1080P --> S:\1080P\

I use the following arguments file

Code: Select all

ut_label=Movies
movieFormat={hd.replaceAll("UHD", replacement = "B:/2160P").replaceAll("SD", replacement = "H:/DVDRIPS").replaceAll("HD", replacement =  vf.replaceAll("720p", replacement = "B:/720P").replaceAll("1080p", replacement = "S:/1080P"))} {hdr}/{collection.ascii()}/{ny.ascii().upperInitial()} [{imdbid}]/{ny.ascii().upperInitial()} [{imdbid}] {if (hd =~ /HD/) vf} {hdr}
seriesFormat="E:/TV Shows/{n}/{n}.{s00e00}.{t}"
animeFormat="E:/Anime/{n}/{n}.{s00e00}.{t}"

I now have to separate 1080P Files according to them belonging or not to a collection like follows :
2160P HDR --> B:\2160P HDR10\
2160P non HDR --> B:\2160P\
720P --> B:\720P\
DVDRIP --> H:\DVDRIPS\
1080P and part of a collection --> S:\1080P - Sagas\
1080P and not part of a collection --> I:\1080P\

I tried without success modifying my arguments file like follows :

Code: Select all

ut_label=Movies
movieFormat={hd.replaceAll("UHD", replacement = "B:/2160P").replaceAll("SD", replacement = "H:/DVDRIPS").replaceAll("HD", replacement =  vf.replaceAll("720p", replacement = "B:/720P").replaceAll("1080p", {any{collection}.replaceall{"S:/Sagas - 1080P"}{"I:/1080P"}}))} {hdr}/{collection.ascii()}/{ny.ascii().upperInitial()} [{imdbid}]/{ny.ascii().upperInitial()} [{imdbid}] {if (hd =~ /HD/) vf} {hdr}
seriesFormat="E:/TV Shows/{n}/{n}.{s00e00}.{t}"
animeFormat="E:/Anime/{n}/{n}.{s00e00}.{t}"

Could you please help me ?

Many thanks
kim
Power User
Posts: 1067
Joined: 15 May 2014, 16:17

Re: Conditional Structures (if-then-else)

Post by kim »

my take on it ;)

Code: Select all

{ def pathList = ['SD' : 'H:/DVDRIPS','HD720p' : 'B:/720p','HD1080ptrue' : 'B:/1080p - Sagas','HD1080pfalse' : 'B:/1080p','UHD2160p' : 'B:/2160P']; any{pathList.get(hd)}{pathList.get(hd + vf)}{pathList.get(hd + vf + any{collection ? true : true}{false})}{'UNKNOWN_PATH'}} {hdr}/{collection.ascii()}/{ny.ascii().upperInitial()}{' ['+imdbid +']'}/{ny.ascii().upperInitial()}{' ['+imdbid +']'} {if (hd =~ /HD/) vf} {hdr}
Brax
Posts: 7
Joined: 31 Mar 2018, 09:58

Re: Conditional Structures (if-then-else)

Post by Brax »

Good evening Kim

Thanks a lot !!!

I spent days trying to figure the right way to do it and you crunched this in no time... Impressive

I did spend a lot of time in the forum reading exemples and in the FAQ and did not see how to use the pathList, neither the use of .get... And I would not have been able to think ot the concatenation trick for 1080P with the any{collection ? true : true}{false}

Works like a charm, and helps me understand better all those functions which make filebot so powerfull

Many thanks again for your help and happy New Year too

Best regards
Post Reply