Code Monkey home page Code Monkey logo

Comments (9)

froschdesign avatar froschdesign commented on June 24, 2024 1

@podcasthosting
The method is far from perfect and leads to unexpected behaviour at the moment. A clean and well-defined API is needed to avoid problems like the current one.

Adds all 3 categories to the feed (as expected). Right now it partly works like an addItunesCategory method.

And this behaviour is wrong. setItunesCategories should set the categories in whole and should overwrite all previous categories.

But at this point, we cannot change the current behaviour because this could break the current running applications.

from laminas-feed.

froschdesign avatar froschdesign commented on June 24, 2024

@podcasthosting

$feed->setItunesCategories(['Arts' => 'Food']);
$feed->setItunesCategories(['Arts' => 'Visual Arts']);

The usage is wrong because the method sets all categories for the feed and a second call overwrites all previous categories. You expect the functionality of a method like addItunesCategory but it does not exist.

Use the following:

$feed->setItunesCategories(['Arts' => ['Food', 'Visual Arts']]);

from laminas-feed.

podcasthosting avatar podcasthosting commented on June 24, 2024

But why does it work with categories with a different main category?

$feed->setItunesCategories(['Arts' => 'Food]);
$feed->setItunesCategories(['Business']);
$feed->setItunesCategories(['Comedy' => 'Comedy Interviews']);

Adds all 3 categories to the feed (as expected). Right now it partly works like an addItunesCategory method.

from laminas-feed.

podcasthosting avatar podcasthosting commented on June 24, 2024

Thank you for clarification!

from laminas-feed.

froschdesign avatar froschdesign commented on June 24, 2024

@podcasthosting
I would leave the issue report open because the API can be improved with the next major version. That's why I had added the milestone.

from laminas-feed.

podcasthosting avatar podcasthosting commented on June 24, 2024

This actually also does not work:

$feed->setItunesCategories(['Comedy' => ['Improv', 'Comedy Interviews']]);

The result is:

    <itunes:category text="Comedy">
      <itunes:category text="Improv"/>
      <itunes:category text="Comedy Interviews"/>
    </itunes:category>

but should be:

    <itunes:category text="Comedy">
      <itunes:category text="Improv"/>
    </itunes:category>

    <itunes:category text="Comedy">
      <itunes:category text="Comedy Interviews"/>
    </itunes:category>

So this is completely broken and a pretty severe bug (from our customers` point of view).

from laminas-feed.

froschdesign avatar froschdesign commented on June 24, 2024

@podcasthosting

but should be:

    <itunes:category text="Comedy">
      <itunes:category text="Improv"/>
    </itunes:category>

    <itunes:category text="Comedy">
      <itunes:category text="Comedy Interviews"/>
    </itunes:category>

Can you provide a reference / documentation for this? Thanks in advance! πŸ‘

from laminas-feed.

froschdesign avatar froschdesign commented on June 24, 2024

@podcasthosting
Another idea is to use the corresponding XML schemas in the unit tests, so the schemas will also help here.

from laminas-feed.

froschdesign avatar froschdesign commented on June 24, 2024

@podcasthosting
Did you find some reference or documentation for this topic?

from laminas-feed.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.