After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660885 - Cannot upload anything if there is no shared media
Cannot upload anything if there is no shared media
Status: RESOLVED FIXED
Product: rygel
Classification: Applications
Component: general
git master
Other Linux
: High normal
: ---
Assigned To: rygel-maint
rygel-maint
ivi
Depends on:
Blocks:
 
 
Reported: 2011-10-04 14:27 UTC by Lukasz Pawlik
Modified: 2013-04-08 14:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Extend containers for add item in empty container patch (28.91 KB, patch)
2011-11-10 08:39 UTC, Marcin Kazmierczak
needs-work Details | Review
Fix bug with add media item to empty container patch (4.66 KB, patch)
2011-11-10 08:40 UTC, Marcin Kazmierczak
none Details | Review
Extend containers for add item in empty container. Fixed version (23.01 KB, patch)
2011-12-08 15:03 UTC, Marcin Kazmierczak
none Details | Review
Fix bug with add media item to empty container patch. Fixed version (5.67 KB, patch)
2011-12-08 15:06 UTC, Marcin Kazmierczak
none Details | Review
Updated version from Marcin (7.65 KB, patch)
2012-02-28 08:36 UTC, Jens Georg
none Details | Review
media-export: Don't hide empty folders (4.30 KB, patch)
2013-04-08 10:43 UTC, Jens Georg
none Details | Review

Description Lukasz Pawlik 2011-10-04 14:27:11 UTC
Precondition:
Rygel up and running. Rygel is sharing some media files.

Steps to reproduce:
1. Remove all shared media.
2. Try to upload something.

Actual results:
After removing media all containers will be deleted also. Client displays error id 500 on upload action. In rygel debug log i.e. following message can be found "Failed to create item under 'DLNA.ORG_AnyContainer':object.item.audioItem.musicTrack' UPnP class unsupported"
After restarting rygel, it cannot be found in network anymore which also breaks upload.

Expected:
Upload should be successful.
After starting rygel without shared content it should be possible to preform successful upload.
Comment 1 Marcin Kazmierczak 2011-11-10 08:39:03 UTC
Created attachment 201123 [details] [review]
Extend containers for add item in empty container patch
Comment 2 Marcin Kazmierczak 2011-11-10 08:40:28 UTC
Created attachment 201124 [details] [review]
Fix bug with add media item to empty container patch
Comment 3 Jens Georg 2011-11-16 10:53:12 UTC
Review of attachment 201123 [details] [review]:

First, I don't think that there should be a special handling for empty children in the MediaContainer class. That is a speciality of SimpleContainer.

Second, please stick to https://live.gnome.org/Rygel/CodingStyle

Third: It doesn't work in the following scenario:

 - Sharing of all media is enabled
 - Only one Picture is available
 - Try to upload music to the server → 'object.item.audioItem.musicTrack' UPnP class unsupported

::: src/rygel/rygel-media-container.vala
@@ +49,2 @@
     public int child_count;
+    public int empty_child_count;

And why do you declare that here if you exclusively use it in SimpleContainer?

@@ +141,3 @@
+     * return the found media object.
+     */
+    public async abstract MediaObject? find_object_in_all_container (string       id,

Despite the fact that I'm not convinced that this should go in here, it should not have been abstract but provided a default implementation with another one in SearchableContainer doing an actual search.
Comment 4 Marcin Kazmierczak 2011-12-08 15:03:44 UTC
Created attachment 203070 [details] [review]
Extend containers for add item in empty container. Fixed version
Comment 5 Marcin Kazmierczak 2011-12-08 15:06:48 UTC
Created attachment 203071 [details] [review]
Fix bug with add media item to empty container patch. Fixed version

I can't reproduce bug, that you have noticed. Can you check this again?
Comment 6 Jens Georg 2011-12-09 12:10:47 UTC
(In reply to comment #5)
> Created an attachment (id=203071) [details] [review]
> Fix bug with add media item to empty container patch. Fixed version
> 
> I can't reproduce bug, that you have noticed. Can you check this again?

I think the issue is that my upload tool uses ImportResource instead of HTTP POST. 

What I get now is:

(rygel:1662): Rygel-WARNING **: Failed to get original URI for 'http://192.168.34.146:1234/Tracker/i/QWxsUGljdHVyZXMsdXJuOnV1aWQ6ZWI0ZWQwNDEtMzM4Zi05ZThjLTY0ZTItYzgwYWFhMDY3NmE4': URI 'http://192.168.34.146:1234/Tracker/i/QWxsUGljdHVyZXMsdXJuOnV1aWQ6ZWI0ZWQwNDEtMzM4Zi05ZThjLTY0ZTItYzgwYWFhMDY3NmE4' invalid for importing contents to

It seems that the patch is missing the modification for the ImportResource case.

Also, can you please move the default implementation into the SimpleContainer interface instead of copying it in every subclass. You can have implementations in GObject interfaces.
Comment 7 Jens Georg 2011-12-16 08:39:24 UTC
(In reply to comment #6)

> Also, can you please move the default implementation into the SimpleContainer
> interface instead of copying it in every subclass. You can have implementations
> in GObject interfaces.

Er SimpleContainer is of course an object, not an interface. but the comment still holds ;)
Comment 8 Jens Georg 2012-02-28 08:36:28 UTC
Created attachment 208554 [details] [review]
Updated version from Marcin
Comment 9 Jens Georg 2013-04-08 10:43:36 UTC
Created attachment 240933 [details] [review]
media-export: Don't hide empty folders

Unbreak synchronisation and fix MediaExport's part of 660885