Banshee.Sources.PrimarySource.DeleteTrack C# (CSharp) Method

DeleteTrack() protected method

protected DeleteTrack ( DatabaseTrackInfo track ) : bool
track Banshee.Collection.Database.DatabaseTrackInfo
return bool
        protected virtual bool DeleteTrack (DatabaseTrackInfo track)
        {
            if (!track.Uri.IsLocalPath)
                throw new Exception ("Cannot delete a non-local resource: " + track.Uri.Scheme);

            try {
                Banshee.IO.Utilities.DeleteFileTrimmingParentDirectories (track.Uri);
            } catch (System.IO.FileNotFoundException) {
            } catch (System.IO.DirectoryNotFoundException) {
            }

            return true;
        }