This project has moved and is read-only. For the latest updates, please go here.

Great Program but....

Jan 3, 2011 at 11:37 PM

I've been looking for something that actually downloaded all the detail and then did a search for the correct episode and series. I was going to write this myself so great work!! Unfortunately in Australia appears that the episode name and overview are merged together into the mce desciption. This means that there is never a match found. To add a bit more insult to injury appears that imdb is used rather than thetvdb.com for the description.

For instance, one particular example of Bewitched has the metadata in the MCE description of:

"Adam, Warlock Or Washout Adam is to be tested for magic powers and if he is normal he is to be taken away from Sam and Darren. Stars Elizabeth Montgomery and Dick Sargent."

The episode name is in fact "Adam, Warlock or Washout" but there is no match ever found due to the concatenation. It is in fact Season 8 Episode 14.

 

The thetvdb.com overview is:

"The Witches Council wants to test out Adam to see if he is a warlock or a mortal. If he is a mortal, he wilh have to be taken away from the Stephens' household. Maurice helps Adam by giving him powers so that he will not be taken away. Adam is indeed normal, but he does have his own powers tucked away somewhere."

 

The imdb.org description is:

"Adam is to be tested for magic powers and if he is normal he is to be taken away from Sam and Darren."

 

So, I'll have a look at your code later to see what can be done to correct the matching. I haven;t done anything in powershell before...Thinking it may be better to determine how much a match of the episode name is to the text description string rather than the text description string to the episode name which appears to be what is happening at present.

 

At present the log file for this particular example is as follows...

Processing Bewitched_GO!_2010_11_04_17_28_07.wtv
... title is 'Bewitched'
... FetchSeriesID returning 71528 from cache
... SeriesIsInIgnoreList
...... ignore list is empty
...... returning False
... SeriesIsNotInOnlyList
...... only list is empty
...... returning False
... retrieved episode information from cache
... testing against the description and colon delimiter
... trying to find an episode that matches 'Adam, Warlock Or Washout Adam is to be tested for magic powers and if he is normal he is to be taken away from Sam and Darren. Stars Elizabeth Montgomery and Dick Sargent.'
... didn't match text
... BestMatchEpisode called for 'Adam, Warlock Or Washout Adam is to be tested for magic powers and if he is normal he is to be taken away from Sam and Darren. Stars Elizabeth Montgomery and Dick Sargent.'
... BestMatchEpisode: ignoring very long text to test against
... testing against the description and full-stop delimiter
... trying to find an episode that matches 'Adam, Warlock Or Washout Adam is to be tested for magic powers and if he is normal he is to be taken away from Sam and Darren'
... didn't match text
... BestMatchEpisode called for 'Adam, Warlock Or Washout Adam is to be tested for magic powers and if he is normal he is to be taken away from Sam and Darren'
... BestMatchEpisode: ignoring very long text to test against
... no precise test
... best matches have a score of -1
... got 264 best matches
... failed to match TV programme precisely against the database
... best matches have a score of -1
... possible matching programmes are:
... S00E01 - Season 1 - The Magic Unveiled, Part 1
... S00E02 - Season 1 - The Magic Unveiled, Part 2
... S00E03 - Season 1 - Magic And Mishaps
... S00E04 - Season 1 DVD Bonus - Interview

 

and so on...

Great work terrific to see someone done this already...finally its been missing for some time....Thanks

 

Jan 4, 2011 at 8:25 AM

I am also in Australia, and get my guide data from IceTV.

I get pretty good results, with this script matching most (if not all) well known tv series, and only struggling with local content like Australian Story, Good Game etc, for which the data in theTvDB.com is incomplete. A couple of other shows match series but not episodes. I haven't tried Bewitched, but would be happy to if you like to see how it goes.

Generally, however, I have found most of my recordings are being matched correctly, given the IceTV guide data.

Cheers.

Jan 4, 2011 at 8:56 AM

Yes because you are using Ice...I'm using the free to air details which is really the issue. Just looking at the script now. I'm going to add an extra match to it to make it work for myself. Basically the chances of a multiple match from episode name to the wonderful description that MCE gets is ok i think to work with...low possiblity that the same text appears in a episodes thats different I would expect.

Jan 5, 2011 at 10:26 PM

Changed line 292 to suit my requirements.

 

Interesting that the match doesn;t take into considerations any special characters embedded in the episode data from thetvdb.com. So I've done a reverse match of the episode name to the recovered metadata from the show and also removed speacial characters and added to the match. Works like a charm for myself. Combined with the other scripts to move to series directories its great. Now just to find a script that will write metadata to a mp4 in a windows format instead of normal itunes.

 

$match = $episodes.Data.Episode | Where-Object { ($_.EpisodeName -eq $text -or (($text -replace "\'|\,|\!|\?","") -match ($_.EpisodeName -replace "\'|\,|\!|\?","") -and $_.EpisodeName -ne "")) }

Jan 6, 2011 at 10:24 AM

Thank you for providing the change you've made.

To be honest, I hadn't felt that special characters in the episode data were going to be an issue, because the text *at that point* can contain anything. Now it is true that you can't then necessarily use all of those characters when creating the filename, and that is why they get remapped later on in the process.

To help me understand this better, can you give an example of where the characters need to be removed in order to match the text properly?

Also, have you managed to get the code working with the description text you gave as an example? I think that the annoying thing about the example is that for the lack of a fullstop, the script would work already! If only proper punctuation was used! What I was thinking about in order to "fix" this was to try matching the first N characters of the description against the episode name, where N is the length of the episode name text. That should, in theory, provide more matches for the format of description you are seeing. Beyond that, I could then use BestMatchEpisode with a similarly truncated version of the description text to see which ones are good fits.

I'm not sure when I'm planning to do some more work on the code, but it is likely to be soon as there has been a little flurry of suggestions ;-)

 

Jan 6, 2011 at 11:45 PM

I read the rest of the source code last night while in the gym. You have attempted to cater for the episode name in the description but it needs a ': ' to be recognised. The wonderful broadcasters here do not add a ': ' to separate the episode name from the description. Thus taking out the special characters wouldn't make the script work as it stands. Your relying upon logic and our broadcasters don;t seem to have any!!

After attempts on about 300 recordings yesterday I ended up changing the match and replacing the special characters as well as removing all spaces etc. Simply if the single long concatenated string of the episode name can be found in the description with all the special characters removed and it starts then I take this as a match. Worked well in the end....until I managed to find one broadcaster who simply isn't sending the episode name at all and only the imdb description which of course doesn't match anything like thetvdb.

The last line I ended up with is below. At present I'm doing some searching for imdb powershell parsing to try and get the other half done.

$match = $episodes.Data.Episode | Where-Object { ($_.EpisodeName -eq $text -or (($text -replace "\'|\,|\!|\?|\-|\.| ","") -match ($_.EpisodeName -replace "\'|\,|\!|\?|\-|\.| ","") -and $_.EpisodeName -ne "")) }
if ($match -ne $null)

Jan 9, 2011 at 1:06 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.