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

Any questions? Need some help?
Post Reply
nekromantik
Posts: 22
Joined: 13 Jul 2015, 21:25

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

Post 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
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Excludes Question

Post 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.
:idea: Please read the FAQ and How to Request Help.
nekromantik
Posts: 22
Joined: 13 Jul 2015, 21:25

Re: Excludes Question

Post 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
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Excludes Question

Post 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.
:idea: Please read the FAQ and How to Request Help.
nekromantik
Posts: 22
Joined: 13 Jul 2015, 21:25

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

Post by nekromantik »

thanks
Post Reply