示例#1
0
        private void AddToLibrary([NotNull] PossibleNewTvShow ai)
        {
            // see if there is a matching show item
            ShowConfiguration found = mDoc.TvLibrary.GetShowItem(ai.ProviderCode, ai.Provider);

            if (found is null)
            {
                // need to add a new showitem
                found = new ShowConfiguration(ai.ProviderCode, ai.Provider);
                mDoc.Add(found);
            }

            found.AutoAddFolderBase = ai.Folder.FullName;

            if (ai.HasSeasonFoldersGuess)
            {
                found.AutoAddType = ai.SeasonFolderFormat == TVSettings.Instance.SeasonFolderFormat
                    ? ShowConfiguration.AutomaticFolderType.libraryDefault
                    : ShowConfiguration.AutomaticFolderType.custom;

                found.AutoAddCustomFolderFormat = ai.SeasonFolderFormat;
            }
            else
            {
                found.AutoAddType = ShowConfiguration.AutomaticFolderType.baseOnly;
            }

            mDoc.Stats().AutoAddedShows++;
        }