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
--filter "!readLines('/path/to/file').contains(n)"
-
- Posts: 22
- Joined: 13 Jul 2015, 21:25
Re: Excludes Question
Play with it:
Read lines will just read all lines and give you a List. It'll work exactly as one would expect, no magic behaviour.
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)
-
- Posts: 22
- Joined: 13 Jul 2015, 21:25
Re: Excludes Question
No I mean the txt file its reading, does it need to have individual listed like normalrednoah wrote:Play with it:Code: Select all
println n; println readLines('''/volume1/homes/rutorrent/excludes.txt'''); true
Code: Select all
['A', 'B'].contains('A')
Read lines will just read all lines and give you a List. It'll work exactly as one would expect, no magic behaviour.Code: Select all
['A', 'B'].contains(n)
n != /Doctor Who/
Or can you just have:
Doctor Who
etc
Re: Excludes Question
1.
Look at the code. The answer is clearly the latter:
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:
readLines(String) is just an easy way to read the List from a file, instead of defining it in the code.
Look at the code. The answer is clearly the latter:
Code: Select all
Doctor Who
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
-
- Posts: 22
- Joined: 13 Jul 2015, 21:25