public MediaInfo2(MediaWizardOptions options, string loc) { Options = options; FileCollection = new List <string>(); MediaFiles = new List <MediaFile>(); Overall = new MediaFile(loc, this.Source); // this could be a file path or a directory Location = loc; }
public MediaInfo2(MediaWizardOptions options, string loc) { Options = options; FileCollection = new List<string>(); MediaFiles = new List<MediaFile>(); Overall = new MediaFile(loc, this.Source); // this could be a file path or a directory this.Location = loc; }
public static MediaWizardOptions GetMediaType(List <string> FileOrDirPaths, bool silent = false) { MediaWizardOptions mwo = new MediaWizardOptions() { MediaTypeChoice = MediaType.MediaIndiv }; if (FileOrDirPaths.Count == 1 && File.Exists(FileOrDirPaths[0])) { mwo.MediaTypeChoice = MediaType.MediaIndiv; } else { bool bDirFound = false; int dirCount = 0; foreach (string fd in FileOrDirPaths) { if (Directory.Exists(fd)) { dirCount++; bDirFound = true; } if (dirCount > 1) { break; } } if (bDirFound && dirCount == 1) { string dir = FileOrDirPaths[0]; if (MediaIsDisc(dir)) { mwo.MediaTypeChoice = MediaType.MediaDisc; } else if (MediaIsAudio(dir)) { mwo.MediaTypeChoice = MediaType.MusicAudioAlbum; } else if (!silent) { mwo.ShowWizard = true; } } else if (!silent) // no dir found { mwo.ShowWizard = true; } } DebugHelper.WriteLine("Determined media type as: " + mwo.MediaTypeChoice.ToString()); return(mwo); }
public TaskSettings() { Profile = App.Settings.ProfileActive; PublishOptions = new PublishOptions(); MediaOptions = new MediaWizardOptions(); TorrentFolder = App.TorrentsDir; if (Media != null && Profile.TorrentsFolder == LocationType.ParentFolder) { TorrentFolder = Path.GetDirectoryName(Media.Location); } }
private static MediaWizardOptions ShowMediaWizard(ref MediaWizardOptions mwo, List<string> FileOrDirPaths) { MediaWizard mw = new MediaWizard(FileOrDirPaths); mwo.DialogResult = mw.ShowDialog(); if (mwo.DialogResult == DialogResult.OK) { mwo = mw.Options; } mwo.PromptShown = true; return mwo; }
public static MediaWizardOptions GetMediaType(List<string> FileOrDirPaths, bool silent = false) { MediaWizardOptions mwo = new MediaWizardOptions() { MediaTypeChoice = MediaType.MediaIndiv }; if (FileOrDirPaths.Count == 1 && File.Exists(FileOrDirPaths[0])) { mwo.MediaTypeChoice = MediaType.MediaIndiv; } else { bool bDirFound = false; int dirCount = 0; foreach (string fd in FileOrDirPaths) { if (Directory.Exists(fd)) { dirCount++; bDirFound = true; } if (dirCount > 1) break; } if (bDirFound && dirCount == 1) { string dir = FileOrDirPaths[0]; if (MediaIsDisc(dir)) { mwo.MediaTypeChoice = MediaType.MediaDisc; } else if (MediaIsAudio(dir)) { mwo.MediaTypeChoice = MediaType.MusicAudioAlbum; } else if (!silent) { mwo.ShowWizard = true; } } else if (!silent) // no dir found { mwo.ShowWizard = true; } } DebugHelper.WriteLine("Determined media type as: " + mwo.MediaTypeChoice.ToString()); return mwo; }
public static MediaWizardOptions GetMediaType(List<string> FileOrDirPaths, bool silent) { MediaWizardOptions mwo = new MediaWizardOptions() { MediaTypeChoice = MediaType.MediaIndiv }; bool showWizard = false; if (FileOrDirPaths.Count == 1 && File.Exists(FileOrDirPaths[0])) { mwo.MediaTypeChoice = MediaType.MediaIndiv; } else { bool bDirFound = false; int dirCount = 0; foreach (string fd in FileOrDirPaths) { if (Directory.Exists(fd)) { dirCount++; bDirFound = true; } if (dirCount > 1) break; } if (bDirFound) { if (dirCount == 1) { string dir = FileOrDirPaths[0]; if (MediaIsDisc(dir)) { mwo.MediaTypeChoice = MediaType.MediaDisc; } else if (MediaIsAudio(dir)) { mwo.MediaTypeChoice = MediaType.MusicAudioAlbum; } else if (!silent) { showWizard = true; } } } else if (!silent) // no dir found { showWizard = true; } } if (showWizard) { MediaWizard mw = new MediaWizard(FileOrDirPaths); mwo.DialogResultMy = mw.ShowDialog(); if (mwo.DialogResultMy == DialogResult.OK) { mwo = mw.Options; } mwo.PromptShown = true; } FileSystem.AppendDebug("Determined media type as: " + mwo.MediaTypeChoice.ToString()); return mwo; }
public static MediaWizardOptions GetMediaType(List <string> FileOrDirPaths, bool silent) { MediaWizardOptions mwo = new MediaWizardOptions() { MediaTypeChoice = MediaType.MediaIndiv }; bool showWizard = false; if (FileOrDirPaths.Count == 1 && File.Exists(FileOrDirPaths[0])) { mwo.MediaTypeChoice = MediaType.MediaIndiv; } else { bool bDirFound = false; int dirCount = 0; foreach (string fd in FileOrDirPaths) { if (Directory.Exists(fd)) { dirCount++; bDirFound = true; } if (dirCount > 1) { break; } } if (bDirFound) { if (dirCount == 1) { string dir = FileOrDirPaths[0]; if (MediaIsDisc(dir)) { mwo.MediaTypeChoice = MediaType.MediaDisc; } else if (MediaIsAudio(dir)) { mwo.MediaTypeChoice = MediaType.MusicAudioAlbum; } else if (!silent) { showWizard = true; } } } else if (!silent) // no dir found { showWizard = true; } } if (showWizard) { MediaWizard mw = new MediaWizard(FileOrDirPaths); mwo.DialogResultMy = mw.ShowDialog(); if (mwo.DialogResultMy == DialogResult.OK) { mwo = mw.Options; } mwo.PromptShown = true; } FileSystem.AppendDebug("Determined media type as: " + mwo.MediaTypeChoice.ToString()); return(mwo); }