Bug 396211 - Plot summary does not alway work
Summary: Plot summary does not alway work
Status: RESOLVED FIXED
Alias: None
Product: tellico
Classification: Applications
Component: general (show other bugs)
Version: 3.1.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Robby Stephenson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-05 17:01 UTC by Joachim
Modified: 2018-08-25 00:34 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 3.1.3
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joachim 2018-07-05 17:01:16 UTC
Hello, 
I've got the problem that the plot summary isn't always transfered correctly from Amazon to Tellico. 

Example: https://www.amazon.de/dp/B0143R4K24 (The Diabolical Blu Ray) shows "Das Haus der Familie Heller wird jede Nacht von unheimlichen..." as "Produktbeschreibung" but adding this film to tellico the plot summary is "Besonderheiten: FSK 16 Jahre". This doesn't match. 

Thanks for help
Comment 1 Robby Stephenson 2018-07-09 00:50:43 UTC
Is this just for amazon.de? I don't have a current access ID for Amazon Germany to test...

Could you possibly go to https://webservices.amazon.com/scratchpad/index.html# Select ItemSearch on the left, change marketplace to Germany, enter all your information, along with the search term (such as Diabolical) in the keyword box, and do "Run Request" ? If that works, inside the Response box, select the "XML" tab and either comment here (remove your access information first) or email to me directly..
Comment 2 Joachim 2018-07-09 15:35:21 UTC
Emaild just two examples directly to you
Comment 3 Joachim 2018-07-15 15:38:58 UTC
Hi, 
I think the plot can be in two segments of the XML structure. I did the following changes in amazon2tellico.xsl: 

   <xsl:when test="$mode='Video'">
    <plot>
     <xsl:value-of select="aws:EditorialReviews/aws:EditorialReview[1]/aws:Content"/>
    </plot>


Changed it to 

   <xsl:when test="$mode='Video'">
    <plot>
     <xsl:value-of select="aws:EditorialReviews/aws:EditorialReview[2]/aws:Content"/>
     <xsl:value-of select="aws:EditorialReviews/aws:EditorialReview[1]/aws:Content"/>
    </plot>

And now I can get both plots. Is there a possibility to add e.g. linebreak between the two plots? I tried it with <br> but this did not help.
Comment 4 Robby Stephenson 2018-07-16 00:41:02 UTC
(In reply to Joachim from comment #3)
> Hi, 
> I think the plot can be in two segments of the XML structure. I did the
> following changes in amazon2tellico.xsl: 
> 
>    <xsl:when test="$mode='Video'">
>     <plot>
>      <xsl:value-of
> select="aws:EditorialReviews/aws:EditorialReview[1]/aws:Content"/>
>     </plot>
> 
> 
> Changed it to 
> 
>    <xsl:when test="$mode='Video'">
>     <plot>
>      <xsl:value-of
> select="aws:EditorialReviews/aws:EditorialReview[2]/aws:Content"/>
>      <xsl:value-of
> select="aws:EditorialReviews/aws:EditorialReview[1]/aws:Content"/>
>     </plot>
> 
> And now I can get both plots. Is there a possibility to add e.g. linebreak
> between the two plots? I tried it with <br> but this did not help.

Try this:

    <plot>
     <xsl:if test="aws:EditorialReviews/aws:EditorialReview[2]">
      <xsl:value-of select="aws:EditorialReviews/aws:EditorialReview[2]/aws:Content"/>
      <xsl:text>&#10;</xsl:text> <!-- newline character -->
     </xsl:if>
     <xsl:value-of select="aws:EditorialReviews/aws:EditorialReview[1]/aws:Content"/>
    </plot>
Comment 5 Joachim 2018-07-16 07:05:58 UTC
Thank you! But

      <xsl:text>&#10;</xsl:text> <!-- newline character -->

did not work for me. It perfectly inserts a new line in the plot at "change entry" but this linebreak is not shown in the main window. I played a bit around and 

     <xsl:text><![CDATA[<p>]]></xsl:text>

helped.
Comment 6 Joachim 2018-07-16 09:07:40 UTC
(In reply to Joachim from comment #5)
> Thank you! But
> 
>       <xsl:text>&#10;</xsl:text> <!-- newline character -->
> 
> did not work for me. It perfectly inserts a new line in the plot at "change
> entry" but this linebreak is not shown in the main window. I played a bit
> around and 
> 
>      <xsl:text><![CDATA[<p>]]></xsl:text>
> 
> helped.


How can I use custom fields and update it with Amazon data? I created a cusotm field named "EAN" in Tellico. The EAN code is submitted in the XML structure from Amazon. How to update the cusom field with the content of the according XML element? Nothing I tried did work.
Comment 7 Robby Stephenson 2018-07-17 01:47:12 UTC
(In reply to Joachim from comment #6)
> How can I use custom fields and update it with Amazon data? I created a
> cusotm field named "EAN" in Tellico. The EAN code is submitted in the XML
> structure from Amazon. How to update the cusom field with the content of the
> according XML element? Nothing I tried did work.

With your collection that has the custom EAN field in it, export to an XML and find the <field .. title="EAN" ... > line in it. Copy that to your amazon2tellico.xsl file up in the beginning within the <fields> element. Then add 
<ean><xsl:value-of select="[whatever the EAN element is in the XML from Amazon]"></ean> somewhere in the Item template.

Does that make sense?
Comment 8 Joachim 2018-07-18 17:14:45 UTC
Got it, thank you! 

Also did some German related optimization (e.g. the FSK rating). 

Except that the plot isn't available via Amazon sometimes (I checked it with the scratchpad) all works like a charm and I was able to learn some XSLT :-) 

I think you can close this Bug because it really isn't one. Perhups you can overtake the changes to the plot element in a future version. 

Thanks for your great support!
Comment 9 Joachim 2018-07-30 11:49:09 UTC
A further question to entry update via Amazon: what's the search criteria? Can I change it?
Comment 10 Robby Stephenson 2018-08-02 03:13:51 UTC
(In reply to Joachim from comment #9)
> A further question to entry update via Amazon: what's the search criteria?
> Can I change it?

For books, it uses the ISBN if possible, followed by a title/author or title/artist search, followed by just title, and then tries to choose the best match out of all those.

It's not changeable without editing the code and recompiling.
Comment 11 Robby Stephenson 2018-08-25 00:30:22 UTC
(In reply to Joachim from comment #8)
> Got it, thank you! 
> 
> Also did some German related optimization (e.g. the FSK rating). 
> 
> Except that the plot isn't available via Amazon sometimes (I checked it with
> the scratchpad) all works like a charm and I was able to learn some XSLT :-) 
> 
> I think you can close this Bug because it really isn't one. Perhups you can
> overtake the changes to the plot element in a future version. 
> 
> Thanks for your great support!

I'm interested in improving the FSK support. If you can send me or post them here, I'll include them in next release.
Comment 12 Robby Stephenson 2018-08-25 00:34:09 UTC
Git commit 714874e03c610682b3e84192a2f61297a6fcab75 by Robby Stephenson.
Committed on 25/08/2018 at 00:33.
Pushed by rstephenson into branch '3.1'.

Include multiple content elements from Amazon fetcher for movie plots
FIXED-IN: 3.1.3

M  +4    -0    ChangeLog
M  +6    -1    xslt/amazon2tellico.xsl

https://commits.kde.org/tellico/714874e03c610682b3e84192a2f61297a6fcab75