Exemple #1
0
        /// <summary>
        /// Add scan result.
        /// </summary>
        /// <param name="episodeDetails">
        /// The episode details.
        /// </param>
        public static void AddScanResult(EpisodeDetails episodeDetails)
        {
            var seriesName = episodeDetails.SeriesName;

            var name   = seriesName;
            var check1 = (from s in Scan where s.Key.ToLower() == name.ToLower() select s.Key).SingleOrDefault();

            // Process Series
            if (check1 == null)
            {
                Scan.Add(seriesName, new ScanSeries());

                var check2 = (from s in SeriesNameList where s.SeriesName.ToLower() == seriesName.ToLower() select s.SeriesName.ToLower()).ToList();

                if (!check2.Contains(seriesName.ToLower()) && !string.IsNullOrEmpty(seriesName))
                {
                    string dir  = Directory.GetParent(episodeDetails.FilePath).Name;
                    string path = string.Empty;
                    if (dir.StartsWith("season", true, System.Globalization.CultureInfo.CurrentCulture))
                    {
                        // Looks like it. Qualified series guess
                        path = Directory.GetParent(episodeDetails.FilePath).Parent.FullName;
                    }
                    else
                    {
                        // Best guess
                        path = Directory.GetParent(episodeDetails.FilePath).FullName;
                    }

                    SeriesNameList.Add(
                        new SeriesListModel {
                        WaitingForScan = true, SeriesName = seriesName, SeriesPath = path
                    });
                }
            }
            else
            {
                seriesName = check1;
            }

            // Process Series
            if (!Scan[seriesName].Seasons.ContainsKey(episodeDetails.SeasonNumber))
            {
                Scan[seriesName].Seasons.Add(episodeDetails.SeasonNumber, new ScanSeason());
            }

            if (
                !Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes.ContainsKey(
                    episodeDetails.EpisodeNumber))
            {
                Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes.Add(
                    episodeDetails.EpisodeNumber, new ScanEpisode());
            }

            Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes[episodeDetails.EpisodeNumber].
            FilePath = episodeDetails.FilePath;

            if (episodeDetails.SecondaryNumbers.Count > 0)
            {
                foreach (int secondary in episodeDetails.SecondaryNumbers)
                {
                    if (
                        !Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes.ContainsKey(
                            secondary))
                    {
                        Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes.Add(
                            secondary, new ScanEpisode());
                    }

                    Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes[secondary].FilePath =
                        episodeDetails.FilePath;
                    Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes[secondary].Secondary =
                        true;
                    Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes[secondary].SecondaryTo
                        = episodeDetails.EpisodeNumber;
                }
            }

            var findList =
                (from s in MediaPathDBFactory.GetMediaPathTvUnsorted()
                 where s.PathAndFileName == episodeDetails.FilePath
                 select s).ToList();

            foreach (var path in findList)
            {
                MediaPathDBFactory.GetMediaPathTvUnsorted().Remove(path);
            }
        }
Exemple #2
0
        //Populate the script lists here.  Follow the example on how to add to a list
        #region Populate Lists
        /// <summary>
        /// Use this method to populate the lists.  They are already set to be selected from the
        /// CycleScripts method and no other work is required.
        /// </summary>
        public override void PopulateLists()
        {
            Account.Clear();
            ForgotUsername.Clear();
            SignIn.Clear();
            AccountCreation.Clear();
            Dashboard.Clear();
            Navigation.Clear();
            Scan.Clear();
            NoScan.Clear();
            TroubleShoot.Clear();
            base.PopulateLists();
            //MyCategory.Add(new TestCase(base.baseURL, base.webdriver, base.verificationErrors));

            Navigation.Add(new Kenwood_Navigation(base.baseURL, base.webdriver, base.verificationErrors));
            SignIn.Add(new Kenwood_SingInTest(base.baseURL, base.webdriver, base.verificationErrors));
            SignIn.Add(new Kenwood_SignInIndicationTest(base.baseURL, base.webdriver, base.verificationErrors));
            SignIn.Add(new Kenwood_SignOut_ValidationTest(base.baseURL, base.webdriver, base.verificationErrors));
            AccountCreation.Add(new TheKenwood_CreateAccount_NewUserTest(base.baseURL, base.webdriver, base.verificationErrors));
            AccountCreation.Add(new Kenwood_CreateAccount_ValidationTest(base.baseURL, base.webdriver, base.verificationErrors));
            ForgotUsername.Add(new Kenwood_ForgotUsername_ValidationTest(base.baseURL, base.webdriver, base.verificationErrors));
            Account.Add(new Kenwood_MyAccount_ValidationTest(base.baseURL, base.webdriver, base.verificationErrors));
            Account.Add(new Kenwood_MyAccount_OrderHistoryTest(base.baseURL, base.webdriver, base.verificationErrors));
            Account.Add(new Kenwood_MyAccount_TrafficSubscriptions_UnlockCodesTest(base.baseURL, base.webdriver, base.verificationErrors));
            Account.Add(new Kenwood_MyAccount_TrafficSubscriptions_ActivateSubscriptionTest(base.baseURL, base.webdriver, base.verificationErrors));
            Account.Add(new Kenwood_ActivateYourMap_Validation(base.baseURL, base.webdriver, base.verificationErrors));
            Account.Add(new Kenwood_ActivateYourMap_GetUnlockCode(base.baseURL, base.webdriver, base.verificationErrors));
            NoScan.Add(new Kenwood_NoScanSD_CheckAddToCart_TrafficService_UserNotLogged_Validation(base.baseURL, base.webdriver, base.verificationErrors));
            //NoScan.Add(new Kenwood_NoScanSD_CheckDeliveryOptions_Validation(base.baseURL, base.webdriver, base.verificationErrors));  //not working in FF to ID missing elements.
            NoScan.Add(new Kenwood_NoScanSD_CheckTheSoftwareUpdates(base.baseURL, base.webdriver, base.verificationErrors));
            NoScan.Add(new Kenwood_NoScanSD_CheckTrafficServices(base.baseURL, base.webdriver, base.verificationErrors));
            NoScan.Add(new Kenwood_NoScanSD_CheckLatestMapForKenwood(base.baseURL, base.webdriver, base.verificationErrors));
            NoScan.Add(new Kenwood_NoScanSD_OtherRegion_CheckTheSoftwareUpdates(base.baseURL, base.webdriver, base.verificationErrors));
            NoScan.Add(new Kenwood_NoScanSD_OtherRegion_CheckLatestMapForKenwood(base.baseURL, base.webdriver, base.verificationErrors));
            //NoScan.Add(new Kenwood_NoScanSD_CheckShippingAddress_Validation(base.baseURL, base.webdriver, base.verificationErrors)); //Not working in FF cannot ID
            NoScan.Add(new Kenwood_NoScanSD_CheckAddToCart_TrafficService_ExternalTrafficRec_CancelPressed(base.baseURL, base.webdriver, base.verificationErrors));
            NoScan.Add(new Kenwood_NoScanSD_CheckAddToCart_TrafficService_CancelPressed(base.baseURL, base.webdriver, base.verificationErrors));
            NoScan.Add(new Kenwood_NoScanSD_CheckShoppingCart_ForATrafficServcie_TryToUpdate(base.baseURL, base.webdriver, base.verificationErrors));
            NoScan.Add(new Kenwood_NoScanSD_CheckShoppingCart_ForATrafficServcie_ContinueShopping(base.baseURL, base.webdriver, base.verificationErrors));
            //NoScan.Add(new Kenwood_NoScanSD_CheckShoppingCart_ForATrafficServcie_ShippingValidation(base.baseURL, base.webdriver, base.verificationErrors));  //Not working in FF and cannot ID
            Scan.Add(new Kenwood_ScanSD_CheckAddToCart_TrafficService_DeviceAlreadyRegisteredToAnotherUser(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_ScanSD_CheckAddToCart_TrafficService_DeviceHasOnlyTrafficReceiveId(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_ScanSD_CheckLatestMap_DeviceRequieresUpdates_DNX9980_Validation(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_ScanSD_CheckLatestMap_DeviceRequieresUpdates_DNX7180_Validation(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_ScanSD_CheckShoppingCart_ForALatestMap_TryToUpdate(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_ScanSD_CheckShoppingCart_ForALatestMap_ContinueShopping(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_ScanSD_CheckShoppingCart_ForALatestMap_UserNotLogged_ShippingValidation(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_ScanSD_CheckShippingAddress_UpdateDetails_BackCart(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_ScanSD_CheckBillingAddress_Validation(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_ScanSD_PaymentInformation_Validation(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_ScanSD_WL_PaymentInfo_check(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_ScanSD_CheckMediaScanValidation(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_ScanSD_CheckTheSoftwareUpdates_FirmwareValidation(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_ScanSD_CheckRealTrafficSubscription(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_ScanSD_CheckTrafficServicesForKenwood(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_ScanSD_CheckLatestMapForKenwood(base.baseURL, base.webdriver, base.verificationErrors));
            Scan.Add(new Kenwood_Model(base.baseURL, base.webdriver, base.verificationErrors));
            Dashboard.Add(new Kenwood_OrderSummary_check(base.baseURL, base.webdriver, base.verificationErrors));
            TroubleShoot.Add(new Kenwood_CheckEach_NA_DeviceType_fortheProductUpdates(base.baseURL, base.webdriver, base.verificationErrors));
            Dashboard.Add(new Kenwood_CheckEach_EU_DeviceType_fortheProductUpdates(base.baseURL, base.webdriver, base.verificationErrors));
            Dashboard.Add(new Kenwood_CheckEach_Other_DeviceType_fortheProductUpdates(base.baseURL, base.webdriver, base.verificationErrors));
        }
Exemple #3
0
        /// <summary>
        /// Add scan result.
        /// </summary>
        /// <param name="episodeDetails">
        /// The episode details.
        /// </param>
        public static void AddScanResult(EpisodeDetails episodeDetails)
        {
            var seriesName = episodeDetails.SeriesName;

            var name   = seriesName;
            var check1 = (from s in Scan where s.Key.ToLower() == name.ToLower() select s.Key).SingleOrDefault();

            // Process Series
            if (check1 == null)
            {
                Scan.Add(seriesName, new ScanSeries());

                var check2 = (from s in SeriesNameList where s.SeriesName.ToLower() == seriesName.ToLower() select s.SeriesName.ToLower()).ToList();

                if (!check2.Contains(seriesName.ToLower()))
                {
                    SeriesNameList.Add(
                        new SeriesListModel {
                        WaitingForScan = true, SeriesName = seriesName
                    });
                }
            }
            else
            {
                seriesName = check1;
            }

            // Process Series
            if (!Scan[seriesName].Seasons.ContainsKey(episodeDetails.SeasonNumber))
            {
                Scan[seriesName].Seasons.Add(episodeDetails.SeasonNumber, new ScanSeason());
            }

            if (
                !Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes.ContainsKey(
                    episodeDetails.EpisodeNumber))
            {
                Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes.Add(
                    episodeDetails.EpisodeNumber, new ScanEpisode());
            }

            Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes[episodeDetails.EpisodeNumber].
            FilePath = episodeDetails.FilePath;

            if (episodeDetails.SecondaryNumbers.Count > 0)
            {
                foreach (int secondary in episodeDetails.SecondaryNumbers)
                {
                    if (
                        !Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes.ContainsKey(
                            secondary))
                    {
                        Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes.Add(
                            secondary, new ScanEpisode());
                    }

                    Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes[secondary].FilePath =
                        episodeDetails.FilePath;
                    Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes[secondary].Secondary =
                        true;
                    Scan[seriesName].Seasons[episodeDetails.SeasonNumber].Episodes[secondary].SecondaryTo
                        = episodeDetails.EpisodeNumber;
                }
            }

            var findList =
                (from s in MediaPathDBFactory.GetMediaPathTvUnsorted()
                 where s.PathAndFileName == episodeDetails.FilePath
                 select s).ToList();

            foreach (var path in findList)
            {
                MediaPathDBFactory.GetMediaPathTvUnsorted().Remove(path);
            }
        }