diff options
author | Andres G. Aragoneses <knocte@gmail.com> | 2013-02-28 11:26:21 +0000 |
---|---|---|
committer | Andres G. Aragoneses <knocte@gmail.com> | 2013-02-28 11:26:21 +0000 |
commit | 2c82ffbeaf4f4ff9f996b4dfaf1bfc84064353f5 (patch) | |
tree | 0d5fc1dccbfbaf1c543f01a9d65d89741cd3d8b6 | |
parent | 189f085feb2e9417245342d368755061b2651af4 (diff) |
DatabaseTrackInfo: don't default to MusicFilePattern when null (bgo#689123)
PathPattern property was defaulting to MusicFileNamePattern in the class
DatabaseTrackInfo, which meant that tracks of sources without a pattern
at all would still get imported with the directory structured configured
for music. The particular case reported in bgo#689123 is Video.
-rw-r--r-- | src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs b/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs index 1b5f98448..e44b5aa7a 100644 --- a/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs +++ b/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs @@ -722,8 +722,7 @@ namespace Banshee.Collection.Database public PathPattern PathPattern { get { var src = PrimarySource; - var pattern = src == null ? null : src.PathPattern; - return pattern ?? MusicLibrarySource.MusicFileNamePattern; + return src == null ? null : src.PathPattern; } } @@ -746,7 +745,8 @@ namespace Banshee.Collection.Database bool in_library = old_uri.IsLocalPath ? old_uri.AbsolutePath.StartsWith (PrimarySource.BaseDirectoryWithSeparator) : false; if (!in_library && ((library_source.HasCopyOnImport && library_source.CopyOnImport) || force_copy)) { - string new_filename = PathPattern.BuildFull (PrimarySource.BaseDirectory, this, Path.GetExtension (old_uri.ToString ())); + string new_filename = PathPattern != null ? PathPattern.BuildFull (PrimarySource.BaseDirectory, this, Path.GetExtension (old_uri.ToString ())) + : Path.Combine (PrimarySource.BaseDirectory, Path.GetFileName (SafeUri.UriToFilename (old_uri))); SafeUri new_uri = new SafeUri (new_filename); try { |