Beispiel #1
0
        public void PushExtracted(Dictionary <string, bool> downloadFolders)
        {
            string basePath = @"\\\\ckmasterplex\\h$\\Downloads\\";
            //string basePath = @"H:\\Downloads\\";
            IWebRequestFactory webReqFac     = new WebRequestFactory("http://*****:*****@"{basePath}{entry.Key}";
                string body =
                    $@"
                {{
                    ""importMode"": ""copy"",
                    ""name"": ""downloadedEpisodesScan"",
                    ""path"": ""{path}""
                }}
                ";
                IWebResponseFactory webRespFac = new WebResponseFactory(webReqFac.BuildRequest(urlParameters, method, contentType, headers, body));
                webRespFac.ExecuteRequest();
            }
        }
Beispiel #2
0
        public void Run(string[] args)
        {
            Sonarr sonarr           = new Sonarr();
            IWebResponseFactory wrf = new WebResponseFactory(sonarr.QueuedItems());
            string                    responseBody     = wrf.GetResponseBody(wrf.ExecuteRequest());
            IJsonManager              jm               = new JsonManager();
            JArray                    jsonArray        = jm.DeserializeArray(responseBody);
            List <string>             downloadFolders  = sonarr.GetDownloadFolders(jsonArray);
            Qbittorrent               qbt              = new Qbittorrent();
            Dictionary <string, bool> downloadFinished = qbt.CheckDownloadStatus(downloadFolders);

            qbt.Logout();
            FileSysOps fso = new FileSysOps();

            fso.ExtractFile(downloadFinished);
            sonarr.PushExtracted(downloadFinished);
        }