Page 1 of 1

--filter "!readLines('/path/to/file').contains(n)"

Posted: 29 Jun 2016, 19:26
by nekromantik
Hi all

Using --filter "!readLines('''/volume1/homes/rutorrent/excludes.txt''').contains(n)" as my excludes list.
However its not working, does the excludes text file need to use the same format as in /The Kingdom/ with escaping the space or can you just put standard text?

Thanks

Re: Excludes Question

Posted: 30 Jun 2016, 04:33
by rednoah
Play with it:

Code: Select all

println n; println readLines('''/volume1/homes/rutorrent/excludes.txt'''); true

Code: Select all

['A', 'B'].contains('A')

Code: Select all

['A', 'B'].contains(n)
Read lines will just read all lines and give you a List. It'll work exactly as one would expect, no magic behaviour.

Re: Excludes Question

Posted: 30 Jun 2016, 21:14
by nekromantik
rednoah wrote:Play with it:

Code: Select all

println n; println readLines('''/volume1/homes/rutorrent/excludes.txt'''); true

Code: Select all

['A', 'B'].contains('A')

Code: Select all

['A', 'B'].contains(n)
Read lines will just read all lines and give you a List. It'll work exactly as one would expect, no magic behaviour.
No I mean the txt file its reading, does it need to have individual listed like normal

n != /Doctor Who/

Or can you just have:

Doctor Who

etc

Re: Excludes Question

Posted: 01 Jul 2016, 05:18
by rednoah
1.
Look at the code. The answer is clearly the latter:

Code: Select all

Doctor Who
readLines(String) will give you a List of String objects for each line. List.contains(String) will check if the List contains a given String.


2.
You can easily figure these things out by playing with the code. ;)

You're asking if this makes sense, which it clearly doesn't once you add a few println statements to see what the values are:

Code: Select all

['n != /Doctor Who/'].contains('Doctor Who') // FALSE

Code: Select all

['Doctor Who'].contains('Doctor Who') // TRUE
readLines(String) is just an easy way to read the List from a file, instead of defining it in the code.

Re: --filter "!readLines('/path/to/file').contains(n)"

Posted: 01 Jul 2016, 10:25
by nekromantik
thanks