private void GetServerSettings() { JMMServerBinary.Contract_ServerSettings contract = _clientBinaryHTTP.GetServerSettings(); // Language this.EpisodeTitleSource = (DataSourceType)contract.EpisodeTitleSource; this.SeriesDescriptionSource = (DataSourceType)contract.SeriesDescriptionSource; this.SeriesNameSource = (DataSourceType)contract.SeriesNameSource; }
private bool SaveServerSettings() { try { JMMServerBinary.Contract_ServerSettings contract = new JMMServerBinary.Contract_ServerSettings(); contract.AniDB_Username = this.AniDB_Username; contract.AniDB_Password = this.AniDB_Password; contract.AniDB_ServerAddress = this.AniDB_ServerAddress; contract.AniDB_ServerPort = this.AniDB_ServerPort; contract.AniDB_ClientPort = this.AniDB_ClientPort; contract.AniDB_AVDumpClientPort = this.AniDB_AVDumpClientPort; contract.AniDB_AVDumpKey = this.AniDB_AVDumpKey; contract.AniDB_DownloadRelatedAnime = this.AniDB_DownloadRelatedAnime; contract.AniDB_DownloadSimilarAnime = this.AniDB_DownloadSimilarAnime; contract.AniDB_DownloadReviews = this.AniDB_DownloadReviews; contract.AniDB_DownloadReleaseGroups = this.AniDB_DownloadReleaseGroups; contract.AniDB_MyList_AddFiles = this.AniDB_MyList_AddFiles; contract.AniDB_MyList_StorageState = this.AniDB_MyList_StorageState; contract.AniDB_MyList_DeleteType = (int)this.AniDB_MyList_DeleteType; contract.AniDB_MyList_ReadWatched = this.AniDB_MyList_ReadWatched; contract.AniDB_MyList_ReadUnwatched = this.AniDB_MyList_ReadUnwatched; contract.AniDB_MyList_SetWatched = this.AniDB_MyList_SetWatched; contract.AniDB_MyList_SetUnwatched = this.AniDB_MyList_SetUnwatched; contract.AniDB_Anime_UpdateFrequency = (int)this.AniDB_Anime_UpdateFrequency; contract.AniDB_Calendar_UpdateFrequency = (int)this.AniDB_Calendar_UpdateFrequency; contract.AniDB_MyList_UpdateFrequency = (int)this.AniDB_MyList_UpdateFrequency; contract.AniDB_MyListStats_UpdateFrequency = (int)this.AniDB_MyListStats_UpdateFrequency; contract.AniDB_File_UpdateFrequency = (int)this.AniDB_File_UpdateFrequency; contract.AniDB_DownloadCharacters = this.AniDB_DownloadCharacters; contract.AniDB_DownloadCreators = this.AniDB_DownloadCreators; // Web Cache contract.WebCache_Address = this.WebCache_Address; contract.WebCache_Anonymous = this.WebCache_Anonymous; contract.WebCache_TvDB_Get = this.WebCache_TvDB_Get; contract.WebCache_TvDB_Send = this.WebCache_TvDB_Send; contract.WebCache_Trakt_Get = this.WebCache_Trakt_Get; contract.WebCache_Trakt_Send = this.WebCache_Trakt_Send; contract.WebCache_MAL_Get = this.WebCache_MAL_Get; contract.WebCache_MAL_Send = this.WebCache_MAL_Send; contract.WebCache_XRefFileEpisode_Get = this.WebCache_XRefFileEpisode_Get; contract.WebCache_XRefFileEpisode_Send = this.WebCache_XRefFileEpisode_Send; contract.WebCache_UserInfo = this.WebCache_UserInfo; // TvDB contract.TvDB_AutoFanart = this.TvDB_AutoFanart; contract.TvDB_AutoFanartAmount = this.TvDB_AutoFanartAmount; contract.TvDB_AutoWideBanners = this.TvDB_AutoWideBanners; contract.TvDB_AutoWideBannersAmount = this.TvDB_AutoWideBannersAmount; contract.TvDB_AutoPosters = this.TvDB_AutoPosters; contract.TvDB_AutoPostersAmount = this.TvDB_AutoPostersAmount; contract.TvDB_UpdateFrequency = (int)this.TvDB_UpdateFrequency; contract.TvDB_Language = this.TvDB_Language; // MovieDB contract.MovieDB_AutoFanart = this.MovieDB_AutoFanart; contract.MovieDB_AutoFanartAmount = this.MovieDB_AutoFanartAmount; contract.MovieDB_AutoPosters = this.MovieDB_AutoPosters; contract.MovieDB_AutoPostersAmount = this.MovieDB_AutoPostersAmount; // Import settings contract.VideoExtensions = this.VideoExtensions; contract.Import_UseExistingFileWatchedStatus = this.UseEpisodeStatus; contract.AutoGroupSeries = this.AutoGroupSeries; contract.RunImportOnStart = this.RunImportOnStart; contract.ScanDropFoldersOnStart = this.ScanDropFoldersOnStart; contract.Hash_CRC32 = this.Hash_CRC32; contract.Hash_MD5 = this.Hash_MD5; contract.Hash_SHA1 = this.Hash_SHA1; // Language contract.LanguagePreference = this.LanguagePreference; contract.LanguageUseSynonyms = this.LanguageUseSynonyms; contract.EpisodeTitleSource = (int)this.EpisodeTitleSource; contract.SeriesDescriptionSource = (int)this.SeriesDescriptionSource; contract.SeriesNameSource = (int)this.SeriesNameSource; // trakt contract.Trakt_IsEnabled = this.Trakt_IsEnabled; contract.Trakt_AuthToken = this.Trakt_AuthToken; contract.Trakt_RefreshToken = this.Trakt_RefreshToken; contract.Trakt_TokenExpirationDate = this.Trakt_TokenExpirationDate; contract.Trakt_UpdateFrequency = (int)this.Trakt_UpdateFrequency; contract.Trakt_SyncFrequency = (int)this.Trakt_SyncFrequency; contract.Trakt_DownloadFanart = this.Trakt_DownloadFanart; contract.Trakt_DownloadPosters = this.Trakt_DownloadPosters; contract.Trakt_DownloadEpisodes = this.Trakt_DownloadEpisodes; // MAL contract.MAL_Username = this.MAL_Username; contract.MAL_Password = this.MAL_Password; contract.MAL_UpdateFrequency = (int)this.MAL_UpdateFrequency; contract.MAL_NeverDecreaseWatchedNums = this.MAL_NeverDecreaseWatchedNums; JMMServerBinary.Contract_ServerSettings_SaveResponse response = _clientBinaryHTTP.SaveServerSettings(contract); if (response.ErrorMessage.Length > 0) return false; else return true; } catch (Exception ex) { Utils.ShowErrorMessage(ex); return false; } }