You are here

Make MDB use 1 of 2 elements...difficult situation

3 posts / 0 new
Last post
karimf
Offline
Joined: 10 years
Last seen: 8 years
Make MDB use 1 of 2 elements...difficult situation

Hi all,

Been trying to enhance my grabbed XMLTV by running mdb postprocess.

Heres is my big dilemma:

1-I only run it on some channels that do not have complete details from the first grab

2-if a show from those channels has actors+productiondate but no description, running mdb postprocess and choosing 'mdb-description' will remove the description from all other shows from all the other channels that are already complete (or won't have their details available on imdb in the first place, like foreign channels for example)

So, my question is this:

Is there a way to make mdb.config "choose" 1 available element and use it ? for example if the original file has actors and no description then use original actors and 'mdb-description" and keep the original 'description' if it is already present?

i am trying to achieve the following idea:

use {'mdb-description'} if {'description'} is not available in the original xmltv file, otherwise keep original

use {'mdb-actor'} if {'actor'} is not available in the original xmltv file otherwise keep original

(which will save other channels from losing their elemnts). Keeping both mdb and original like : {'mdb-actor'} {'actor'} will result in everything duplicated!

Is this impossible ? from what i read and tried it seems impossible and that only 1 choice has to be made (no "if-then" logic is possible).

Does anyone have any ideas ?

WGMaker
Offline
WGMaker's picture
WG++ Team memberDonator
Joined: 12 years
Last seen: 3 hours
Is the support helpful?
support us

Hi Karimf,

sorry for the delayed response. We are very busy right now .

karimf wrote:

2-if a show from those channels has actors+productiondate but no description, running mdb postprocess and choosing 'mdb-description' will remove the description from all other shows from all the other channels that are already complete (or won't have their details available on imdb in the first place, like foreign channels for example

That shouldn't happen with the right setting in mdb.config.

Look at this example:
<desc>'description'{\n[imdb description: 'mdb-description']}</desc>
This wil give you the existing description (if there is one) , then,  if there is a mdb-description, on a new line, this 'mdb-description' prefixed by the text "imdb description​: " .
Shows that are not ​selected and matched by IMDb will simply list the existing description because the second part , {\n[imdb description: 'mdb-description']} will be empty if there is no mdb-description.

Try it   ...  Jan​

P.S. Something to read that may be helpful, from rex.config, a step by step explanation of how the allocation and presentation can be configured :
(This is for REX, but you can use mdb elements in the same way and mix them with the existing xmltv elements)
 
Suppose you want to move the actors to the end of the desciption. You then specify:
      <desc>'description'\n'actor'</desc>
  The result is the existing 'description' , followed by, on a newline,  the actor(s) separated by the standard WG++ element separator | .
  The result:
      <desc>This is the original description.
  Michael Douglas|Kim Basinger</desc>
 
  You probably don't like the | as separator between the actors, so you specify another separator like this:
      <desc>'description'\n'actor(, )'</desc>
  The result:
      <desc>This is the original description.
      Michael Douglas, Kim Basinger</desc> 
     
  You can make this prettier by adding some text to the actors addition:
      <desc>'description'\nActors: 'actor(, )'.</desc>
  The result:
      <desc>This is the original description.
      Actors: Michael Douglas, Kim Basinger.</desc> 
     
  A small problem: Suppose the source xmltv show doesn't have any actors, then the result would be not so pretty:
      <desc>This is the original description.
      Actors: .</desc> 
  To avoid that, the added text can be linked to the element it must be added to, like this:
      <desc>'description'{\nActors: 'actor(, )'.}</desc>
  Result with actors:
      <desc>This is the original description.
      Actors: Michael Douglas, Kim Basinger.</desc>
  And without actors:
      <desc>This is the original description.</desc>
     
  An example with some more elements:
      <desc>'description'{\n\tYear of production: 'productiondate'.}{\n\tProducer: 'producer(, )'.}{\n\tActors: 'actor(, )'.}</desc>
  Result:
      <desc>This is the original description.
        Year of production: 2002.
        Producer: Steven Spielberg.
        Actors: Michael Douglas, Kim Basinger.</desc>
       
  And another one:
      <sub-title>{Episode: 'episode'\t}'subtitle'</sub-title>
  Result:
      <sub-title>Episode: 3.2/12.1    The original subtitle</sub-title>
     
  You can also remove elements (but not the title!) from the xmltv listing by specifying an empty element, like this:
      <actor></actor>
  This will remove all <actor> elements
  And this:
      <credits></credits>
  Will remove the <credits> element, including all its child elements like <actor> , <producer> etc. ]]>

karimf
Offline
Joined: 10 years
Last seen: 8 years

Thanks Jan for your reply, I understand you're busy and no need to apologize.

I read the documentation and your answer above, but the thing is that if the show has a 'title' AND it also gets a match from mdb this means there will be 2 titles for that show. This is of course for all other elements (actors, productiondate,etc..)

This is what I am trying to avoid.

To have a conditional statement to use the "original" element(s) if it exists, otherwise use the mdb elements.

Thanks a lot.

Log in or register to post comments

Brought to you by Jan van Straaten

Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl