Пример #1
0
        public static void Send_Media(string ed2k, Shoko.Models.PlexAndKodi.Media media)
        {
            //if (!ServerSettings.WebCache_XRefFileEpisode_Send) return;

            string uri = string.Format(@"http://{0}/api/Media", azureHostBaseAddress);

            List <Azure_Media_Request> inputs = new List <Azure_Media_Request>();
            Azure_Media_Request        input  = media.ToMediaRequest(ed2k);

            inputs.Add(input);
            string json = JsonConvert.SerializeObject(inputs);

            SendData(uri, json, "POST");
        }
Пример #2
0
        public static void Send_Media(string ed2k, Shoko.Models.PlexAndKodi.Media media)
        {
            if (string.IsNullOrEmpty(ed2k))
            {
                return;
            }

            try
            {
                string uri = $@"http://{azureHostBaseAddress}/api/Media";

                List <Azure_Media_Request> inputs = new List <Azure_Media_Request>();
                Azure_Media_Request        input  = media.ToMediaRequest(ed2k);
                inputs.Add(input);
                string json = JSONHelper.Serialize(inputs);
                SendData(uri, json, "POST");
            }
            catch (Exception ex)
            {
                logger.Warn($"There was an error sending MediaInfo to WebCache for {ed2k}: {ex.Message}");
            }
        }