You are here

Site.ini element cleanup question

10 posts / 0 new
Last post
Maniac
Offline
Donator
Joined: 11 years
Last seen: 9 months
Site.ini element cleanup question

Hi there,
I have an issue in my .ini file and don't know how to solve it. So I could use some help here :)
 
The ini file scrubs two programme titles,  "title" and "titleoriginal". (one in domestic language the other in original).
The problem is that sometimes the original title does not contain a propper value here, just blank or only the release year, e.g. (2014).
 
I would like to check if the element "titleoriginal" starts with (  or just contains a year (nnnn), and add to the start the "title" element value.
How would I go about and write the modify code to make it work like this? Or any other suggestion on how to solve this?
 
Thanks

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

Hi,

 

the best way to do this is to ensure that these wrong values do not end up in the title original. To give you advice on how to achieve that I need to know the ini fie you use.

 

But it is also possible to replace the wrong titleoriginal with the title. You say it's sometimes 'blank' but that cannot be completely true because 'blank' as in "" , empty string doesn't generate a listing in the xmltv file. So there is some space or maybe a newline character. To remove that you can do a cleanup, like:

titleoriginal.modify {cleanup}

It is not clear to me what you want if the titleoriginal only contains the productiondate within (), like (2007)

Suppose you want to replace that with the title , I would suggest this

productiondate.modify {calculate(format=productiondate)|'titleoriginal'} * this saves the productiondate if in titleoriginal.
titleoriginal.modify {replace|('productiondate')|'title'} * this replaces the productiondate between () with the title

Or if you want to add the title to the titleoriginal if it contains the (productiondate), after the first line continue like this:

temp_1.modify {addstart|('productiondate'} * the temp element containing the test string (productiondate)
titleoriginal.modify {addstart(~ 'temp_1')|'title'} * this adds the title if titleoriginal contains  ~ (productiondate)

Or if you simply want to remove (productiondate) , because I think you don't need a titleoriginal that has the already listed title

titleoriginal.modify {clear(= 'temp_1')}  * this clears the titleorginal if its value is (productiondate)
or
titleoroginal.modify {cleanup(tags="("")")} * this removes everything between ( and )

 

Hope this helps     Jan

Maniac
Offline
Donator
Joined: 11 years
Last seen: 9 months

Hi Jan, thanks for your reply.
I've tried this and still have problems in getting it to work the way I want to. 

I was wrong when I said that the title is sometimes "blank", of course it is not :)
But sometimes it is just '(?)' or '(Year)', and sometimes it is title + year. 
When it is title, or title + year, I want to keep it that way and do nothing. But when it is only '(year)', I want to remove it. 

So how do I remove a title that only contains a year in a title element? If title is present, then do nothing. 
I've tried the examples you provided, but they either do nothing or they remove the year on all programmes even if it has propper title. So it becomes title + (?). 
I've provided my custom ini file for tvprofil.net. Keep in mind that the index site and show url are different!

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

Hi,
 
I have adapted your ini. I hope this is what you want. If it is OK like this I will place it in the collection to replace m.profil.net.ini
 
Jan

Maniac
Offline
Donator
Joined: 11 years
Last seen: 9 months

Hi Jan, 
This is okay to use as a default for the site, sure. But in my original ini I changed it up a bit, so that 'title' is accually 'titleoriginal', and vice versa.
Because I want the original title to be used as main title. I want movie titles in their Native language and not in Bosnian (bad translation :-) ).

The problem is that tvprofil site, in their movie\series description pages, the 'original title' field has to functions:

1) Native language title + production year
or
2) Production year

So my .xml sometimes contains programmes like this (just an example):

Bad 
<title lang="xx">1990</title>
<title lang="hr">Umri Muski</title>

Good
<title lang="xx">Die Hard (1990)</title>

<title lang="hr">Umri Muski (1990)</title>

So if the first example is the case, I want to filter out the 1990, or remove the line, so that the next one is the main one. 

Hope you understand what I want to do :) Thanks

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

Hi

I compared the two ini's :

your ini:

1. <title lang="hr">(1978)</title>
    <title lang="xx">Punom parom</title>

2. <title lang="hr">SVE ĆE BITI DOBRO (2008)</title>
     <title lang="xx">Sve će biti dobro</title>

3. <title lang="hr">FAHRT INS RISIKO / HOT ROADS: THE WORLD'S MOST DANGEROUS ROADS</title>
    <title lang="xx">Opasne ceste: Jadranska cesta snova</title>

4. <title lang="hr">Show III. (2011)</title>
    <title lang="xx">Dr. Oz</title>

the one I uploaded :

1. <title lang="hr">Punom parom</title>

2. <title lang="hr">Sve će biti dobro</title>

3. <title lang="hr">Opasne ceste: Jadranska cesta snova</title>
    <title lang="xx">Fahrt ins risiko / hot roads: the world's most dangerous roads</title>

4. <title lang="hr">Dr. Oz</title>

In this ini the productiondate is no longer part of the title, it's only where it belongs .. element <date>
Therefore the titles that contain only the production date are not there anymore.

If you look at these examples what exactly do you want different?

 

Jan

 

Maniac
Offline
Donator
Joined: 11 years
Last seen: 9 months

Yes I have noticed that, thanks :) But there is one main diferance:
In your ini file: 3. example, I would like lang="xx" to be the first in line ('title'), if there is one. 
3. 
<title lang="xx">Fahrt ins risiko / hot roads: the world's most dangerous roads</title>
<title lang="hr">Opasne ceste: Jadranska cesta snova</title>
This is because my pvr-addon in XBMC reads only the first title and not the rest. :)

 

Maniac
Offline
Donator
Joined: 11 years
Last seen: 9 months

Hi Jan,
Any updates on this? 

Do you have an idea on how I can achieve this?

Basicly I would like the original title (english), if available, to be prioritized. 
That is what I tryed to do in my version of the .ini file. But from time to time, there are titles with only producition year in them. 

If there is Title + Production year = keep them
If there is only Production year = remove\filter out\ replace

Thanks

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

Hi,

 

the best I can do is swap title and titleoriginal in the ini attached a few posts up :

 

Add the following lines at the end of the listing , just above the channel file creation:

* swap title and titleoriginal
* park title in temp_4
temp_4.modify {addstart|'title'}
* replace title with titleoriginal
title.modify {replace('titleoriginal' not "")|'title'|'titleoriginal'}
* replace titleoriginal with title (temp_4)
titleoriginal.modify {replace('titleoriginal' not "")|'titleoriginal'|'temp_4'}

Make sure you have titlematchfactor=0

It's not perfect because the lang attribute will show "hr" for the original title .

Another improvement: Change this line:

index_urlshow.modify {remove(type=regex)|"/serije/"}

in this :

index_urlshow.modify {clear(= "http://tvprofil.net/serije/")}

(avoids un-necessary grabbing of non existent showdetail pages)

 

Jan

 

Maniac
Offline
Donator
Joined: 11 years
Last seen: 9 months

Sweet! This works great now :) 

Thanks again :)

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