Page 1 of 1

Excluding part of title for searchs

Posted: 2011-01-02 14:33:51
by z3us
I use my DB with MyFilms, a plugin of MediaPortal. This plugin allows to organize the films in groups. These groups are created with the translated title in this way:
Saw \ saw
Saw \ saw II
...

Batman \batman begins
Batman \ The dark knight
...
etc.
I use a program, amc updater, that automatically inserts the group name at the start of the title, copying the name of the folder where the videos are.
But, when importing info of internet with AMC, the whole title is used. This results in poor automatization and having to delete all in the left of the \ in the title for each search.
Is there any way for doing AMC ignore this? can it be programmed in the scripts? Or is it impossible?
Thanks

Posted: 2011-01-04 09:45:45
by antp
So you want that the script ignores what is before the "\" when importing info?
It depends which script you use, but in all cases you can easily do that.
For example if you take the IMDB script, at the bottom of the script (entry point) there is the following:

Code: Select all

    if MovieName = '' then
      MovieName := GetField(fieldOriginalTitle);
    if MovieName = '' then
      MovieName := GetField(fieldTranslatedTitle);
After these lines you can add this:

Code: Select all

if Pos('\', MovieName) > 0 then
  MovieName = TextAfter(MovieName, '\', '');

Posted: 2011-01-07 11:28:45
by z3us
With imdb I haven tproblems, because it uses the original title field for searches.
But with this:
viewtopic.php?t=4501
How can I modify it?
Thanks

Posted: 2011-01-08 00:44:07
by antp
In the same way, add the lines after those where the titles are read ("GetField")
i.e. after

Code: Select all

    MovieName := GetField(fieldTranslatedTitle);
    if MovieName = '' then
      MovieName := GetField(fieldOriginalTitle);

Posted: 2011-01-08 18:00:40
by z3us
I get this error:
Image

Uploaded with ImageShack.us

Posted: 2011-01-11 12:51:33
by antp
My fault, it should be a ":=" instead of the "="
(always switching between programming languages lead to such errors :D)