Banshee crashes when file/directory is not present

Bug #158419 reported by LCID Fire
4
Affects Status Importance Assigned to Milestone
banshee (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: banshee

When banshee screws up the import there are chances that the underlying file and directory is not present. When doing a Delete from drive it crashes big time. Please patch the following changes into PlayerInterface.cs:

     private void DeleteSong(TrackInfo ti)
        {
  try
  {
            File.Delete(ti.Uri.LocalPath);
  }
  catch(System.IO.DirectoryNotFoundException)
  {
   //directory is not there so for some reason the file is
   //already purged - ignore
  }

LCID Fire (lcid-fire)
Changed in banshee:
status: New → Confirmed
Revision history for this message
Pepijn van de Geer (pvandegeer) wrote :

This seems to be fixed as the current code of the stable branch looks like this:

        private void DeleteSong(TrackInfo ti)
        {
            File.Delete(ti.Uri.LocalPath);

            // trim empty parent directories
            try {
                string old_dir = Path.GetDirectoryName(ti.Uri.LocalPath);
                while(old_dir != null && old_dir != String.Empty) {
                    Directory.Delete(old_dir);
                    old_dir = Path.GetDirectoryName(old_dir);
                }
            } catch(Exception) {}
        }

Revision history for this message
LCID Fire (lcid-fire) wrote :

No, the problem is the File.Delete - not the Directory.Delete

Revision history for this message
Andrew Conkling (andrewski) wrote :

Can you test in the new Banshee? It is available on Intrepid, and on Hardy via the Banshee PPA: https://launchpad.net/~banshee-team/+archive.

Changed in banshee:
status: Confirmed → Incomplete
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in banshee:
status: Incomplete → Invalid
Revision history for this message
Andrew Conkling (andrewski) wrote :

Reopening bug. If this is an issue, it still is, but we should test.

LCID Fire, can you provide some steps to reproduce? I simply don't know what you're referring to in this bug.

Changed in banshee:
status: Invalid → New
Changed in banshee:
status: New → Incomplete
Revision history for this message
LCID Fire (lcid-fire) wrote :

It is fixed with 1.2 - just tried it in Intrepid.

Changed in banshee:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.