make channel access opt-in rather than opt out

This commit is contained in:
Luke Pulverenti
2015-01-12 22:46:44 -05:00
parent f552174069
commit d8d5dd4873
72 changed files with 399 additions and 241 deletions

View File

@@ -401,11 +401,11 @@ namespace MediaBrowser.Server.Implementations.Library
try
{
Directory.Delete(metadataPath, true);
_fileSystem.DeleteDirectory(metadataPath, true);
}
catch (DirectoryNotFoundException)
{
}
catch (Exception ex)
{
@@ -420,12 +420,12 @@ namespace MediaBrowser.Server.Implementations.Library
if (Directory.Exists(path))
{
_logger.Debug("Deleting path {0}", path);
Directory.Delete(path, true);
_fileSystem.DeleteDirectory(path, true);
}
else if (File.Exists(path))
{
_logger.Debug("Deleting path {0}", path);
File.Delete(path);
_fileSystem.DeleteFile(path);
}
}
@@ -840,6 +840,23 @@ namespace MediaBrowser.Server.Implementations.Library
return GetItemByName<Year>(ConfigurationManager.ApplicationPaths.YearPath, value.ToString(UsCulture));
}
/// <summary>
/// Gets the artists path.
/// </summary>
/// <value>The artists path.</value>
public string ArtistsPath
{
get
{
if (ConfigurationManager.Configuration.StoreArtistsInMetadata)
{
return Path.Combine(ConfigurationManager.ApplicationPaths.InternalMetadataPath, "artists");
}
return Path.Combine(ConfigurationManager.ApplicationPaths.ItemsByNamePath, "artists");
}
}
/// <summary>
/// Gets a Genre
/// </summary>
@@ -847,7 +864,7 @@ namespace MediaBrowser.Server.Implementations.Library
/// <returns>Task{Genre}.</returns>
public MusicArtist GetArtist(string name)
{
return GetItemByName<MusicArtist>(ConfigurationManager.ApplicationPaths.ArtistsPath, name);
return GetItemByName<MusicArtist>(ArtistsPath, name);
}
private T GetItemByName<T>(string path, string name)
@@ -976,7 +993,7 @@ namespace MediaBrowser.Server.Implementations.Library
public Task ValidateArtists(CancellationToken cancellationToken, IProgress<double> progress)
{
// Ensure the location is unavailable.
Directory.CreateDirectory(ConfigurationManager.ApplicationPaths.ArtistsPath);
Directory.CreateDirectory(ArtistsPath);
return new ArtistsValidator(this, _userManager, _logger).Run(progress, cancellationToken);
}