private string getDestinationPath(string filePath) { string folder = Path.GetDirectoryName(filePath); string name = Path.GetFileName(filePath); if (QiyiFolder.IsQiyiFolder(folder)) { QiyiFolder qyFolder = new QiyiFolder(folder); QiyiConfig config = qyFolder.Config; name = config.Title + Path.GetExtension(name).ToLower(); if (this.rootPath != null) { name = Path.Combine(config.Series, name); } } //without specifying rootPath, it mean keep the files in its own place if (this.rootPath == null) { return(Path.Combine(folder, name)); } else { return(Path.Combine(this.rootPath, name)); } }
public static bool IsQiyiFolder(string folderPath) { if (!Directory.Exists(folderPath)) { return(false); } QiyiFolder folder = new QiyiFolder(folderPath); return(File.Exists(folder.QsvFilePath) && File.Exists(folder.ConfigFilePath)); }
private bool isQsvInFolder(DirectoryInfo dirInfo) { if (dirInfo.GetFiles("*.qsv").Length > 0) { return(true); } foreach (DirectoryInfo subdirInfo in dirInfo.GetDirectories()) { if (QiyiFolder.IsQiyiFolder(subdirInfo.FullName)) { return(true); } } return(false); }