Bug 371192 - Export podcasts to OPML option missing in 2.8
Summary: Export podcasts to OPML option missing in 2.8
Status: CONFIRMED
Alias: None
Product: amarok
Classification: Applications
Component: Podcast (show other bugs)
Version: 2.8.0
Platform: Mint (Ubuntu based) Linux
: NOR normal (vote)
Target Milestone: 2.9
Assignee: Amarok Developers
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2016-10-18 20:21 UTC by Dan Dart
Modified: 2017-08-21 07:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Dart 2016-10-18 20:21:08 UTC
I used to be able to export podcasts to OPML but this function seems missing in 2.8.

Reproducible: Always

Steps to Reproduce:
1. Click the arrow in Podcasts
2. Observe, it's missing.

Actual Results:  
Export podcast to OPML option is missing

Expected Results:  
Export podcast to OPML option should be present

In both latest Ubuntu and Mint packages.
Comment 1 Myriam Schweingruber 2016-10-19 11:35:27 UTC
Are you sure there was an export function for podcasts? I don't recall any of that, the only existing one was to import from OPML
Comment 2 Dan Dart 2016-10-19 12:12:39 UTC
See a release notice here https://www.linux.com/news/new-features-amarok-24
and a previous bug here https://bugs.kde.org/show_bug.cgi?id=126120

Cheers
Comment 3 Myriam Schweingruber 2016-10-20 06:35:33 UTC
Indeed, it was introduced in 2.4.0, no idea what triggered the loss of that export function, strange nobody else complained in 2 years.
Comment 4 Stefano Pettini 2017-08-20 20:24:24 UTC
I've investigated this bug and it's quite strange. I'm not a Qt expert nor I know how Amarok is architectured, so I have to give up. But before doing it let me share some points.

What I've found is the following: the model of the podcast collection, the one that derives from PlaylistBrowserModel, somehow does not expose the list of providerActions properly. When data() is called for PrettyTreeRoles::DecoratorRole, it either returns an empty QVariant, or it returns a QVariantList of multiple QVariant<QList<QAction*>>. This is strange because in the rest of the code it's always assumed that DecoratorRole is a QVariant<QList<Action*>>, and not a list of them, so it sounds wrong.

Then I tried to fix it by returning that QVariant when handling the DecoratorRole. This case was not present. In case of providers.size() == 1, I returned a QVariant<QList<QAction*>> with providersActions inside. It almost worked. When I tried to investigate what it didn't work in PlaylistBrowserView::actionsFor, basically the QVariant received, instead of the QVariant<Qlist<QAction*>>, contained a QVariantList with two identical elements: each of them was that expected QVariant<QList<QAction*>>.

I could not find the place where that QVariantList is created.

Because in many places .value<QActionList>() is called on the returned QVariant and because it appears to be a QVariantList instead of just the expected element, .value() returns an empty list, so no pop-up menu and no hoover buttons to export the playlists but also to refresh podcasts and other features.

The strangest thing is that, before trying to investigate, I tested with standard 2.8 and everything worked, I saw the icons, I saw the pop-up menu. Then I switched to the git version, and I could confirm the bug. Running again the default 2.8 from Kubuntu could not solve it, and now it's broken forever.

This may also mean it depends on some config file, more than a bug in the code.
Comment 5 Stefano Pettini 2017-08-21 07:04:42 UTC
I've found it. If you delete all the podcast, the pop-up menu and the hover buttons appear.

I did all my tests with two podcasts. Basically .data of the "Local Podcast" entry returned the providerActions of all the tracks, so of all the podcasts, that's why I had a list of list of actoins, with two equal elements, instead of just a list of actions.

Who knows the internals should be in a position now to fix it easily.