public BulkAddEditMovie([NotNull] PossibleNewMovie hint)
        {
            InitializeComponent();

            codeFinderControl = new CombinedCodeFinder("", MediaConfiguration.MediaType.movie, TVSettings.Instance.DefaultMovieProvider)
            {
                Dock = DockStyle.Fill
            };
            codeFinderControl.SelectionChanged      += CodeChanged;
            codeFinderControl.lvMatches.DoubleClick += MatchDoubleClick;

            label1.Text = $"Search for {TVSettings.Instance.DefaultMovieProvider} entry, by partial name or ID:";

            pnlCF.SuspendLayout();
            pnlCF.Controls.Add(codeFinderControl);
            pnlCF.ResumeLayout();

            if (hint.CodeKnown)
            {
                codeFinderControl.SetHint(hint.ProviderCode.ToString(), hint.Provider);
            }
            else
            {
                codeFinderControl.SetHint(string.IsNullOrWhiteSpace(hint.RefinedHint)
                    ? hint.Directory.Name
                    : hint.RefinedHint, TVSettings.Instance.DefaultMovieProvider);
            }
            Code     = -1;
            Provider = TVDoc.ProviderType.libraryDefault;
        }
Beispiel #2
0
        public BulkAddEditShow([NotNull] PossibleNewTvShow hint)
        {
            InitializeComponent();

            codeFinderControl = new CombinedCodeFinder("", MediaConfiguration.MediaType.tv, TVSettings.Instance.DefaultProvider)
            {
                Dock = DockStyle.Fill
            };
            codeFinderControl.SelectionChanged      += CodeChanged;
            codeFinderControl.lvMatches.DoubleClick += MatchDoubleClick;
            label1.Text = $"Search for {TVSettings.Instance.DefaultProvider.PrettyPrint()} entry, by partial name or ID:";

            pnlCF.SuspendLayout();
            pnlCF.Controls.Add(codeFinderControl);
            pnlCF.ResumeLayout();

            if (hint.CodeKnown)
            {
                codeFinderControl.SetHint(hint.ProviderCode.ToString(), hint.Provider);
            }
            else
            {
                string s = hint.Folder.FullName;
                int    p = s.LastIndexOf(System.IO.Path.DirectorySeparatorChar);
                codeFinderControl.SetHint(string.IsNullOrWhiteSpace(hint.RefinedHint)
                    ? s.Substring(p + 1)
                    : hint.RefinedHint, TVDoc.ProviderType.libraryDefault);
            }
            Code = -1;
        }
Beispiel #3
0
        public FolderMonitorEdit([NotNull] PossibleNewTvShow hint)
        {
            InitializeComponent();

            codeFinderControl = new CombinedCodeFinder("", MediaConfiguration.MediaType.tv, TVDoc.ProviderType.TheTVDB)
            {
                Dock = DockStyle.Fill
            };
            codeFinderControl.SelectionChanged      += CodeChanged;
            codeFinderControl.lvMatches.DoubleClick += MatchDoubleClick;

            pnlCF.SuspendLayout();
            pnlCF.Controls.Add(codeFinderControl);
            pnlCF.ResumeLayout();

            if (hint.CodeKnown)
            {
                codeFinderControl.SetHint(hint.TVDBCode.ToString());
            }
            else
            {
                string s = hint.Folder.FullName;
                int    p = s.LastIndexOf(System.IO.Path.DirectorySeparatorChar);
                codeFinderControl.SetHint(string.IsNullOrWhiteSpace(hint.RefinedHint)
                    ? s.Substring(p + 1)
                    : hint.RefinedHint);
            }
            Code = -1;
        }
Beispiel #4
0
        public BulkAddEditMovie([NotNull] PossibleNewMovie hint)
        {
            InitializeComponent();

            codeFinderControl = new CombinedCodeFinder("", MediaConfiguration.MediaType.movie, TVDoc.ProviderType.TMDB)
            {
                Dock = DockStyle.Fill
            };
            codeFinderControl.SelectionChanged      += CodeChanged;
            codeFinderControl.lvMatches.DoubleClick += MatchDoubleClick;

            pnlCF.SuspendLayout();
            pnlCF.Controls.Add(codeFinderControl);
            pnlCF.ResumeLayout();

            if (hint.CodeKnown)
            {
                codeFinderControl.SetHint(hint.TMDBCode.ToString()); //todo make generic
            }
            else
            {
                codeFinderControl.SetHint(string.IsNullOrWhiteSpace(hint.RefinedHint)
                    ? hint.Directory.Name
                    : hint.RefinedHint);
            }
            Code = -1;
        }
Beispiel #5
0
        public AutoAddMedia(string hint, FileInfo file, bool assumeMovie)
        {
            InitializeComponent();
            ShowConfiguration  = new ShowConfiguration();
            MovieConfiguration = new MovieConfiguration();

            this.assumeMovie = assumeMovie;

            lblFileName.Text = "Filename: " + file.FullName;


            tvCodeFinder = new CombinedCodeFinder("", MediaConfiguration.MediaType.tv, TVDoc.ProviderType.libraryDefault)
            {
                Dock = DockStyle.Fill
            };
            movieCodeFinder = new CombinedCodeFinder("", MediaConfiguration.MediaType.movie, TVDoc.ProviderType.libraryDefault)
            {
                Dock = DockStyle.Fill
            };

            tvCodeFinder.SelectionChanged    += MTCCF_SelectionChanged;
            movieCodeFinder.SelectionChanged += MTCCF_SelectionChanged;

            SingleTvShowFound = tvCodeFinder.SetHint(hint, TVSettings.Instance.DefaultProvider) && TVSettings.Instance.DefShowAutoFolders && TVSettings.Instance.DefShowUseDefLocation;
            SingleMovieFound  = movieCodeFinder.SetHint(hint, TVSettings.Instance.DefaultMovieProvider) && TVSettings.Instance.DefMovieDefaultLocation.HasValue() && TVSettings.Instance.DefMovieUseDefaultLocation && assumeMovie;

            originalHint = hint;

            if (SingleTvShowFound)
            {
                string filenameFriendly = TVSettings.Instance.FilenameFriendly(FileHelper.MakeValidPath(tvCodeFinder.TvShowInitialFound.Name));
                SetShowItem(tvCodeFinder.TvShowInitialFoundCode, tvCodeFinder.Source, TVSettings.Instance.DefShowLocation + System.IO.Path.DirectorySeparatorChar + filenameFriendly);
                if (ShowConfiguration.Code == -1)
                {
                    SetShowItem();
                }
            }
            if (SingleMovieFound)
            {
                SetMovieItem(movieCodeFinder.MovieInitialFoundCode, movieCodeFinder.Source, TVSettings.Instance.DefMovieDefaultLocation);
                if (MovieConfiguration.Code == -1)
                {
                    SetMovieItem();
                }
            }

            pnlCF.SuspendLayout();
            pnlCF.Controls.Add(tvCodeFinder);
            pnlCF.ResumeLayout();

            panel1.SuspendLayout();
            panel1.Controls.Add(movieCodeFinder);
            panel1.ResumeLayout();

            UpdateDirectoryDropDown(cbDirectory, TVSettings.Instance.LibraryFolders, TVSettings.Instance.DefShowLocation, TVSettings.Instance.DefShowAutoFolders && TVSettings.Instance.DefShowUseDefLocation, tpTV);
            UpdateDirectoryDropDown(cbMovieDirectory, TVSettings.Instance.MovieLibraryFolders, TVSettings.Instance.DefMovieDefaultLocation, true, tpMovie);
        }
Beispiel #6
0
        public AddEditMovie([NotNull] MovieConfiguration si, TVDoc doc)
        {
            selectedShow  = si;
            mDoc          = doc;
            addingNewShow = si.TvdbCode == -1;
            InitializeComponent();

            SetupDropDowns(si);

            lblSeasonWordPreview.Text = TVSettings.Instance.MovieFolderFormat + "-(" +
                                        CustomMovieName.NameFor(si,
                                                                TVSettings.Instance.MovieFolderFormat) + ")";

            lblSeasonWordPreview.ForeColor = Color.DarkGray;

            codeFinderForm =
                new CombinedCodeFinder(si.TmdbCode != -1 ? si.TmdbCode.ToString() : "", MediaConfiguration.MediaType.movie, si.Provider)
            {
                Dock = DockStyle.Fill
            };

            codeFinderForm.SelectionChanged += MTCCF_SelectionChanged;

            pnlCF.SuspendLayout();
            pnlCF.Controls.Add(codeFinderForm);
            pnlCF.ResumeLayout();

            cntfw = null;
            chkCustomShowName.Checked = si.UseCustomShowName;
            if (chkCustomShowName.Checked)
            {
                txtCustomShowName.Text = si.CustomShowName;
            }

            chkCustomRegion.Checked = selectedShow.UseCustomRegion;
            cbRegion.Text           = selectedShow.CustomRegionCode;

            UpdateCustomShowNameEnabled();

            SetupLanguages(si);

            cbDoRenaming.Checked     = si.DoRename;
            cbDoMissingCheck.Checked = si.DoMissingCheck;

            SetProvider(si);
            chkManualFolders.Checked = selectedShow.UseManualLocations;
            chkAutoFolders.Checked   = selectedShow.UseAutomaticFolders;
            PopulateRootDirectories(selectedShow.AutomaticFolderRoot);
            txtFolderNameFormat.Text            = selectedShow.CustomFolderNameFormat;
            txtCustomMovieFileNamingFormat.Text = selectedShow.CustomNamingFormat;
            cbUseCustomNamingFormat.Checked     = selectedShow.UseCustomNamingFormat;

            ActiveControl = codeFinderForm; // set initial focus to the code entry/show finder control

            foreach (string folder in selectedShow.ManualLocations)
            {
                lvManualFolders.Items.Add(folder);
            }

            PopulateAliasses();
            SetTagListText();
            EnableDisableCustomNaming();
            UpdateIgnore();
            SetMovieFolderType(si);
        }
Beispiel #7
0
        public AddEditShow([NotNull] ShowConfiguration si, TVDoc doc)
        {
            selectedShow          = si;
            mDoc                  = doc;
            sampleProcessedSeason = si.GetFirstAvailableSeason();
            sampleEpisode         = si.GetFirstAvailableEpisode();
            addingNewShow         = (si.TvdbCode == -1 && si.TmdbCode == -1 && si.TVmazeCode == -1);
            InitializeComponent();

            if (sampleProcessedSeason != null)
            {
                lblSeasonWordPreview.Text = TVSettings.Instance.SeasonFolderFormat + "-(" +
                                            CustomSeasonName.NameFor(sampleProcessedSeason,
                                                                     TVSettings.Instance.SeasonFolderFormat) + ")";
            }
            else
            {
                lblSeasonWordPreview.Text = TVSettings.Instance.SeasonFolderFormat;
            }

            lblSeasonWordPreview.ForeColor = Color.DarkGray;

            SetupDropDowns(si);

            codeFinderForm = new CombinedCodeFinder(si.Code != -1 ? si.Code.ToString() : "", MediaConfiguration.MediaType.tv, si.Provider)
            {
                Dock = DockStyle.Fill
            };

            codeFinderForm.SelectionChanged += MTCCF_SelectionChanged;

            pnlCF.SuspendLayout();
            pnlCF.Controls.Add(codeFinderForm);
            pnlCF.ResumeLayout();

            cntfw = null;
            chkCustomShowName.Checked = si.UseCustomShowName;
            if (chkCustomShowName.Checked)
            {
                txtCustomShowName.Text = si.CustomShowName;
            }

            UpdateCustomShowNameEnabled();

            SetupLanguages(si);

            cbSequentialMatching.Checked = si.UseSequentialMatch;
            cbAirdateMatching.Checked    = si.UseAirDateMatch;
            cbEpNameMatching.Checked     = si.UseEpNameMatch;

            chkShowNextAirdate.Checked = si.ShowNextAirdate;
            chkSpecialsCount.Checked   = si.CountSpecials;
            txtBaseFolder.Text         = si.AutoAddFolderBase;

            cbDoRenaming.Checked     = si.DoRename;
            cbDoMissingCheck.Checked = si.DoMissingCheck;
            cbDoMissingCheck_CheckedChanged(null, null);

            SetAutoAdd(si);
            SetProvider(si);

            txtSeasonFormat.Text = si.AutoAddCustomFolderFormat;

            chkDVDOrder.Checked           = si.DvdOrder;
            cbIncludeFuture.Checked       = si.ForceCheckFuture;
            cbIncludeNoAirdate.Checked    = si.ForceCheckNoAirdate;
            chkReplaceAutoFolders.Checked = si.ManualFoldersReplaceAutomatic;

            SetIgnoreSeasons(si);

            SetManualFolders(si);

            CheckToEnableAddButton();
            txtFolder_TextChanged();

            ActiveControl = codeFinderForm; // set initial focus to the code entry/show finder control

            PopulateAliasses();
            SetTagListText();

            cbUseCustomSearch.Checked       = si.UseCustomSearchUrl && !string.IsNullOrWhiteSpace(si.CustomSearchUrl);
            cbUseCustomNamingFormat.Checked = si.UseCustomNamingFormat && !string.IsNullOrWhiteSpace(si.CustomNamingFormat);

            txtSearchURL.Text = si.CustomSearchUrl;
            txtCustomEpisodeNamingFormat.Text = si.CustomNamingFormat;

            EnableDisableCustomSearch();
            EnableDisableCustomNaming();
            UpdateIgnore();
        }