mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
fix repeated errors when server has only readonly access
This commit is contained in:
parent
e1ea92890d
commit
98020809c8
@ -532,9 +532,16 @@ namespace MediaBrowser.Server.Implementations.IO
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In order to determine if the file is being written to, we have to request write access
|
||||||
|
// But if the server only has readonly access, this is going to cause this entire algorithm to fail
|
||||||
|
// So we'll take a best guess about our access level
|
||||||
|
var requestedFileAccess = ConfigurationManager.Configuration.SaveLocalMeta
|
||||||
|
? FileAccess.ReadWrite
|
||||||
|
: FileAccess.Read;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (_fileSystem.GetFileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite))
|
using (_fileSystem.GetFileStream(path, FileMode.Open, requestedFileAccess, FileShare.ReadWrite))
|
||||||
{
|
{
|
||||||
if (_updateTimer != null)
|
if (_updateTimer != null)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user