GNOME Bugzilla – Bug 537367
USB DAP Plugin does not correctly respect folder depth setting
Last modified: 2009-03-28 10:28:39 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.
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.
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.
*** Bug 550035 has been marked as a duplicate of this bug. ***
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.
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. :)
Just adding myself to the CC list.
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/
Created attachment 131190 [details] [review] Replaces old patch. Fixes issues presented in previous comment.
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.
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.
Thanks Brian, committed!
*** Bug 577043 has been marked as a duplicate of this bug. ***