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 537367 - USB DAP Plugin does not correctly respect folder depth setting
USB DAP Plugin does not correctly respect folder depth setting
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: Device - USB Mass Storage
git master
Other Linux
: Normal major
: 1.x
Assigned To: Gabriel Burt
Gabriel Burt
: 550035 577043 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-06-09 10:01 UTC by Michael Monreal
Modified: 2009-03-28 10:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch to solve this issue. (11.06 KB, patch)
2009-03-21 15:41 UTC, Brian Lucas
needs-work Details | Review
Replaces old patch. (5.74 KB, patch)
2009-03-23 15:10 UTC, Brian Lucas
needs-work Details | Review
updates DAP Plugin to respect folder depth in .is_audio_player file (6.26 KB, patch)
2009-03-23 20:18 UTC, Brian Lucas
committed Details | Review

Description Michael Monreal 2008-06-09 10:01:16 UTC
I have a DAP device which only supports reading files in the root directory. In the fdi file, folder dephs is set to "0":

<merge key="portable_audio_player.folder_depth" type="int">0</merge>

But still banshee creates a subfolder for every artist I copy to the DAP which means the songs are not playable from within the device itself. If I understand this setting correctly, "0" should mean "no subfolders at all". 
Also note that in the DAP's details window it actually says folder dephs is "0", so banshee reads the setting correctly but does not do the right thing.
Comment 1 Matt 2008-06-12 19:09:05 UTC
I am experiencing this same bug. I have tried setting the value to both "0" and "1" in the device's .is_audio_player file, and even though Banshee seems to recognize that the required folder depth is either 0 or 1 respectively, it continues to copy the same Artist/Album folder hierarchy regardless.
Comment 2 Michael Monreal 2008-08-31 13:39:17 UTC
Referencing a comment from bug 398491:

"...unless your device has a HAL folder_depth set (most don't), in which case we have to do our own thing."

I guess "doing our own thing" is what banshee does not do atm.
Comment 3 Michael Monreal 2008-08-31 13:40:51 UTC
*** Bug 550035 has been marked as a duplicate of this bug. ***
Comment 4 Bertrand Lorentz 2008-08-31 13:53:50 UTC
Bringing over my comment from bug #550035, and fixing a typo in the summary (which could explain the duplicate ;) :

The code that's supposed to handle the folder_depth setting is commented out in
MassStorageSource.GetTrackPath.
Comment 5 Brian Lucas 2009-03-21 15:41:21 UTC
Created attachment 131086 [details] [review]
Proposed patch to solve this issue.

This was mostly just uncommenting the code and moving it to the proper blocks.  I don't use podcasts though so I haven't tested if it has any negative side effects on those.  Please test. :)
Comment 6 Brian Lucas 2009-03-21 15:43:15 UTC
Just adding myself to the CC list.
Comment 7 Bertrand Lorentz 2009-03-22 19:29:21 UTC
Please leave out translators.xml from the patch. Just ignore changes to this file.

I think the following is missing a Path.Combine in the loop :

+for (int i = 0; i < depth - 2; i++) {
+    file_path = track_artist.Substring (0, Math.Min (i, track_artist.Length)).Trim ();
+}

I think the objective is that, if depth > 2, we build a folder structure like this :
P/Pi/Pin/Pink Floyd/The Wall/
Comment 8 Brian Lucas 2009-03-23 15:10:33 UTC
Created attachment 131190 [details] [review]
Replaces old patch.

Fixes issues presented in previous comment.
Comment 9 Gabriel Burt 2009-03-23 19:00:12 UTC
You removed the call to ms_device.GetTrackPath (track, out file_path) which is going to break some stuff.  I think you should keep the else if condition the same (instead of replacing it with the else).

Also, in the depth > 0 cases we should use album_artist instead of track_artist for the top level folder.

Actually, we should probably use track.Display* properties too so we don't wind up with blank directory names for Unknown* albums/artists.
Comment 10 Brian Lucas 2009-03-23 20:18:29 UTC
Created attachment 131215 [details] [review]
updates DAP Plugin to respect folder depth in .is_audio_player file

Reinstates else if condition and uses Display properties where possible.  Also only uses track artist if folder depth is 0 otherwise uses Album Artist.
Comment 11 Gabriel Burt 2009-03-23 22:31:44 UTC
Thanks Brian, committed!
Comment 12 Bertrand Lorentz 2009-03-28 10:28:39 UTC
*** Bug 577043 has been marked as a duplicate of this bug. ***