public void UpdateGuideFavorites(string favorites) { // Just store body as data UserProfileSettings.GuideFavorites = ControllerContext.Request.Content.ReadAsStringAsync().Result ?? string.Empty; // And update UserProfileSettings.Update(); }
/// <summary> /// Aktualisiert die Einstellungen des Anwenders. /// </summary> public void Update() { // Direct copy UserProfileSettings.NoHibernateOnAbort = NoHibernateOnAbort; UserProfileSettings.BackToEPG = BackToGuideAfterAdd; UserProfileSettings.UseSubTitles = PreferSubtitles; UserProfileSettings.UseMP2 = PreferAllLanguages; UserProfileSettings.UseTTX = PreferVideotext; UserProfileSettings.UseAC3 = PreferDolby; // A bit more work on flag groups switch (DefaultSourceTypeSelector ?? string.Empty) { case "R": UserProfileSettings.Radio = true; UserProfileSettings.Television = false; break; case "T": UserProfileSettings.Radio = false; UserProfileSettings.Television = true; break; case "RT": UserProfileSettings.Radio = true; UserProfileSettings.Television = true; break; } switch (DefaultSourceEncryptionSelector ?? string.Empty) { case "F": UserProfileSettings.FreeTV = true; UserProfileSettings.PayTV = false; break; case "P": UserProfileSettings.FreeTV = false; UserProfileSettings.PayTV = true; break; case "FP": UserProfileSettings.FreeTV = true; UserProfileSettings.PayTV = true; break; } // Numbers are copied after check if (DaysToShowInPlan >= 1) { if (DaysToShowInPlan <= 50) { UserProfileSettings.DaysToShow = DaysToShowInPlan; } } if (RowsInRecentSources >= 1) { if (RowsInRecentSources <= 50) { UserProfileSettings.MaxRecentChannels = RowsInRecentSources; } } if (GuideStartEarly >= 0) { if (GuideStartEarly <= 240) { UserProfileSettings.EPGPreTime = GuideStartEarly; } } if (GuideEndLate >= 0) { if (GuideEndLate <= 240) { UserProfileSettings.EPGPostTime = GuideEndLate; } } if (RowsInGuide >= 10) { if (RowsInGuide <= 100) { UserProfileSettings.EPGEntries = RowsInGuide; } } // Store UserProfileSettings.Update(); }