Page 1 of 1

Need help figuring out how to deal with certain tv show name

Posted: 23 Mar 2013, 22:13
by bonelifer
I've got the naming/pathway the way I it. But I'm not sure how to deal with say tv show names that are two parts, like NCIS: LA, CSI: NY, etc. I'm getting my recordings from a mythtv + mythnuv2mkv.sh script. It's naming the file:

CSI_Miami--Cyberlebrity.mkv

Great so far, but then when Filebot renames it, it has to deal with the "_". I'd like to be able to tell it exactly what to rename the showname for the files/folders created. So for instance, I'd like for it to name it like

CSI- Miami/Season 06/CSI- Miami - [06x02] - Cyber-lebrity.mkv

More generically I'd like to give it a specific name for certain shows, and have it replace the final name with that.

The best way I see for dealing with different shows would be to have some sort of CSV file? with the Showname mythtv outputs, mapped to the name I want the final file/folder to have.

This is what I'm using with TV shows(on a SMB share mapped to a drive letter on the windows machine):

Code: Select all

Y:/Videos/TV/{n}/{"Season"} {s.pad(2)}/{n} - [{s.pad(2)}x{e.pad(2)}] - {t}

Re: Need help figuring out how to deal with certain tv show

Posted: 24 Mar 2013, 03:12
by rednoah

Re: Need help figuring out how to deal with certain tv show

Posted: 24 Mar 2013, 04:23
by bonelifer
From that I got this code, it doesn't show any errors, but it isn't using the replacement either:

Code: Select all

Y:/Videos/TV/{def a; new File('Y:/incoming/scripts/names.csv').splitEachLine(';'){ if (n == it[0]) a = it[1]}; a ?: n.upperInitial().replaceTrailingBrackets()}/{"Season"} {s.pad(2)}/{n} - [{s.pad(2)}x{e.pad(2)}] - {t}
names.csv

Code: Select all

CSI.MIAMI;CSI- MIAMI
NCIS.Los.Angeles;NCIS- LA
Original File Name:
NCIS.Los.Angeles--Killshot.mkv

Re: Need help figuring out how to deal with certain tv show

Posted: 24 Mar 2013, 06:03
by rednoah
Drop the dots. You're remapping the value of {n}. So that's the official name of the series in the db. So it'll need to be:

Code: Select all

CSI: Miami;CSI- Miami

Re: Need help figuring out how to deal with certain tv show

Posted: 24 Mar 2013, 16:16
by bonelifer
Thanks. Obviously I was over thinking it. I had looked at Filebot before, but thought it was a little to complicated and the forum may not have been very active at the time. I just gave it a second chance because tvnamer started acting up(ie would rename the file, but not move it, had to then rerun the command on the files for it to move them), that alone wouldn't have brought me over. But, theRenamer started deleting the entire Fetch folder and all the folders and files in the folder above(which included my tvnamer config file[highly configured and stupidly no backup]), I decided to give Filebot a try. That also included half a season of NCIS: LA in the Later folder as I hadn't yet worked out how to get it to not think it was the original NCIS. Thanks for a great program and support. As soon as I can, I'll donate some money. Also, twitter and fb shall soon hear about Filebot(at least the few friends I have will).

note: twitter and fb recommendations complete.

Re: Need help figuring out how to deal with certain tv show

Posted: 24 Mar 2013, 23:21
by bonelifer
Ok, one more scenario:

The tv show, M*A*S*H. These video files are on mapped SMB folders. The "*" character isn't a valid character as far as Windows(SMB) is concerned, so "M*A*S*H--Farewell and Amen.mkv" is shown as "MOHFOW~2.mkv" in Windows. After much searching online I found an example bash file that I could understand and change for my purpose:

Code: Select all

#!/bin/bash

for i in ./TV/M\*A\*S\*H-*.mkv; do mv "$i" "`echo $i | sed -e 's,*,\-,g'`"; done
I'm fine with doing that. But is there a way that Filebot could take the new name "M-A-S-H--Farewell and Amen.mkv" and properly match it to M*A*S*H without having to manually enter it in everytime?

Re: Need help figuring out how to deal with certain tv show

Posted: 25 Mar 2013, 00:43
by rednoah
1.
So * is not stripped away automatically? Guess I forgot to add to the list of Windows illegal filename characters. For now you can just do that in your format, e.g.

Code: Select all

{n.replaceAll(/\*/, '-')}
2.
I'll have a look. You mean it's not recognized? Like auto-detecting the series doesn't work, but if you manually enter the query it matches things alright? I guess the query being 4 single-letter terms messes with search. If the filenames say "mash" and not "m a s h" it'll probably work.

Also once I add M.A.S.H to this list of it'll magically work:
http://filebot.net/data/series-mappings.txt

3.
You can use my path/replace script instead of that complicated bash script:
http://www.filebot.net/forums/viewtopic ... &t=5#p2100

e.g.

Code: Select all

filebot -script fn:replace --def "e=M.A.S.H" "r=MASH" /path/to/files

Re: Need help figuring out how to deal with certain tv show

Posted: 25 Mar 2013, 00:47
by bonelifer
1.
I'm running Filebot on Windows 7. The files are on another computer(Mythbuntu machine) on a SMB share that is mapped to a drive letter on windows. Since Windows(SMB) doesn't consider * to be a legal char the filename is shown as "MOHFOW~2.mkv". Which obviously not going to mean anything to Filebot.

2.
Yes if I enter the M*A*S*H in manually it works. If the file has MASH, it doesn't recognize and gives a dialog to choose, it does have M*A*S*H as the first one, but still.

3.
Since I'm running Filebot on the Windows machine reading filenames from SMB, I'll need to run that bash script to make the filename readable over SMB.

Re: Need help figuring out how to deal with certain tv show

Posted: 25 Mar 2013, 08:36
by rednoah
1.
Got it. It's not FileBot not replacing the *** but that you get your files that way. You'll have to either run filebot on the linux machine are validate the filenames.

2.
Should work better by tomorrow. My still ask though.

3.
You can replace your bash script with cmdline filebot for linux if you want. ;)

Re: Need help figuring out how to deal with certain tv show

Posted: 25 Mar 2013, 12:30
by bonelifer
1.
I knew it wasn't Filebot, I was just asking if it was possible for a different format or work around for shows containing an asterisk(*).

2.
Thanks.

3.
I'll have to stick with the script as it works, and I use Ember Media Manager. Don't want to run it in wine. I've tried Mediaelch(only cross-platform that supported both TV/MOVIES), but didn't like it. If at the end I have to manually enter it won't be the end of the world. I record M*A*S*H off TVLAND and I'm mostly finished recording it so it's only a minor inconvenience.

Re: Need help figuring out how to deal with certain tv show

Posted: 26 Mar 2013, 03:26
by bonelifer
rednoah wrote:2.
Should work better by tomorrow. My still ask though.
Thank you. Works. Donation hopefully at the beginning of the month. I'm also available as a Moderator if you need the help. References can be had from my TL at phpbb.com or Marshalrusty(i'm sure he won't mind me suggesting that :) ) : bonelifer. bonelifer now runs hides Marshalrusty... :lol:

Re: Need help figuring out how to deal with certain tv show

Posted: 26 Mar 2013, 03:43
by rednoah
Done. :)

Here's some tips:
1. Almost any post regarding "amc cmdline doesn't work" is because of issues with unintentionally escaping or not escaping double quotes.
2. Or because of the update people using IO redirection without running the command with cmd.

Cheers!

Re: Need help figuring out how to deal with certain tv show

Posted: 26 Mar 2013, 23:45
by bonelifer
This maybe one of those that's hard to do or will just require manual renaming but here's another scenario that just hit me:

Filename:
How_I_Met_Your_Mother--Robin_101.mkv

Should be:
How I Met Your Mother - [05x03] - Robin 101.mkv

Filebot sees that as:
How I Met Your Mother - [01x01] - Pilot.mkv

Re: Need help figuring out how to deal with certain tv show

Posted: 27 Mar 2013, 01:11
by rednoah
Yeah, in that kinda tricky case it gets a bit unstable. That's matching by name, generally not as stable. I could easily fix that, but misleading strings are far more common than misleading numbers.

So right now it's sxe > title, so you get a few understandable issues like this. If I did title > sxe you'd get issues the other way around, but that'd be less easy to understand for users.

It's not a big issue since this will work: It'll narrow down to 5x03 and 1x01 and than further narrow down to 5x03 because of the episode title:

Code: Select all

How_I_Met_Your_Mother-503-Robin_101.mkv

Re: Need help figuring out how to deal with certain tv show

Posted: 27 Mar 2013, 03:46
by bonelifer
Filbot via theTVDB or TVRage

is taking:
NCIS_Los_Angeles--Red_Part_Two.mkv

and producing:
NCIS- LA - [03x14] - Partners.mkv

Should be something like:
NCIS- LA - [04x19] - Red (2).mkv

It was tonight's episode, but it's already on their site. Cache or not properly matching?

Re: Need help figuring out how to deal with certain tv show

Posted: 27 Mar 2013, 04:37
by rednoah
Yeah, that issue seems to be caused by by episodes Red (1) and Red (2) even after all differentation steps still being equal and thus ignored. Fixed that, so it'll now narrow down on Red (1) always (even for file Red Part Two).

But if you match those two files at once:

Code: Select all

NCIS_Los_Angeles--Red_Part_One
NCIS_Los_Angeles--Red_Part_Two
It'll work just due to episodes being matched and taken away in order.

I'll give you a new HEAD release later.

EDIT:
Fixed with r1560. Possibly introducing issues in other special cases. :P

Re: Need help figuring out how to deal with certain tv show

Posted: 28 Mar 2013, 00:27
by bonelifer
bonelifer wrote:As soon as I can, I'll donate some money.
And money came in early, so done. Filebot makes one of the most tedious and time consuming parts of recording shows and storing them so completely easy. Thanks.

Re: Need help figuring out how to deal with certain tv show

Posted: 28 Mar 2013, 04:21
by rednoah
bonelifer wrote:And money came in early, so done. Filebot makes one of the most tedious and time consuming parts of recording shows and storing them so completely easy. Thanks.
Having another mod around here makes the most tedious and time consuming parts of dealing fnoobs more easy, much more so than money. :D