diff --git a/Emby.Common.Implementations/IO/ManagedFileSystem.cs b/Emby.Common.Implementations/IO/ManagedFileSystem.cs index 62d285072c..78070a5d91 100644 --- a/Emby.Common.Implementations/IO/ManagedFileSystem.cs +++ b/Emby.Common.Implementations/IO/ManagedFileSystem.cs @@ -490,38 +490,13 @@ namespace Emby.Common.Implementations.IO var temp1 = Path.GetTempFileName(); // Copying over will fail against hidden files - RemoveHiddenAttribute(file1); - RemoveHiddenAttribute(file2); + SetHidden(file1, false); + SetHidden(file2, false); CopyFile(file1, temp1, true); CopyFile(file2, file1, true); CopyFile(temp1, file2, true); - - DeleteFile(temp1); - } - - /// - /// Removes the hidden attribute. - /// - /// The path. - private void RemoveHiddenAttribute(string path) - { - if (string.IsNullOrEmpty(path)) - { - throw new ArgumentNullException("path"); - } - - var currentFile = new FileInfo(path); - - // This will fail if the file is hidden - if (currentFile.Exists) - { - if ((currentFile.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden) - { - currentFile.Attributes &= ~FileAttributes.Hidden; - } - } } public bool ContainsSubPath(string parentPath, string path) diff --git a/Emby.Server.Implementations/Connect/ConnectManager.cs b/Emby.Server.Implementations/Connect/ConnectManager.cs index b7faaa9013..8c8b7b0268 100644 --- a/Emby.Server.Implementations/Connect/ConnectManager.cs +++ b/Emby.Server.Implementations/Connect/ConnectManager.cs @@ -570,9 +570,9 @@ namespace Emby.Server.Implementations.Connect } catch (HttpException ex) { - if (!ex.StatusCode.HasValue) + if (!ex.StatusCode.HasValue || ex.IsTimedOut) { - throw; + throw new Exception("Unable to invite guest, " + ex.Message, ex); } // If they entered a username, then whatever the error is just throw it, for example, user not found diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index ae21651918..7ee0c566f7 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -424,6 +424,9 @@ + + +