Excluding part of title for searchs

If you need help on how to use the program
Post Reply
z3us
Posts: 86
Joined: 2008-02-19 17:36:53

Excluding part of title for searchs

Post 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
antp
Site Admin
Posts: 9668
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post 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, '\', '');
z3us
Posts: 86
Joined: 2008-02-19 17:36:53

Post 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
antp
Site Admin
Posts: 9668
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post 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);
z3us
Posts: 86
Joined: 2008-02-19 17:36:53

Post by z3us »

I get this error:
Image

Uploaded with ImageShack.us
antp
Site Admin
Posts: 9668
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

My fault, it should be a ":=" instead of the "="
(always switching between programming languages lead to such errors :D)
Post Reply