diff options
7 files changed, 38 insertions, 233 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 9d5f73141..602acff09 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -562,6 +562,13 @@ namespace MediaBrowser.Api.Playback /// <returns>Task.</returns> protected async Task StartFfMpeg(StreamState state, string outputPath) { + var parentPath = Path.GetDirectoryName(outputPath); + + if (!Directory.Exists(parentPath)) + { + Directory.CreateDirectory(parentPath); + } + var video = state.Item as Video; if (video != null && video.VideoType == VideoType.Iso && video.IsoType.HasValue && IsoManager.CanMount(video.Path)) diff --git a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs index 82a35fc51..f6667f236 100644 --- a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs +++ b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs @@ -45,7 +45,7 @@ namespace MediaBrowser.Common.Implementations /// <summary> /// Gets the path to the system folder /// </summary> - public string ProgramSystemPath { get { return Path.Combine(ProgramDataPath, "System"); } } + public string ProgramSystemPath { get { return Path.Combine(ProgramDataPath, "system"); } } /// <summary> /// The _data directory @@ -160,7 +160,7 @@ namespace MediaBrowser.Common.Implementations { if (_tempUpdatePath == null) { - _tempUpdatePath = Path.Combine(ProgramDataPath, "Updates"); + _tempUpdatePath = Path.Combine(ProgramDataPath, "updates"); if (!Directory.Exists(_tempUpdatePath)) { Directory.CreateDirectory(_tempUpdatePath); @@ -220,10 +220,6 @@ namespace MediaBrowser.Common.Implementations } /// <summary> - /// The _system configuration file path - /// </summary> - private string _systemConfigurationFilePath; - /// <summary> /// Gets the path to the system configuration file /// </summary> /// <value>The system configuration file path.</value> @@ -231,7 +227,7 @@ namespace MediaBrowser.Common.Implementations { get { - return _systemConfigurationFilePath ?? (_systemConfigurationFilePath = Path.Combine(ConfigurationDirectoryPath, "system.xml")); + return Path.Combine(ConfigurationDirectoryPath, "system.xml"); } } diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs index 65884332a..e991820e3 100644 --- a/MediaBrowser.Controller/Entities/User.cs +++ b/MediaBrowser.Controller/Entities/User.cs @@ -28,19 +28,14 @@ namespace MediaBrowser.Controller.Entities { get { - if (Configuration.UseCustomLibrary) - { - var rootFolderPath = GetRootFolderPath(Name); + var path = Configuration.UseCustomLibrary ? GetRootFolderPath(Name) : ConfigurationManager.ApplicationPaths.DefaultUserViewsPath; - if (!Directory.Exists(rootFolderPath)) - { - Directory.CreateDirectory(rootFolderPath); - } - - return rootFolderPath; + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); } - return ConfigurationManager.ApplicationPaths.DefaultUserViewsPath; + return path; } } diff --git a/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs index 86f774a01..b99fefcca 100644 --- a/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs +++ b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs @@ -50,7 +50,7 @@ namespace MediaBrowser.Model.Configuration public BaseApplicationConfiguration() { EnableAutoUpdate = true; - LogFileRetentionDays = 7; + LogFileRetentionDays = 3; #if (DEBUG) EnableDebugLevelLogging = true; diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index f9c8e9a31..8a19a8d3f 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -558,6 +558,12 @@ namespace MediaBrowser.Server.Implementations.Library public AggregateFolder CreateRootFolder() { var rootFolderPath = ConfigurationManager.ApplicationPaths.RootFolderPath; + + if (!Directory.Exists(rootFolderPath)) + { + Directory.CreateDirectory(rootFolderPath); + } + var rootFolder = RetrieveItem(rootFolderPath.GetMBId(typeof(AggregateFolder))) as AggregateFolder ?? (AggregateFolder)ResolvePath(rootFolderPath); // Add in the plug-in folders diff --git a/MediaBrowser.Server.Implementations/ServerApplicationPaths.cs b/MediaBrowser.Server.Implementations/ServerApplicationPaths.cs index c30c1b9db..655876c8c 100644 --- a/MediaBrowser.Server.Implementations/ServerApplicationPaths.cs +++ b/MediaBrowser.Server.Implementations/ServerApplicationPaths.cs @@ -27,10 +27,6 @@ namespace MediaBrowser.Server.Implementations } #endif /// <summary> - /// The _root folder path - /// </summary> - private string _rootFolderPath; - /// <summary> /// Gets the path to the base root media directory /// </summary> /// <value>The root folder path.</value> @@ -38,23 +34,11 @@ namespace MediaBrowser.Server.Implementations { get { - if (_rootFolderPath == null) - { - _rootFolderPath = Path.Combine(ProgramDataPath, "Root"); - if (!Directory.Exists(_rootFolderPath)) - { - Directory.CreateDirectory(_rootFolderPath); - } - } - return _rootFolderPath; + return Path.Combine(ProgramDataPath, "root"); } } /// <summary> - /// The _default user views path - /// </summary> - private string _defaultUserViewsPath; - /// <summary> /// Gets the path to the default user view directory. Used if no specific user view is defined. /// </summary> /// <value>The default user views path.</value> @@ -62,23 +46,11 @@ namespace MediaBrowser.Server.Implementations { get { - if (_defaultUserViewsPath == null) - { - _defaultUserViewsPath = Path.Combine(RootFolderPath, "Default"); - if (!Directory.Exists(_defaultUserViewsPath)) - { - Directory.CreateDirectory(_defaultUserViewsPath); - } - } - return _defaultUserViewsPath; + return Path.Combine(RootFolderPath, "default"); } } /// <summary> - /// The _localization path - /// </summary> - private string _localizationPath; - /// <summary> /// Gets the path to localization data. /// </summary> /// <value>The localization path.</value> @@ -86,15 +58,7 @@ namespace MediaBrowser.Server.Implementations { get { - if (_localizationPath == null) - { - _localizationPath = Path.Combine(ProgramDataPath, "Localization"); - if (!Directory.Exists(_localizationPath)) - { - Directory.CreateDirectory(_localizationPath); - } - } - return _localizationPath; + return Path.Combine(ProgramDataPath, "localization"); } } @@ -110,37 +74,15 @@ namespace MediaBrowser.Server.Implementations { get { - if (_ibnPath == null) - { - _ibnPath = Path.Combine(ProgramDataPath, "ImagesByName"); - if (!Directory.Exists(_ibnPath)) - { - Directory.CreateDirectory(_ibnPath); - } - } - - return _ibnPath; + return _ibnPath ?? (_ibnPath = Path.Combine(ProgramDataPath, "ImagesByName")); } set { _ibnPath = value; - - _peoplePath = null; - _studioPath = null; - _genrePath = null; - _yearPath = null; - _musicArtistsPath = null; - _generalPath = null; - _ratingsPath = null; - _mediaInfoImagesPath = null; } } /// <summary> - /// The _people path - /// </summary> - private string _peoplePath; - /// <summary> /// Gets the path to the People directory /// </summary> /// <value>The people path.</value> @@ -148,24 +90,11 @@ namespace MediaBrowser.Server.Implementations { get { - if (_peoplePath == null) - { - _peoplePath = Path.Combine(ItemsByNamePath, "People"); - if (!Directory.Exists(_peoplePath)) - { - Directory.CreateDirectory(_peoplePath); - } - } - - return _peoplePath; + return Path.Combine(ItemsByNamePath, "People"); } } /// <summary> - /// The _genre path - /// </summary> - private string _genrePath; - /// <summary> /// Gets the path to the Genre directory /// </summary> /// <value>The genre path.</value> @@ -173,24 +102,11 @@ namespace MediaBrowser.Server.Implementations { get { - if (_genrePath == null) - { - _genrePath = Path.Combine(ItemsByNamePath, "Genre"); - if (!Directory.Exists(_genrePath)) - { - Directory.CreateDirectory(_genrePath); - } - } - - return _genrePath; + return Path.Combine(ItemsByNamePath, "Genre"); } } /// <summary> - /// The _studio path - /// </summary> - private string _studioPath; - /// <summary> /// Gets the path to the Studio directory /// </summary> /// <value>The studio path.</value> @@ -198,24 +114,11 @@ namespace MediaBrowser.Server.Implementations { get { - if (_studioPath == null) - { - _studioPath = Path.Combine(ItemsByNamePath, "Studio"); - if (!Directory.Exists(_studioPath)) - { - Directory.CreateDirectory(_studioPath); - } - } - - return _studioPath; + return Path.Combine(ItemsByNamePath, "Studio"); } } /// <summary> - /// The _year path - /// </summary> - private string _yearPath; - /// <summary> /// Gets the path to the Year directory /// </summary> /// <value>The year path.</value> @@ -223,24 +126,11 @@ namespace MediaBrowser.Server.Implementations { get { - if (_yearPath == null) - { - _yearPath = Path.Combine(ItemsByNamePath, "Year"); - if (!Directory.Exists(_yearPath)) - { - Directory.CreateDirectory(_yearPath); - } - } - - return _yearPath; + return Path.Combine(ItemsByNamePath, "Year"); } } /// <summary> - /// The _general path - /// </summary> - private string _generalPath; - /// <summary> /// Gets the path to the General IBN directory /// </summary> /// <value>The general path.</value> @@ -248,24 +138,11 @@ namespace MediaBrowser.Server.Implementations { get { - if (_generalPath == null) - { - _generalPath = Path.Combine(ItemsByNamePath, "General"); - if (!Directory.Exists(_generalPath)) - { - Directory.CreateDirectory(_generalPath); - } - } - - return _generalPath; + return Path.Combine(ItemsByNamePath, "general"); } } /// <summary> - /// The _ratings path - /// </summary> - private string _ratingsPath; - /// <summary> /// Gets the path to the Ratings IBN directory /// </summary> /// <value>The ratings path.</value> @@ -273,24 +150,11 @@ namespace MediaBrowser.Server.Implementations { get { - if (_ratingsPath == null) - { - _ratingsPath = Path.Combine(ItemsByNamePath, "Ratings"); - if (!Directory.Exists(_ratingsPath)) - { - Directory.CreateDirectory(_ratingsPath); - } - } - - return _ratingsPath; + return Path.Combine(ItemsByNamePath, "ratings"); } } /// <summary> - /// The _media info images path - /// </summary> - private string _mediaInfoImagesPath; - /// <summary> /// Gets the media info images path. /// </summary> /// <value>The media info images path.</value> @@ -298,24 +162,11 @@ namespace MediaBrowser.Server.Implementations { get { - if (_mediaInfoImagesPath == null) - { - _mediaInfoImagesPath = Path.Combine(ItemsByNamePath, "MediaInfo"); - if (!Directory.Exists(_mediaInfoImagesPath)) - { - Directory.CreateDirectory(_mediaInfoImagesPath); - } - } - - return _mediaInfoImagesPath; + return Path.Combine(ItemsByNamePath, "mediainfo"); } } /// <summary> - /// The _user configuration directory path - /// </summary> - private string _userConfigurationDirectoryPath; - /// <summary> /// Gets the path to the user configuration directory /// </summary> /// <value>The user configuration directory path.</value> @@ -323,23 +174,11 @@ namespace MediaBrowser.Server.Implementations { get { - if (_userConfigurationDirectoryPath == null) - { - _userConfigurationDirectoryPath = Path.Combine(ConfigurationDirectoryPath, "users"); - if (!Directory.Exists(_userConfigurationDirectoryPath)) - { - Directory.CreateDirectory(_userConfigurationDirectoryPath); - } - } - return _userConfigurationDirectoryPath; + return Path.Combine(ConfigurationDirectoryPath, "users"); } } /// <summary> - /// The _f F MPEG stream cache path - /// </summary> - private string _fFMpegStreamCachePath; - /// <summary> /// Gets the FF MPEG stream cache path. /// </summary> /// <value>The FF MPEG stream cache path.</value> @@ -347,25 +186,11 @@ namespace MediaBrowser.Server.Implementations { get { - if (_fFMpegStreamCachePath == null) - { - _fFMpegStreamCachePath = Path.Combine(CachePath, "encoded-media"); - - if (!Directory.Exists(_fFMpegStreamCachePath)) - { - Directory.CreateDirectory(_fFMpegStreamCachePath); - } - } - - return _fFMpegStreamCachePath; + return Path.Combine(CachePath, "encoded-media"); } } /// <summary> - /// The _images data path - /// </summary> - private string _downloadedImagesDataPath; - /// <summary> /// Gets the images data path. /// </summary> /// <value>The images data path.</value> @@ -373,25 +198,11 @@ namespace MediaBrowser.Server.Implementations { get { - if (_downloadedImagesDataPath == null) - { - _downloadedImagesDataPath = Path.Combine(DataPath, "remote-images"); - - if (!Directory.Exists(_downloadedImagesDataPath)) - { - Directory.CreateDirectory(_downloadedImagesDataPath); - } - } - - return _downloadedImagesDataPath; + return Path.Combine(DataPath, "remote-images"); } } /// <summary> - /// The _music artists path - /// </summary> - private string _musicArtistsPath; - /// <summary> /// Gets the artists path. /// </summary> /// <value>The artists path.</value> @@ -399,16 +210,7 @@ namespace MediaBrowser.Server.Implementations { get { - if (_musicArtistsPath == null) - { - _musicArtistsPath = Path.Combine(ItemsByNamePath, "Artists"); - if (!Directory.Exists(_musicArtistsPath)) - { - Directory.CreateDirectory(_musicArtistsPath); - } - } - - return _musicArtistsPath; + return Path.Combine(ItemsByNamePath, "artists"); } } } diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index 5425e0b9a..54f513892 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -9,7 +9,7 @@ <projectUrl>https://github.com/MediaBrowser/MediaBrowser</projectUrl> <iconUrl>http://www.mb3admin.com/images/mb3icons1-1.png</iconUrl> <requireLicenseAcceptance>false</requireLicenseAcceptance> - <description>Contains common components shared by Media Browser Theatre and Media Browser Server. Not intended for plugin developer consumption.</description> + <description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description> <copyright>Copyright © Media Browser 2013</copyright> <dependencies> <dependency id="MediaBrowser.Common" version="3.0.113" /> @@ -20,6 +20,5 @@ </metadata> <files> <file src="dlls\MediaBrowser.Common.Implementations.dll" target="lib\net45\MediaBrowser.Common.Implementations.dll" /> - <file src="dlls\Mediabrowser.PluginSecurity.dll" target="lib\net45\Mediabrowser.PluginSecurity.dll" /> </files> </package>
\ No newline at end of file |
