~ubuntu-branches/ubuntu/quantal/banshee/quantal

« back to all changes in this revision

Viewing changes to src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MassStorageSource.cs

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2011-12-12 01:40:00 UTC
  • mfrom: (6.3.20 experimental)
  • Revision ID: package-import@ubuntu.com-20111212014000-0q4jsvif0oecyth8
Tags: 2.3.2-1ubuntu1
* Merge from Debian Experimental, remaining changes:
  + Enable and recommend SoundMenu and Disable NotificationArea by default
  + Disable boo and karma extensions
  + Enable and suggest u1ms
  + Move desktop file for Meego UI to /usr/share/une/applications
  + Change the url for the Amazon store redirector
  + [08dea2c] Revert "Fix invalid cast causing ftbfs with libgpod"

Show diffs side-by-side

added added

removed removed

Lines of Context:
633
633
                // the exact given depth (not including the mount point/audio_folder).
634
634
                if (FolderDepth != -1) {
635
635
                    int depth = FolderDepth;
 
636
 
 
637
                    bool is_album_unknown = String.IsNullOrEmpty (track.AlbumTitle);
 
638
 
636
639
                    string album_artist = FileNamePattern.Escape (track.DisplayAlbumArtistName);
637
640
                    string track_album  = FileNamePattern.Escape (track.DisplayAlbumTitle);
638
641
                    string track_number = FileNamePattern.Escape (String.Format ("{0:00}", track.TrackNumber));
641
644
                    if (depth == 0) {
642
645
                        // Artist - Album - 01 - Title
643
646
                        string track_artist = FileNamePattern.Escape (track.DisplayArtistName);
644
 
                        file_path = String.Format ("{0} - {1} - {2} - {3}", track_artist, track_album, track_number, track_title);
 
647
                        file_path = is_album_unknown ?
 
648
                            String.Format ("{0} - {1} - {2}", track_artist, track_number, track_title) :
 
649
                            String.Format ("{0} - {1} - {2} - {3}", track_artist, track_album, track_number, track_title);
645
650
                    } else if (depth == 1) {
646
651
                        // Artist - Album/01 - Title
647
 
                        file_path = String.Format ("{0} - {1}", album_artist, track_album);
 
652
                        file_path = is_album_unknown ?
 
653
                            album_artist :
 
654
                            String.Format ("{0} - {1}", album_artist, track_album);
648
655
                        file_path = System.IO.Path.Combine (file_path, String.Format ("{0} - {1}", track_number, track_title));
649
656
                    } else if (depth == 2) {
650
657
                        // Artist/Album/01 - Title
651
658
                        file_path = album_artist;
652
 
                        file_path = System.IO.Path.Combine (file_path, track_album);
 
659
                        if (!is_album_unknown || ms_device.MinimumFolderDepth == depth) {
 
660
                            file_path = System.IO.Path.Combine (file_path, track_album);
 
661
                        }
653
662
                        file_path = System.IO.Path.Combine (file_path, String.Format ("{0} - {1}", track_number, track_title));
654
663
                    } else {
655
664
                        // If the *required* depth is more than 2..go nuts!