diff --git a/src/Service/Jobs/ChineseNfoRegistry.cs b/src/Service/Jobs/ChineseNfoRegistry.cs index dd7805d..56429c1 100644 --- a/src/Service/Jobs/ChineseNfoRegistry.cs +++ b/src/Service/Jobs/ChineseNfoRegistry.cs @@ -64,20 +64,14 @@ public class ChineseNfoRegistry : Registry, IChineseNfoRegistry var failedCount = 0; var skippedCount = 0; - // 使用 chmod -R 666 设置全部文件的读写权限 - var permission = new Process + // 使用 root 角色执行 chmod -R 666 设置全部文件的读写权限 + var permission = new ProcessStartInfo("sudo", "chmod -R 666 " + tvFolder) { - StartInfo = new ProcessStartInfo - { - FileName = "chmod", - Arguments = "-R 666 " + tvFolder, - RedirectStandardOutput = true, - UseShellExecute = false, - CreateNoWindow = true - } + CreateNoWindow = true, + UseShellExecute = false }; + Process.Start(permission); - permission.Start(); // 扫描 tvshow.nfo 文件 var tvShowFiles = Directory.GetFiles(tvFolder, "tvshow.nfo", SearchOption.AllDirectories);