Can filebot match date-based filenames?

Any questions? Need some help?
Post Reply
belgarth
Posts: 30
Joined: 25 Jan 2012, 09:19

Can filebot match date-based filenames?

Post by belgarth »

I am trying to figure out if it is possible to get filebot to understand and match against the dbs (specifically thetvdb) with shows that use date-based filenames (the colbert report and the daily show).

I found thread https://sourceforge.net/projects/filebo ... ic/3858199
where it shows that now you can output using the date info to the new filename, but as far as I can tell that just helps with the output format and not the matching.

I want to be able to do something like the following and have it work, instead of the failure seen.
filebot -rename --db thetvdb --format "{n} - {s}x{e}" the.colbert.report.2012.01.11.hdtv.xvid-fqm.avi
Rename episodes using [TheTVDB]
Exception: Unable to auto-select query: []
Failure (°_°)

same failure happens if I add in -non-strict.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Can filebot match date-based filenames?

Post by rednoah »

Matching: YES
Auto-Detect show from 1 filename: NO

In your case you need to specify --q manual query parameter since auto-detection doesn't work.

Normal solution would be to rename at least 3-5 files in which case FileBot will probably be able to auto-determine which part of the filename is the showname.
:idea: Please read the FAQ and How to Request Help.
belgarth
Posts: 30
Joined: 25 Jan 2012, 09:19

Re: Can filebot match date-based filenames?

Post by belgarth »

The --q option partially works. It works when the filename has the tite/guest name, but not when the filename is just the series plus date:
filebot -rename --db thetvdb --q "The Colbert Report" --format "{n} - {s}x{e} - {t}" *
Rename episodes using [TheTVDB]
Fetching episode data for [The Colbert Report]
No matching episode: the.colbert.report.2012.01.11.hdtv.xvid-fqm.avi
No matching episode: the.colbert.report.2012.01.16.hdtv.xvid-fqm.avi
No matching episode: the.colbert.report.2012.01.17.hdtv.xvid-fqm.avi
No matching episode: the.colbert.report.2012.01.18.hdtv.xvid-fqm.avi
No matching episode: the.colbert.report.2012.01.19.hdtv.xvid-fqm.avi

If I add in -non-script, it detects it, but interprets the month-date as season-episode:
filebot -rename -non-strict --db thetvdb --q "The Colbert Report" --format "{n} - {s}x{e} - {t}" *
Rename episodes using [TheTVDB]
Fetching episode data for [The Colbert Report]
Renamed [/home/belgarth/Downloads/TV-Shows/Unsorted/the.colbert.report.2012.01.11.hdtv.xvid-fqm.avi] to [The Colbert Report - 1x11 - Bruce Feiler.avi]
Renamed [/home/belgarth/Downloads/TV-Shows/Unsorted/the.colbert.report.2012.01.16.hdtv.xvid-fqm.avi] to [The Colbert Report - 1x16 - Cokie Roberts.avi]
Renamed [/home/belgarth/Downloads/TV-Shows/Unsorted/the.colbert.report.2012.01.17.hdtv.xvid-fqm.avi] to [The Colbert Report - 1x17 - Sen. Bob Kerrey.avi]
Renamed [/home/belgarth/Downloads/TV-Shows/Unsorted/the.colbert.report.2012.01.18.hdtv.xvid-fqm.avi] to [The Colbert Report - 1x18 - Rev. Al Sharpton.avi]
Renamed [/home/belgarth/Downloads/TV-Shows/Unsorted/the.colbert.report.2012.01.19.hdtv.xvid-fqm.avi] to [The Colbert Report - 1x19 - Matt Taibbi.avi]


I don't understand what you mean by renaming 3-5 files? Do you mean to manually rename some of the files to include the season/episode and then filebot will detect the show? If so, that would basically be manually doing what I am tryint to automate using filebot.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Can filebot match date-based filenames?

Post by rednoah »

OK that is wierd. This should work. I'll have a look at this when I have time again. Are you sure there is not some problem with the db? Might just be that the dates in tvdb don't match your files. Try this with the GUI /TVRage and see what happens. Add the date info to the format to see what filebot thinks the date is.

Note about query/show auto-detection:
Works on a set of files, more files, more context, better detection / matching

e.g.
1.
24 12 8am -> showname???

2.
24 12 8am
24 13 9am
24 14 10am
Clearly "24" because we have more context

Get my point? ;)
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Can filebot match date-based filenames?

Post by rednoah »

At least on the website the dates match. Well, guess somewhere something is broken. I'll fix it when I get back mid-Feb.
:idea: Please read the FAQ and How to Request Help.
Hobit
Posts: 2
Joined: 24 Nov 2011, 01:49

Re: Can filebot match date-based filenames?

Post by Hobit »

I was noticing this problem as well, and did a little experimenting and found that while "yyyy.mm.dd" isn't picked up as the airdate, "yyyy-mm-dd" will be picked up just fine and lead to the correct episode being grabbed. It seems like filebot is picking up the "yyyy" as a part of the show name, leaving only "mm.dd" which fits the season-episode model.
Hope this can help

A side question I have for you rednoah, I've taken a few programming classes in C++ and VB, and one of the hardest things for me has been documenting my code, I was looking through your code last night and was really impressed with how clean and well-documented it is. Was this something you were naturally inclined to do, or did it take work? Back in December I wrote a groovy script to monitor my download folder and automatically rename my files and move them to a "New Episodes" folder, but when I got done, my code, while functional, is a cluster-fuck to look at and troubleshoot, especially when comparing it to the script file you put up which does pretty much the same thing.
Any tips for when to add in comments, and when comments aren't needed? Also when writing a program like filebot, how do you decide when to create a new .java file?
Thanks so much for all your hard work, you have really done an amazing job making such a useful program, and sharing it free of charge while providing great support to those of us who run into snags.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Can filebot match date-based filenames?

Post by rednoah »

Yep, the year is constant in all files and right after the name it's probably interpreted as part of the name. I'll try to make that more strict for next release.

@Hobit Groovy samples is extremely well documented because it serves as documentation. Thus apart from that there is none. In the Java code there is next to no comments except for thing one really can't know by looking at the code (usually add comments after I find bugs / unexpected behaviour of APIs / workarounds / etc). I just refactor a lot, so no comments are better than outdated documentation and if you're the only coder anyway it's ok if u understand. IMHO readable code is more important than docs. As for classes, I use polymorphism alot so I naturally get many interfaces/implementations and again I refactor alot. Helps me solve one little problem at a time, and then integrate it into the whole.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Can filebot match date-based filenames?

Post by rednoah »

Fixed that for next release. You can try the latest beta for a peek at that.
:idea: Please read the FAQ and How to Request Help.
belgarth
Posts: 30
Joined: 25 Jan 2012, 09:19

Re: Can filebot match date-based filenames?

Post by belgarth »

I imagine this is a noob question, but where are the beta versions? I tried looking around both the sourceforge page and searching google with no luck.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Can filebot match date-based filenames?

Post by rednoah »

:idea: Please read the FAQ and How to Request Help.
Post Reply