Exemple #1
0
        public ActionResult TestAniDB()
        {
            if (ServerState.Instance.ServerOnline || ServerState.Instance.ServerStarting)
            {
                return(APIStatus.BadRequest("You may only do this before server init"));
            }

            ShokoService.AnidbProcessor.ForceLogout();
            ShokoService.AnidbProcessor.CloseConnections();

            Thread.Sleep(1000);

            Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(ServerSettings.Instance.Culture);

            ShokoService.AnidbProcessor.Init(ServerSettings.Instance.AniDb.Username, ServerSettings.Instance.AniDb.Password,
                                             ServerSettings.Instance.AniDb.ServerAddress,
                                             ServerSettings.Instance.AniDb.ServerPort, ServerSettings.Instance.AniDb.ClientPort);

            if (!ShokoService.AnidbProcessor.Login())
            {
                return(APIStatus.Unauthorized());
            }
            ShokoService.AnidbProcessor.ForceLogout();

            return(APIStatus.OK());
        }
Exemple #2
0
        public ActionResult TestAniDB()
        {
            ShokoService.AnidbProcessor.ForceLogout();
            ShokoService.AnidbProcessor.CloseConnections();

            Thread.Sleep(1000);

            Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(ServerSettings.Instance.Culture);

            ShokoService.AnidbProcessor.Init(ServerSettings.Instance.AniDb.Username, ServerSettings.Instance.AniDb.Password,
                                             ServerSettings.Instance.AniDb.ServerAddress,
                                             ServerSettings.Instance.AniDb.ServerPort, ServerSettings.Instance.AniDb.ClientPort);

            if (ShokoService.AnidbProcessor.Login())
            {
                ShokoService.AnidbProcessor.ForceLogout();
                return(APIStatus.OK());
            }

            return(APIStatus.Unauthorized());
        }
Exemple #3
0
 /// <summary>
 /// Create AuthToken and RefreshToken from PIN
 /// </summary>
 /// <returns></returns>
 private object CreateTrakt()
 {
     return(TraktTVHelper.EnterTraktPIN(ServerSettings.Trakt_PIN) == "Success"
         ? APIStatus.OK()
         : APIStatus.Unauthorized());
 }
Exemple #4
0
 /// <summary>
 /// Test MAL Creditionals against MAL
 /// </summary>
 /// <returns></returns>
 private object TestMAL()
 {
     return(MALHelper.VerifyCredentials()
         ? APIStatus.OK()
         : APIStatus.Unauthorized());
 }