Compare commits

..

2 Commits

Author SHA1 Message Date
孙诚
f3a1b8be3f Remove redundant code for setting file permissions in ChineseNfoRegistry
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 12s
Docker Build & Deploy / Deploy to Production (push) Successful in 3s
2025-03-19 14:54:23 +08:00
孙诚
a685a324b6 Add process to set read/write permissions for files in ChineseNfoRegistry 2025-03-19 14:54:08 +08:00

View File

@@ -1,3 +1,4 @@
using System.Diagnostics;
using System.Net; using System.Net;
using System.Text.Json.Nodes; using System.Text.Json.Nodes;
using System.Xml; using System.Xml;
@@ -63,6 +64,21 @@ public class ChineseNfoRegistry : Registry, IChineseNfoRegistry
var failedCount = 0; var failedCount = 0;
var skippedCount = 0; var skippedCount = 0;
// 使用 chmod -R 666 设置全部文件的读写权限
var permission = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "chmod",
Arguments = "-R 666 " + tvFolder,
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
}
};
permission.Start();
// 扫描 tvshow.nfo 文件 // 扫描 tvshow.nfo 文件
var tvShowFiles = Directory.GetFiles(tvFolder, "tvshow.nfo", SearchOption.AllDirectories); var tvShowFiles = Directory.GetFiles(tvFolder, "tvshow.nfo", SearchOption.AllDirectories);
@@ -230,14 +246,6 @@ public class ChineseNfoRegistry : Registry, IChineseNfoRegistry
try try
{ {
// 尝试放开Linux文件的读写权限
var fileInfo = new FileInfo(episodeFile)
{
Attributes = FileAttributes.Normal,
IsReadOnly = false
};
fileInfo.Refresh();
episodeXml.Save(episodeFile); episodeXml.Save(episodeFile);
} }
catch (Exception e) catch (Exception e)