Page 1 of 1

Manual Discrepancy Fix

Posted: 07 Oct 2013, 16:42
by Kentoss
Over the last week I spent time setting up SickBeard to work with sabnzbd and Filebot. I've got a pretty good automated workflow going that I'm happy with, however last Sunday night is became apparent to me that the TVDB's decision to go against the grain with American Dad's season numbering is a problem for that workflow. For anyone that doesn't know, there's a controversy around the number of seasons American Dad has. Fox claims we are in the 10th season (currently), while the DVD releases, release groups, and most other online sources say that we're in the 9th season. The TVDB has chosen to go with Fox's listing, meaning that any time I go to process an American Dad episode from the latest season, FileBot grabs the info for one season back, which is incorrect.

So, I did some searching and found other users of SickBeard who've made attempts to fix the problem themselves on SickBeard's side, which I've already implemented in my installation and that works great. Now the problem I'm having is doing the same to FileBot. I'm using a script that based off of and nearly identical to the amc.groovy script that you have available online. Going through it, I can't really pinpoint a location where I could write in my own code to detect the special case of American Dad and renumber the season and episodes correctly. Is there I way I can modify a function to do what I need?

I would sincerely appreciate any help I could get!

EDIT:

I just re-read this and I don't even know if I'm being clear. Basically I want to inject something like the following pseudo-code into the renamer or somewhere before it so it correctly converts a release to the correct TVDB episode:

Code: Select all

if (showname == "American Dad!") {
    if (season == 1 && episode > 7) {
        season = 2
        episode = episode-7
    } else if (season >= 2) {
        season = season+1
    }
}

Re: Manual Discrepancy Fix

Posted: 07 Oct 2013, 18:12
by rednoah
This is something you can't fix in the groovy code. It's all in the internal matching engine. Though what if you just switch from airdate numbering to DVD numbering for this one?

I think the best fix would be to first fix the SxE numbers in the files before u run filebot.

If you send me the paths and what it should rename things to and i'll have a look.

Re: Manual Discrepancy Fix

Posted: 07 Oct 2013, 19:53
by Kentoss
rednoah wrote:This is something you can't fix in the groovy code. It's all in the internal matching engine. Though what if you just switch from airdate numbering to DVD numbering for this one?

I think the best fix would be to first fix the SxE numbers in the files before u run filebot.

If you send me the paths and what it should rename things to and i'll have a look.
How would I switch to DVD numbering? Basically the whole show is off by a season when compared to the TVDB. It has to do with whether or not you consider the first season and second season to be one season. For example, the latest episode according to the TVDB is:

American Dad! - S10E02 - Poltergasm

However, the latest release shows up as:

American Dad S09E02 Poltergasm 720p WEB-DL x264 AAC

When FileBot renames the release above using TVDB it finds what TVDB considers is S09E02, so it ends up being moved on my HDD as:

H:/TV Shows/American Dad!/Season 9/American Dad! - S09E02 - Killer Vacation.mkv

I'm not sure what other information you need, or what you mean specifically by "paths", but you can see the TVDB page for American Dad! here: http://thetvdb.com/?tab=series&id=73141&lid=7 when compared to any recent release site they're always mismatched.

Re: Manual Discrepancy Fix

Posted: 07 Oct 2013, 20:24
by rednoah
Works for me... with the latest svn revision anyway:

Code: Select all

Locking D:\workspace\filebot\..\output\APPDATA\logs\amc.test.log
Argument: D:\workspace\testdata\AMC-TEST
Input: D:\workspace\testdata\AMC-TEST\American Dad S09E02 Poltergasm 720p WEB-DL x264 AAC.avi
Group: [tvs:American Dad] => [American Dad S09E02 Poltergasm 720p WEB-DL x264 AAC.avi]
Rename episodes using [TheTVDB]
Auto-detected query: [American Dad]
Fetching episode data for [American Dad!]
[COPY] Rename [D:\workspace\testdata\AMC-TEST\American Dad S09E02 Poltergasm 720p WEB-DL x264 AAC.avi] to [D:\workspace\output\TV Shows\American Dad!\Season 10\American Dad! - S10E02 - Poltergasm.avi]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ
This case is easy since FileBot has been matching by SxE as well as episode title for years.


But if didn't work, this is what I would do:

Code: Select all

--filter "!(n =~ /American.Dad/ && episode.season < 10)"
If the wrong episode gets matched, just make filebot exclude that episode and it'll pick the next best match (in -non-strict mode).

Code: Select all

Locking D:\workspace\filebot\..\output\APPDATA\logs\amc.test.log
Argument: D:\workspace\testdata\AMC-TEST
Input: D:\workspace\testdata\AMC-TEST\American Dad S09E02 Poltergasm 720p WEB-DL x264 AAC.avi
Group: [tvs:American Dad] => [American Dad S09E02 Poltergasm 720p WEB-DL x264 AAC.avi]
Rename episodes using [TheTVDB]
Auto-detected query: [American Dad]
Fetching episode data for [American Dad!]
Apply Filter: {!(n =~ /American.Dad/ && episode.season < 10)}
Include [American Dad! - 10x01 - Steve and Snot's Test-Tubular Adventure]
Include [American Dad! - 10x02 - Poltergasm]
Include [American Dad! - 10x03 - Crotchwalkers]
[COPY] Rename [D:\workspace\testdata\AMC-TEST\American Dad S09E02 Poltergasm 720p WEB-DL x264 AAC.avi] to [D:\workspace\output\TV Shows\American Dad!\Season 10\American Dad! - S10E02 - Poltergasm.avi]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ

Re: Manual Discrepancy Fix

Posted: 07 Oct 2013, 20:55
by Kentoss
I looked through my logs, and you're right. It works fine if it has the episode title, however more often than not the release has no episode title. So it seems to be hit and miss. From this morning:

Code: Select all

Input: H:\Downloads\tv\American.Dad.S09E02.720p.HDTV.X264-DIMENSION\American.Dad.S09E02.720p.HDTV.X264-DIMENSION.mkv
Group: [tvs:American Dad] => [American.Dad.S09E02.720p.HDTV.X264-DIMENSION.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [American Dad]
Fetching episode data for [American Dad!]
[MOVE] Rename [H:\Downloads\tv\American.Dad.S09E02.720p.HDTV.X264-DIMENSION\American.Dad.S09E02.720p.HDTV.X264-DIMENSION.mkv] to [H:\TV Shows\American Dad!\Season 9\American Dad! - S09E02 - Killer Vacation .mkv]
I'll give the filter a try, hopefully that'll help. Thanks for the help so far, by the way!

Re: Manual Discrepancy Fix

Posted: 15 Sep 2014, 14:10
by casmo
Hi,

I've just started using filebot and would really love to find a way around the issue with this show. Its painful to have to
manually rename files when everything else is automated so nicely.
So we're now on season 10 which to tvdb is season 11. If a add the filter below, should this solve the problem? I can confirm, on my feed at least, the files appear without the title i.e american.dad.10x1

--filter "!(n =~ /American.Dad/ && episode.season < 11)"

Loving filebot by the way!

Re: Manual Discrepancy Fix

Posted: 15 Sep 2014, 14:21
by rednoah
By excluding everything below 11x01 you will force a (partial) match from 11x01 or above. But that partial match may just as well be 12x01 or 13x01 and so on. Though it will probably work since filebot takes File Last-Modified and Episode Airdate into account while matching.

The best solution would be to exclude everything older than 2 weeks. So there'll probably only be 2-3 options only 1 of which will be a partial match. You can do that with the {age} binding ... days since airdate.

Code: Select all

--filter "!(n =~ /American.Dad/ && age > 14)"

Re: Manual Discrepancy Fix

Posted: 16 Sep 2014, 11:28
by casmo
Hi,

I tried both these filters, but in both cases I got the "filename, directory name, or volume label syntax is incorrect" message when the script ran. Just to clarify, its working perfectly otherwise so I dont believe its an issue with my paths or disk names. Once I remove the filter, its working again (on other files, american dad is still getting picking up as season 10)
Im working on the assumption that I just take the line --filter "!(n =~ /American.Dad/ && age > 14)" and paste it into the run program command in utorrent so it reads something like:

filebot -script fn:amc --output "g:/media" --log-file amc.log --action move--conflict override -non-strict --def music=n subtitles=en artwork=y --def clean=y --filter "!(n =~ /American.Dad/ && age > 14)" "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"

(included any other changes I've made in case these have any impact)

Im sure its just something very stupid im doing (or not doing)

Many thanks

Re: Manual Discrepancy Fix

Posted: 16 Sep 2014, 14:40
by rednoah
There error is a IO Error from the OS. Are you sure the destination paths are proper? Are you sure G: exists? Logs could be useful.

Re: Manual Discrepancy Fix

Posted: 16 Sep 2014, 15:29
by casmo
Hi,

Thanks for the response. I'll have another look tonight and get the logs. But the destination g:/media definately exists. When I use the commmand below (i.e. without --filter "!(n =~ /American.Dad/ && age > 14)") it works fine and has been working successfully for the last few days.

filebot -script fn:amc --output "g:/media" --log-file amc.log --action move--conflict override -non-strict --def music=n subtitles=en artwork=y --def clean=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"

Re: Manual Discrepancy Fix

Posted: 16 Sep 2014, 15:46
by rednoah
This is definitely a Windows error message:

Code: Select all

filename, directory name, or volume label syntax is incorrect
Lets see the logs.

Re: Manual Discrepancy Fix

Posted: 17 Sep 2014, 13:28
by casmo
Hi, see below. i believe this covers a couple of different attepmts using the filters

Code: Select all

ep 15, 2014 7:21:27 PM net.filebot.cli.ArgumentBean getFiles

WARNING: The filename, directory name, or volume label syntax is incorrect

Parameter: music = n

Parameter: artwork = y

Parameter: clean = y

Parameter: xbmc = 192.xxx.x.xx

Argument: C:\Windows\System32\ut_label=Show RSS TV

Argument: C:\Windows\System32\ut_state=20

Argument: C:\Windows\System32\ut_title=American.Dad.S10E01.HDTV.x264-KILLERS.[VTV].mp4

Argument: C:\Windows\System32\ut_kind=single

Argument: C:\Windows\System32\ut_file=American.Dad.S10E01.HDTV.x264-KILLERS.[VTV].mp4

Argument: C:\Windows\system32\ut_dir=G:\Media

File not found: C:\Windows\System32\ut_label=Show RSS TV

Failure (°_°)

Sep 15, 2014 7:25:29 PM net.filebot.cli.ArgumentBean getFiles

WARNING: The filename, directory name, or volume label syntax is incorrect

Parameter: music = n

Parameter: artwork = y

Parameter: clean = y

Parameter: xbmc = 192.xxx.x.xx

Argument: C:\Windows\System32\ut_label=Show RSS TV

Argument: C:\Windows\System32\ut_state=20

Argument: C:\Windows\System32\ut_title=American.Dad.S10E01.HDTV.x264-KILLERS.[VTV].mp4

Argument: C:\Windows\System32\ut_kind=single

Argument: C:\Windows\System32\ut_file=American.Dad.S10E01.HDTV.x264-KILLERS.[VTV].mp4

Argument: C:\Windows\system32\ut_dir=G:\Media

File not found: C:\Windows\System32\ut_label=Show RSS TV

Failure (°_°)

Parameter: music = n

Parameter: artwork = y

Parameter: clean = y

Parameter: xbmc = 192.xxx.x.xx

Parameter: ut_label = Show RSS TV

Parameter: ut_state = 20

Parameter: ut_title = American.Dad.S10E02.HDTV.x264-KILLERS.[VTV].mp4

Parameter: ut_kind = single

Parameter: ut_file = American.Dad.S10E02.HDTV.x264-KILLERS.[VTV].mp4

Parameter: ut_dir = G:\Media

Input: G:\Media\American.Dad.S10E02.HDTV.x264-KILLERS.[VTV].mp4

Group: [tvs:american dad] => [American.Dad.S10E02.HDTV.x264-KILLERS.[VTV].mp4]

Rename episodes using [TheTVDB]

Auto-detected query: [American Dad]

Fetching episode data for [American Dad!]

[MOVE] Rename [G:\Media\American.Dad.S10E02.HDTV.x264-KILLERS.[VTV].mp4] to [g:\media\TV Shows\American Dad!\Season 10\American Dad! - S10E02 - Poltergasm.mp4]

Processed 1 files

Re: Manual Discrepancy Fix

Posted: 17 Sep 2014, 14:54
by rednoah

Re: Manual Discrepancy Fix

Posted: 17 Sep 2014, 16:01
by casmo
Thanks for that. Ive been reading throught that, im just not clear as to where im going wrong.

I'll keep trying though

Re: Manual Discrepancy Fix

Posted: 23 Sep 2014, 12:22
by casmo
Cant seem to figure out where im going wrong. If anyone could point me the the right direction, i'd be very greatful..

Thanks

Re: Manual Discrepancy Fix

Posted: 23 Sep 2014, 15:42
by rednoah
What's the command?

PS: you're not quoting things correctly

Re: Manual Discrepancy Fix

Posted: 23 Sep 2014, 15:59
by casmo
So all ive done so far was follow the guide below;

http://www.filebot.net/forums/viewtopic.php?f=4&t=215

Changing --output "X:/path/to/media" to "G:/media"

I added the clean up and notify xbmc commands

This all works fine.

I then added --filter "!(n =~ /American.Dad/ && age > 14)"

Re: Manual Discrepancy Fix

Posted: 23 Sep 2014, 16:39
by rednoah
So... what's the command then?

You clearly messed up the quotes here:

Code: Select all

Parameter: xbmc = 192.xxx.x.xx
Argument: C:\Windows\System32\ut_label=Show RSS TV