Page 1 of 1

Several Issues/Questions Regarding AMC

Posted: 28 Mar 2016, 20:14
by kovibear
I've dealt with random quirks over the last year or so of using AMC, but none that were really ever a huge deal.. but lately I've been encountering a few of them at a time, and figured it's finally time to get permanent solutions/help for them. Bit of a long post incoming..

1. Interpretation issues: I've started downloading Join or Die with Craig Ferguson, and have been experiencing an issue with both AMC and the GUI interpreting this as The Late Late Show with Craig Ferguson. Interestingly, even if I remove the Craig Ferguson bit from the title before attempting to match, it would still pull up The Late Late Show. It seems that the interpretation is heavily latching onto the Craig Ferguson portion of the title, and "higher popularity" of the show. So, by the time the filter is being checked and season/episode would be compared, the show has already been searched against The Late Late Show. The names and titles are definitely clean and fairly black and white "Join.or.Die.with.Craig.Ferguson.S01E01" formats, though. I assume this could also be xattr related, and has some sort of fallback to that based on the initial automated rename.. but it's causing some serious annoyance to have to manually match/rename every episode. Attempting to solve this has lead me to issue 2:

2. Filters don't seem to be checked until after the initial interpretation match. So even if I include an "n != 'The Late Late Show with Craig Ferguson'" filter or variations of that (I may be misunderstanding the filter format and thus have an incorrect filter for what I wish to achieve), this filter doesn't seem to be checked until after AMC has already interpreted the show as The Late Late Show (I discovered this by checking logs). This causes an issue of the entire file just refusing to be re-checked or matched in any sort of way, thus achieving absolutely nothing.. with or without -non-strict enabled. Am I doing something horribly wrong, or is there another method to achieve the desired filter of "ignore The Late Late show as a possibility at all before looking at episodes, and interpret/match against the other options"?

3. I've had very mixed and sporadic behavior regarding some episodes of Dragon Ball Super being flagged as Dragon Ball Z episodes, despite all of them having an identical filename format. We're talking random ones, like episode 5, 16, 24.. no real number convention that makes sense. This issue would also be solved by filtering out Dragon Ball Z, but hits the same problem as issue 2.

4. This is less of an issue, and more of a convenience question that coupled with solving first three issues might make my life a lot easier. I noticed a tutorial on utilizing a filters txt file that utilizes .contains(n) on the per-line bases to filter shows (but, again: issues above also present).. but I was curious if such a method is possible with full filter formats. Is it possible to simply do the same --filter "!readLines('''/path/to/excludes.txt''').contains(n)" but have each line be its own filter expression/format? Would just dropping the .contains(n) do that, or is more necessary? If this is not possible, does one just pass multiple filters through arguments using && or || separators? I run my AMC on a single folder often containing both movies, shows, and anime.. and thus haven't yet found a single solitary "all-in-one" filter that would work for me.. especially considering I now have several specific shows I wish to filter out.

It's very possible that all of these "issues" aren't really issues and I'm just missing something, but I've been playing around and trying to search/read for any relevant information.. but most of my needs are fairly niche and I've had to kinda patchwork things together in the meantime, and am getting frustrated with how often I've had to manually edit things.

Thanks in advance for reading, and any help you can offer.

Re: Several Issues/Questions Regarding AMC

Posted: 28 Mar 2016, 21:18
by rednoah
Logs? Filenames? Examples of files that don't get matched correctly (full file path as text) would be VERY helpful.

Re: Several Issues/Questions Regarding AMC

Posted: 28 Mar 2016, 22:07
by kovibear
rednoah wrote:Logs? Filenames? Examples of files that don't get matched correctly (full file path as text) would be VERY helpful.
I didn't include them in the original post because I had several examples and didn't want to add a bunch more text on top of an already long post.. and hoped that my explanations would be enough. I apologize for not including enough information.. I was hoping my description would be enough, but I realize the wall of text was probably difficult to parse.

For the primary issue example, here's an example of my Join or Die with Craig Ferguson issue using a copy of the original file using its original filename.
Run script [fn:amc] at [Mon Mar 28 17:45:40 EDT 2016]
Parameter: clean = y
Parameter: plex = REDACTED
Argument: D:\Media\Torrents
Input: D:\Media\Torrents\Join.or.Die.with.Craig.Ferguson.S01E06.HDTV.x264-UAV.mp4
Group: [tvs:the late late show with craig ferguson] => [Join.or.Die.with.Craig.Ferguson.S01E06.HDTV.x264-UAV.mp4]
Rename episodes using [TheTVDB]
Auto-detected query: [The Late Late Show with Craig Ferguson]
Fetching episode data for [The Late Late Show with Craig Ferguson]
Apply Filter: {n != 'The Late Late Show with Craig Ferguson'}
No matching episode: Join.or.Die.with.Craig.Ferguson.S01E06.HDTV.x264-UAV.mp4
CmdlineException: Unable to match files to episode data
Clean clutter files and empty folders
Finished without processing any files
Failure (°_°)
and I execute AMC utilizing this in a bat file:
filebot -script fn:amc --output "D:/Media" --log-file "REDACTED/Scripts/AutomatedMediaCenter/amcLog.log" --filter "n != 'The Late Late Show with Craig Ferguson'" --action move "D:/Media/Torrents" --def clean=y --def plex=REDACTED
I redacted my Plex token just for privacy sake, but as you can see.. the filter doesn't seem to be applied until after AMC has already interpreted the show to be The Late Late Show with Craig Ferguson, despite the naming format on the file being pretty blatant. The interpretation seems to aggressively latch onto the "Craig Ferguson" portion, and go from there. What is interesting is that even if I rename the file manually and remove the "Craig Ferguson" portion before running AMC or using the GUI, it still resolves to The Late Late Show with Craig Ferguson. The only resolution for that is manual renaming. I even tested this with several-week old episodes, and same issue. I wasn't sure if AMC uses a cached version of TheTVDB to minimize impact or not, and considered that. However, I have experienced several instances (my original post's containing a few examples of shows causing it) where TheTVDB is entirely current and up-to-date on listings, but AMC/Filebot are unable to find matches.. despite there only being one possible result for the exact same query. This is, again.. with or without -non-strict enabled.

As for an example of what I'd like for multiple filters.. I was just curious if, for example: --filter "n != 'show one'" || ("n != 'show two' || Age > 7)", or --filter "{n != 'show one' || 'show two &&} || Age > 7'" are valid methods for passing multiple separate filters through to AMC. I also mentioned a desire to use a filter txt file using a method you've shown before ( --filter "!readLines('''/path/to/excludes.txt''').contains(n)" ) could be modified to something like --filter "!readLines('''/folder/amcFilters.txt''')" an amcFilters.txt file containing, say:
n != 'show one'
n != 'show two' || Age > 7
and would be possible to pass through each line's separate filters, if only for the easy modification of multiple filters. I could be wrong on the formatting of these, as I'm not 100% confident in my personal interpretation of the format on filters quite yet. I understand regex pretty comfortably, but there aren't quite as many examples for your filter formatting. I'm not even entirely sure what the difference (or if there even is one) between "n != 'show one'" and 'n != /show one/".. I've seen examples using each that don't seem to differ.

I hope that supplies more information and I've explained the issues more clearly. Thanks for taking the time to help.

Re: Several Issues/Questions Regarding AMC

Posted: 29 Mar 2016, 05:51
by rednoah
1.
Your filter looks good, have you checked if FileBot knows the episode data you're looking for?

Code: Select all

filebot -list --q "Join or Die with Craig Ferguson"
There is a bit of caching going on. There's a good chance it doesn't work well simply because the show is less than a week old. Clearing the cache is acceptable in this case.


2.
If you have previously renamed files with filebot, then they're now tagged with xattr metadata. The xattr tags may take precedence over the filename. You can always use CTRL+Click to force a series.


3.
The --filter works on episodes, not series options. FileBot will fetch all episode data for all (maybe just top 5) series options, so this is not an issue.


4.
Just play with the code. The -list command is great for playing with filter expressions:

Code: Select all

filebot -list --q "Join or Die with Craig Ferguson" --filter "age > 7 && t =~ /Biggest/"

5.
You can pass arguments via text files, one argument per line:
viewtopic.php?f=3&t=3244

6.
Check out Strings and Slashy Strings in the Groovy manual.

'...' and /.../ is the same in most cases, but I prefer /.../ on the command-line because quote/double-quote already have special meaning there.


EDIT:


After further investigation: /Craig.Ferguson/ is force set to The Late Late Show with Craig Ferguson. This probably needs to be fixed now.


EDIT 2:


Try r3087.

Re: Several Issues/Questions Regarding AMC

Posted: 29 Mar 2016, 12:48
by kovibear
1/Edits: Ah.. there was a force going on. That actually makes a lot of sense. I'd seen that there was a list of those, but didn't know that was global.. I assumed it was a list that could be opted into. I wondered why Filebot hung so tightly to the Craig Ferguson portion of any title. I had actually tried clearly the cache, as well.. and completely forgot to mention that. Thankfully the culprit was found, though.

2. I was familiar with the ability to force a series, thankfully.. and that part of my method of manual override. It just proves to be an annoyance to do it for every episode of a show.. but at least the specific cause for Craig Ferguson was found.

3/4. I didn't know that the filter command only works on episodes themselves. The shown examples of "complex situations" in the filters section of the AMC post seemed to indicate the ability to filter out a series from possibly results entirely. I was under the impression that filters would be checked against a series/title as well, and not just on an episodic basis. Is that not the case, or was the Craig Ferguson override the only cause of it appearing to have zero affect? I suppose without an override in place, when the filter is checked, it would just drop say 'The Late Late Show' possible matches from the currently pulled eligible matches? That definitely makes sense, then.. I just didn't quite understand the order in which that was done. I'm so used to regex with lookaheads and such. I did play around with -list and my attempted filters a bit, but only really got to a point of "okay, so this doesn't look like it's breaking anything.. and also seems to ignore these shows". It sounds like I managed to understand more of it than I was confident of, though.. so I guess I've got that going for me.

5. Passing full arguments via txt appears a bit more complex than I initially anticipated, but thankfully it sounds like I have a decent understanding of how the filters work and can just further optimize the ones I use in a more versatile way.

In the meantime, I'll have to play around with things and tweak until everything works the way I desire it to. At least it's pretty difficult to fully break things, right? :)

I greatly appreciate the help you've given and the work you've done on Filebot/AMC. I've experienced many little quirks with it over the years, and more in the last year of finally automating it all.. but the functionality continues to improve and exceed expectations. It really does make Media Center automation possible in such a great way. Really can't thank you enough. :D

Re: Several Issues/Questions Regarding AMC

Posted: 29 Mar 2016, 13:22
by rednoah
3.
Using the --filter to exclude every single episode of a series is equivalent to excluding the series. However, the --filter option is designed to be used in automation, so general rules (e.g. age filter, rating filter, etc) are preferred over manually maintained include/exclude rules.

Plus, working on the episode level means that the episode filter and episode format are pretty much the same thing. ;)


4.
I think it didn't even find the series in the first place, thus nothing to filter out:

Code: Select all

Fetching episode data for [...]
Pro Tip: You can put "println" statements into your filter to see what's happening:

Code: Select all

--filter "println episode; true"

5.
If your filter excludes the good results, but leaves the bad ones, then bad things will happen (if -non-strict is set). ;)


6.
Very few people spend time with understanding how filter works (it's not so tricky actually IMHO). Once you've figured out your setup, and it's running smoothly, I'd really appreciate it if you could write a tutorial or blog on what you did and how things work. :ugeek: