Exemplo n.º 1
0
        protected virtual void InitRestClients()
        {
            RestClient = new RestClient(RootUrl + "api/");
            RestClient.AddDefaultHeader("Authentication", ApiKey);
            RestClient.AddDefaultHeader("X-Api-Key", ApiKey);

            Blacklist         = new ClientBase <BlacklistResource>(RestClient, ApiKey);
            Commands          = new CommandClient(RestClient, ApiKey);
            DownloadClients   = new DownloadClientClient(RestClient, ApiKey);
            Episodes          = new EpisodeClient(RestClient, ApiKey);
            History           = new ClientBase <HistoryResource>(RestClient, ApiKey);
            HostConfig        = new ClientBase <HostConfigResource>(RestClient, ApiKey, "config/host");
            Indexers          = new IndexerClient(RestClient, ApiKey);
            Logs              = new LogsClient(RestClient, ApiKey);
            NamingConfig      = new ClientBase <NamingConfigResource>(RestClient, ApiKey, "config/naming");
            Notifications     = new NotificationClient(RestClient, ApiKey);
            Profiles          = new ClientBase <ProfileResource>(RestClient, ApiKey);
            Releases          = new ReleaseClient(RestClient, ApiKey);
            ReleasePush       = new ReleasePushClient(RestClient, ApiKey);
            RootFolders       = new ClientBase <RootFolderResource>(RestClient, ApiKey);
            Series            = new SeriesClient(RestClient, ApiKey);
            Tags              = new ClientBase <TagResource>(RestClient, ApiKey);
            WantedMissing     = new ClientBase <EpisodeResource>(RestClient, ApiKey, "wanted/missing");
            WantedCutoffUnmet = new ClientBase <EpisodeResource>(RestClient, ApiKey, "wanted/cutoff");
        }
Exemplo n.º 2
0
 private void InitRestClients()
 {
     RestClient   = new RestClient("http://localhost:8989/api");
     Series       = new SeriesClient(RestClient);
     Releases     = new ReleaseClient(RestClient);
     RootFolders  = new ClientBase <RootFolderResource>(RestClient);
     Commands     = new ClientBase <CommandResource>(RestClient);
     History      = new ClientBase <HistoryResource>(RestClient);
     Indexers     = new IndexerClient(RestClient);
     Episodes     = new EpisodeClient(RestClient);
     NamingConfig = new ClientBase <NamingConfigResource>(RestClient, "config/naming");
 }
Exemplo n.º 3
0
 private void InitRestClients()
 {
     RestClient = new RestClient("http://localhost:8989/api");
     Series = new SeriesClient(RestClient, _runner.ApiKey);
     Releases = new ReleaseClient(RestClient, _runner.ApiKey);
     RootFolders = new ClientBase<RootFolderResource>(RestClient, _runner.ApiKey);
     Commands = new ClientBase<CommandResource>(RestClient, _runner.ApiKey);
     History = new ClientBase<HistoryResource>(RestClient, _runner.ApiKey);
     Indexers = new IndexerClient(RestClient, _runner.ApiKey);
     Episodes = new EpisodeClient(RestClient, _runner.ApiKey);
     NamingConfig = new ClientBase<NamingConfigResource>(RestClient, _runner.ApiKey, "config/naming");
 }
Exemplo n.º 4
0
 private void InitRestClients()
 {
     RestClient    = new RestClient(RootUrl + "api/");
     Series        = new SeriesClient(RestClient, _runner.ApiKey);
     Releases      = new ReleaseClient(RestClient, _runner.ApiKey);
     RootFolders   = new ClientBase <RootFolderResource>(RestClient, _runner.ApiKey);
     Commands      = new ClientBase <CommandResource>(RestClient, _runner.ApiKey);
     History       = new ClientBase <HistoryResource>(RestClient, _runner.ApiKey);
     Indexers      = new IndexerClient(RestClient, _runner.ApiKey);
     Episodes      = new EpisodeClient(RestClient, _runner.ApiKey);
     NamingConfig  = new ClientBase <NamingConfigResource>(RestClient, _runner.ApiKey, "config/naming");
     Notifications = new NotificationClient(RestClient, _runner.ApiKey);
 }
        public async Task LoadMore()
        {
            if (!IsLoading)
            {
                IsLoading = true;

                StateHasChanged();

                //await Task.Delay(1000);
                EpisodeResponse ep = await _data.GetEpisodes(PageSize, PageNumber);

                if (ep == null)
                {
                    return;
                }
                for (int j = 0; j < ep.Data.Count; j++)
                {
                    EpisodeClient episodeClient = new EpisodeClient(ep.Data[j]);
                    episodeClient.AnimationDelay = _cssDelay + j * 100;

                    Episodes.Add(episodeClient);

                    if (Episodes[Episodes.Count - 1].Image == null || Episodes[Episodes.Count - 1].Image == "")
                    {
                        Episodes[Episodes.Count - 1].Image = "assets/WhiteThemenschaedel.png";
                        if (random.Next(1, 10001) > 9995)
                        {
                            Episodes[Episodes.Count - 1].Image = "assets/WhiteThemenschaedel3.png";
                        }
                        if (random.Next(1, 10001) > 9900)
                        {
                            Episodes[Episodes.Count - 1].Image = "assets/WhiteThemenschaedel2.png";
                        }
                    }
                }

                PageNumber++;

                IsLoading = false;

                StateHasChanged();


                //at the end of pages or results stop loading anymore
                if (PageNumber > ep.Meta.EpisodeMaxPageCount)
                {
                    await StopListener();
                }
            }
        }
Exemplo n.º 6
0
        public TheTvDbClient(string apiKey, string userkey = "", string username = "")
        {
            HttpClient = new RestClient("https://api.thetvdb.com/");

            Language = Languages.En;

            _authenticationClient = new AuthenticationClient(this);
            _authenticationClient.Login(apiKey, userkey, username);

            SearchClient  = new SearchClient(this);
            SeriesClient  = new SeriesClient(this);
            EpisodeClient = new EpisodeClient(this);
            UpdateClient  = new UpdateClient(this);
        }
Exemplo n.º 7
0
        protected virtual void InitRestClients()
        {
            RestClient = new RestClient(RootUrl + "api/");
            RestClient.AddDefaultHeader("Authentication", ApiKey);
            RestClient.AddDefaultHeader("X-Api-Key", ApiKey);

            Blacklist       = new ClientBase <BlacklistResource>(RestClient, ApiKey);
            Commands        = new CommandClient(RestClient, ApiKey);
            DownloadClients = new DownloadClientClient(RestClient, ApiKey);
            Episodes        = new EpisodeClient(RestClient, ApiKey);
            History         = new ClientBase <HistoryResource>(RestClient, ApiKey);
            Indexers        = new IndexerClient(RestClient, ApiKey);
            NamingConfig    = new ClientBase <NamingConfigResource>(RestClient, ApiKey, "config/naming");
            Notifications   = new NotificationClient(RestClient, ApiKey);
            Releases        = new ReleaseClient(RestClient, ApiKey);
            RootFolders     = new ClientBase <RootFolderResource>(RestClient, ApiKey);
            Series          = new SeriesClient(RestClient, ApiKey);
            Tags            = new ClientBase <TagResource>(RestClient, ApiKey);
        }
Exemplo n.º 8
0
        protected virtual void InitRestClients()
        {
            RestClient = new RestClient(RootUrl + "api/");
            RestClient.AddDefaultHeader("Authentication", ApiKey);
            RestClient.AddDefaultHeader("X-Api-Key", ApiKey);

            Blacklist = new ClientBase<BlacklistResource>(RestClient, ApiKey);
            Commands = new CommandClient(RestClient, ApiKey);
            DownloadClients = new DownloadClientClient(RestClient, ApiKey);
            Episodes = new EpisodeClient(RestClient, ApiKey);
            History = new ClientBase<HistoryResource>(RestClient, ApiKey);
            HostConfig = new ClientBase<HostConfigResource>(RestClient, ApiKey, "config/host");
            Indexers = new IndexerClient(RestClient, ApiKey);
            NamingConfig = new ClientBase<NamingConfigResource>(RestClient, ApiKey, "config/naming");
            Notifications = new NotificationClient(RestClient, ApiKey);
            Profiles = new ClientBase<ProfileResource>(RestClient, ApiKey);
            Releases = new ReleaseClient(RestClient, ApiKey);
            RootFolders = new ClientBase<RootFolderResource>(RestClient, ApiKey);
            Series = new SeriesClient(RestClient, ApiKey);
            Tags = new ClientBase<TagResource>(RestClient, ApiKey);
            WantedMissing = new ClientBase<EpisodeResource>(RestClient, ApiKey, "wanted/missing");
            WantedCutoffUnmet = new ClientBase<EpisodeResource>(RestClient, ApiKey, "wanted/cutoff");
        }
Exemplo n.º 9
0
        private void InitRestClients()
        {
            RestClient = new RestClient(RootUrl + "api/");
            RestClient.AddDefaultHeader("Authentication", _runner.ApiKey);
            RestClient.AddDefaultHeader("X-Api-Key", _runner.ApiKey);

            Series = new SeriesClient(RestClient, _runner.ApiKey);
            Releases = new ReleaseClient(RestClient, _runner.ApiKey);
            RootFolders = new ClientBase<RootFolderResource>(RestClient, _runner.ApiKey);
            Commands = new ClientBase<CommandResource>(RestClient, _runner.ApiKey);
            History = new ClientBase<HistoryResource>(RestClient, _runner.ApiKey);
            Indexers = new IndexerClient(RestClient, _runner.ApiKey);
            Episodes = new EpisodeClient(RestClient, _runner.ApiKey);
            NamingConfig = new ClientBase<NamingConfigResource>(RestClient, _runner.ApiKey, "config/naming");
            Notifications = new NotificationClient(RestClient, _runner.ApiKey);
        }