binhex wrote:hi neo_x, at the moment moviegrabber simply removes any illegal characters from the imdb name, using your examples:-
2001: A Space Odyssey
translated to
2001 A Space Odyssey
11:11
translated to
1111
Are We There Yet?
translated to
Are We There Yet
i like your suggestion of converting 11:11 into 11-11 as an alternative, bit tricky to regex as in your example your both replacing ":" with null and also replacing ":" with "-" so i would need to build a bit of logic into, i could as you pointed out use the space to decide whether its time format or not, what about movies like "50/50" im guessing your preferred name would be "50-50"? (
http://www.imdb.com/title/tt1306980/).
logic i applied acroos about 5k titles i have on my pc -
ie input is IMDB title string with a space and the year appended in brackets. ie "IMDB TITLE (YEAR)"
then string is further manipulated as follows (visual basic script but should be easy to follow)
Code: Select all
new_name = replace(new_name,": "," ") / first replace colon including a space with just a space
new_name = replace(new_name,":","-") // then replace colons
new_name = replace(new_name,"?","") // remove other invalids
new_name = replace(new_name,"/","-")// remove other invalids
new_name = replace(new_name,"\","-")// remove other invalids
new_name = replace(new_name,"?","")// remove other invalids
new_name = replace(new_name,"<","")// remove other invalids
new_name = replace(new_name,">","")// remove other invalids
new_name = replace(new_name,"|","")// remove other invalids
new_name = replace(new_name,"amp;","") //this was a possible scraper issue - some titles had this character sequence inside
new_name = replace(new_name," "," ")// replace all double spaces with single space in order to clean-up name
i know its not 100% fool proof, but it worked
*and yes in my case i modified titles starting with "the" and "a" to move the words to the back of the title
*
hope this helps - thank you for looking into this
Neo_x
*edit*
*hmmmm
50/50 seems to be an interesting one. let me run my script to see what will happen. 50-50 is probably the best solution
*edit2*
correct replacing / and \ with "-" did present better results - updated code as per above