diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2019-06-08 23:53:35 -0400 |
|---|---|---|
| committer | Joshua M. Boniface <joshua@boniface.me> | 2019-06-08 23:54:26 -0400 |
| commit | d1d0ddf62f75d7b49aa3f585d3ad8e54821d2d04 (patch) | |
| tree | 710ee4a73d7ec30c7286f47c9338e8df72a4cfa6 | |
| parent | 2d011b781e8a696bb6dc6cf355d19463f6b9cdb3 (diff) | |
Use the username for the user config path
Use the username to construct the UserConfigurationDirectory,
instead of the user ID, and move the old ID-based path to the new
path if needed when loading (temporary transitional code). Removes
administrator guesswork as to what user each directory belongs to,
which I found very annoying when investigating user configs.
| -rw-r--r-- | MediaBrowser.Controller/Entities/User.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs index 0d5f508dd..9952ba418 100644 --- a/MediaBrowser.Controller/Entities/User.cs +++ b/MediaBrowser.Controller/Entities/User.cs @@ -228,7 +228,15 @@ namespace MediaBrowser.Controller.Entities return System.IO.Path.Combine(ConfigurationManager.ApplicationPaths.UserConfigurationDirectoryPath, safeFolderName); } - return System.IO.Path.Combine(parentPath, Id.ToString("N")); + // TODO: Remove idPath and just use usernamePath for future releases + var usernamePath = System.IO.Path.Combine(parentPath, username); + var idPath = System.IO.Path.Combine(parentPath, Id.ToString("N")); + if (!Directory.Exists(usernamePath) && Directory.Exists(idPath)) + { + Directory.Move(idPath, usernamePath); + } + + return usernamePath; } public bool IsParentalScheduleAllowed() |
